diff -Nru bzr-2.5.0/bzr bzr-2.6.0~beta1/bzr --- bzr-2.5.0/bzr 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzr 2012-03-15 10:00:24.000000000 +0000 @@ -1,6 +1,6 @@ #! /usr/bin/env python -# Copyright (C) 2005-2011 Canonical Ltd +# Copyright (C) 2005-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ import warnings # update this on each release -_script_version = (2, 5, 0) +_script_version = (2, 6, 0) NEED_VERS = (2, 6) diff -Nru bzr-2.5.0/bzrlib/add.py bzr-2.6.0~beta1/bzrlib/add.py --- bzr-2.5.0/bzrlib/add.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/add.py 2012-03-15 10:00:24.000000000 +0000 @@ -82,9 +82,7 @@ return False opt_name = 'add.maximum_file_size' if self._maxSize is None: - # FIXME: We use the branch config as there is no tree config - # -- vila 2011-12-16 - config = tree.branch.get_config_stack() + config = tree.get_config_stack() self._maxSize = config.get(opt_name) if stat_value is None: file_size = os.path.getsize(path); @@ -131,7 +129,8 @@ """ if self.base_tree.has_id(parent_ie.file_id): - base_parent_ie = self.base_tree.inventory[parent_ie.file_id] + # FIXME: Handle nested trees + base_parent_ie = self.base_tree.root_inventory[parent_ie.file_id] base_child_ie = base_parent_ie.children.get( osutils.basename(path)) if base_child_ie is not None: diff -Nru bzr-2.5.0/bzrlib/_annotator_pyx.c bzr-2.6.0~beta1/bzrlib/_annotator_pyx.c --- bzr-2.5.0/bzrlib/_annotator_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_annotator_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,894 +1,300 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:23 2012 */ +/* Generated by Pyrex 0.9.8.5 on Fri Oct 8 14:00:55 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif - -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif - -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif - +#include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif - -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include -#define __PYX_HAVE_API__bzrlib___annotator_pyx #include "python-compat.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - - -/* inline attribute */ -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -/* unused attribute */ -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - -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*/ +typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ -/* Type Conversion Predeclarations */ - -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - static PyObject *__pyx_m; static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - +static char *__pyx_filename; +static char **__pyx_f; -static const char *__pyx_f[] = { - "_annotator_pyx.pyx", -}; - -/* Type declarations */ - -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif - -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); - end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static char __pyx_mdoc[] = "Functionality for doing annotations in the \'optimal\' way"; static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ -static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} - - -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - - -#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { - PyObject *r; - if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { - r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { - r = PySequence_GetItem(o, i); - } - else { - r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); - } - return r; -} +static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/ +static int __Pyx_EndUnpack(PyObject *); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/ - -static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, - PyObject *modname); /*proto*/ - -#define __pyx_binding_PyCFunctionType_USED 1 - -typedef struct { - PyCFunctionObject func; -} __pyx_binding_PyCFunctionType_object; - -static PyTypeObject __pyx_binding_PyCFunctionType_type; -static PyTypeObject *__pyx_binding_PyCFunctionType = NULL; +static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/ -static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */ -#define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL) - -static int __pyx_binding_PyCFunctionType_init(void); /* proto */ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); +static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/ -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); +static void __Pyx_AddTraceback(char *funcname); /*proto*/ -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); +/* Declarations from bzrlib._annotator_pyx */ -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); +/* Declarations from implementation of bzrlib._annotator_pyx */ -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *,PyObject *); /*proto*/ +static int __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(PyObject *,PyObject *,Py_ssize_t,Py_ssize_t,Py_ssize_t); /*proto*/ +static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *,Py_ssize_t *); /*proto*/ +static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *,PyObject *,PyObject *); /*proto*/ +static int __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(PyObject *,PyObject *,PyObject *); /*proto*/ +static int __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(PyObject *,PyObject *,PyObject *,PyObject *,PyObject *); /*proto*/ + +static char __pyx_k1[] = "annotations must be a list"; +static char __pyx_k2[] = "parent_annotations must be a list"; +static char __pyx_k3[] = "Match length exceeds len of parent_annotations %s > %s"; +static char __pyx_k4[] = "Match length exceeds len of annotations %s > %s"; +static char __pyx_k5[] = "annotations must be tuples"; +static char __pyx_k6[] = "_get_parent_annotations_and_matches"; +static char __pyx_k7[] = "_ann_tuple_cache"; +static char __pyx_k8[] = "bzrlib"; +static char __pyx_k9[] = "annotate"; +static char __pyx_k10[] = "_break_annotation_tie"; +static char __pyx_k11[] = "_get_heads_provider"; +static char __pyx_k12[] = "heads"; +static char __pyx_k13[] = "_resolve_annotation_tie"; +static char __pyx_k14[] = "_annotator_py"; +static char __pyx_k15[] = "Annotator"; +static char __pyx_k16[] = "Class that drives performing annotations."; +static char __pyx_k17[] = "_update_from_first_parent"; +static char __pyx_k18[] = "_update_from_other_parents"; +static char __pyx_k19[] = "annotate_flat"; + +static PyObject *__pyx_n_Annotator; +static PyObject *__pyx_n__ann_tuple_cache; +static PyObject *__pyx_n__annotator_py; +static PyObject *__pyx_n__break_annotation_tie; +static PyObject *__pyx_n__get_heads_provider; +static PyObject *__pyx_n__resolve_annotation_tie; +static PyObject *__pyx_n__update_from_first_parent; +static PyObject *__pyx_n__update_from_other_parents; +static PyObject *__pyx_n_annotate; +static PyObject *__pyx_n_annotate_flat; +static PyObject *__pyx_n_bzrlib; +static PyObject *__pyx_n_heads; + +static PyObject *__pyx_k1p; +static PyObject *__pyx_k2p; +static PyObject *__pyx_k3p; +static PyObject *__pyx_k4p; +static PyObject *__pyx_k5p; +static PyObject *__pyx_k6p; +static PyObject *__pyx_k16p; -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_Annotator, 1, __pyx_k15, sizeof(__pyx_k15)}, + {&__pyx_n__ann_tuple_cache, 1, __pyx_k7, sizeof(__pyx_k7)}, + {&__pyx_n__annotator_py, 1, __pyx_k14, sizeof(__pyx_k14)}, + {&__pyx_n__break_annotation_tie, 1, __pyx_k10, sizeof(__pyx_k10)}, + {&__pyx_n__get_heads_provider, 1, __pyx_k11, sizeof(__pyx_k11)}, + {&__pyx_n__resolve_annotation_tie, 1, __pyx_k13, sizeof(__pyx_k13)}, + {&__pyx_n__update_from_first_parent, 1, __pyx_k17, sizeof(__pyx_k17)}, + {&__pyx_n__update_from_other_parents, 1, __pyx_k18, sizeof(__pyx_k18)}, + {&__pyx_n_annotate, 1, __pyx_k9, sizeof(__pyx_k9)}, + {&__pyx_n_annotate_flat, 1, __pyx_k19, sizeof(__pyx_k19)}, + {&__pyx_n_bzrlib, 1, __pyx_k8, sizeof(__pyx_k8)}, + {&__pyx_n_heads, 1, __pyx_k12, sizeof(__pyx_k12)}, + {&__pyx_k1p, 0, __pyx_k1, sizeof(__pyx_k1)}, + {&__pyx_k2p, 0, __pyx_k2, sizeof(__pyx_k2)}, + {&__pyx_k3p, 0, __pyx_k3, sizeof(__pyx_k3)}, + {&__pyx_k4p, 0, __pyx_k4, sizeof(__pyx_k4)}, + {&__pyx_k5p, 0, __pyx_k5, sizeof(__pyx_k5)}, + {&__pyx_k6p, 0, __pyx_k6, sizeof(__pyx_k6)}, + {&__pyx_k16p, 0, __pyx_k16, sizeof(__pyx_k16)}, + {0, 0, 0, 0} +}; -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from bzrlib._annotator_pyx */ -static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *, PyObject *); /*proto*/ -static int __pyx_f_6bzrlib_14_annotator_pyx__check_match_ranges(PyObject *, PyObject *, Py_ssize_t, Py_ssize_t, Py_ssize_t); /*proto*/ -static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *, Py_ssize_t *); /*proto*/ -static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *, PyObject *, PyObject *); /*proto*/ -static int __pyx_f_6bzrlib_14_annotator_pyx__apply_parent_annotations(PyObject *, PyObject *, PyObject *); /*proto*/ -static int __pyx_f_6bzrlib_14_annotator_pyx__merge_annotations(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/ -#define __Pyx_MODULE_NAME "bzrlib._annotator_pyx" -static int __pyx_module_is_main_bzrlib___annotator_pyx = 0; /* Implementation of bzrlib._annotator_pyx */ -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_ValueError; -static char __pyx_k_1[] = "annotations must be a list"; -static char __pyx_k_3[] = "parent_annotations must be a list"; -static char __pyx_k_5[] = "Match length exceeds len of parent_annotations %s > %s"; -static char __pyx_k_6[] = "Match length exceeds len of annotations %s > %s"; -static char __pyx_k_7[] = "annotations must be tuples"; -static char __pyx_k_9[] = "_get_parent_annotations_and_matches"; -static char __pyx_k_10[] = "_break_annotation_tie"; -static char __pyx_k_11[] = "_resolve_annotation_tie"; -static char __pyx_k_12[] = "Functionality for doing annotations in the 'optimal' way"; -static char __pyx_k_13[] = "bzrlib._annotator_pyx"; -static char __pyx_k_14[] = "_update_from_first_parent"; -static char __pyx_k_15[] = "_update_from_other_parents"; -static char __pyx_k_16[] = "Class that drives performing annotations."; -static char __pyx_k__key[] = "key"; -static char __pyx_k__self[] = "self"; -static char __pyx_k__heads[] = "heads"; -static char __pyx_k__lines[] = "lines"; -static char __pyx_k__bzrlib[] = "bzrlib"; -static char __pyx_k__ob_item[] = "ob_item"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__annotate[] = "annotate"; -static char __pyx_k__Annotator[] = "Annotator"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k__parent_key[] = "parent_key"; -static char __pyx_k__annotations[] = "annotations"; -static char __pyx_k___annotator_py[] = "_annotator_py"; -static char __pyx_k__annotate_flat[] = "annotate_flat"; -static char __pyx_k__this_annotation[] = "this_annotation"; -static char __pyx_k___ann_tuple_cache[] = "_ann_tuple_cache"; -static char __pyx_k___get_heads_provider[] = "_get_heads_provider"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_n_s_10; -static PyObject *__pyx_n_s_11; -static PyObject *__pyx_n_s_13; -static PyObject *__pyx_n_s_14; -static PyObject *__pyx_n_s_15; -static PyObject *__pyx_kp_s_16; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_6; -static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_n_s_9; -static PyObject *__pyx_n_s__Annotator; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___ann_tuple_cache; -static PyObject *__pyx_n_s___annotator_py; -static PyObject *__pyx_n_s___get_heads_provider; -static PyObject *__pyx_n_s__annotate; -static PyObject *__pyx_n_s__annotate_flat; -static PyObject *__pyx_n_s__annotations; -static PyObject *__pyx_n_s__bzrlib; -static PyObject *__pyx_n_s__heads; -static PyObject *__pyx_n_s__key; -static PyObject *__pyx_n_s__lines; -static PyObject *__pyx_n_s__ob_item; -static PyObject *__pyx_n_s__parent_key; -static PyObject *__pyx_n_s__self; -static PyObject *__pyx_n_s__this_annotation; -static PyObject *__pyx_k_tuple_2; -static PyObject *__pyx_k_tuple_4; -static PyObject *__pyx_k_tuple_8; - -/* "bzrlib/_annotator_pyx.pyx":61 - * - * - * cdef int _check_annotations_are_lists(annotations, # <<<<<<<<<<<<<< - * parent_annotations) except -1: - * if not PyList_CheckExact(annotations): - */ -static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *__pyx_v_annotations, PyObject *__pyx_v_parent_annotations) { +static int __pyx_f_6bzrlib_14_annotator_pyx__check_annotations_are_lists(PyObject *__pyx_v_annotations,PyObject *__pyx_v_parent_annotations) { int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("_check_annotations_are_lists"); - - /* "bzrlib/_annotator_pyx.pyx":63 - * cdef int _check_annotations_are_lists(annotations, - * parent_annotations) except -1: - * if not PyList_CheckExact(annotations): # <<<<<<<<<<<<<< - * raise TypeError('annotations must be a list') - * if not PyList_CheckExact(parent_annotations): - */ - __pyx_t_1 = (!PyList_CheckExact(__pyx_v_annotations)); - if (__pyx_t_1) { - - /* "bzrlib/_annotator_pyx.pyx":64 - * parent_annotations) except -1: - * if not PyList_CheckExact(annotations): - * raise TypeError('annotations must be a list') # <<<<<<<<<<<<<< - * if not PyList_CheckExact(parent_annotations): - * raise TypeError('parent_annotations must be a list') - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_annotations); + Py_INCREF(__pyx_v_parent_annotations); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":63 */ + __pyx_1 = (!PyList_CheckExact(__pyx_v_annotations)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + Py_INCREF(__pyx_k1p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k1p); + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":65 */ + __pyx_1 = (!PyList_CheckExact(__pyx_v_parent_annotations)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;} + Py_INCREF(__pyx_k2p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k2p); + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_annotator_pyx.pyx":65 - * if not PyList_CheckExact(annotations): - * raise TypeError('annotations must be a list') - * if not PyList_CheckExact(parent_annotations): # <<<<<<<<<<<<<< - * raise TypeError('parent_annotations must be a list') - * return 0 - */ - __pyx_t_1 = (!PyList_CheckExact(__pyx_v_parent_annotations)); - if (__pyx_t_1) { - - /* "bzrlib/_annotator_pyx.pyx":66 - * raise TypeError('annotations must be a list') - * if not PyList_CheckExact(parent_annotations): - * raise TypeError('parent_annotations must be a list') # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "bzrlib/_annotator_pyx.pyx":67 - * if not PyList_CheckExact(parent_annotations): - * raise TypeError('parent_annotations must be a list') - * return 0 # <<<<<<<<<<<<<< - * - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":67 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._annotator_pyx._check_annotations_are_lists"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_annotations); + Py_DECREF(__pyx_v_parent_annotations); return __pyx_r; } -/* "bzrlib/_annotator_pyx.pyx":70 - * - * - * cdef int _check_match_ranges(parent_annotations, annotations, # <<<<<<<<<<<<<< - * Py_ssize_t parent_idx, Py_ssize_t lines_idx, - * Py_ssize_t match_len) except -1: - */ - -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) { +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) { int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_check_match_ranges"); - - /* "bzrlib/_annotator_pyx.pyx":73 - * Py_ssize_t parent_idx, Py_ssize_t lines_idx, - * Py_ssize_t match_len) except -1: - * if parent_idx + match_len > PyList_GET_SIZE(parent_annotations): # <<<<<<<<<<<<<< - * raise ValueError('Match length exceeds len of' - * ' parent_annotations %s > %s' - */ - __pyx_t_1 = ((__pyx_v_parent_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_parent_annotations)); - if (__pyx_t_1) { - - /* "bzrlib/_annotator_pyx.pyx":76 - * raise ValueError('Match length exceeds len of' - * ' parent_annotations %s > %s' - * % (parent_idx + match_len, # <<<<<<<<<<<<<< - * PyList_GET_SIZE(parent_annotations))) - * if lines_idx + match_len > PyList_GET_SIZE(annotations): - */ - __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;} - __Pyx_GOTREF(__pyx_t_2); - - /* "bzrlib/_annotator_pyx.pyx":77 - * ' parent_annotations %s > %s' - * % (parent_idx + match_len, - * PyList_GET_SIZE(parent_annotations))) # <<<<<<<<<<<<<< - * if lines_idx + match_len > PyList_GET_SIZE(annotations): - * raise ValueError('Match length exceeds len of' - */ - __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;} - __Pyx_GOTREF(__pyx_t_3); - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_INCREF(__pyx_v_parent_annotations); + Py_INCREF(__pyx_v_annotations); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":73 */ + __pyx_1 = ((__pyx_v_parent_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_parent_annotations)); + if (__pyx_1) { + __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;} + __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;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_2 = 0; + __pyx_3 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k3p, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":78 */ + __pyx_1 = ((__pyx_v_lines_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_annotations)); + if (__pyx_1) { + __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;} + __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;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_2 = 0; + __pyx_3 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k4p, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_annotator_pyx.pyx":78 - * % (parent_idx + match_len, - * PyList_GET_SIZE(parent_annotations))) - * if lines_idx + match_len > PyList_GET_SIZE(annotations): # <<<<<<<<<<<<<< - * raise ValueError('Match length exceeds len of' - * ' annotations %s > %s' - */ - __pyx_t_1 = ((__pyx_v_lines_idx + __pyx_v_match_len) > PyList_GET_SIZE(__pyx_v_annotations)); - if (__pyx_t_1) { - - /* "bzrlib/_annotator_pyx.pyx":81 - * raise ValueError('Match length exceeds len of' - * ' annotations %s > %s' - * % (lines_idx + match_len, # <<<<<<<<<<<<<< - * PyList_GET_SIZE(annotations))) - * return 0 - */ - __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;} - __Pyx_GOTREF(__pyx_t_3); - - /* "bzrlib/_annotator_pyx.pyx":82 - * ' annotations %s > %s' - * % (lines_idx + match_len, - * PyList_GET_SIZE(annotations))) # <<<<<<<<<<<<<< - * return 0 - * - */ - __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;} - __Pyx_GOTREF(__pyx_t_4); - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "bzrlib/_annotator_pyx.pyx":83 - * % (lines_idx + match_len, - * PyList_GET_SIZE(annotations))) - * return 0 # <<<<<<<<<<<<<< - * - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":83 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._annotator_pyx._check_match_ranges"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_parent_annotations); + Py_DECREF(__pyx_v_annotations); return __pyx_r; } -/* "bzrlib/_annotator_pyx.pyx":86 - * - * - * cdef PyObject *_next_tuple_entry(object tpl, Py_ssize_t *pos): # cannot_raise # <<<<<<<<<<<<<< - * """Return the next entry from this tuple. - * - */ - -static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *__pyx_v_tpl, Py_ssize_t *__pyx_v_pos) { +static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(PyObject *__pyx_v_tpl,Py_ssize_t *__pyx_v_pos) { PyObject *__pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("_next_tuple_entry"); + int __pyx_1; + Py_INCREF(__pyx_v_tpl); - /* "bzrlib/_annotator_pyx.pyx":94 - * This cannot raise an exception, as it does no error checking. - * """ - * pos[0] = pos[0] + 1 # <<<<<<<<<<<<<< - * if pos[0] >= PyTuple_GET_SIZE(tpl): - * return NULL - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":94 */ (__pyx_v_pos[0]) = ((__pyx_v_pos[0]) + 1); - /* "bzrlib/_annotator_pyx.pyx":95 - * """ - * pos[0] = pos[0] + 1 - * if pos[0] >= PyTuple_GET_SIZE(tpl): # <<<<<<<<<<<<<< - * return NULL - * return PyTuple_GET_ITEM(tpl, pos[0]) - */ - __pyx_t_1 = ((__pyx_v_pos[0]) >= PyTuple_GET_SIZE(__pyx_v_tpl)); - if (__pyx_t_1) { - - /* "bzrlib/_annotator_pyx.pyx":96 - * pos[0] = pos[0] + 1 - * if pos[0] >= PyTuple_GET_SIZE(tpl): - * return NULL # <<<<<<<<<<<<<< - * return PyTuple_GET_ITEM(tpl, pos[0]) - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":95 */ + __pyx_1 = ((__pyx_v_pos[0]) >= PyTuple_GET_SIZE(__pyx_v_tpl)); + if (__pyx_1) { __pyx_r = NULL; goto __pyx_L0; - goto __pyx_L3; + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_annotator_pyx.pyx":97 - * if pos[0] >= PyTuple_GET_SIZE(tpl): - * return NULL - * return PyTuple_GET_ITEM(tpl, pos[0]) # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = PyTuple_GET_ITEM(__pyx_v_tpl, (__pyx_v_pos[0])); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":97 */ + __pyx_r = PyTuple_GET_ITEM(__pyx_v_tpl,(__pyx_v_pos[0])); goto __pyx_L0; __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_tpl); return __pyx_r; } -/* "bzrlib/_annotator_pyx.pyx":100 - * - * - * cdef object _combine_annotations(ann_one, ann_two, cache): # <<<<<<<<<<<<<< - * """Combine the annotations from both sides.""" - * cdef Py_ssize_t pos_one, pos_two, len_one, len_two - */ - -static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *__pyx_v_ann_one, PyObject *__pyx_v_ann_two, PyObject *__pyx_v_cache) { +static PyObject *__pyx_f_6bzrlib_14_annotator_pyx__combine_annotations(PyObject *__pyx_v_ann_one,PyObject *__pyx_v_ann_two,PyObject *__pyx_v_cache) { Py_ssize_t __pyx_v_pos_one; Py_ssize_t __pyx_v_pos_two; Py_ssize_t __pyx_v_out_pos; @@ -897,508 +303,223 @@ PyObject *__pyx_v_right; PyObject *__pyx_v_cache_key; PyObject *__pyx_v_new_ann; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("_combine_annotations"); - __pyx_v_cache_key = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_new_ann = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_annotator_pyx.pyx":106 - * cdef PyObject *temp, *left, *right - * - * if (PyObject_RichCompareBool(ann_one, ann_two, Py_LT)): # <<<<<<<<<<<<<< - * cache_key = (ann_one, ann_two) - * else: - */ - __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;} - if (__pyx_t_1) { - - /* "bzrlib/_annotator_pyx.pyx":107 - * - * if (PyObject_RichCompareBool(ann_one, ann_two, Py_LT)): - * cache_key = (ann_one, ann_two) # <<<<<<<<<<<<<< - * else: - * cache_key = (ann_two, ann_one) - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_ann_one); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ann_one); - __Pyx_GIVEREF(__pyx_v_ann_one); - __Pyx_INCREF(__pyx_v_ann_two); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ann_two); - __Pyx_GIVEREF(__pyx_v_ann_two); - __Pyx_DECREF(((PyObject *)__pyx_v_cache_key)); - __pyx_v_cache_key = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L3; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_ann_one); + Py_INCREF(__pyx_v_ann_two); + Py_INCREF(__pyx_v_cache); + __pyx_v_cache_key = Py_None; Py_INCREF(Py_None); + __pyx_v_new_ann = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":106 */ + __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;} + if (__pyx_1) { + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;} + Py_INCREF(__pyx_v_ann_one); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ann_one); + Py_INCREF(__pyx_v_ann_two); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_ann_two); + Py_DECREF(__pyx_v_cache_key); + __pyx_v_cache_key = __pyx_2; + __pyx_2 = 0; + goto __pyx_L2; } /*else*/ { - - /* "bzrlib/_annotator_pyx.pyx":109 - * cache_key = (ann_one, ann_two) - * else: - * cache_key = (ann_two, ann_one) # <<<<<<<<<<<<<< - * temp = PyDict_GetItem(cache, cache_key) - * if temp != NULL: - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_ann_two); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ann_two); - __Pyx_GIVEREF(__pyx_v_ann_two); - __Pyx_INCREF(__pyx_v_ann_one); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ann_one); - __Pyx_GIVEREF(__pyx_v_ann_one); - __Pyx_DECREF(((PyObject *)__pyx_v_cache_key)); - __pyx_v_cache_key = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;} + Py_INCREF(__pyx_v_ann_two); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ann_two); + Py_INCREF(__pyx_v_ann_one); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_ann_one); + Py_DECREF(__pyx_v_cache_key); + __pyx_v_cache_key = __pyx_2; + __pyx_2 = 0; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":110 */ + __pyx_v_temp = PyDict_GetItem(__pyx_v_cache,__pyx_v_cache_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":111 */ + __pyx_1 = (__pyx_v_temp != NULL); + if (__pyx_1) { + Py_INCREF(((PyObject *)__pyx_v_temp)); + __pyx_r = ((PyObject *)__pyx_v_temp); + goto __pyx_L0; + goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_annotator_pyx.pyx":110 - * else: - * cache_key = (ann_two, ann_one) - * temp = PyDict_GetItem(cache, cache_key) # <<<<<<<<<<<<<< - * if temp != NULL: - * return temp - */ - __pyx_v_temp = PyDict_GetItem(__pyx_v_cache, ((PyObject *)__pyx_v_cache_key)); - - /* "bzrlib/_annotator_pyx.pyx":111 - * cache_key = (ann_two, ann_one) - * temp = PyDict_GetItem(cache, cache_key) - * if temp != NULL: # <<<<<<<<<<<<<< - * return temp - * - */ - __pyx_t_3 = (__pyx_v_temp != NULL); - if (__pyx_t_3) { - - /* "bzrlib/_annotator_pyx.pyx":112 - * temp = PyDict_GetItem(cache, cache_key) - * if temp != NULL: - * return temp # <<<<<<<<<<<<<< - * - * if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_temp)); - __pyx_r = ((PyObject *)__pyx_v_temp); - goto __pyx_L0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":114 */ + __pyx_1 = (!PyTuple_CheckExact(__pyx_v_ann_one)); + if (!__pyx_1) { + __pyx_1 = (!PyTuple_CheckExact(__pyx_v_ann_two)); + } + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + Py_INCREF(__pyx_k5p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k5p); + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "bzrlib/_annotator_pyx.pyx":114 - * return temp - * - * if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two): # <<<<<<<<<<<<<< - * raise TypeError('annotations must be tuples') - * # We know that annotations are tuples, and that both sides are already - */ - __pyx_t_3 = (!PyTuple_CheckExact(__pyx_v_ann_one)); - if (!__pyx_t_3) { - __pyx_t_4 = (!PyTuple_CheckExact(__pyx_v_ann_two)); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_3; - } - if (__pyx_t_5) { + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":118 */ + __pyx_v_pos_one = (-1); - /* "bzrlib/_annotator_pyx.pyx":115 - * - * if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two): - * raise TypeError('annotations must be tuples') # <<<<<<<<<<<<<< - * # We know that annotations are tuples, and that both sides are already - * # sorted, so we can just walk and update a new list. - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":119 */ + __pyx_v_pos_two = (-1); - /* "bzrlib/_annotator_pyx.pyx":118 - * # We know that annotations are tuples, and that both sides are already - * # sorted, so we can just walk and update a new list. - * pos_one = -1 # <<<<<<<<<<<<<< - * pos_two = -1 - * out_pos = 0 - */ - __pyx_v_pos_one = -1; - - /* "bzrlib/_annotator_pyx.pyx":119 - * # sorted, so we can just walk and update a new list. - * pos_one = -1 - * pos_two = -1 # <<<<<<<<<<<<<< - * out_pos = 0 - * left = _next_tuple_entry(ann_one, &pos_one) - */ - __pyx_v_pos_two = -1; - - /* "bzrlib/_annotator_pyx.pyx":120 - * pos_one = -1 - * pos_two = -1 - * out_pos = 0 # <<<<<<<<<<<<<< - * left = _next_tuple_entry(ann_one, &pos_one) - * right = _next_tuple_entry(ann_two, &pos_two) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":120 */ __pyx_v_out_pos = 0; - /* "bzrlib/_annotator_pyx.pyx":121 - * pos_two = -1 - * out_pos = 0 - * left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<< - * right = _next_tuple_entry(ann_two, &pos_two) - * new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one) - */ - __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one)); - - /* "bzrlib/_annotator_pyx.pyx":122 - * out_pos = 0 - * left = _next_tuple_entry(ann_one, &pos_one) - * right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<< - * new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one) - * + PyTuple_GET_SIZE(ann_two)) - */ - __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two)); - - /* "bzrlib/_annotator_pyx.pyx":124 - * right = _next_tuple_entry(ann_two, &pos_two) - * new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one) - * + PyTuple_GET_SIZE(ann_two)) # <<<<<<<<<<<<<< - * while left != NULL and right != NULL: - * # left == right is done by PyObject_RichCompareBool_ptr, however it - */ - __pyx_t_2 = PyTuple_New((PyTuple_GET_SIZE(__pyx_v_ann_one) + PyTuple_GET_SIZE(__pyx_v_ann_two))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_new_ann); - __pyx_v_new_ann = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_annotator_pyx.pyx":125 - * new_ann = PyTuple_New(PyTuple_GET_SIZE(ann_one) - * + PyTuple_GET_SIZE(ann_two)) - * while left != NULL and right != NULL: # <<<<<<<<<<<<<< - * # left == right is done by PyObject_RichCompareBool_ptr, however it - * # avoids a function call for a very common case. Drops 'time bzr - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":121 */ + __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":122 */ + __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":123 */ + __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;} + Py_DECREF(__pyx_v_new_ann); + __pyx_v_new_ann = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":125 */ while (1) { - __pyx_t_5 = (__pyx_v_left != NULL); - if (__pyx_t_5) { - __pyx_t_3 = (__pyx_v_right != NULL); - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = __pyx_t_5; + __pyx_1 = (__pyx_v_left != NULL); + if (__pyx_1) { + __pyx_1 = (__pyx_v_right != NULL); } - if (!__pyx_t_4) break; + if (!__pyx_1) break; - /* "bzrlib/_annotator_pyx.pyx":130 - * # annotate NEWS' from 7.25s to 7.16s, so it *is* a visible impact. - * if (left == right - * or PyObject_RichCompareBool_ptr(left, right, Py_EQ)): # <<<<<<<<<<<<<< - * # Identical values, step both - * Py_INCREF_ptr(left) - */ - __pyx_t_4 = (__pyx_v_left == __pyx_v_right); - if (!__pyx_t_4) { - __pyx_t_5 = PyObject_RichCompareBool(__pyx_v_left, __pyx_v_right, Py_EQ); - } else { - __pyx_t_5 = __pyx_t_4; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":129 */ + __pyx_1 = (__pyx_v_left == __pyx_v_right); + if (!__pyx_1) { + __pyx_1 = PyObject_RichCompareBool(__pyx_v_left,__pyx_v_right,Py_EQ); } - if (__pyx_t_5) { + if (__pyx_1) { - /* "bzrlib/_annotator_pyx.pyx":132 - * or PyObject_RichCompareBool_ptr(left, right, Py_EQ)): - * # Identical values, step both - * Py_INCREF_ptr(left) # <<<<<<<<<<<<<< - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) - * left = _next_tuple_entry(ann_one, &pos_one) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":132 */ Py_INCREF(__pyx_v_left); - /* "bzrlib/_annotator_pyx.pyx":133 - * # Identical values, step both - * Py_INCREF_ptr(left) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) # <<<<<<<<<<<<<< - * left = _next_tuple_entry(ann_one, &pos_one) - * right = _next_tuple_entry(ann_two, &pos_two) - */ - PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left); - - /* "bzrlib/_annotator_pyx.pyx":134 - * Py_INCREF_ptr(left) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) - * left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<< - * right = _next_tuple_entry(ann_two, &pos_two) - * elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)): - */ - __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one)); - - /* "bzrlib/_annotator_pyx.pyx":135 - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) - * left = _next_tuple_entry(ann_one, &pos_one) - * right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<< - * elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)): - * # left < right or right == NULL - */ - __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two)); - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":133 */ + PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":134 */ + __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":135 */ + __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two)); + goto __pyx_L7; } + __pyx_1 = PyObject_RichCompareBool(__pyx_v_left,__pyx_v_right,Py_LT); + if (__pyx_1) { - /* "bzrlib/_annotator_pyx.pyx":136 - * left = _next_tuple_entry(ann_one, &pos_one) - * right = _next_tuple_entry(ann_two, &pos_two) - * elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)): # <<<<<<<<<<<<<< - * # left < right or right == NULL - * Py_INCREF_ptr(left) - */ - __pyx_t_1 = PyObject_RichCompareBool(__pyx_v_left, __pyx_v_right, Py_LT); - if (__pyx_t_1) { - - /* "bzrlib/_annotator_pyx.pyx":138 - * elif (PyObject_RichCompareBool_ptr(left, right, Py_LT)): - * # left < right or right == NULL - * Py_INCREF_ptr(left) # <<<<<<<<<<<<<< - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) - * left = _next_tuple_entry(ann_one, &pos_one) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":138 */ Py_INCREF(__pyx_v_left); - /* "bzrlib/_annotator_pyx.pyx":139 - * # left < right or right == NULL - * Py_INCREF_ptr(left) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) # <<<<<<<<<<<<<< - * left = _next_tuple_entry(ann_one, &pos_one) - * else: # right < left or left == NULL - */ - PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left); - - /* "bzrlib/_annotator_pyx.pyx":140 - * Py_INCREF_ptr(left) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) - * left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<< - * else: # right < left or left == NULL - * Py_INCREF_ptr(right) - */ - __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one)); - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":139 */ + PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":140 */ + __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one)); + goto __pyx_L7; } /*else*/ { - /* "bzrlib/_annotator_pyx.pyx":142 - * left = _next_tuple_entry(ann_one, &pos_one) - * else: # right < left or left == NULL - * Py_INCREF_ptr(right) # <<<<<<<<<<<<<< - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) - * right = _next_tuple_entry(ann_two, &pos_two) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":142 */ Py_INCREF(__pyx_v_right); - /* "bzrlib/_annotator_pyx.pyx":143 - * else: # right < left or left == NULL - * Py_INCREF_ptr(right) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) # <<<<<<<<<<<<<< - * right = _next_tuple_entry(ann_two, &pos_two) - * out_pos = out_pos + 1 - */ - PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_right); - - /* "bzrlib/_annotator_pyx.pyx":144 - * Py_INCREF_ptr(right) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) - * right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<< - * out_pos = out_pos + 1 - * while left != NULL: - */ - __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":143 */ + PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_right); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":144 */ + __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two)); } - __pyx_L8:; + __pyx_L7:; - /* "bzrlib/_annotator_pyx.pyx":145 - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) - * right = _next_tuple_entry(ann_two, &pos_two) - * out_pos = out_pos + 1 # <<<<<<<<<<<<<< - * while left != NULL: - * Py_INCREF_ptr(left) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":145 */ __pyx_v_out_pos = (__pyx_v_out_pos + 1); } - /* "bzrlib/_annotator_pyx.pyx":146 - * right = _next_tuple_entry(ann_two, &pos_two) - * out_pos = out_pos + 1 - * while left != NULL: # <<<<<<<<<<<<<< - * Py_INCREF_ptr(left) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":146 */ while (1) { - __pyx_t_5 = (__pyx_v_left != NULL); - if (!__pyx_t_5) break; + __pyx_1 = (__pyx_v_left != NULL); + if (!__pyx_1) break; - /* "bzrlib/_annotator_pyx.pyx":147 - * out_pos = out_pos + 1 - * while left != NULL: - * Py_INCREF_ptr(left) # <<<<<<<<<<<<<< - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) - * left = _next_tuple_entry(ann_one, &pos_one) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":147 */ Py_INCREF(__pyx_v_left); - /* "bzrlib/_annotator_pyx.pyx":148 - * while left != NULL: - * Py_INCREF_ptr(left) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) # <<<<<<<<<<<<<< - * left = _next_tuple_entry(ann_one, &pos_one) - * out_pos = out_pos + 1 - */ - PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_left); - - /* "bzrlib/_annotator_pyx.pyx":149 - * Py_INCREF_ptr(left) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) - * left = _next_tuple_entry(ann_one, &pos_one) # <<<<<<<<<<<<<< - * out_pos = out_pos + 1 - * while right != NULL: - */ - __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one, (&__pyx_v_pos_one)); - - /* "bzrlib/_annotator_pyx.pyx":150 - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, left) - * left = _next_tuple_entry(ann_one, &pos_one) - * out_pos = out_pos + 1 # <<<<<<<<<<<<<< - * while right != NULL: - * Py_INCREF_ptr(right) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":148 */ + PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_left); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":149 */ + __pyx_v_left = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_one,(&__pyx_v_pos_one)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":150 */ __pyx_v_out_pos = (__pyx_v_out_pos + 1); } - /* "bzrlib/_annotator_pyx.pyx":151 - * left = _next_tuple_entry(ann_one, &pos_one) - * out_pos = out_pos + 1 - * while right != NULL: # <<<<<<<<<<<<<< - * Py_INCREF_ptr(right) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":151 */ while (1) { - __pyx_t_5 = (__pyx_v_right != NULL); - if (!__pyx_t_5) break; + __pyx_1 = (__pyx_v_right != NULL); + if (!__pyx_1) break; - /* "bzrlib/_annotator_pyx.pyx":152 - * out_pos = out_pos + 1 - * while right != NULL: - * Py_INCREF_ptr(right) # <<<<<<<<<<<<<< - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) - * right = _next_tuple_entry(ann_two, &pos_two) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":152 */ Py_INCREF(__pyx_v_right); - /* "bzrlib/_annotator_pyx.pyx":153 - * while right != NULL: - * Py_INCREF_ptr(right) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) # <<<<<<<<<<<<<< - * right = _next_tuple_entry(ann_two, &pos_two) - * out_pos = out_pos + 1 - */ - PyTuple_SET_ITEM(__pyx_v_new_ann, __pyx_v_out_pos, __pyx_v_right); - - /* "bzrlib/_annotator_pyx.pyx":154 - * Py_INCREF_ptr(right) - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) - * right = _next_tuple_entry(ann_two, &pos_two) # <<<<<<<<<<<<<< - * out_pos = out_pos + 1 - * if out_pos != PyTuple_GET_SIZE(new_ann): - */ - __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two, (&__pyx_v_pos_two)); - - /* "bzrlib/_annotator_pyx.pyx":155 - * PyTuple_SET_ITEM_ptr(new_ann, out_pos, right) - * right = _next_tuple_entry(ann_two, &pos_two) - * out_pos = out_pos + 1 # <<<<<<<<<<<<<< - * if out_pos != PyTuple_GET_SIZE(new_ann): - * # Timing _PyTuple_Resize was not significantly faster that slicing - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":153 */ + PyTuple_SET_ITEM(__pyx_v_new_ann,__pyx_v_out_pos,__pyx_v_right); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":154 */ + __pyx_v_right = __pyx_f_6bzrlib_14_annotator_pyx__next_tuple_entry(__pyx_v_ann_two,(&__pyx_v_pos_two)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":155 */ __pyx_v_out_pos = (__pyx_v_out_pos + 1); } - /* "bzrlib/_annotator_pyx.pyx":156 - * right = _next_tuple_entry(ann_two, &pos_two) - * out_pos = out_pos + 1 - * if out_pos != PyTuple_GET_SIZE(new_ann): # <<<<<<<<<<<<<< - * # Timing _PyTuple_Resize was not significantly faster that slicing - * # PyTuple_Resize((new_ann), out_pos) - */ - __pyx_t_5 = (__pyx_v_out_pos != PyTuple_GET_SIZE(__pyx_v_new_ann)); - if (__pyx_t_5) { - - /* "bzrlib/_annotator_pyx.pyx":159 - * # Timing _PyTuple_Resize was not significantly faster that slicing - * # PyTuple_Resize((new_ann), out_pos) - * new_ann = new_ann[0:out_pos] # <<<<<<<<<<<<<< - * PyDict_SetItem(cache, cache_key, new_ann) - * return new_ann - */ - __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_new_ann, 0, __pyx_v_out_pos); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_new_ann); - __pyx_v_new_ann = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L13; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":156 */ + __pyx_1 = (__pyx_v_out_pos != PyTuple_GET_SIZE(__pyx_v_new_ann)); + if (__pyx_1) { + __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;} + Py_DECREF(__pyx_v_new_ann); + __pyx_v_new_ann = __pyx_3; + __pyx_3 = 0; + goto __pyx_L12; } - __pyx_L13:; + __pyx_L12:; - /* "bzrlib/_annotator_pyx.pyx":160 - * # PyTuple_Resize((new_ann), out_pos) - * new_ann = new_ann[0:out_pos] - * PyDict_SetItem(cache, cache_key, new_ann) # <<<<<<<<<<<<<< - * return new_ann - * - */ - __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;} - - /* "bzrlib/_annotator_pyx.pyx":161 - * new_ann = new_ann[0:out_pos] - * PyDict_SetItem(cache, cache_key, new_ann) - * return new_ann # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_new_ann); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":160 */ + __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;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":161 */ + Py_INCREF(__pyx_v_new_ann); __pyx_r = __pyx_v_new_ann; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._annotator_pyx._combine_annotations"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_cache_key); - __Pyx_DECREF(__pyx_v_new_ann); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_cache_key); + Py_DECREF(__pyx_v_new_ann); + Py_DECREF(__pyx_v_ann_one); + Py_DECREF(__pyx_v_ann_two); + Py_DECREF(__pyx_v_cache); return __pyx_r; } -/* "bzrlib/_annotator_pyx.pyx":164 - * - * - * cdef int _apply_parent_annotations(annotations, parent_annotations, # <<<<<<<<<<<<<< - * matching_blocks) except -1: - * """Apply the annotations from parent_annotations into annotations. - */ - -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) { +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) { Py_ssize_t __pyx_v_parent_idx; Py_ssize_t __pyx_v_lines_idx; Py_ssize_t __pyx_v_match_len; @@ -1408,214 +529,93 @@ PyObject **__pyx_v_par_temp; PyObject **__pyx_v_ann_temp; int __pyx_r; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - Py_ssize_t __pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_ssize_t __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - __Pyx_RefNannySetupContext("_apply_parent_annotations"); - - /* "bzrlib/_annotator_pyx.pyx":174 - * cdef PyObject **par_temp, **ann_temp - * - * _check_annotations_are_lists(annotations, parent_annotations) # <<<<<<<<<<<<<< - * par_list = parent_annotations - * ann_list = annotations - */ - __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;} - - /* "bzrlib/_annotator_pyx.pyx":175 - * - * _check_annotations_are_lists(annotations, parent_annotations) - * par_list = parent_annotations # <<<<<<<<<<<<<< - * ann_list = annotations - * # For NEWS and bzrlib/builtins.py, over 99% of the lines are simply copied - */ + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_ssize_t __pyx_5; + Py_INCREF(__pyx_v_annotations); + Py_INCREF(__pyx_v_parent_annotations); + Py_INCREF(__pyx_v_matching_blocks); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":174 */ + __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;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":175 */ __pyx_v_par_list = ((PyListObject *)__pyx_v_parent_annotations); - /* "bzrlib/_annotator_pyx.pyx":176 - * _check_annotations_are_lists(annotations, parent_annotations) - * par_list = parent_annotations - * ann_list = annotations # <<<<<<<<<<<<<< - * # For NEWS and bzrlib/builtins.py, over 99% of the lines are simply copied - * # across from the parent entry. So this routine is heavily optimized for - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":176 */ __pyx_v_ann_list = ((PyListObject *)__pyx_v_annotations); - /* "bzrlib/_annotator_pyx.pyx":181 - * # that. Would be interesting if we could use memcpy() but we have to incref - * # and decref - * for parent_idx, lines_idx, match_len in matching_blocks: # <<<<<<<<<<<<<< - * _check_match_ranges(parent_annotations, annotations, - * parent_idx, lines_idx, match_len) - */ - if (PyList_CheckExact(__pyx_v_matching_blocks) || PyTuple_CheckExact(__pyx_v_matching_blocks)) { - __pyx_t_2 = 0; __pyx_t_3 = __pyx_v_matching_blocks; __Pyx_INCREF(__pyx_t_3); - } else { - __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;} - __Pyx_GOTREF(__pyx_t_3); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":181 */ + __pyx_2 = PyObject_GetIter(__pyx_v_matching_blocks); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; - } else { - __pyx_t_4 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_4) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 3)) { - PyObject* tuple = __pyx_t_4; - __pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5); - __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;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6); - __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;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7); - __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;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_parent_idx = __pyx_t_8; - __pyx_v_lines_idx = __pyx_t_9; - __pyx_v_match_len = __pyx_t_10; - } else { - __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;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_5); - __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;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_6); - __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;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_7); - __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;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_EndUnpack(__pyx_t_11, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_parent_idx = __pyx_t_10; - __pyx_v_lines_idx = __pyx_t_9; - __pyx_v_match_len = __pyx_t_8; - } + __pyx_3 = PyIter_Next(__pyx_2); + if (!__pyx_3) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + break; + } + __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_parent_idx = __pyx_5; + __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_lines_idx = __pyx_5; + __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_match_len = __pyx_5; + if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "bzrlib/_annotator_pyx.pyx":183 - * for parent_idx, lines_idx, match_len in matching_blocks: - * _check_match_ranges(parent_annotations, annotations, - * parent_idx, lines_idx, match_len) # <<<<<<<<<<<<<< - * par_temp = par_list.ob_item + parent_idx - * ann_temp = ann_list.ob_item + lines_idx - */ - __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;} - - /* "bzrlib/_annotator_pyx.pyx":184 - * _check_match_ranges(parent_annotations, annotations, - * parent_idx, lines_idx, match_len) - * par_temp = par_list.ob_item + parent_idx # <<<<<<<<<<<<<< - * ann_temp = ann_list.ob_item + lines_idx - * for idx from 0 <= idx < match_len: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":182 */ + __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;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":184 */ __pyx_v_par_temp = (__pyx_v_par_list->ob_item + __pyx_v_parent_idx); - /* "bzrlib/_annotator_pyx.pyx":185 - * parent_idx, lines_idx, match_len) - * par_temp = par_list.ob_item + parent_idx - * ann_temp = ann_list.ob_item + lines_idx # <<<<<<<<<<<<<< - * for idx from 0 <= idx < match_len: - * Py_INCREF_ptr(par_temp[idx]) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":185 */ __pyx_v_ann_temp = (__pyx_v_ann_list->ob_item + __pyx_v_lines_idx); - /* "bzrlib/_annotator_pyx.pyx":186 - * par_temp = par_list.ob_item + parent_idx - * ann_temp = ann_list.ob_item + lines_idx - * for idx from 0 <= idx < match_len: # <<<<<<<<<<<<<< - * Py_INCREF_ptr(par_temp[idx]) - * Py_DECREF_ptr(ann_temp[idx]) - */ - __pyx_t_8 = __pyx_v_match_len; - for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_8; __pyx_v_idx++) { - - /* "bzrlib/_annotator_pyx.pyx":187 - * ann_temp = ann_list.ob_item + lines_idx - * for idx from 0 <= idx < match_len: - * Py_INCREF_ptr(par_temp[idx]) # <<<<<<<<<<<<<< - * Py_DECREF_ptr(ann_temp[idx]) - * ann_temp[idx] = par_temp[idx] - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":186 */ + for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_v_match_len; ++__pyx_v_idx) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":187 */ Py_INCREF((__pyx_v_par_temp[__pyx_v_idx])); - /* "bzrlib/_annotator_pyx.pyx":188 - * for idx from 0 <= idx < match_len: - * Py_INCREF_ptr(par_temp[idx]) - * Py_DECREF_ptr(ann_temp[idx]) # <<<<<<<<<<<<<< - * ann_temp[idx] = par_temp[idx] - * return 0 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":188 */ Py_DECREF((__pyx_v_ann_temp[__pyx_v_idx])); - /* "bzrlib/_annotator_pyx.pyx":189 - * Py_INCREF_ptr(par_temp[idx]) - * Py_DECREF_ptr(ann_temp[idx]) - * ann_temp[idx] = par_temp[idx] # <<<<<<<<<<<<<< - * return 0 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":189 */ (__pyx_v_ann_temp[__pyx_v_idx]) = (__pyx_v_par_temp[__pyx_v_idx]); } } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "bzrlib/_annotator_pyx.pyx":190 - * Py_DECREF_ptr(ann_temp[idx]) - * ann_temp[idx] = par_temp[idx] - * return 0 # <<<<<<<<<<<<<< - * - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":190 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_11); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._annotator_pyx._apply_parent_annotations"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_annotations); + Py_DECREF(__pyx_v_parent_annotations); + Py_DECREF(__pyx_v_matching_blocks); return __pyx_r; } -/* "bzrlib/_annotator_pyx.pyx":193 - * - * - * cdef int _merge_annotations(this_annotation, annotations, parent_annotations, # <<<<<<<<<<<<<< - * matching_blocks, ann_cache) except -1: - * cdef Py_ssize_t parent_idx, ann_idx, lines_idx, match_len, idx - */ - -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) { +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) { Py_ssize_t __pyx_v_parent_idx; Py_ssize_t __pyx_v_ann_idx; Py_ssize_t __pyx_v_lines_idx; @@ -1630,417 +630,195 @@ PyObject *__pyx_v_ann; PyObject *__pyx_v_new_ann; int __pyx_r; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - Py_ssize_t __pyx_t_8; - Py_ssize_t __pyx_t_9; - Py_ssize_t __pyx_t_10; - PyObject *__pyx_t_11 = NULL; - int __pyx_t_12; - int __pyx_t_13; - int __pyx_t_14; - __Pyx_RefNannySetupContext("_merge_annotations"); - __pyx_v_last_ann = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_last_parent = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_last_res = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_par_ann = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_ann = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_new_ann = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_annotator_pyx.pyx":199 - * cdef PyObject *ann_temp, *par_temp - * - * _check_annotations_are_lists(annotations, parent_annotations) # <<<<<<<<<<<<<< - * last_ann = None - * last_parent = None - */ - __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;} - - /* "bzrlib/_annotator_pyx.pyx":200 - * - * _check_annotations_are_lists(annotations, parent_annotations) - * last_ann = None # <<<<<<<<<<<<<< - * last_parent = None - * last_res = None - */ - __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_v_last_ann); + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_ssize_t __pyx_5; + Py_INCREF(__pyx_v_this_annotation); + Py_INCREF(__pyx_v_annotations); + Py_INCREF(__pyx_v_parent_annotations); + Py_INCREF(__pyx_v_matching_blocks); + Py_INCREF(__pyx_v_ann_cache); + __pyx_v_last_ann = Py_None; Py_INCREF(Py_None); + __pyx_v_last_parent = Py_None; Py_INCREF(Py_None); + __pyx_v_last_res = Py_None; Py_INCREF(Py_None); + __pyx_v_par_ann = Py_None; Py_INCREF(Py_None); + __pyx_v_ann = Py_None; Py_INCREF(Py_None); + __pyx_v_new_ann = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":199 */ + __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;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":200 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_last_ann); __pyx_v_last_ann = Py_None; - /* "bzrlib/_annotator_pyx.pyx":201 - * _check_annotations_are_lists(annotations, parent_annotations) - * last_ann = None - * last_parent = None # <<<<<<<<<<<<<< - * last_res = None - * for parent_idx, lines_idx, match_len in matching_blocks: - */ - __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_v_last_parent); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":201 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_last_parent); __pyx_v_last_parent = Py_None; - /* "bzrlib/_annotator_pyx.pyx":202 - * last_ann = None - * last_parent = None - * last_res = None # <<<<<<<<<<<<<< - * for parent_idx, lines_idx, match_len in matching_blocks: - * _check_match_ranges(parent_annotations, annotations, - */ - __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_v_last_res); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":202 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_last_res); __pyx_v_last_res = Py_None; - /* "bzrlib/_annotator_pyx.pyx":203 - * last_parent = None - * last_res = None - * for parent_idx, lines_idx, match_len in matching_blocks: # <<<<<<<<<<<<<< - * _check_match_ranges(parent_annotations, annotations, - * parent_idx, lines_idx, match_len) - */ - if (PyList_CheckExact(__pyx_v_matching_blocks) || PyTuple_CheckExact(__pyx_v_matching_blocks)) { - __pyx_t_2 = 0; __pyx_t_3 = __pyx_v_matching_blocks; __Pyx_INCREF(__pyx_t_3); - } else { - __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;} - __Pyx_GOTREF(__pyx_t_3); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":203 */ + __pyx_2 = PyObject_GetIter(__pyx_v_matching_blocks); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; - } else { - __pyx_t_4 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_4) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 3)) { - PyObject* tuple = __pyx_t_4; - __pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5); - __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;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6); - __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;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7); - __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;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_parent_idx = __pyx_t_8; - __pyx_v_lines_idx = __pyx_t_9; - __pyx_v_match_len = __pyx_t_10; - } else { - __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;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_5); - __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;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_6); - __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;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_7); - __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;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_EndUnpack(__pyx_t_11, 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_v_parent_idx = __pyx_t_10; - __pyx_v_lines_idx = __pyx_t_9; - __pyx_v_match_len = __pyx_t_8; - } + __pyx_3 = PyIter_Next(__pyx_2); + if (!__pyx_3) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + break; + } + __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_parent_idx = __pyx_5; + __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_lines_idx = __pyx_5; + __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + __pyx_5 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_match_len = __pyx_5; + if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":204 */ + __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;} - /* "bzrlib/_annotator_pyx.pyx":205 - * for parent_idx, lines_idx, match_len in matching_blocks: - * _check_match_ranges(parent_annotations, annotations, - * parent_idx, lines_idx, match_len) # <<<<<<<<<<<<<< - * # For lines which match this parent, we will now resolve whether - * # this parent wins over the current annotation - */ - __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;} - - /* "bzrlib/_annotator_pyx.pyx":208 - * # For lines which match this parent, we will now resolve whether - * # this parent wins over the current annotation - * for idx from 0 <= idx < match_len: # <<<<<<<<<<<<<< - * ann_idx = lines_idx + idx - * ann_temp = PyList_GET_ITEM(annotations, ann_idx) - */ - __pyx_t_8 = __pyx_v_match_len; - for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_t_8; __pyx_v_idx++) { - - /* "bzrlib/_annotator_pyx.pyx":209 - * # this parent wins over the current annotation - * for idx from 0 <= idx < match_len: - * ann_idx = lines_idx + idx # <<<<<<<<<<<<<< - * ann_temp = PyList_GET_ITEM(annotations, ann_idx) - * par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":208 */ + for (__pyx_v_idx = 0; __pyx_v_idx < __pyx_v_match_len; ++__pyx_v_idx) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":209 */ __pyx_v_ann_idx = (__pyx_v_lines_idx + __pyx_v_idx); - /* "bzrlib/_annotator_pyx.pyx":210 - * for idx from 0 <= idx < match_len: - * ann_idx = lines_idx + idx - * ann_temp = PyList_GET_ITEM(annotations, ann_idx) # <<<<<<<<<<<<<< - * par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx) - * if (ann_temp == par_temp): - */ - __pyx_v_ann_temp = PyList_GET_ITEM(__pyx_v_annotations, __pyx_v_ann_idx); - - /* "bzrlib/_annotator_pyx.pyx":211 - * ann_idx = lines_idx + idx - * ann_temp = PyList_GET_ITEM(annotations, ann_idx) - * par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx) # <<<<<<<<<<<<<< - * if (ann_temp == par_temp): - * # This is parent, do nothing - */ - __pyx_v_par_temp = PyList_GET_ITEM(__pyx_v_parent_annotations, (__pyx_v_parent_idx + __pyx_v_idx)); - - /* "bzrlib/_annotator_pyx.pyx":212 - * ann_temp = PyList_GET_ITEM(annotations, ann_idx) - * par_temp = PyList_GET_ITEM(parent_annotations, parent_idx + idx) - * if (ann_temp == par_temp): # <<<<<<<<<<<<<< - * # This is parent, do nothing - * # Pointer comparison is fine here. Value comparison would - */ - __pyx_t_12 = (__pyx_v_ann_temp == __pyx_v_par_temp); - if (__pyx_t_12) { - - /* "bzrlib/_annotator_pyx.pyx":220 - * # PyObject_RichCompareBool using pointer comparison drops - * # timing from 215ms => 125ms - * continue # <<<<<<<<<<<<<< - * par_ann = par_temp - * ann = ann_temp - */ - goto __pyx_L5_continue; - goto __pyx_L7; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":210 */ + __pyx_v_ann_temp = PyList_GET_ITEM(__pyx_v_annotations,__pyx_v_ann_idx); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":211 */ + __pyx_v_par_temp = PyList_GET_ITEM(__pyx_v_parent_annotations,(__pyx_v_parent_idx + __pyx_v_idx)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":212 */ + __pyx_1 = (__pyx_v_ann_temp == __pyx_v_par_temp); + if (__pyx_1) { + goto __pyx_L4; + goto __pyx_L6; } - __pyx_L7:; + __pyx_L6:; - /* "bzrlib/_annotator_pyx.pyx":221 - * # timing from 215ms => 125ms - * continue - * par_ann = par_temp # <<<<<<<<<<<<<< - * ann = ann_temp - * if (ann is this_annotation): - */ - __Pyx_INCREF(((PyObject *)__pyx_v_par_temp)); - __Pyx_DECREF(__pyx_v_par_ann); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":221 */ + Py_INCREF(((PyObject *)__pyx_v_par_temp)); + Py_DECREF(__pyx_v_par_ann); __pyx_v_par_ann = ((PyObject *)__pyx_v_par_temp); - /* "bzrlib/_annotator_pyx.pyx":222 - * continue - * par_ann = par_temp - * ann = ann_temp # <<<<<<<<<<<<<< - * if (ann is this_annotation): - * # Originally claimed 'this', but it was really in this - */ - __Pyx_INCREF(((PyObject *)__pyx_v_ann_temp)); - __Pyx_DECREF(__pyx_v_ann); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":222 */ + Py_INCREF(((PyObject *)__pyx_v_ann_temp)); + Py_DECREF(__pyx_v_ann); __pyx_v_ann = ((PyObject *)__pyx_v_ann_temp); - /* "bzrlib/_annotator_pyx.pyx":223 - * par_ann = par_temp - * ann = ann_temp - * if (ann is this_annotation): # <<<<<<<<<<<<<< - * # Originally claimed 'this', but it was really in this - * # parent - */ - __pyx_t_12 = (__pyx_v_ann == __pyx_v_this_annotation); - if (__pyx_t_12) { - - /* "bzrlib/_annotator_pyx.pyx":226 - * # Originally claimed 'this', but it was really in this - * # parent - * Py_INCREF(par_ann) # <<<<<<<<<<<<<< - * PyList_SetItem(annotations, ann_idx, par_ann) - * continue - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":223 */ + __pyx_1 = __pyx_v_ann == __pyx_v_this_annotation; + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":226 */ Py_INCREF(__pyx_v_par_ann); - /* "bzrlib/_annotator_pyx.pyx":227 - * # parent - * Py_INCREF(par_ann) - * PyList_SetItem(annotations, ann_idx, par_ann) # <<<<<<<<<<<<<< - * continue - * # Resolve the fact that both sides have a different value for - */ - __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;} - - /* "bzrlib/_annotator_pyx.pyx":228 - * Py_INCREF(par_ann) - * PyList_SetItem(annotations, ann_idx, par_ann) - * continue # <<<<<<<<<<<<<< - * # Resolve the fact that both sides have a different value for - * # last modified - */ - goto __pyx_L5_continue; - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":227 */ + __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;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":228 */ + goto __pyx_L4; + goto __pyx_L7; } - __pyx_L8:; + __pyx_L7:; - /* "bzrlib/_annotator_pyx.pyx":231 - * # Resolve the fact that both sides have a different value for - * # last modified - * if (ann is last_ann and par_ann is last_parent): # <<<<<<<<<<<<<< - * Py_INCREF(last_res) - * PyList_SetItem(annotations, ann_idx, last_res) - */ - __pyx_t_12 = (__pyx_v_ann == __pyx_v_last_ann); - if (__pyx_t_12) { - __pyx_t_13 = (__pyx_v_par_ann == __pyx_v_last_parent); - __pyx_t_14 = __pyx_t_13; - } else { - __pyx_t_14 = __pyx_t_12; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":231 */ + __pyx_1 = __pyx_v_ann == __pyx_v_last_ann; + if (__pyx_1) { + __pyx_1 = __pyx_v_par_ann == __pyx_v_last_parent; } - if (__pyx_t_14) { + if (__pyx_1) { - /* "bzrlib/_annotator_pyx.pyx":232 - * # last modified - * if (ann is last_ann and par_ann is last_parent): - * Py_INCREF(last_res) # <<<<<<<<<<<<<< - * PyList_SetItem(annotations, ann_idx, last_res) - * else: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":232 */ Py_INCREF(__pyx_v_last_res); - /* "bzrlib/_annotator_pyx.pyx":233 - * if (ann is last_ann and par_ann is last_parent): - * Py_INCREF(last_res) - * PyList_SetItem(annotations, ann_idx, last_res) # <<<<<<<<<<<<<< - * else: - * new_ann = _combine_annotations(ann, par_ann, ann_cache) - */ - __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;} - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":233 */ + __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;} + goto __pyx_L8; } /*else*/ { - /* "bzrlib/_annotator_pyx.pyx":235 - * PyList_SetItem(annotations, ann_idx, last_res) - * else: - * new_ann = _combine_annotations(ann, par_ann, ann_cache) # <<<<<<<<<<<<<< - * Py_INCREF(new_ann) - * PyList_SetItem(annotations, ann_idx, new_ann) - */ - __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;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_v_new_ann); - __pyx_v_new_ann = __pyx_t_4; - __pyx_t_4 = 0; - - /* "bzrlib/_annotator_pyx.pyx":236 - * else: - * new_ann = _combine_annotations(ann, par_ann, ann_cache) - * Py_INCREF(new_ann) # <<<<<<<<<<<<<< - * PyList_SetItem(annotations, ann_idx, new_ann) - * last_ann = ann - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":235 */ + __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;} + Py_DECREF(__pyx_v_new_ann); + __pyx_v_new_ann = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":236 */ Py_INCREF(__pyx_v_new_ann); - /* "bzrlib/_annotator_pyx.pyx":237 - * new_ann = _combine_annotations(ann, par_ann, ann_cache) - * Py_INCREF(new_ann) - * PyList_SetItem(annotations, ann_idx, new_ann) # <<<<<<<<<<<<<< - * last_ann = ann - * last_parent = par_ann - */ - __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;} - - /* "bzrlib/_annotator_pyx.pyx":238 - * Py_INCREF(new_ann) - * PyList_SetItem(annotations, ann_idx, new_ann) - * last_ann = ann # <<<<<<<<<<<<<< - * last_parent = par_ann - * last_res = new_ann - */ - __Pyx_INCREF(__pyx_v_ann); - __Pyx_DECREF(__pyx_v_last_ann); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":237 */ + __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;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":238 */ + Py_INCREF(__pyx_v_ann); + Py_DECREF(__pyx_v_last_ann); __pyx_v_last_ann = __pyx_v_ann; - /* "bzrlib/_annotator_pyx.pyx":239 - * PyList_SetItem(annotations, ann_idx, new_ann) - * last_ann = ann - * last_parent = par_ann # <<<<<<<<<<<<<< - * last_res = new_ann - * return 0 - */ - __Pyx_INCREF(__pyx_v_par_ann); - __Pyx_DECREF(__pyx_v_last_parent); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":239 */ + Py_INCREF(__pyx_v_par_ann); + Py_DECREF(__pyx_v_last_parent); __pyx_v_last_parent = __pyx_v_par_ann; - /* "bzrlib/_annotator_pyx.pyx":240 - * last_ann = ann - * last_parent = par_ann - * last_res = new_ann # <<<<<<<<<<<<<< - * return 0 - * - */ - __Pyx_INCREF(__pyx_v_new_ann); - __Pyx_DECREF(__pyx_v_last_res); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":240 */ + Py_INCREF(__pyx_v_new_ann); + Py_DECREF(__pyx_v_last_res); __pyx_v_last_res = __pyx_v_new_ann; } - __pyx_L9:; - __pyx_L5_continue:; + __pyx_L8:; + __pyx_L4:; } } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "bzrlib/_annotator_pyx.pyx":241 - * last_parent = par_ann - * last_res = new_ann - * return 0 # <<<<<<<<<<<<<< - * - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":241 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_11); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._annotator_pyx._merge_annotations"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_DECREF(__pyx_v_last_ann); - __Pyx_DECREF(__pyx_v_last_parent); - __Pyx_DECREF(__pyx_v_last_res); - __Pyx_DECREF(__pyx_v_par_ann); - __Pyx_DECREF(__pyx_v_ann); - __Pyx_DECREF(__pyx_v_new_ann); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_last_ann); + Py_DECREF(__pyx_v_last_parent); + Py_DECREF(__pyx_v_last_res); + Py_DECREF(__pyx_v_par_ann); + Py_DECREF(__pyx_v_ann); + Py_DECREF(__pyx_v_new_ann); + Py_DECREF(__pyx_v_this_annotation); + Py_DECREF(__pyx_v_annotations); + Py_DECREF(__pyx_v_parent_annotations); + Py_DECREF(__pyx_v_matching_blocks); + Py_DECREF(__pyx_v_ann_cache); return __pyx_r; } -/* "bzrlib/_annotator_pyx.pyx":247 - * """Class that drives performing annotations.""" - * - * def _update_from_first_parent(self, key, annotations, lines, parent_key): # <<<<<<<<<<<<<< - * """Reannotate this text relative to its first parent.""" - * (parent_annotations, - */ - -static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent[] = "Reannotate this text relative to its first parent."; -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)}; -static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +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}; +static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_annotations = 0; @@ -2048,192 +826,72 @@ PyObject *__pyx_v_parent_key = 0; PyObject *__pyx_v_parent_annotations; PyObject *__pyx_v_matching_blocks; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - 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}; - __Pyx_RefNannySetupContext("_update_from_first_parent"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[5] = {0,0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key); - if (likely(values[1])) kw_args--; - else { - __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;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__annotations); - if (likely(values[2])) kw_args--; - else { - __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;} - } - case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lines); - if (likely(values[3])) kw_args--; - else { - __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;} - } - case 4: - values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent_key); - if (likely(values[4])) kw_args--; - else { - __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;} - } - } - if (unlikely(kw_args > 0)) { - 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;} - } - __pyx_v_self = values[0]; - __pyx_v_key = values[1]; - __pyx_v_annotations = values[2]; - __pyx_v_lines = values[3]; - __pyx_v_parent_key = values[4]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_annotations = PyTuple_GET_ITEM(__pyx_args, 2); - __pyx_v_lines = PyTuple_GET_ITEM(__pyx_args, 3); - __pyx_v_parent_key = PyTuple_GET_ITEM(__pyx_args, 4); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __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;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_first_parent"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_parent_annotations = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_matching_blocks = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_annotator_pyx.pyx":250 - * """Reannotate this text relative to its first parent.""" - * (parent_annotations, - * matching_blocks) = self._get_parent_annotations_and_matches( # <<<<<<<<<<<<<< - * key, lines, parent_key) - * - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - - /* "bzrlib/_annotator_pyx.pyx":251 - * (parent_annotations, - * matching_blocks) = self._get_parent_annotations_and_matches( - * key, lines, parent_key) # <<<<<<<<<<<<<< - * - * _apply_parent_annotations(annotations, parent_annotations, - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __Pyx_INCREF(__pyx_v_lines); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lines); - __Pyx_GIVEREF(__pyx_v_lines); - __Pyx_INCREF(__pyx_v_parent_key); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_parent_key); - __Pyx_GIVEREF(__pyx_v_parent_key); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { - PyObject* tuple = __pyx_t_3; - __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1); - - /* "bzrlib/_annotator_pyx.pyx":249 - * def _update_from_first_parent(self, key, annotations, lines, parent_key): - * """Reannotate this text relative to its first parent.""" - * (parent_annotations, # <<<<<<<<<<<<<< - * matching_blocks) = self._get_parent_annotations_and_matches( - * key, lines, parent_key) - */ - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_parent_annotations); - __pyx_v_parent_annotations = __pyx_t_2; - __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_matching_blocks); - __pyx_v_matching_blocks = __pyx_t_1; - __pyx_t_1 = 0; - } else { - __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;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_2); - __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;} - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_parent_annotations); - __pyx_v_parent_annotations = __pyx_t_2; - __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_matching_blocks); - __pyx_v_matching_blocks = __pyx_t_1; - __pyx_t_1 = 0; - } + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + int __pyx_4; + static char *__pyx_argnames[] = {"self","key","annotations","lines","parent_key",0}; + 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; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + Py_INCREF(__pyx_v_annotations); + Py_INCREF(__pyx_v_lines); + Py_INCREF(__pyx_v_parent_key); + __pyx_v_parent_annotations = Py_None; Py_INCREF(Py_None); + __pyx_v_matching_blocks = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":250 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_k6p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} + __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} + Py_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key); + Py_INCREF(__pyx_v_lines); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_lines); + Py_INCREF(__pyx_v_parent_key); + PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_parent_key); + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} + Py_DECREF(__pyx_v_parent_annotations); + __pyx_v_parent_annotations = __pyx_2; + __pyx_2 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} + Py_DECREF(__pyx_v_matching_blocks); + __pyx_v_matching_blocks = __pyx_3; + __pyx_3 = 0; + if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "bzrlib/_annotator_pyx.pyx":254 - * - * _apply_parent_annotations(annotations, parent_annotations, - * matching_blocks) # <<<<<<<<<<<<<< - * - * def _update_from_other_parents(self, key, annotations, lines, - */ - __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;} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":253 */ + __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;} - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_first_parent"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_parent_annotations); - __Pyx_DECREF(__pyx_v_matching_blocks); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_parent_annotations); + Py_DECREF(__pyx_v_matching_blocks); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); + Py_DECREF(__pyx_v_annotations); + Py_DECREF(__pyx_v_lines); + Py_DECREF(__pyx_v_parent_key); return __pyx_r; } -/* "bzrlib/_annotator_pyx.pyx":256 - * matching_blocks) - * - * def _update_from_other_parents(self, key, annotations, lines, # <<<<<<<<<<<<<< - * this_annotation, parent_key): - * """Reannotate this text relative to a second (or more) parent.""" - */ - -static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents[] = "Reannotate this text relative to a second (or more) parent."; -static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents = {__Pyx_NAMESTR("_update_from_other_parents"), (PyCFunction)__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents)}; -static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents[] = "Reannotate this text relative to a second (or more) parent."; +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}; +static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator__update_from_other_parents(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_annotations = 0; @@ -2242,204 +900,76 @@ PyObject *__pyx_v_parent_key = 0; PyObject *__pyx_v_parent_annotations; PyObject *__pyx_v_matching_blocks; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - 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}; - __Pyx_RefNannySetupContext("_update_from_other_parents"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[6] = {0,0,0,0,0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); - case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); - case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key); - if (likely(values[1])) kw_args--; - else { - __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;} - } - case 2: - values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__annotations); - if (likely(values[2])) kw_args--; - else { - __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;} - } - case 3: - values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lines); - if (likely(values[3])) kw_args--; - else { - __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;} - } - case 4: - values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__this_annotation); - if (likely(values[4])) kw_args--; - else { - __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;} - } - case 5: - values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent_key); - if (likely(values[5])) kw_args--; - else { - __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;} - } - } - if (unlikely(kw_args > 0)) { - 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;} - } - __pyx_v_self = values[0]; - __pyx_v_key = values[1]; - __pyx_v_annotations = values[2]; - __pyx_v_lines = values[3]; - __pyx_v_this_annotation = values[4]; - __pyx_v_parent_key = values[5]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_annotations = PyTuple_GET_ITEM(__pyx_args, 2); - __pyx_v_lines = PyTuple_GET_ITEM(__pyx_args, 3); - __pyx_v_this_annotation = PyTuple_GET_ITEM(__pyx_args, 4); - __pyx_v_parent_key = PyTuple_GET_ITEM(__pyx_args, 5); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __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;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_other_parents"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_parent_annotations = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_matching_blocks = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_annotator_pyx.pyx":260 - * """Reannotate this text relative to a second (or more) parent.""" - * (parent_annotations, - * matching_blocks) = self._get_parent_annotations_and_matches( # <<<<<<<<<<<<<< - * key, lines, parent_key) - * _merge_annotations(this_annotation, annotations, parent_annotations, - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - - /* "bzrlib/_annotator_pyx.pyx":261 - * (parent_annotations, - * matching_blocks) = self._get_parent_annotations_and_matches( - * key, lines, parent_key) # <<<<<<<<<<<<<< - * _merge_annotations(this_annotation, annotations, parent_annotations, - * matching_blocks, self._ann_tuple_cache) - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __Pyx_INCREF(__pyx_v_lines); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_lines); - __Pyx_GIVEREF(__pyx_v_lines); - __Pyx_INCREF(__pyx_v_parent_key); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_parent_key); - __Pyx_GIVEREF(__pyx_v_parent_key); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { - PyObject* tuple = __pyx_t_3; - __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1); - - /* "bzrlib/_annotator_pyx.pyx":259 - * this_annotation, parent_key): - * """Reannotate this text relative to a second (or more) parent.""" - * (parent_annotations, # <<<<<<<<<<<<<< - * matching_blocks) = self._get_parent_annotations_and_matches( - * key, lines, parent_key) - */ - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_parent_annotations); - __pyx_v_parent_annotations = __pyx_t_2; - __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_matching_blocks); - __pyx_v_matching_blocks = __pyx_t_1; - __pyx_t_1 = 0; - } else { - __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;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_2); - __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;} - __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_parent_annotations); - __pyx_v_parent_annotations = __pyx_t_2; - __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_matching_blocks); - __pyx_v_matching_blocks = __pyx_t_1; - __pyx_t_1 = 0; - } - - /* "bzrlib/_annotator_pyx.pyx":263 - * key, lines, parent_key) - * _merge_annotations(this_annotation, annotations, parent_annotations, - * matching_blocks, self._ann_tuple_cache) # <<<<<<<<<<<<<< - * - * def annotate_flat(self, key): - */ - __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;} - __Pyx_GOTREF(__pyx_t_3); - __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;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + int __pyx_4; + static char *__pyx_argnames[] = {"self","key","annotations","lines","this_annotation","parent_key",0}; + 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; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + Py_INCREF(__pyx_v_annotations); + Py_INCREF(__pyx_v_lines); + Py_INCREF(__pyx_v_this_annotation); + Py_INCREF(__pyx_v_parent_key); + __pyx_v_parent_annotations = Py_None; Py_INCREF(Py_None); + __pyx_v_matching_blocks = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":260 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_k6p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;} + __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;} + Py_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key); + Py_INCREF(__pyx_v_lines); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_lines); + Py_INCREF(__pyx_v_parent_key); + PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_parent_key); + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} + Py_DECREF(__pyx_v_parent_annotations); + __pyx_v_parent_annotations = __pyx_2; + __pyx_2 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} + Py_DECREF(__pyx_v_matching_blocks); + __pyx_v_matching_blocks = __pyx_3; + __pyx_3 = 0; + if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":262 */ + __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;} + __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;} + Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator._update_from_other_parents"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_parent_annotations); - __Pyx_DECREF(__pyx_v_matching_blocks); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_parent_annotations); + Py_DECREF(__pyx_v_matching_blocks); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); + Py_DECREF(__pyx_v_annotations); + Py_DECREF(__pyx_v_lines); + Py_DECREF(__pyx_v_this_annotation); + Py_DECREF(__pyx_v_parent_key); return __pyx_r; } -/* "bzrlib/_annotator_pyx.pyx":265 - * matching_blocks, self._ann_tuple_cache) - * - * def annotate_flat(self, key): # <<<<<<<<<<<<<< - * """Determine the single-best-revision to source for each line. - * - */ - -static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat[] = "Determine the single-best-revision to source for each line.\n\n This is meant as a compatibility thunk to how annotate() used to work.\n "; -static PyMethodDef __pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat = {__Pyx_NAMESTR("annotate_flat"), (PyCFunction)__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat)}; -static PyObject *__pyx_pf_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +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 "; +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}; +static PyObject *__pyx_f_6bzrlib_14_annotator_pyx_9Annotator_annotate_flat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_key = 0; Py_ssize_t __pyx_v_pos; @@ -2454,759 +984,288 @@ PyObject *__pyx_v_line; PyObject *__pyx_v_head; PyObject *__pyx_v_the_heads; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - Py_ssize_t __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__key,0}; - __Pyx_RefNannySetupContext("annotate_flat"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("annotate_flat", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - 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;} - } - __pyx_v_self = values[0]; - __pyx_v_key = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __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;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator.annotate_flat"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_annotate = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_custom_tiebreaker = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_annotations = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_lines = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_out = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_heads = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_annotation = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_line = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_head = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_the_heads = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_annotator_pyx.pyx":272 - * cdef Py_ssize_t pos, num_lines - * - * from bzrlib import annotate # <<<<<<<<<<<<<< - * - * custom_tiebreaker = annotate._break_annotation_tie - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__annotate)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__annotate)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__annotate)); - __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;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_annotate); - __pyx_v_annotate = __pyx_t_1; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_annotator_pyx.pyx":274 - * from bzrlib import annotate - * - * custom_tiebreaker = annotate._break_annotation_tie # <<<<<<<<<<<<<< - * annotations, lines = self.annotate(key) - * num_lines = len(lines) - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_annotate, __pyx_n_s_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_custom_tiebreaker); - __pyx_v_custom_tiebreaker = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_annotator_pyx.pyx":275 - * - * custom_tiebreaker = annotate._break_annotation_tie - * annotations, lines = self.annotate(key) # <<<<<<<<<<<<<< - * num_lines = len(lines) - * out = [] - */ - __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;} - __Pyx_GOTREF(__pyx_t_2); - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { - PyObject* tuple = __pyx_t_3; - __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_annotations); - __pyx_v_annotations = __pyx_t_1; - __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_lines); - __pyx_v_lines = __pyx_t_2; - __pyx_t_2 = 0; - } else { - __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;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_1); - __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;} - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_annotations); - __pyx_v_annotations = __pyx_t_1; - __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_lines); - __pyx_v_lines = __pyx_t_2; - __pyx_t_2 = 0; - } - - /* "bzrlib/_annotator_pyx.pyx":276 - * custom_tiebreaker = annotate._break_annotation_tie - * annotations, lines = self.annotate(key) - * num_lines = len(lines) # <<<<<<<<<<<<<< - * out = [] - * heads = self._get_heads_provider().heads - */ - __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;} - __pyx_v_num_lines = __pyx_t_5; - - /* "bzrlib/_annotator_pyx.pyx":277 - * annotations, lines = self.annotate(key) - * num_lines = len(lines) - * out = [] # <<<<<<<<<<<<<< - * heads = self._get_heads_provider().heads - * for pos from 0 <= pos < num_lines: - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_v_out)); - __pyx_v_out = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_annotator_pyx.pyx":278 - * num_lines = len(lines) - * out = [] - * heads = self._get_heads_provider().heads # <<<<<<<<<<<<<< - * for pos from 0 <= pos < num_lines: - * annotation = annotations[pos] - */ - __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;} - __Pyx_GOTREF(__pyx_t_3); - __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;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_heads); - __pyx_v_heads = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_annotator_pyx.pyx":279 - * out = [] - * heads = self._get_heads_provider().heads - * for pos from 0 <= pos < num_lines: # <<<<<<<<<<<<<< - * annotation = annotations[pos] - * line = lines[pos] - */ - __pyx_t_5 = __pyx_v_num_lines; - for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_5; __pyx_v_pos++) { - - /* "bzrlib/_annotator_pyx.pyx":280 - * heads = self._get_heads_provider().heads - * for pos from 0 <= pos < num_lines: - * annotation = annotations[pos] # <<<<<<<<<<<<<< - * line = lines[pos] - * if len(annotation) == 1: - */ - __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;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_annotation); - __pyx_v_annotation = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_annotator_pyx.pyx":281 - * for pos from 0 <= pos < num_lines: - * annotation = annotations[pos] - * line = lines[pos] # <<<<<<<<<<<<<< - * if len(annotation) == 1: - * head = annotation[0] - */ - __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;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_line); - __pyx_v_line = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_annotator_pyx.pyx":282 - * annotation = annotations[pos] - * line = lines[pos] - * if len(annotation) == 1: # <<<<<<<<<<<<<< - * head = annotation[0] - * else: - */ - __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;} - __pyx_t_7 = (__pyx_t_6 == 1); - if (__pyx_t_7) { - - /* "bzrlib/_annotator_pyx.pyx":283 - * line = lines[pos] - * if len(annotation) == 1: - * head = annotation[0] # <<<<<<<<<<<<<< - * else: - * the_heads = heads(annotation) - */ - __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;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_head); - __pyx_v_head = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L8; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_ssize_t __pyx_4; + int __pyx_5; + static char *__pyx_argnames[] = {"self","key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_key)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_v_annotate = Py_None; Py_INCREF(Py_None); + __pyx_v_custom_tiebreaker = Py_None; Py_INCREF(Py_None); + __pyx_v_annotations = Py_None; Py_INCREF(Py_None); + __pyx_v_lines = Py_None; Py_INCREF(Py_None); + __pyx_v_out = Py_None; Py_INCREF(Py_None); + __pyx_v_heads = Py_None; Py_INCREF(Py_None); + __pyx_v_annotation = Py_None; Py_INCREF(Py_None); + __pyx_v_line = Py_None; Py_INCREF(Py_None); + __pyx_v_head = Py_None; Py_INCREF(Py_None); + __pyx_v_the_heads = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":272 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;} + Py_INCREF(__pyx_n_annotate); + PyList_SET_ITEM(__pyx_1, 0, __pyx_n_annotate); + __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_annotate); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; goto __pyx_L1;} + Py_DECREF(__pyx_v_annotate); + __pyx_v_annotate = __pyx_1; + __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":274 */ + __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;} + Py_DECREF(__pyx_v_custom_tiebreaker); + __pyx_v_custom_tiebreaker = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":275 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_annotate); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} + Py_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key); + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} + Py_DECREF(__pyx_v_annotations); + __pyx_v_annotations = __pyx_2; + __pyx_2 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} + Py_DECREF(__pyx_v_lines); + __pyx_v_lines = __pyx_3; + __pyx_3 = 0; + if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":276 */ + __pyx_4 = PyObject_Length(__pyx_v_lines); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; goto __pyx_L1;} + __pyx_v_num_lines = __pyx_4; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":277 */ + __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; goto __pyx_L1;} + Py_DECREF(__pyx_v_out); + __pyx_v_out = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":278 */ + __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;} + __pyx_1 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_heads); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_v_heads); + __pyx_v_heads = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":279 */ + for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_v_num_lines; ++__pyx_v_pos) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":280 */ + __pyx_3 = __Pyx_GetItemInt(__pyx_v_annotations, __pyx_v_pos); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} + Py_DECREF(__pyx_v_annotation); + __pyx_v_annotation = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":281 */ + __pyx_1 = __Pyx_GetItemInt(__pyx_v_lines, __pyx_v_pos); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} + Py_DECREF(__pyx_v_line); + __pyx_v_line = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":282 */ + __pyx_4 = PyObject_Length(__pyx_v_annotation); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;} + __pyx_5 = (__pyx_4 == 1); + if (__pyx_5) { + __pyx_2 = __Pyx_GetItemInt(__pyx_v_annotation, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;} + Py_DECREF(__pyx_v_head); + __pyx_v_head = __pyx_2; + __pyx_2 = 0; + goto __pyx_L4; } /*else*/ { - /* "bzrlib/_annotator_pyx.pyx":285 - * head = annotation[0] - * else: - * the_heads = heads(annotation) # <<<<<<<<<<<<<< - * if len(the_heads) == 1: - * for head in the_heads: break # get the item out of the set - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_annotation); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_annotation); - __Pyx_GIVEREF(__pyx_v_annotation); - __pyx_t_2 = PyObject_Call(__pyx_v_heads, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_the_heads); - __pyx_v_the_heads = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_annotator_pyx.pyx":286 - * else: - * the_heads = heads(annotation) - * if len(the_heads) == 1: # <<<<<<<<<<<<<< - * for head in the_heads: break # get the item out of the set - * else: - */ - __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;} - __pyx_t_7 = (__pyx_t_6 == 1); - if (__pyx_t_7) { - - /* "bzrlib/_annotator_pyx.pyx":287 - * the_heads = heads(annotation) - * if len(the_heads) == 1: - * for head in the_heads: break # get the item out of the set # <<<<<<<<<<<<<< - * else: - * # We need to resolve the ambiguity, for now just pick the - */ - if (PyList_CheckExact(__pyx_v_the_heads) || PyTuple_CheckExact(__pyx_v_the_heads)) { - __pyx_t_6 = 0; __pyx_t_2 = __pyx_v_the_heads; __Pyx_INCREF(__pyx_t_2); - } else { - __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;} - __Pyx_GOTREF(__pyx_t_2); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":285 */ + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} + Py_INCREF(__pyx_v_annotation); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_annotation); + __pyx_1 = PyObject_CallObject(__pyx_v_heads, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_v_the_heads); + __pyx_v_the_heads = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":286 */ + __pyx_4 = PyObject_Length(__pyx_v_the_heads); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; goto __pyx_L1;} + __pyx_5 = (__pyx_4 == 1); + if (__pyx_5) { + __pyx_2 = PyObject_GetIter(__pyx_v_the_heads); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; - } else if (likely(PyTuple_CheckExact(__pyx_t_2))) { - if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; - } else { - __pyx_t_3 = PyIter_Next(__pyx_t_2); - if (!__pyx_t_3) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_3); + __pyx_3 = PyIter_Next(__pyx_2); + if (!__pyx_3) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;} + break; } - __Pyx_DECREF(__pyx_v_head); - __pyx_v_head = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L11_break; - } - __pyx_L11_break:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L9; + Py_DECREF(__pyx_v_head); + __pyx_v_head = __pyx_3; + __pyx_3 = 0; + goto __pyx_L7; + } + __pyx_L7:; + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L5; } /*else*/ { - - /* "bzrlib/_annotator_pyx.pyx":291 - * # We need to resolve the ambiguity, for now just pick the - * # sorted smallest - * head = self._resolve_annotation_tie(the_heads, line, # <<<<<<<<<<<<<< - * custom_tiebreaker) - * PyList_Append(out, (head, line)) - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_11); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - - /* "bzrlib/_annotator_pyx.pyx":292 - * # sorted smallest - * head = self._resolve_annotation_tie(the_heads, line, - * custom_tiebreaker) # <<<<<<<<<<<<<< - * PyList_Append(out, (head, line)) - * return out - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_the_heads); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_the_heads); - __Pyx_GIVEREF(__pyx_v_the_heads); - __Pyx_INCREF(__pyx_v_line); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_line); - __Pyx_GIVEREF(__pyx_v_line); - __Pyx_INCREF(__pyx_v_custom_tiebreaker); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_custom_tiebreaker); - __Pyx_GIVEREF(__pyx_v_custom_tiebreaker); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_head); - __pyx_v_head = __pyx_t_1; - __pyx_t_1 = 0; + __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;} + __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;} + Py_INCREF(__pyx_v_the_heads); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_the_heads); + Py_INCREF(__pyx_v_line); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_line); + Py_INCREF(__pyx_v_custom_tiebreaker); + PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_custom_tiebreaker); + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_v_head); + __pyx_v_head = __pyx_2; + __pyx_2 = 0; } - __pyx_L9:; + __pyx_L5:; } - __pyx_L8:; - - /* "bzrlib/_annotator_pyx.pyx":293 - * head = self._resolve_annotation_tie(the_heads, line, - * custom_tiebreaker) - * PyList_Append(out, (head, line)) # <<<<<<<<<<<<<< - * return out - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_head); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_head); - __Pyx_GIVEREF(__pyx_v_head); - __Pyx_INCREF(__pyx_v_line); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_line); - __Pyx_GIVEREF(__pyx_v_line); - __pyx_t_8 = PyList_Append(((PyObject *)__pyx_v_out), ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - } + __pyx_L4:; - /* "bzrlib/_annotator_pyx.pyx":294 - * custom_tiebreaker) - * PyList_Append(out, (head, line)) - * return out # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_out)); - __pyx_r = ((PyObject *)__pyx_v_out); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":293 */ + __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; goto __pyx_L1;} + Py_INCREF(__pyx_v_head); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_head); + Py_INCREF(__pyx_v_line); + PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_line); + __pyx_5 = PyList_Append(__pyx_v_out,__pyx_1); if (__pyx_5 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + } + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":294 */ + Py_INCREF(__pyx_v_out); + __pyx_r = __pyx_v_out; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._annotator_pyx.Annotator.annotate_flat"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_annotate); - __Pyx_DECREF(__pyx_v_custom_tiebreaker); - __Pyx_DECREF(__pyx_v_annotations); - __Pyx_DECREF(__pyx_v_lines); - __Pyx_DECREF(__pyx_v_out); - __Pyx_DECREF(__pyx_v_heads); - __Pyx_DECREF(__pyx_v_annotation); - __Pyx_DECREF(__pyx_v_line); - __Pyx_DECREF(__pyx_v_head); - __Pyx_DECREF(__pyx_v_the_heads); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_annotate); + Py_DECREF(__pyx_v_custom_tiebreaker); + Py_DECREF(__pyx_v_annotations); + Py_DECREF(__pyx_v_lines); + Py_DECREF(__pyx_v_out); + Py_DECREF(__pyx_v_heads); + Py_DECREF(__pyx_v_annotation); + Py_DECREF(__pyx_v_line); + Py_DECREF(__pyx_v_head); + Py_DECREF(__pyx_v_the_heads); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -static PyMethodDef __pyx_methods[] = { +static struct PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("_annotator_pyx"), - __Pyx_DOCSTR(__pyx_k_12), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif +static void __pyx_init_filenames(void); /*proto*/ -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_n_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 1}, - {&__pyx_n_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 1}, - {&__pyx_n_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 1}, - {&__pyx_n_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 1}, - {&__pyx_n_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 1}, - {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, - {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_n_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 1}, - {&__pyx_n_s__Annotator, __pyx_k__Annotator, sizeof(__pyx_k__Annotator), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___ann_tuple_cache, __pyx_k___ann_tuple_cache, sizeof(__pyx_k___ann_tuple_cache), 0, 0, 1, 1}, - {&__pyx_n_s___annotator_py, __pyx_k___annotator_py, sizeof(__pyx_k___annotator_py), 0, 0, 1, 1}, - {&__pyx_n_s___get_heads_provider, __pyx_k___get_heads_provider, sizeof(__pyx_k___get_heads_provider), 0, 0, 1, 1}, - {&__pyx_n_s__annotate, __pyx_k__annotate, sizeof(__pyx_k__annotate), 0, 0, 1, 1}, - {&__pyx_n_s__annotate_flat, __pyx_k__annotate_flat, sizeof(__pyx_k__annotate_flat), 0, 0, 1, 1}, - {&__pyx_n_s__annotations, __pyx_k__annotations, sizeof(__pyx_k__annotations), 0, 0, 1, 1}, - {&__pyx_n_s__bzrlib, __pyx_k__bzrlib, sizeof(__pyx_k__bzrlib), 0, 0, 1, 1}, - {&__pyx_n_s__heads, __pyx_k__heads, sizeof(__pyx_k__heads), 0, 0, 1, 1}, - {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1}, - {&__pyx_n_s__lines, __pyx_k__lines, sizeof(__pyx_k__lines), 0, 0, 1, 1}, - {&__pyx_n_s__ob_item, __pyx_k__ob_item, sizeof(__pyx_k__ob_item), 0, 0, 1, 1}, - {&__pyx_n_s__parent_key, __pyx_k__parent_key, sizeof(__pyx_k__parent_key), 0, 0, 1, 1}, - {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1}, - {&__pyx_n_s__this_annotation, __pyx_k__this_annotation, sizeof(__pyx_k__this_annotation), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __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;} - __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;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "bzrlib/_annotator_pyx.pyx":64 - * parent_annotations) except -1: - * if not PyList_CheckExact(annotations): - * raise TypeError('annotations must be a list') # <<<<<<<<<<<<<< - * if not PyList_CheckExact(parent_annotations): - * raise TypeError('parent_annotations must be a list') - */ - __pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); - PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2)); - - /* "bzrlib/_annotator_pyx.pyx":66 - * raise TypeError('annotations must be a list') - * if not PyList_CheckExact(parent_annotations): - * raise TypeError('parent_annotations must be a list') # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4)); - - /* "bzrlib/_annotator_pyx.pyx":115 - * - * if not PyTuple_CheckExact(ann_one) or not PyTuple_CheckExact(ann_two): - * raise TypeError('annotations must be tuples') # <<<<<<<<<<<<<< - * # We know that annotations are tuples, and that both sides are already - * # sorted, so we can just walk and update a new list. - */ - __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); - PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC init_annotator_pyx(void); /*proto*/ -PyMODINIT_FUNC init_annotator_pyx(void) -#else -PyMODINIT_FUNC PyInit__annotator_pyx(void); /*proto*/ -PyMODINIT_FUNC PyInit__annotator_pyx(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__annotator_pyx(void)", __LINE__, __FILE__); - #endif - __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;} - __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;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_annotator_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_12), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_annotator_pyx(void) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + __pyx_init_filenames(); + __pyx_m = Py_InitModule4("_annotator_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_bzrlib___annotator_pyx) { - 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;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "bzrlib/_annotator_pyx.pyx":58 - * - * - * from bzrlib import _annotator_py # <<<<<<<<<<<<<< - * - * - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s___annotator_py)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s___annotator_py)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s___annotator_py)); - __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;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __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;} - __Pyx_GOTREF(__pyx_t_1); - 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;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_annotator_pyx.pyx":244 - * - * - * class Annotator(_annotator_py.Annotator): # <<<<<<<<<<<<<< - * """Class that drives performing annotations.""" - * - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - - /* "bzrlib/_annotator_pyx.pyx":247 - * """Class that drives performing annotations.""" - * - * def _update_from_first_parent(self, key, annotations, lines, parent_key): # <<<<<<<<<<<<<< - * """Reannotate this text relative to its first parent.""" - * (parent_annotations, - */ - __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator__update_from_first_parent, NULL, __pyx_n_s_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_14, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_annotator_pyx.pyx":256 - * matching_blocks) - * - * def _update_from_other_parents(self, key, annotations, lines, # <<<<<<<<<<<<<< - * this_annotation, parent_key): - * """Reannotate this text relative to a second (or more) parent.""" - */ - __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_1_update_from_other_parents, NULL, __pyx_n_s_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_15, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_annotator_pyx.pyx":265 - * matching_blocks, self._ann_tuple_cache) - * - * def annotate_flat(self, key): # <<<<<<<<<<<<<< - * """Determine the single-best-revision to source for each line. - * - */ - __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6bzrlib_14_annotator_pyx_9Annotator_2annotate_flat, NULL, __pyx_n_s_13); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetItem(__pyx_t_2, __pyx_n_s__annotate_flat, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_annotator_pyx.pyx":244 - * - * - * class Annotator(_annotator_py.Annotator): # <<<<<<<<<<<<<< - * """Class that drives performing annotations.""" - * - */ - __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;} - __Pyx_GOTREF(__pyx_t_1); - __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;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - if (PyDict_SetItemString(((PyObject *)__pyx_t_2), "__doc__", ((PyObject *)__pyx_kp_s_16)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2), __pyx_n_s__Annotator, __pyx_n_s_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - 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;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "bzrlib/_annotator_pyx.pyx":1 - * # Copyright (C) 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<< - * # - * # This program is free software; you can redistribute it and/or modify - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - 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;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - if (__pyx_m) { - __Pyx_AddTraceback("init bzrlib._annotator_pyx"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init bzrlib._annotator_pyx"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 + __pyx_b = PyImport_AddModule("__builtin__"); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":58 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} + Py_INCREF(__pyx_n__annotator_py); + PyList_SET_ITEM(__pyx_1, 0, __pyx_n__annotator_py); + __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n__annotator_py); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n__annotator_py, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":244 */ + __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__annotator_py); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_Annotator); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3); + __pyx_3 = 0; + if (PyDict_SetItemString(__pyx_2, "__doc__", __pyx_k16p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;} + __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;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":247 */ + __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;} + __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + 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;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":256 */ + __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;} + __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + 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;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_annotator_pyx.pyx":265 */ + __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;} + __pyx_4 = PyMethod_New(__pyx_1, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (PyObject_SetAttr(__pyx_3, __pyx_n_annotate_flat, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_Annotator, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; return; - #else - return __pyx_m; - #endif + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + __Pyx_AddTraceback("bzrlib._annotator_pyx"); } -/* Runtime support code */ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} +static char *__pyx_filenames[] = { + "_annotator_pyx.pyx", +}; -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} +/* Runtime support code */ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } - -#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); @@ -3247,13 +1306,12 @@ Py_INCREF(type); } else { - type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else - type = (PyObject*) Py_TYPE(type); + type = (PyObject*) type->ob_type; Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, @@ -3262,8 +1320,7 @@ } #endif } - - __Pyx_ErrRestore(type, value, tb); + PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); @@ -3272,84 +1329,24 @@ return; } -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; -} -#endif - -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "need more than %d value%s to unpack", (int)index, - #else - "need more than %zd value%s to unpack", index, - #endif - (index == 1) ? "" : "s"); +static void __Pyx_UnpackError(void) { + PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size"); } -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - #if PY_VERSION_HEX < 0x02050000 - "too many values to unpack (expected %d)", (int)expected); - #else - "too many values to unpack (expected %zd)", expected); - #endif -} - -static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { +static PyObject *__Pyx_UnpackItem(PyObject *iter) { PyObject *item; if (!(item = PyIter_Next(iter))) { - if (!PyErr_Occurred()) { - __Pyx_RaiseNeedMoreValuesError(index); - } + if (!PyErr_Occurred()) + __Pyx_UnpackError(); } return item; } -static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) { +static int __Pyx_EndUnpack(PyObject *iter) { PyObject *item; if ((item = PyIter_Next(iter))) { Py_DECREF(item); - __Pyx_RaiseTooManyValuesError(expected); + __Pyx_UnpackError(); return -1; } else if (!PyErr_Occurred()) @@ -3358,138 +1355,15 @@ return -1; } -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; + PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) + __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); + if (!__import__) goto bad; if (from_list) list = from_list; @@ -3505,557 +1379,109 @@ empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); + module = PyObject_CallFunction(__import__, "OOOO", + name, global_dict, empty_dict, list); bad: Py_XDECREF(empty_list); - Py_XDECREF(py_import); + Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } -static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) { - PyObject *metaclass; - /* Default metaclass */ -#if PY_MAJOR_VERSION < 3 - if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) { - PyObject *base = PyTuple_GET_ITEM(bases, 0); - metaclass = PyObject_GetAttrString(base, "__class__"); - if (!metaclass) { - PyErr_Clear(); - metaclass = (PyObject*) Py_TYPE(base); - } - } else { - metaclass = (PyObject *) &PyClass_Type; - } -#else - if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) { - PyObject *base = PyTuple_GET_ITEM(bases, 0); - metaclass = (PyObject*) Py_TYPE(base); - } else { - metaclass = (PyObject *) &PyType_Type; - } -#endif - Py_INCREF(metaclass); - return metaclass; -} - -static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, - PyObject *modname) { - PyObject *result; - PyObject *metaclass; - - if (PyDict_SetItemString(dict, "__module__", modname) < 0) - return NULL; - - /* Python2 __metaclass__ */ - metaclass = PyDict_GetItemString(dict, "__metaclass__"); - if (metaclass) { - Py_INCREF(metaclass); - } else { - metaclass = __Pyx_FindPy2Metaclass(bases); +static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i) { + PyTypeObject *t = o->ob_type; + PyObject *r; + if (t->tp_as_sequence && t->tp_as_sequence->sq_item) + r = PySequence_GetItem(o, i); + else { + PyObject *j = PyInt_FromLong(i); + if (!j) + return 0; + r = PyObject_GetItem(o, j); + Py_DECREF(j); } - result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL); - Py_DECREF(metaclass); - return result; -} - - -static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) { - __pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType); - if (op == NULL) - return NULL; - op->func.m_ml = ml; - Py_XINCREF(self); - op->func.m_self = self; - Py_XINCREF(module); - op->func.m_module = module; - PyObject_GC_Track(op); - return (PyObject *)op; -} - -static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) { - PyObject_GC_UnTrack(m); - Py_XDECREF(m->func.m_self); - Py_XDECREF(m->func.m_module); - PyObject_GC_Del(m); -} - -static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) { - if (obj == Py_None) - obj = NULL; - return PyMethod_New(func, obj, type); + return r; } -static int __pyx_binding_PyCFunctionType_init(void) { - __pyx_binding_PyCFunctionType_type = PyCFunction_Type; - __pyx_binding_PyCFunctionType_type.tp_name = __Pyx_NAMESTR("cython_binding_builtin_function_or_method"); - __pyx_binding_PyCFunctionType_type.tp_dealloc = (destructor)__pyx_binding_PyCFunctionType_dealloc; - __pyx_binding_PyCFunctionType_type.tp_descr_get = __pyx_binding_PyCFunctionType_descr_get; - if (PyType_Ready(&__pyx_binding_PyCFunctionType_type) < 0) { - return -1; +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + if (!*t->p) + return -1; + if (t->i) + PyString_InternInPlace(t->p); + ++t; } - __pyx_binding_PyCFunctionType = &__pyx_binding_PyCFunctionType_type; return 0; - -} - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); } -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } +static PyObject *__Pyx_CreateClass( + PyObject *bases, PyObject *dict, PyObject *name, char *modname) +{ + PyObject *py_modname; + PyObject *result = 0; + + py_modname = PyString_FromString(modname); + if (!py_modname) + goto bad; + if (PyDict_SetItemString(dict, "__module__", py_modname) < 0) + goto bad; + result = PyClass_New(bases, dict, name); +bad: + Py_XDECREF(py_modname); + return result; } #include "compile.h" #include "frameobject.h" #include "traceback.h" -static void __Pyx_AddTraceback(const char *funcname) { +static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; + PyObject *empty_tuple = 0; + PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } + py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; + empty_tuple = PyTuple_New(0); + if (!empty_tuple) goto bad; + empty_string = PyString_FromString(""); + if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + empty_string, /*PyObject *code,*/ + empty_tuple, /*PyObject *consts,*/ + empty_tuple, /*PyObject *names,*/ + empty_tuple, /*PyObject *varnames,*/ + empty_tuple, /*PyObject *freevars,*/ + empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ + empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ + PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ @@ -4066,128 +1492,8 @@ bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); + Py_XDECREF(empty_tuple); + Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} - -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff -Nru bzr-2.5.0/bzrlib/_bencode_pyx.c bzr-2.6.0~beta1/bzrlib/_bencode_pyx.c --- bzr-2.5.0/bzrlib/_bencode_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_bencode_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,225 +1,32 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:24 2012 */ +/* Generated by Pyrex 0.9.8.5 on Fri Oct 8 14:00:55 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif - -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif - -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif - +#include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif - -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include -#define __PYX_HAVE_API__bzrlib___bencode_pyx #include "stddef.h" #include "stdlib.h" #include "string.h" @@ -227,109 +34,41 @@ #include "_bencode_pyx.h" #include "_static_tuple_c.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif +typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ -/* inline attribute */ -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif +static PyObject *__pyx_m; +static PyObject *__pyx_b; +static int __pyx_lineno; +static char *__pyx_filename; +static char **__pyx_f; -/* unused attribute */ -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif +static char __pyx_mdoc[] = "Pyrex implementation for bencode coder/decoder"; -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*/ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -/* Type Conversion Predeclarations */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; +static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ +static PyObject *__Pyx_ImportModule(char *name); /*proto*/ -static const char *__pyx_f[] = { - "_bencode_pyx.pyx", - "_static_tuple_c.pxd", -}; +static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/ -/* Type declarations */ +static void __Pyx_AddTraceback(char *funcname); /*proto*/ -/* "bzrlib/_bencode_pyx.pyx":240 - * - * - * cdef enum: # <<<<<<<<<<<<<< - * INITSIZE = 1024 # initial size for encoder buffer - * INT_BUF_SIZE = 32 - */ +/* Declarations from bzrlib._static_tuple_c */ -enum { - __pyx_e_6bzrlib_12_bencode_pyx_INITSIZE = 1024, - __pyx_e_6bzrlib_12_bencode_pyx_INT_BUF_SIZE = 32 -}; +static PyTypeObject *__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple = 0; + +/* Declarations from bzrlib._bencode_pyx */ -/* "bzrlib/_bencode_pyx.pyx":54 - * int snprintf(char* buffer, size_t nsize, char* fmt, ...) - * - * cdef class Decoder # <<<<<<<<<<<<<< - * cdef class Encoder - * - */ + +/* Declarations from implementation of bzrlib._bencode_pyx */ struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder { PyObject_HEAD @@ -340,13 +79,10 @@ PyObject *text; }; -/* "bzrlib/_bencode_pyx.pyx":55 - * - * cdef class Decoder - * cdef class Encoder # <<<<<<<<<<<<<< - * - * cdef extern from "_bencode_pyx.h": - */ +enum { + __pyx_e_6bzrlib_12_bencode_pyx_INITSIZE = 1024, + __pyx_e_6bzrlib_12_bencode_pyx_INT_BUF_SIZE = 32 +}; struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder { PyObject_HEAD @@ -358,37 +94,9 @@ }; -/* "bzrlib/_bencode_pyx.pyx":245 - * - * - * cdef class Encoder: # <<<<<<<<<<<<<< - * """Bencode encoder""" - * - */ - -struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder { - int (*_ensure_buffer)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, int); - int (*_encode_int)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, int); - int (*_encode_long)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, PyObject *); - int (*_append_string)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, PyObject *); - int (*_encode_string)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, PyObject *); - int (*_encode_list)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, PyObject *); - int (*_encode_dict)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, PyObject *); -}; -static struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *__pyx_vtabptr_6bzrlib_12_bencode_pyx_Encoder; - - -/* "bzrlib/_bencode_pyx.pyx":69 - * - * - * cdef class Decoder: # <<<<<<<<<<<<<< - * """Bencode decoder""" - * - */ - struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder { PyObject *(*_decode_object)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *); - int (*_read_digits)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *, char); + int (*_read_digits)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *,char); PyObject *(*_decode_int)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *); PyObject *(*_decode_string)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *); PyObject *(*_decode_list)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *); @@ -396,3868 +104,1770 @@ }; static struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *__pyx_vtabptr_6bzrlib_12_bencode_pyx_Decoder; -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif - -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); - end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/ - -static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, - PyObject *modname); /*proto*/ - -#define __pyx_binding_PyCFunctionType_USED 1 - -typedef struct { - PyCFunctionObject func; -} __pyx_binding_PyCFunctionType_object; - -static PyTypeObject __pyx_binding_PyCFunctionType_type; -static PyTypeObject *__pyx_binding_PyCFunctionType = NULL; - -static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */ -#define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL) - -static int __pyx_binding_PyCFunctionType_init(void); /* proto */ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ - -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ +struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder { + int (*_ensure_buffer)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *,int); + int (*_encode_int)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *,int); + int (*_encode_long)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *,PyObject *); + int (*_append_string)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *,PyObject *); + int (*_encode_string)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *,PyObject *); + int (*_encode_list)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *,PyObject *); + int (*_encode_dict)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *,PyObject *); +}; +static struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *__pyx_vtabptr_6bzrlib_12_bencode_pyx_Encoder; -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ +static PyTypeObject *__pyx_ptype_6bzrlib_12_bencode_pyx_Decoder = 0; +static PyTypeObject *__pyx_ptype_6bzrlib_12_bencode_pyx_Encoder = 0; -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from bzrlib._static_tuple_c */ +static char __pyx_k1[] = "String required"; +static char __pyx_k2[] = "junk in stream"; +static char __pyx_k3[] = "stream underflow"; +static char __pyx_k4[] = "_decode_object"; +static char __pyx_k5[] = "too deeply nested"; +static char __pyx_k6[] = "unknown object type identifier %r"; +static char __pyx_k7[] = "Stop character %c not found: %c"; +static char __pyx_k8[] = "string len not terminated by \":\""; +static char __pyx_k9[] = "leading zeros are not allowed"; +static char __pyx_k10[] = ""; +static char __pyx_k11[] = "string size below zero: %d"; +static char __pyx_k12[] = "malformed list"; +static char __pyx_k13[] = "key was not a simple string."; +static char __pyx_k14[] = "dict keys disordered"; +static char __pyx_k15[] = "malformed dict"; +static char __pyx_k16[] = "decode"; +static char __pyx_k17[] = "bencoded"; +static char __pyx_k18[] = "Not enough memory to allocate buffer for encoder"; +static char __pyx_k19[] = "Cannot realloc buffer for encoder"; +static char __pyx_k20[] = "i%de"; +static char __pyx_k21[] = "int %d too big to encode"; +static char __pyx_k22[] = "join"; +static char __pyx_k23[] = "i"; +static char __pyx_k24[] = "e"; +static char __pyx_k25[] = "%d:"; +static char __pyx_k26[] = "string %s too big to encode"; +static char __pyx_k27[] = "process"; +static char __pyx_k28[] = "keys"; +static char __pyx_k29[] = "sort"; +static char __pyx_k30[] = "key in dict should be string"; +static char __pyx_k31[] = "encode"; +static char __pyx_k32[] = "Bencached"; +static char __pyx_k33[] = "unsupported type %r"; +static char __pyx_k34[] = "object"; +static char __pyx_k35[] = "__slots__"; +static char __pyx_k36[] = "__init__"; + +static PyObject *__pyx_n_Bencached; +static PyObject *__pyx_n___init__; +static PyObject *__pyx_n___slots__; +static PyObject *__pyx_n_bencoded; +static PyObject *__pyx_n_decode; +static PyObject *__pyx_n_e; +static PyObject *__pyx_n_i; +static PyObject *__pyx_n_join; +static PyObject *__pyx_n_keys; +static PyObject *__pyx_n_object; +static PyObject *__pyx_n_process; +static PyObject *__pyx_n_sort; + +static PyObject *__pyx_k1p; +static PyObject *__pyx_k2p; +static PyObject *__pyx_k3p; +static PyObject *__pyx_k5p; +static PyObject *__pyx_k6p; +static PyObject *__pyx_k7p; +static PyObject *__pyx_k8p; +static PyObject *__pyx_k9p; +static PyObject *__pyx_k10p; +static PyObject *__pyx_k11p; +static PyObject *__pyx_k12p; +static PyObject *__pyx_k13p; +static PyObject *__pyx_k14p; +static PyObject *__pyx_k15p; +static PyObject *__pyx_k18p; +static PyObject *__pyx_k19p; +static PyObject *__pyx_k21p; +static PyObject *__pyx_k26p; +static PyObject *__pyx_k30p; +static PyObject *__pyx_k33p; -/* Module declarations from bzrlib._static_tuple_c */ +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_Bencached, 1, __pyx_k32, sizeof(__pyx_k32)}, + {&__pyx_n___init__, 1, __pyx_k36, sizeof(__pyx_k36)}, + {&__pyx_n___slots__, 1, __pyx_k35, sizeof(__pyx_k35)}, + {&__pyx_n_bencoded, 1, __pyx_k17, sizeof(__pyx_k17)}, + {&__pyx_n_decode, 1, __pyx_k16, sizeof(__pyx_k16)}, + {&__pyx_n_e, 1, __pyx_k24, sizeof(__pyx_k24)}, + {&__pyx_n_i, 1, __pyx_k23, sizeof(__pyx_k23)}, + {&__pyx_n_join, 1, __pyx_k22, sizeof(__pyx_k22)}, + {&__pyx_n_keys, 1, __pyx_k28, sizeof(__pyx_k28)}, + {&__pyx_n_object, 1, __pyx_k34, sizeof(__pyx_k34)}, + {&__pyx_n_process, 1, __pyx_k27, sizeof(__pyx_k27)}, + {&__pyx_n_sort, 1, __pyx_k29, sizeof(__pyx_k29)}, + {&__pyx_k1p, 0, __pyx_k1, sizeof(__pyx_k1)}, + {&__pyx_k2p, 0, __pyx_k2, sizeof(__pyx_k2)}, + {&__pyx_k3p, 0, __pyx_k3, sizeof(__pyx_k3)}, + {&__pyx_k5p, 0, __pyx_k5, sizeof(__pyx_k5)}, + {&__pyx_k6p, 0, __pyx_k6, sizeof(__pyx_k6)}, + {&__pyx_k7p, 0, __pyx_k7, sizeof(__pyx_k7)}, + {&__pyx_k8p, 0, __pyx_k8, sizeof(__pyx_k8)}, + {&__pyx_k9p, 0, __pyx_k9, sizeof(__pyx_k9)}, + {&__pyx_k10p, 0, __pyx_k10, sizeof(__pyx_k10)}, + {&__pyx_k11p, 0, __pyx_k11, sizeof(__pyx_k11)}, + {&__pyx_k12p, 0, __pyx_k12, sizeof(__pyx_k12)}, + {&__pyx_k13p, 0, __pyx_k13, sizeof(__pyx_k13)}, + {&__pyx_k14p, 0, __pyx_k14, sizeof(__pyx_k14)}, + {&__pyx_k15p, 0, __pyx_k15, sizeof(__pyx_k15)}, + {&__pyx_k18p, 0, __pyx_k18, sizeof(__pyx_k18)}, + {&__pyx_k19p, 0, __pyx_k19, sizeof(__pyx_k19)}, + {&__pyx_k21p, 0, __pyx_k21, sizeof(__pyx_k21)}, + {&__pyx_k26p, 0, __pyx_k26, sizeof(__pyx_k26)}, + {&__pyx_k30p, 0, __pyx_k30, sizeof(__pyx_k30)}, + {&__pyx_k33p, 0, __pyx_k33, sizeof(__pyx_k33)}, + {0, 0, 0, 0} +}; -static PyTypeObject *__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple = 0; -/* Module declarations from bzrlib._bencode_pyx */ +static PyObject *__pyx_d1; +static int __pyx_d2; -static PyTypeObject *__pyx_ptype_6bzrlib_12_bencode_pyx_Decoder = 0; -static PyTypeObject *__pyx_ptype_6bzrlib_12_bencode_pyx_Encoder = 0; -#define __Pyx_MODULE_NAME "bzrlib._bencode_pyx" -static int __pyx_module_is_main_bzrlib___bencode_pyx = 0; /* Implementation of bzrlib._bencode_pyx */ -static PyObject *__pyx_builtin_object; -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_MemoryError; -static char __pyx_k_1[] = "String required"; -static char __pyx_k_3[] = "junk in stream"; -static char __pyx_k_5[] = "stream underflow"; -static char __pyx_k_7[] = "too deeply nested"; -static char __pyx_k_9[] = "unknown object type identifier %r"; -static char __pyx_k_10[] = "Stop character %c not found: %c"; -static char __pyx_k_11[] = "string len not terminated by \":\""; -static char __pyx_k_13[] = "leading zeros are not allowed"; -static char __pyx_k_15[] = ""; -static char __pyx_k_17[] = "string size below zero: %d"; -static char __pyx_k_18[] = "malformed list"; -static char __pyx_k_20[] = "key was not a simple string."; -static char __pyx_k_22[] = "dict keys disordered"; -static char __pyx_k_24[] = "malformed dict"; -static char __pyx_k_27[] = "Not enough memory to allocate buffer for encoder"; -static char __pyx_k_29[] = "Cannot realloc buffer for encoder"; -static char __pyx_k_31[] = "i%de"; -static char __pyx_k_32[] = "int %d too big to encode"; -static char __pyx_k_33[] = "%d:"; -static char __pyx_k_34[] = "string %s too big to encode"; -static char __pyx_k_35[] = "key in dict should be string"; -static char __pyx_k_38[] = "unsupported type %r"; -static char __pyx_k_39[] = "Pyrex implementation for bencode coder/decoder"; -static char __pyx_k_40[] = "bzrlib._bencode_pyx"; -static char __pyx_k__e[] = "e"; -static char __pyx_k__i[] = "i"; -static char __pyx_k__s[] = "s"; -static char __pyx_k__join[] = "join"; -static char __pyx_k__keys[] = "keys"; -static char __pyx_k__self[] = "self"; -static char __pyx_k__size[] = "size"; -static char __pyx_k__sort[] = "sort"; -static char __pyx_k__tail[] = "tail"; -static char __pyx_k__text[] = "text"; -static char __pyx_k__buffer[] = "buffer"; -static char __pyx_k__decode[] = "decode"; -static char __pyx_k__encode[] = "encode"; -static char __pyx_k__object[] = "object"; -static char __pyx_k__bdecode[] = "bdecode"; -static char __pyx_k__bencode[] = "bencode"; -static char __pyx_k__maxsize[] = "maxsize"; -static char __pyx_k__process[] = "process"; -static char __pyx_k____init__[] = "__init__"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__bencoded[] = "bencoded"; -static char __pyx_k__Bencached[] = "Bencached"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k____slots__[] = "__slots__"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k__MemoryError[] = "MemoryError"; -static char __pyx_k___decode_int[] = "_decode_int"; -static char __pyx_k___encode_int[] = "_encode_int"; -static char __pyx_k__RuntimeError[] = "RuntimeError"; -static char __pyx_k___decode_dict[] = "_decode_dict"; -static char __pyx_k___decode_list[] = "_decode_list"; -static char __pyx_k___encode_dict[] = "_encode_dict"; -static char __pyx_k___encode_list[] = "_encode_list"; -static char __pyx_k___encode_long[] = "_encode_long"; -static char __pyx_k___read_digits[] = "_read_digits"; -static char __pyx_k__yield_tuples[] = "yield_tuples"; -static char __pyx_k___yield_tuples[] = "_yield_tuples"; -static char __pyx_k___append_string[] = "_append_string"; -static char __pyx_k___decode_object[] = "_decode_object"; -static char __pyx_k___decode_string[] = "_decode_string"; -static char __pyx_k___encode_string[] = "_encode_string"; -static char __pyx_k___ensure_buffer[] = "_ensure_buffer"; -static char __pyx_k__bdecode_as_tuple[] = "bdecode_as_tuple"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_kp_s_10; -static PyObject *__pyx_kp_s_11; -static PyObject *__pyx_kp_s_13; -static PyObject *__pyx_kp_s_15; -static PyObject *__pyx_kp_s_17; -static PyObject *__pyx_kp_s_18; -static PyObject *__pyx_kp_s_20; -static PyObject *__pyx_kp_s_22; -static PyObject *__pyx_kp_s_24; -static PyObject *__pyx_kp_s_27; -static PyObject *__pyx_kp_s_29; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_32; -static PyObject *__pyx_kp_s_34; -static PyObject *__pyx_kp_s_35; -static PyObject *__pyx_kp_s_38; -static PyObject *__pyx_n_s_40; -static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_kp_s_9; -static PyObject *__pyx_n_s__Bencached; -static PyObject *__pyx_n_s__MemoryError; -static PyObject *__pyx_n_s__RuntimeError; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____init__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____slots__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___append_string; -static PyObject *__pyx_n_s___decode_dict; -static PyObject *__pyx_n_s___decode_int; -static PyObject *__pyx_n_s___decode_list; -static PyObject *__pyx_n_s___decode_object; -static PyObject *__pyx_n_s___decode_string; -static PyObject *__pyx_n_s___encode_dict; -static PyObject *__pyx_n_s___encode_int; -static PyObject *__pyx_n_s___encode_list; -static PyObject *__pyx_n_s___encode_long; -static PyObject *__pyx_n_s___encode_string; -static PyObject *__pyx_n_s___ensure_buffer; -static PyObject *__pyx_n_s___read_digits; -static PyObject *__pyx_n_s___yield_tuples; -static PyObject *__pyx_n_s__bdecode; -static PyObject *__pyx_n_s__bdecode_as_tuple; -static PyObject *__pyx_n_s__bencode; -static PyObject *__pyx_n_s__bencoded; -static PyObject *__pyx_n_s__buffer; -static PyObject *__pyx_n_s__decode; -static PyObject *__pyx_n_s__e; -static PyObject *__pyx_n_s__i; -static PyObject *__pyx_n_s__join; -static PyObject *__pyx_n_s__keys; -static PyObject *__pyx_n_s__maxsize; -static PyObject *__pyx_n_s__object; -static PyObject *__pyx_n_s__process; -static PyObject *__pyx_n_s__s; -static PyObject *__pyx_n_s__self; -static PyObject *__pyx_n_s__size; -static PyObject *__pyx_n_s__sort; -static PyObject *__pyx_n_s__tail; -static PyObject *__pyx_n_s__text; -static PyObject *__pyx_n_s__yield_tuples; -static PyObject *__pyx_int_0; -static int __pyx_k_26; -static PyObject *__pyx_k_tuple_2; -static PyObject *__pyx_k_tuple_4; -static PyObject *__pyx_k_tuple_6; -static PyObject *__pyx_k_tuple_8; -static PyObject *__pyx_k_tuple_12; -static PyObject *__pyx_k_tuple_14; -static PyObject *__pyx_k_tuple_16; -static PyObject *__pyx_k_tuple_19; -static PyObject *__pyx_k_tuple_21; -static PyObject *__pyx_k_tuple_23; -static PyObject *__pyx_k_tuple_25; -static PyObject *__pyx_k_tuple_28; -static PyObject *__pyx_k_tuple_30; -static PyObject *__pyx_k_tuple_36; -static PyObject *__pyx_k_tuple_37; - -/* "bzrlib/_bencode_pyx.pyx":77 - * cdef object text - * - * def __init__(self, s, yield_tuples=0): # <<<<<<<<<<<<<< - * """Initialize decoder engine. - * @param s: Python string. - */ - -static int __pyx_pf_6bzrlib_12_bencode_pyx_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_12_bencode_pyx_7Decoder___init__[] = "Initialize decoder engine.\n @param s: Python string.\n "; -struct wrapperbase __pyx_wrapperbase_6bzrlib_12_bencode_pyx_7Decoder___init__; -static int __pyx_pf_6bzrlib_12_bencode_pyx_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + +static int __pyx_f_6bzrlib_12_bencode_pyx_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6bzrlib_12_bencode_pyx_7Decoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_s = 0; PyObject *__pyx_v_yield_tuples = 0; int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - char *__pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__s,&__pyx_n_s__yield_tuples,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - values[1] = ((PyObject *)__pyx_int_0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__s); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__yield_tuples); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_s = values[0]; - __pyx_v_yield_tuples = values[1]; - } else { - __pyx_v_yield_tuples = ((PyObject *)__pyx_int_0); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_yield_tuples = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: __pyx_v_s = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "bzrlib/_bencode_pyx.pyx":81 - * @param s: Python string. - * """ - * if not PyString_CheckExact(s): # <<<<<<<<<<<<<< - * raise TypeError("String required") - * - */ - __pyx_t_1 = (!PyString_CheckExact(__pyx_v_s)); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":82 - * """ - * if not PyString_CheckExact(s): - * raise TypeError("String required") # <<<<<<<<<<<<<< - * - * self.text = s - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "bzrlib/_bencode_pyx.pyx":84 - * raise TypeError("String required") - * - * self.text = s # <<<<<<<<<<<<<< - * self.tail = PyString_AS_STRING(s) - * self.size = PyString_GET_SIZE(s) - */ - __Pyx_INCREF(__pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->text); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->text); + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + char *__pyx_4; + Py_ssize_t __pyx_5; + static char *__pyx_argnames[] = {"s","yield_tuples",0}; + __pyx_v_yield_tuples = __pyx_d1; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_s, &__pyx_v_yield_tuples)) return -1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_s); + Py_INCREF(__pyx_v_yield_tuples); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":81 */ + __pyx_1 = (!PyString_CheckExact(__pyx_v_s)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;} + Py_INCREF(__pyx_k1p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k1p); + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":84 */ + Py_INCREF(__pyx_v_s); + Py_DECREF(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->text); ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->text = __pyx_v_s; - /* "bzrlib/_bencode_pyx.pyx":85 - * - * self.text = s - * self.tail = PyString_AS_STRING(s) # <<<<<<<<<<<<<< - * self.size = PyString_GET_SIZE(s) - * self._yield_tuples = int(yield_tuples) - */ - __pyx_t_3 = PyString_AS_STRING(__pyx_v_s); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->tail = __pyx_t_3; - - /* "bzrlib/_bencode_pyx.pyx":86 - * self.text = s - * self.tail = PyString_AS_STRING(s) - * self.size = PyString_GET_SIZE(s) # <<<<<<<<<<<<<< - * self._yield_tuples = int(yield_tuples) - * - */ - __pyx_t_4 = PyString_GET_SIZE(__pyx_v_s); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->size = __pyx_t_4; - - /* "bzrlib/_bencode_pyx.pyx":87 - * self.tail = PyString_AS_STRING(s) - * self.size = PyString_GET_SIZE(s) - * self._yield_tuples = int(yield_tuples) # <<<<<<<<<<<<<< - * - * def decode(self): - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_yield_tuples); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_yield_tuples); - __Pyx_GIVEREF(__pyx_v_yield_tuples); - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->_yield_tuples = __pyx_t_6; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":85 */ + __pyx_4 = PyString_AS_STRING(__pyx_v_s); if (__pyx_4 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} + ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->tail = __pyx_4; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":86 */ + __pyx_5 = PyString_GET_SIZE(__pyx_v_s); if (__pyx_5 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; goto __pyx_L1;} + ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->size = __pyx_5; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":87 */ + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;} + Py_INCREF(__pyx_v_yield_tuples); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_yield_tuples); + __pyx_3 = PyObject_CallObject(((PyObject *)(&PyInt_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->_yield_tuples = __pyx_1; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder.__init__"); __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_s); + Py_DECREF(__pyx_v_yield_tuples); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":89 - * self._yield_tuples = int(yield_tuples) - * - * def decode(self): # <<<<<<<<<<<<<< - * result = self._decode_object() - * if self.size != 0: - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_1decode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_1decode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder_decode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder_decode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_result; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannySetupContext("decode"); - __pyx_v_result = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_bencode_pyx.pyx":90 - * - * def decode(self): - * result = self._decode_object() # <<<<<<<<<<<<<< - * if self.size != 0: - * raise ValueError('junk in stream') - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->__pyx_vtab)->_decode_object(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_bencode_pyx.pyx":91 - * def decode(self): - * result = self._decode_object() - * if self.size != 0: # <<<<<<<<<<<<<< - * raise ValueError('junk in stream') - * return result - */ - __pyx_t_2 = (((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->size != 0); - if (__pyx_t_2) { - - /* "bzrlib/_bencode_pyx.pyx":92 - * result = self._decode_object() - * if self.size != 0: - * raise ValueError('junk in stream') # <<<<<<<<<<<<<< - * return result - * - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_v_result = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":90 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->__pyx_vtab)->_decode_object(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} + Py_DECREF(__pyx_v_result); + __pyx_v_result = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":91 */ + __pyx_2 = (((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->size != 0); + if (__pyx_2) { + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;} + Py_INCREF(__pyx_k2p); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k2p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_bencode_pyx.pyx":93 - * if self.size != 0: - * raise ValueError('junk in stream') - * return result # <<<<<<<<<<<<<< - * - * def decode_object(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_result); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":93 */ + Py_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder.decode"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_result); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_result); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":95 - * return result - * - * def decode_object(self): # <<<<<<<<<<<<<< - * return self._decode_object() - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_2decode_object(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_2decode_object(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("decode_object"); - - /* "bzrlib/_bencode_pyx.pyx":96 - * - * def decode_object(self): - * return self._decode_object() # <<<<<<<<<<<<<< - * - * cdef object _decode_object(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->__pyx_vtab)->_decode_object(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder_decode_object(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder_decode_object(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->__pyx_vtab)->_decode_object(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder.decode_object"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":98 - * return self._decode_object() - * - * cdef object _decode_object(self): # <<<<<<<<<<<<<< - * cdef char ch - * - */ - -static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_object(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_object(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self) { char __pyx_v_ch; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_decode_object"); - - /* "bzrlib/_bencode_pyx.pyx":101 - * cdef char ch - * - * if 0 == self.size: # <<<<<<<<<<<<<< - * raise ValueError('stream underflow') - * - */ - __pyx_t_1 = (0 == __pyx_v_self->size); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":102 - * - * if 0 == self.size: - * raise ValueError('stream underflow') # <<<<<<<<<<<<<< - * - * if Py_EnterRecursiveCall("_decode_object"): - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":101 */ + __pyx_1 = (0 == __pyx_v_self->size); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;} + Py_INCREF(__pyx_k3p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k3p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":104 */ + __pyx_1 = Py_EnterRecursiveCall(__pyx_k4); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + Py_INCREF(__pyx_k5p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k5p); + __pyx_3 = PyObject_CallObject(PyExc_RuntimeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_bencode_pyx.pyx":104 - * raise ValueError('stream underflow') - * - * if Py_EnterRecursiveCall("_decode_object"): # <<<<<<<<<<<<<< - * raise RuntimeError("too deeply nested") - * try: - */ - __pyx_t_3 = Py_EnterRecursiveCall(__pyx_k___decode_object); - if (__pyx_t_3) { - - /* "bzrlib/_bencode_pyx.pyx":105 - * - * if Py_EnterRecursiveCall("_decode_object"): - * raise RuntimeError("too deeply nested") # <<<<<<<<<<<<<< - * try: - * ch = self.tail[0] - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "bzrlib/_bencode_pyx.pyx":106 - * if Py_EnterRecursiveCall("_decode_object"): - * raise RuntimeError("too deeply nested") - * try: # <<<<<<<<<<<<<< - * ch = self.tail[0] - * if c'0' <= ch <= c'9': - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":106 */ /*try:*/ { - /* "bzrlib/_bencode_pyx.pyx":107 - * raise RuntimeError("too deeply nested") - * try: - * ch = self.tail[0] # <<<<<<<<<<<<<< - * if c'0' <= ch <= c'9': - * return self._decode_string() - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":107 */ __pyx_v_ch = (__pyx_v_self->tail[0]); - /* "bzrlib/_bencode_pyx.pyx":108 - * try: - * ch = self.tail[0] - * if c'0' <= ch <= c'9': # <<<<<<<<<<<<<< - * return self._decode_string() - * elif ch == c'l': - */ - __pyx_t_1 = ('0' <= __pyx_v_ch); - if (__pyx_t_1) { - __pyx_t_1 = (__pyx_v_ch <= '9'); - } - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":109 - * ch = self.tail[0] - * if c'0' <= ch <= c'9': - * return self._decode_string() # <<<<<<<<<<<<<< - * elif ch == c'l': - * D_UPDATE_TAIL(self, 1) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_string(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L6;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L5; - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":108 */ + __pyx_1 = '0' <= __pyx_v_ch; + if (__pyx_1) { + __pyx_1 = __pyx_v_ch <= '9'; + } + if (__pyx_1) { + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_string(__pyx_v_self); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L5;} + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L4; + goto __pyx_L7; } + __pyx_1 = (__pyx_v_ch == 'l'); + if (__pyx_1) { - /* "bzrlib/_bencode_pyx.pyx":110 - * if c'0' <= ch <= c'9': - * return self._decode_string() - * elif ch == c'l': # <<<<<<<<<<<<<< - * D_UPDATE_TAIL(self, 1) - * return self._decode_list() - */ - __pyx_t_1 = (__pyx_v_ch == 'l'); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":111 - * return self._decode_string() - * elif ch == c'l': - * D_UPDATE_TAIL(self, 1) # <<<<<<<<<<<<<< - * return self._decode_list() - * elif ch == c'i': - */ - D_UPDATE_TAIL(__pyx_v_self, 1); - - /* "bzrlib/_bencode_pyx.pyx":112 - * elif ch == c'l': - * D_UPDATE_TAIL(self, 1) - * return self._decode_list() # <<<<<<<<<<<<<< - * elif ch == c'i': - * D_UPDATE_TAIL(self, 1) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_list(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L6;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L5; - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":111 */ + D_UPDATE_TAIL(__pyx_v_self,1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":112 */ + __pyx_3 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_list(__pyx_v_self); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L5;} + __pyx_r = __pyx_3; + __pyx_3 = 0; + goto __pyx_L4; + goto __pyx_L7; } + __pyx_1 = (__pyx_v_ch == 'i'); + if (__pyx_1) { - /* "bzrlib/_bencode_pyx.pyx":113 - * D_UPDATE_TAIL(self, 1) - * return self._decode_list() - * elif ch == c'i': # <<<<<<<<<<<<<< - * D_UPDATE_TAIL(self, 1) - * return self._decode_int() - */ - __pyx_t_1 = (__pyx_v_ch == 'i'); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":114 - * return self._decode_list() - * elif ch == c'i': - * D_UPDATE_TAIL(self, 1) # <<<<<<<<<<<<<< - * return self._decode_int() - * elif ch == c'd': - */ - D_UPDATE_TAIL(__pyx_v_self, 1); - - /* "bzrlib/_bencode_pyx.pyx":115 - * elif ch == c'i': - * D_UPDATE_TAIL(self, 1) - * return self._decode_int() # <<<<<<<<<<<<<< - * elif ch == c'd': - * D_UPDATE_TAIL(self, 1) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_int(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L6;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L5; - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":114 */ + D_UPDATE_TAIL(__pyx_v_self,1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":115 */ + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_int(__pyx_v_self); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L5;} + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L4; + goto __pyx_L7; } + __pyx_1 = (__pyx_v_ch == 'd'); + if (__pyx_1) { - /* "bzrlib/_bencode_pyx.pyx":116 - * D_UPDATE_TAIL(self, 1) - * return self._decode_int() - * elif ch == c'd': # <<<<<<<<<<<<<< - * D_UPDATE_TAIL(self, 1) - * return self._decode_dict() - */ - __pyx_t_1 = (__pyx_v_ch == 'd'); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":117 - * return self._decode_int() - * elif ch == c'd': - * D_UPDATE_TAIL(self, 1) # <<<<<<<<<<<<<< - * return self._decode_dict() - * else: - */ - D_UPDATE_TAIL(__pyx_v_self, 1); - - /* "bzrlib/_bencode_pyx.pyx":118 - * elif ch == c'd': - * D_UPDATE_TAIL(self, 1) - * return self._decode_dict() # <<<<<<<<<<<<<< - * else: - * raise ValueError('unknown object type identifier %r' % ch) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_dict(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L6;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L5; - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":117 */ + D_UPDATE_TAIL(__pyx_v_self,1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":118 */ + __pyx_3 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_dict(__pyx_v_self); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L5;} + __pyx_r = __pyx_3; + __pyx_3 = 0; + goto __pyx_L4; + goto __pyx_L7; } /*else*/ { - - /* "bzrlib/_bencode_pyx.pyx":120 - * return self._decode_dict() - * else: - * raise ValueError('unknown object type identifier %r' % ch) # <<<<<<<<<<<<<< - * finally: - * Py_LeaveRecursiveCall() - */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_ch); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L6;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L6;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L6;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L6;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L6;} + __pyx_2 = PyInt_FromLong(__pyx_v_ch); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L5;} + __pyx_3 = PyNumber_Remainder(__pyx_k6p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L5;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L5;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L5;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L5;} } - __pyx_L8:; + __pyx_L7:; } - - /* "bzrlib/_bencode_pyx.pyx":122 - * raise ValueError('unknown object type identifier %r' % ch) - * finally: - * Py_LeaveRecursiveCall() # <<<<<<<<<<<<<< - * - * cdef int _read_digits(self, char stop_char) except -1: - */ /*finally:*/ { int __pyx_why; PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L7; - __pyx_L5: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 3; goto __pyx_L7; - __pyx_L6: { + __pyx_why = 0; goto __pyx_L6; + __pyx_L4: __pyx_why = 3; goto __pyx_L6; + __pyx_L5: { __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + Py_XDECREF(__pyx_2); __pyx_2 = 0; + Py_XDECREF(__pyx_3); __pyx_3 = 0; + PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L7; + goto __pyx_L6; } - __pyx_L7:; + __pyx_L6:; Py_LeaveRecursiveCall(); switch (__pyx_why) { case 3: goto __pyx_L0; case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); __pyx_lineno = __pyx_exc_lineno; __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; - goto __pyx_L1_error; + goto __pyx_L1; } } } - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder._decode_object"); __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":124 - * Py_LeaveRecursiveCall() - * - * cdef int _read_digits(self, char stop_char) except -1: # <<<<<<<<<<<<<< - * cdef int i - * i = 0 - */ - -static int __pyx_f_6bzrlib_12_bencode_pyx_7Decoder__read_digits(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self, char __pyx_v_stop_char) { +static int __pyx_f_6bzrlib_12_bencode_pyx_7Decoder__read_digits(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self,char __pyx_v_stop_char) { int __pyx_v_i; int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - __Pyx_RefNannySetupContext("_read_digits"); - - /* "bzrlib/_bencode_pyx.pyx":126 - * cdef int _read_digits(self, char stop_char) except -1: - * cdef int i - * i = 0 # <<<<<<<<<<<<<< - * while ((self.tail[i] >= c'0' and self.tail[i] <= c'9') or - * self.tail[i] == c'-') and i < self.size: - */ + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":126 */ __pyx_v_i = 0; - /* "bzrlib/_bencode_pyx.pyx":127 - * cdef int i - * i = 0 - * while ((self.tail[i] >= c'0' and self.tail[i] <= c'9') or # <<<<<<<<<<<<<< - * self.tail[i] == c'-') and i < self.size: - * i = i + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":127 */ while (1) { - - /* "bzrlib/_bencode_pyx.pyx":128 - * i = 0 - * while ((self.tail[i] >= c'0' and self.tail[i] <= c'9') or - * self.tail[i] == c'-') and i < self.size: # <<<<<<<<<<<<<< - * i = i + 1 - * - */ - __pyx_t_1 = ((__pyx_v_self->tail[__pyx_v_i]) >= '0'); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":127 - * cdef int i - * i = 0 - * while ((self.tail[i] >= c'0' and self.tail[i] <= c'9') or # <<<<<<<<<<<<<< - * self.tail[i] == c'-') and i < self.size: - * i = i + 1 - */ - __pyx_t_2 = ((__pyx_v_self->tail[__pyx_v_i]) <= '9'); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (!__pyx_t_3) { - - /* "bzrlib/_bencode_pyx.pyx":128 - * i = 0 - * while ((self.tail[i] >= c'0' and self.tail[i] <= c'9') or - * self.tail[i] == c'-') and i < self.size: # <<<<<<<<<<<<<< - * i = i + 1 - * - */ - __pyx_t_1 = ((__pyx_v_self->tail[__pyx_v_i]) == '-'); - __pyx_t_2 = __pyx_t_1; - } else { - __pyx_t_2 = __pyx_t_3; - } - if (__pyx_t_2) { - __pyx_t_3 = (__pyx_v_i < __pyx_v_self->size); - __pyx_t_1 = __pyx_t_3; - } else { - __pyx_t_1 = __pyx_t_2; - } - if (!__pyx_t_1) break; - - /* "bzrlib/_bencode_pyx.pyx":129 - * while ((self.tail[i] >= c'0' and self.tail[i] <= c'9') or - * self.tail[i] == c'-') and i < self.size: - * i = i + 1 # <<<<<<<<<<<<<< - * - * if self.tail[i] != stop_char: - */ + __pyx_1 = ((__pyx_v_self->tail[__pyx_v_i]) >= '0'); + if (__pyx_1) { + __pyx_1 = ((__pyx_v_self->tail[__pyx_v_i]) <= '9'); + } + if (!__pyx_1) { + __pyx_1 = ((__pyx_v_self->tail[__pyx_v_i]) == '-'); + } + if (__pyx_1) { + __pyx_1 = (__pyx_v_i < __pyx_v_self->size); + } + if (!__pyx_1) break; __pyx_v_i = (__pyx_v_i + 1); } - /* "bzrlib/_bencode_pyx.pyx":131 - * i = i + 1 - * - * if self.tail[i] != stop_char: # <<<<<<<<<<<<<< - * raise ValueError("Stop character %c not found: %c" % - * (stop_char, self.tail[i])) - */ - __pyx_t_1 = ((__pyx_v_self->tail[__pyx_v_i]) != __pyx_v_stop_char); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":133 - * if self.tail[i] != stop_char: - * raise ValueError("Stop character %c not found: %c" % - * (stop_char, self.tail[i])) # <<<<<<<<<<<<<< - * if (self.tail[0] == c'0' or - * (self.tail[0] == c'-' and self.tail[1] == c'0')): - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_stop_char); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyInt_FromLong((__pyx_v_self->tail[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":131 */ + __pyx_1 = ((__pyx_v_self->tail[__pyx_v_i]) != __pyx_v_stop_char); + if (__pyx_1) { + __pyx_2 = PyInt_FromLong(__pyx_v_stop_char); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong((__pyx_v_self->tail[__pyx_v_i])); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_2 = 0; + __pyx_3 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k7p, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; - /* "bzrlib/_bencode_pyx.pyx":134 - * raise ValueError("Stop character %c not found: %c" % - * (stop_char, self.tail[i])) - * if (self.tail[0] == c'0' or # <<<<<<<<<<<<<< - * (self.tail[0] == c'-' and self.tail[1] == c'0')): - * if i == 1: - */ - __pyx_t_1 = ((__pyx_v_self->tail[0]) == '0'); - if (!__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":135 - * (stop_char, self.tail[i])) - * if (self.tail[0] == c'0' or - * (self.tail[0] == c'-' and self.tail[1] == c'0')): # <<<<<<<<<<<<<< - * if i == 1: - * return i - */ - __pyx_t_2 = ((__pyx_v_self->tail[0]) == '-'); - if (__pyx_t_2) { - __pyx_t_3 = ((__pyx_v_self->tail[1]) == '0'); - __pyx_t_7 = __pyx_t_3; - } else { - __pyx_t_7 = __pyx_t_2; - } - __pyx_t_2 = __pyx_t_7; - } else { - __pyx_t_2 = __pyx_t_1; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":134 */ + __pyx_1 = ((__pyx_v_self->tail[0]) == '0'); + if (!__pyx_1) { + __pyx_1 = ((__pyx_v_self->tail[0]) == '-'); + if (__pyx_1) { + __pyx_1 = ((__pyx_v_self->tail[1]) == '0'); + } } - if (__pyx_t_2) { - - /* "bzrlib/_bencode_pyx.pyx":136 - * if (self.tail[0] == c'0' or - * (self.tail[0] == c'-' and self.tail[1] == c'0')): - * if i == 1: # <<<<<<<<<<<<<< - * return i - * else: - */ - __pyx_t_2 = (__pyx_v_i == 1); - if (__pyx_t_2) { - - /* "bzrlib/_bencode_pyx.pyx":137 - * (self.tail[0] == c'-' and self.tail[1] == c'0')): - * if i == 1: - * return i # <<<<<<<<<<<<<< - * else: - * raise ValueError # leading zeroes are not allowed - */ + if (__pyx_1) { + __pyx_1 = (__pyx_v_i == 1); + if (__pyx_1) { __pyx_r = __pyx_v_i; goto __pyx_L0; - goto __pyx_L7; + goto __pyx_L6; } /*else*/ { - - /* "bzrlib/_bencode_pyx.pyx":139 - * return i - * else: - * raise ValueError # leading zeroes are not allowed # <<<<<<<<<<<<<< - * return i - * - */ - __Pyx_Raise(__pyx_builtin_ValueError, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_Raise(PyExc_ValueError, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;} } - __pyx_L7:; - goto __pyx_L6; + __pyx_L6:; + goto __pyx_L5; } - __pyx_L6:; + __pyx_L5:; - /* "bzrlib/_bencode_pyx.pyx":140 - * else: - * raise ValueError # leading zeroes are not allowed - * return i # <<<<<<<<<<<<<< - * - * cdef object _decode_int(self): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":140 */ __pyx_r = __pyx_v_i; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder._read_digits"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":142 - * return i - * - * cdef object _decode_int(self): # <<<<<<<<<<<<<< - * cdef int i - * i = self._read_digits(c'e') - */ - -static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_int(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_int(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self) { int __pyx_v_i; PyObject *__pyx_v_ret; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("_decode_int"); - __pyx_v_ret = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_bencode_pyx.pyx":144 - * cdef object _decode_int(self): - * cdef int i - * i = self._read_digits(c'e') # <<<<<<<<<<<<<< - * self.tail[i] = 0 - * try: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_read_digits(__pyx_v_self, 'e'); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_i = __pyx_t_1; - - /* "bzrlib/_bencode_pyx.pyx":145 - * cdef int i - * i = self._read_digits(c'e') - * self.tail[i] = 0 # <<<<<<<<<<<<<< - * try: - * ret = PyInt_FromString(self.tail, NULL, 10) - */ + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_ret = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":144 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_read_digits(__pyx_v_self,'e'); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L1;} + __pyx_v_i = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":145 */ (__pyx_v_self->tail[__pyx_v_i]) = 0; - /* "bzrlib/_bencode_pyx.pyx":146 - * i = self._read_digits(c'e') - * self.tail[i] = 0 - * try: # <<<<<<<<<<<<<< - * ret = PyInt_FromString(self.tail, NULL, 10) - * finally: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":146 */ /*try:*/ { - - /* "bzrlib/_bencode_pyx.pyx":147 - * self.tail[i] = 0 - * try: - * ret = PyInt_FromString(self.tail, NULL, 10) # <<<<<<<<<<<<<< - * finally: - * self.tail[i] = c'e' - */ - __pyx_t_2 = PyInt_FromString(__pyx_v_self->tail, NULL, 10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L4;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_ret); - __pyx_v_ret = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_2 = PyInt_FromString(__pyx_v_self->tail,NULL,10); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L3;} + Py_DECREF(__pyx_v_ret); + __pyx_v_ret = __pyx_2; + __pyx_2 = 0; } - - /* "bzrlib/_bencode_pyx.pyx":149 - * ret = PyInt_FromString(self.tail, NULL, 10) - * finally: - * self.tail[i] = c'e' # <<<<<<<<<<<<<< - * D_UPDATE_TAIL(self, i+1) - * return ret - */ /*finally:*/ { int __pyx_why; PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L5; - __pyx_L4: { + __pyx_why = 0; goto __pyx_L4; + __pyx_L3: { __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + Py_XDECREF(__pyx_2); __pyx_2 = 0; + PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L5; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; (__pyx_v_self->tail[__pyx_v_i]) = 'e'; switch (__pyx_why) { case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); __pyx_lineno = __pyx_exc_lineno; __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; - goto __pyx_L1_error; + goto __pyx_L1; } } } - /* "bzrlib/_bencode_pyx.pyx":150 - * finally: - * self.tail[i] = c'e' - * D_UPDATE_TAIL(self, i+1) # <<<<<<<<<<<<<< - * return ret - * - */ - D_UPDATE_TAIL(__pyx_v_self, (__pyx_v_i + 1)); - - /* "bzrlib/_bencode_pyx.pyx":151 - * self.tail[i] = c'e' - * D_UPDATE_TAIL(self, i+1) - * return ret # <<<<<<<<<<<<<< - * - * cdef object _decode_string(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_ret); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":150 */ + D_UPDATE_TAIL(__pyx_v_self,(__pyx_v_i + 1)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":151 */ + Py_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder._decode_int"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_ret); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_ret); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":153 - * return ret - * - * cdef object _decode_string(self): # <<<<<<<<<<<<<< - * cdef int n - * cdef char *next_tail - */ - -static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_string(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_string(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self) { int __pyx_v_n; char *__pyx_v_next_tail; PyObject *__pyx_v_result; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("_decode_string"); - __pyx_v_result = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_bencode_pyx.pyx":160 - * # or they wouldn't have called _decode_string - * # strtol will stop at trailing whitespace, etc - * n = strtol(self.tail, &next_tail, 10) # <<<<<<<<<<<<<< - * if next_tail == NULL or next_tail[0] != c':': - * raise ValueError('string len not terminated by ":"') - */ - __pyx_v_n = strtol(__pyx_v_self->tail, (&__pyx_v_next_tail), 10); - - /* "bzrlib/_bencode_pyx.pyx":161 - * # strtol will stop at trailing whitespace, etc - * n = strtol(self.tail, &next_tail, 10) - * if next_tail == NULL or next_tail[0] != c':': # <<<<<<<<<<<<<< - * raise ValueError('string len not terminated by ":"') - * # strtol allows leading zeros, so validate that we don't have that - */ - __pyx_t_1 = (__pyx_v_next_tail == NULL); - if (!__pyx_t_1) { - __pyx_t_2 = ((__pyx_v_next_tail[0]) != ':'); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "bzrlib/_bencode_pyx.pyx":162 - * n = strtol(self.tail, &next_tail, 10) - * if next_tail == NULL or next_tail[0] != c':': - * raise ValueError('string len not terminated by ":"') # <<<<<<<<<<<<<< - * # strtol allows leading zeros, so validate that we don't have that - * if (self.tail[0] == c'0' - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_result = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":160 */ + __pyx_v_n = strtol(__pyx_v_self->tail,(&__pyx_v_next_tail),10); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":161 */ + __pyx_1 = (__pyx_v_next_tail == NULL); + if (!__pyx_1) { + __pyx_1 = ((__pyx_v_next_tail[0]) != ':'); + } + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} + Py_INCREF(__pyx_k8p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k8p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":164 */ + __pyx_1 = ((__pyx_v_self->tail[0]) == '0'); + if (__pyx_1) { + __pyx_1 = (__pyx_v_n != 0); + if (!__pyx_1) { + __pyx_1 = ((__pyx_v_next_tail - __pyx_v_self->tail) != 1); + } + } + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} + Py_INCREF(__pyx_k9p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k9p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_bencode_pyx.pyx":164 - * raise ValueError('string len not terminated by ":"') - * # strtol allows leading zeros, so validate that we don't have that - * if (self.tail[0] == c'0' # <<<<<<<<<<<<<< - * and (n != 0 or (next_tail - self.tail != 1))): - * raise ValueError('leading zeros are not allowed') - */ - __pyx_t_3 = ((__pyx_v_self->tail[0]) == '0'); - if (__pyx_t_3) { - - /* "bzrlib/_bencode_pyx.pyx":165 - * # strtol allows leading zeros, so validate that we don't have that - * if (self.tail[0] == c'0' - * and (n != 0 or (next_tail - self.tail != 1))): # <<<<<<<<<<<<<< - * raise ValueError('leading zeros are not allowed') - * D_UPDATE_TAIL(self, next_tail - self.tail + 1) - */ - __pyx_t_1 = (__pyx_v_n != 0); - if (!__pyx_t_1) { - __pyx_t_2 = ((__pyx_v_next_tail - __pyx_v_self->tail) != 1); - __pyx_t_5 = __pyx_t_2; - } else { - __pyx_t_5 = __pyx_t_1; - } - __pyx_t_1 = __pyx_t_5; - } else { - __pyx_t_1 = __pyx_t_3; - } - if (__pyx_t_1) { + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":167 */ + D_UPDATE_TAIL(__pyx_v_self,((__pyx_v_next_tail - __pyx_v_self->tail) + 1)); - /* "bzrlib/_bencode_pyx.pyx":166 - * if (self.tail[0] == c'0' - * and (n != 0 or (next_tail - self.tail != 1))): - * raise ValueError('leading zeros are not allowed') # <<<<<<<<<<<<<< - * D_UPDATE_TAIL(self, next_tail - self.tail + 1) - * if n == 0: - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":168 */ + __pyx_1 = (__pyx_v_n == 0); + if (__pyx_1) { + Py_INCREF(__pyx_k10p); + __pyx_r = __pyx_k10p; + goto __pyx_L0; goto __pyx_L4; } __pyx_L4:; - /* "bzrlib/_bencode_pyx.pyx":167 - * and (n != 0 or (next_tail - self.tail != 1))): - * raise ValueError('leading zeros are not allowed') - * D_UPDATE_TAIL(self, next_tail - self.tail + 1) # <<<<<<<<<<<<<< - * if n == 0: - * return '' - */ - D_UPDATE_TAIL(__pyx_v_self, ((__pyx_v_next_tail - __pyx_v_self->tail) + 1)); - - /* "bzrlib/_bencode_pyx.pyx":168 - * raise ValueError('leading zeros are not allowed') - * D_UPDATE_TAIL(self, next_tail - self.tail + 1) - * if n == 0: # <<<<<<<<<<<<<< - * return '' - * if n > self.size: - */ - __pyx_t_1 = (__pyx_v_n == 0); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":169 - * D_UPDATE_TAIL(self, next_tail - self.tail + 1) - * if n == 0: - * return '' # <<<<<<<<<<<<<< - * if n > self.size: - * raise ValueError('stream underflow') - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_15)); - __pyx_r = ((PyObject *)__pyx_kp_s_15); - goto __pyx_L0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":170 */ + __pyx_1 = (__pyx_v_n > __pyx_v_self->size); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;} + Py_INCREF(__pyx_k3p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k3p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "bzrlib/_bencode_pyx.pyx":170 - * if n == 0: - * return '' - * if n > self.size: # <<<<<<<<<<<<<< - * raise ValueError('stream underflow') - * if n < 0: - */ - __pyx_t_1 = (__pyx_v_n > __pyx_v_self->size); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":171 - * return '' - * if n > self.size: - * raise ValueError('stream underflow') # <<<<<<<<<<<<<< - * if n < 0: - * raise ValueError('string size below zero: %d' % n) - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":172 */ + __pyx_1 = (__pyx_v_n < 0); + if (__pyx_1) { + __pyx_2 = PyInt_FromLong(__pyx_v_n); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k11p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "bzrlib/_bencode_pyx.pyx":172 - * if n > self.size: - * raise ValueError('stream underflow') - * if n < 0: # <<<<<<<<<<<<<< - * raise ValueError('string size below zero: %d' % n) - * - */ - __pyx_t_1 = (__pyx_v_n < 0); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":173 - * raise ValueError('stream underflow') - * if n < 0: - * raise ValueError('string size below zero: %d' % n) # <<<<<<<<<<<<<< - * - * result = PyString_FromStringAndSize(self.tail, n) - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_n); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":175 */ + __pyx_2 = PyString_FromStringAndSize(__pyx_v_self->tail,__pyx_v_n); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + Py_DECREF(__pyx_v_result); + __pyx_v_result = __pyx_2; + __pyx_2 = 0; - /* "bzrlib/_bencode_pyx.pyx":175 - * raise ValueError('string size below zero: %d' % n) - * - * result = PyString_FromStringAndSize(self.tail, n) # <<<<<<<<<<<<<< - * D_UPDATE_TAIL(self, n) - * return result - */ - __pyx_t_6 = PyString_FromStringAndSize(__pyx_v_self->tail, __pyx_v_n); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_6; - __pyx_t_6 = 0; - - /* "bzrlib/_bencode_pyx.pyx":176 - * - * result = PyString_FromStringAndSize(self.tail, n) - * D_UPDATE_TAIL(self, n) # <<<<<<<<<<<<<< - * return result - * - */ - D_UPDATE_TAIL(__pyx_v_self, __pyx_v_n); - - /* "bzrlib/_bencode_pyx.pyx":177 - * result = PyString_FromStringAndSize(self.tail, n) - * D_UPDATE_TAIL(self, n) - * return result # <<<<<<<<<<<<<< - * - * cdef object _decode_list(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_result); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":176 */ + D_UPDATE_TAIL(__pyx_v_self,__pyx_v_n); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":177 */ + Py_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder._decode_string"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_result); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_result); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":179 - * return result - * - * cdef object _decode_list(self): # <<<<<<<<<<<<<< - * result = [] - * - */ - -static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_list(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_list(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self) { PyObject *__pyx_v_result; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("_decode_list"); - __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_bencode_pyx.pyx":180 - * - * cdef object _decode_list(self): - * result = [] # <<<<<<<<<<<<<< - * - * while self.size > 0: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_result)); - __pyx_v_result = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_bencode_pyx.pyx":182 - * result = [] - * - * while self.size > 0: # <<<<<<<<<<<<<< - * if self.tail[0] == c'e': - * D_UPDATE_TAIL(self, 1) - */ - while (1) { - __pyx_t_2 = (__pyx_v_self->size > 0); - if (!__pyx_t_2) break; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_result = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":180 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} + Py_DECREF(__pyx_v_result); + __pyx_v_result = __pyx_1; + __pyx_1 = 0; - /* "bzrlib/_bencode_pyx.pyx":183 - * - * while self.size > 0: - * if self.tail[0] == c'e': # <<<<<<<<<<<<<< - * D_UPDATE_TAIL(self, 1) - * if self._yield_tuples: - */ - __pyx_t_2 = ((__pyx_v_self->tail[0]) == 'e'); - if (__pyx_t_2) { - - /* "bzrlib/_bencode_pyx.pyx":184 - * while self.size > 0: - * if self.tail[0] == c'e': - * D_UPDATE_TAIL(self, 1) # <<<<<<<<<<<<<< - * if self._yield_tuples: - * return tuple(result) - */ - D_UPDATE_TAIL(__pyx_v_self, 1); - - /* "bzrlib/_bencode_pyx.pyx":185 - * if self.tail[0] == c'e': - * D_UPDATE_TAIL(self, 1) - * if self._yield_tuples: # <<<<<<<<<<<<<< - * return tuple(result) - * else: - */ - if (__pyx_v_self->_yield_tuples) { - - /* "bzrlib/_bencode_pyx.pyx":186 - * D_UPDATE_TAIL(self, 1) - * if self._yield_tuples: - * return tuple(result) # <<<<<<<<<<<<<< - * else: - * return result - */ - __Pyx_XDECREF(__pyx_r); - if (unlikely(__pyx_v_result == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_v_result)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":182 */ + while (1) { + __pyx_2 = (__pyx_v_self->size > 0); + if (!__pyx_2) break; + __pyx_2 = ((__pyx_v_self->tail[0]) == 'e'); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":184 */ + D_UPDATE_TAIL(__pyx_v_self,1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":185 */ + __pyx_2 = __pyx_v_self->_yield_tuples; + if (__pyx_2) { + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + Py_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_result); + __pyx_3 = PyObject_CallObject(((PyObject *)(&PyTuple_Type)), __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; - goto __pyx_L6; + goto __pyx_L5; } /*else*/ { - - /* "bzrlib/_bencode_pyx.pyx":188 - * return tuple(result) - * else: - * return result # <<<<<<<<<<<<<< - * else: - * # As a quick shortcut, check to see if the next object is a - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); + Py_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; } - __pyx_L6:; - goto __pyx_L5; + __pyx_L5:; + goto __pyx_L4; } /*else*/ { - - /* "bzrlib/_bencode_pyx.pyx":193 - * # string, since we know that won't be creating recursion - * # if self.tail[0] >= c'0' and self.tail[0] <= c'9': - * PyList_Append(result, self._decode_object()) # <<<<<<<<<<<<<< - * - * raise ValueError('malformed list') - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_result), __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - } - - /* "bzrlib/_bencode_pyx.pyx":195 - * PyList_Append(result, self._decode_object()) - * - * raise ValueError('malformed list') # <<<<<<<<<<<<<< - * - * cdef object _decode_dict(self): - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_object(__pyx_v_self); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} + __pyx_2 = PyList_Append(__pyx_v_result,__pyx_1); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + } + __pyx_L4:; + } + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":195 */ + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;} + Py_INCREF(__pyx_k12p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k12p); + __pyx_1 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_1, 0, 0); + Py_DECREF(__pyx_1); __pyx_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;} + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder._decode_list"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_result); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_result); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":197 - * raise ValueError('malformed list') - * - * cdef object _decode_dict(self): # <<<<<<<<<<<<<< - * cdef char ch - * - */ - -static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_dict(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_dict(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *__pyx_v_self) { char __pyx_v_ch; PyObject *__pyx_v_result; PyObject *__pyx_v_lastkey; PyObject *__pyx_v_key; PyObject *__pyx_v_value; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("_decode_dict"); - __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_lastkey = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_value = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_bencode_pyx.pyx":200 - * cdef char ch - * - * result = {} # <<<<<<<<<<<<<< - * lastkey = None - * - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_result)); - __pyx_v_result = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_bencode_pyx.pyx":201 - * - * result = {} - * lastkey = None # <<<<<<<<<<<<<< - * - * while self.size > 0: - */ - __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_v_lastkey); + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_result = Py_None; Py_INCREF(Py_None); + __pyx_v_lastkey = Py_None; Py_INCREF(Py_None); + __pyx_v_key = Py_None; Py_INCREF(Py_None); + __pyx_v_value = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":200 */ + __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;} + Py_DECREF(__pyx_v_result); + __pyx_v_result = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":201 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_lastkey); __pyx_v_lastkey = Py_None; - /* "bzrlib/_bencode_pyx.pyx":203 - * lastkey = None - * - * while self.size > 0: # <<<<<<<<<<<<<< - * ch = self.tail[0] - * if ch == c'e': - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":203 */ while (1) { - __pyx_t_2 = (__pyx_v_self->size > 0); - if (!__pyx_t_2) break; + __pyx_2 = (__pyx_v_self->size > 0); + if (!__pyx_2) break; - /* "bzrlib/_bencode_pyx.pyx":204 - * - * while self.size > 0: - * ch = self.tail[0] # <<<<<<<<<<<<<< - * if ch == c'e': - * D_UPDATE_TAIL(self, 1) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":204 */ __pyx_v_ch = (__pyx_v_self->tail[0]); - /* "bzrlib/_bencode_pyx.pyx":205 - * while self.size > 0: - * ch = self.tail[0] - * if ch == c'e': # <<<<<<<<<<<<<< - * D_UPDATE_TAIL(self, 1) - * return result - */ - __pyx_t_2 = (__pyx_v_ch == 'e'); - if (__pyx_t_2) { - - /* "bzrlib/_bencode_pyx.pyx":206 - * ch = self.tail[0] - * if ch == c'e': - * D_UPDATE_TAIL(self, 1) # <<<<<<<<<<<<<< - * return result - * else: - */ - D_UPDATE_TAIL(__pyx_v_self, 1); - - /* "bzrlib/_bencode_pyx.pyx":207 - * if ch == c'e': - * D_UPDATE_TAIL(self, 1) - * return result # <<<<<<<<<<<<<< - * else: - * # keys should be strings only - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":205 */ + __pyx_2 = (__pyx_v_ch == 'e'); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":206 */ + D_UPDATE_TAIL(__pyx_v_self,1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":207 */ + Py_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L4; } /*else*/ { - /* "bzrlib/_bencode_pyx.pyx":210 - * else: - * # keys should be strings only - * if self.tail[0] < c'0' or self.tail[0] > c'9': # <<<<<<<<<<<<<< - * raise ValueError('key was not a simple string.') - * key = self._decode_string() - */ - __pyx_t_2 = ((__pyx_v_self->tail[0]) < '0'); - if (!__pyx_t_2) { - __pyx_t_3 = ((__pyx_v_self->tail[0]) > '9'); - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = __pyx_t_2; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":210 */ + __pyx_2 = ((__pyx_v_self->tail[0]) < '0'); + if (!__pyx_2) { + __pyx_2 = ((__pyx_v_self->tail[0]) > '9'); } - if (__pyx_t_4) { - - /* "bzrlib/_bencode_pyx.pyx":211 - * # keys should be strings only - * if self.tail[0] < c'0' or self.tail[0] > c'9': - * raise ValueError('key was not a simple string.') # <<<<<<<<<<<<<< - * key = self._decode_string() - * if lastkey >= key: - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + if (__pyx_2) { + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + Py_INCREF(__pyx_k13p); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k13p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + goto __pyx_L5; } - __pyx_L6:; + __pyx_L5:; - /* "bzrlib/_bencode_pyx.pyx":212 - * if self.tail[0] < c'0' or self.tail[0] > c'9': - * raise ValueError('key was not a simple string.') - * key = self._decode_string() # <<<<<<<<<<<<<< - * if lastkey >= key: - * raise ValueError('dict keys disordered') - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_string(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_bencode_pyx.pyx":213 - * raise ValueError('key was not a simple string.') - * key = self._decode_string() - * if lastkey >= key: # <<<<<<<<<<<<<< - * raise ValueError('dict keys disordered') - * else: - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_lastkey, __pyx_v_key, Py_GE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_4) { - - /* "bzrlib/_bencode_pyx.pyx":214 - * key = self._decode_string() - * if lastkey >= key: - * raise ValueError('dict keys disordered') # <<<<<<<<<<<<<< - * else: - * lastkey = key - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":212 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_string(__pyx_v_self); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} + Py_DECREF(__pyx_v_key); + __pyx_v_key = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":213 */ + if (PyObject_Cmp(__pyx_v_lastkey, __pyx_v_key, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} + __pyx_2 = __pyx_2 >= 0; + if (__pyx_2) { + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;} + Py_INCREF(__pyx_k14p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k14p); + __pyx_1 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_1, 0, 0); + Py_DECREF(__pyx_1); __pyx_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; goto __pyx_L1;} + goto __pyx_L6; } /*else*/ { - - /* "bzrlib/_bencode_pyx.pyx":216 - * raise ValueError('dict keys disordered') - * else: - * lastkey = key # <<<<<<<<<<<<<< - * value = self._decode_object() - * result[key] = value - */ - __Pyx_INCREF(__pyx_v_key); - __Pyx_DECREF(__pyx_v_lastkey); + Py_INCREF(__pyx_v_key); + Py_DECREF(__pyx_v_lastkey); __pyx_v_lastkey = __pyx_v_key; } - __pyx_L7:; - - /* "bzrlib/_bencode_pyx.pyx":217 - * else: - * lastkey = key - * value = self._decode_object() # <<<<<<<<<<<<<< - * result[key] = value - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_value); - __pyx_v_value = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_bencode_pyx.pyx":218 - * lastkey = key - * value = self._decode_object() - * result[key] = value # <<<<<<<<<<<<<< - * - * raise ValueError('malformed dict') - */ - if (PyDict_SetItem(((PyObject *)__pyx_v_result), __pyx_v_key, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_L5:; - } + __pyx_L6:; - /* "bzrlib/_bencode_pyx.pyx":220 - * result[key] = value - * - * raise ValueError('malformed dict') # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":217 */ + __pyx_3 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self->__pyx_vtab)->_decode_object(__pyx_v_self); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} + Py_DECREF(__pyx_v_value); + __pyx_v_value = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":218 */ + if (PyObject_SetItem(__pyx_v_result, __pyx_v_key, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} + } + __pyx_L4:; + } + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":220 */ + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + Py_INCREF(__pyx_k15p); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k15p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; goto __pyx_L1;} + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder._decode_dict"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_result); - __Pyx_DECREF(__pyx_v_lastkey); - __Pyx_DECREF(__pyx_v_key); - __Pyx_DECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_bencode_pyx.pyx":72 - * """Bencode decoder""" - * - * cdef readonly char *tail # <<<<<<<<<<<<<< - * cdef readonly int size - * cdef readonly int _yield_tuples - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_4tail___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_4tail___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->tail); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder.tail.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_bencode_pyx.pyx":73 - * - * cdef readonly char *tail - * cdef readonly int size # <<<<<<<<<<<<<< - * cdef readonly int _yield_tuples - * cdef object text - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_4size___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_4size___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder.size.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_result); + Py_DECREF(__pyx_v_lastkey); + Py_DECREF(__pyx_v_key); + Py_DECREF(__pyx_v_value); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":74 - * cdef readonly char *tail - * cdef readonly int size - * cdef readonly int _yield_tuples # <<<<<<<<<<<<<< - * cdef object text - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_13_yield_tuples___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_13_yield_tuples___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)__pyx_v_self)->_yield_tuples); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._bencode_pyx.Decoder._yield_tuples.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_bencode_pyx.pyx":223 - * - * - * def bdecode(object s): # <<<<<<<<<<<<<< - * """Decode string x to Python object""" - * return Decoder(s).decode() - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_bdecode(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_bdecode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6bzrlib_12_bencode_pyx_bdecode[] = "Decode string x to Python object"; -static PyMethodDef __pyx_mdef_6bzrlib_12_bencode_pyx_bdecode = {__Pyx_NAMESTR("bdecode"), (PyCFunction)__pyx_pf_6bzrlib_12_bencode_pyx_bdecode, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_12_bencode_pyx_bdecode)}; -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_bdecode(PyObject *__pyx_self, PyObject *__pyx_v_s) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("bdecode"); - __pyx_self = __pyx_self; - - /* "bzrlib/_bencode_pyx.pyx":225 - * def bdecode(object s): - * """Decode string x to Python object""" - * return Decoder(s).decode() # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_12_bencode_pyx_Decoder)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_bdecode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {"s",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_s)) return 0; + Py_INCREF(__pyx_v_s); + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_s); + __pyx_2 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_12_bencode_pyx_Decoder), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_decode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._bencode_pyx.bdecode"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_s); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":228 - * - * - * def bdecode_as_tuple(object s): # <<<<<<<<<<<<<< - * """Decode string x to Python object, using tuples rather than lists.""" - * return Decoder(s, True).decode() - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_1bdecode_as_tuple(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/ -static char __pyx_doc_6bzrlib_12_bencode_pyx_1bdecode_as_tuple[] = "Decode string x to Python object, using tuples rather than lists."; -static PyMethodDef __pyx_mdef_6bzrlib_12_bencode_pyx_1bdecode_as_tuple = {__Pyx_NAMESTR("bdecode_as_tuple"), (PyCFunction)__pyx_pf_6bzrlib_12_bencode_pyx_1bdecode_as_tuple, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_12_bencode_pyx_1bdecode_as_tuple)}; -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_1bdecode_as_tuple(PyObject *__pyx_self, PyObject *__pyx_v_s) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("bdecode_as_tuple"); - __pyx_self = __pyx_self; - - /* "bzrlib/_bencode_pyx.pyx":230 - * def bdecode_as_tuple(object s): - * """Decode string x to Python object, using tuples rather than lists.""" - * return Decoder(s, True).decode() # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_s); - __Pyx_GIVEREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_12_bencode_pyx_Decoder)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_bdecode_as_tuple(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_12_bencode_pyx_bdecode_as_tuple[] = "Decode string x to Python object, using tuples rather than lists."; +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_bdecode_as_tuple(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_s = 0; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {"s",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_s)) return 0; + Py_INCREF(__pyx_v_s); + __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + Py_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_s); + Py_INCREF(Py_True); + PyTuple_SET_ITEM(__pyx_1, 1, Py_True); + __pyx_2 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_12_bencode_pyx_Decoder), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_decode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._bencode_pyx.bdecode_as_tuple"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_s); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":236 - * __slots__ = ['bencoded'] - * - * def __init__(self, s): # <<<<<<<<<<<<<< - * self.bencoded = s - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_9Bencached___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_6bzrlib_12_bencode_pyx_9Bencached___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_6bzrlib_12_bencode_pyx_9Bencached___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_9Bencached___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_9Bencached___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyMethodDef __pyx_mdef_6bzrlib_12_bencode_pyx_9Bencached___init__ = {"__init__", (PyCFunction)__pyx_f_6bzrlib_12_bencode_pyx_9Bencached___init__, METH_VARARGS|METH_KEYWORDS, 0}; +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_9Bencached___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_s = 0; - PyObject *__pyx_r = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__s,0}; - __Pyx_RefNannySetupContext("__init__"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__s); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_self = values[0]; - __pyx_v_s = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_s = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._bencode_pyx.Bencached.__init__"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - - /* "bzrlib/_bencode_pyx.pyx":237 - * - * def __init__(self, s): - * self.bencoded = s # <<<<<<<<<<<<<< - * - * - */ - if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__bencoded, __pyx_v_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyObject *__pyx_r; + static char *__pyx_argnames[] = {"self","s",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_s)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_s); + if (PyObject_SetAttr(__pyx_v_self, __pyx_n_bencoded, __pyx_v_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;} - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; __Pyx_AddTraceback("bzrlib._bencode_pyx.Bencached.__init__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_s); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":253 - * cdef readonly int maxsize - * - * def __init__(self, int maxsize=INITSIZE): # <<<<<<<<<<<<<< - * """Initialize encoder engine - * @param maxsize: initial size of internal char buffer - */ - -static int __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_12_bencode_pyx_7Encoder___init__[] = "Initialize encoder engine\n @param maxsize: initial size of internal char buffer\n "; -struct wrapperbase __pyx_wrapperbase_6bzrlib_12_bencode_pyx_7Encoder___init__; -static int __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_maxsize; char *__pyx_v_p; int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__maxsize,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__maxsize); - if (value) { values[0] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - if (values[0]) { - __pyx_v_maxsize = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_maxsize == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } else { - __pyx_v_maxsize = __pyx_k_26; - } - } else { - __pyx_v_maxsize = __pyx_k_26; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: __pyx_v_maxsize = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_maxsize == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "bzrlib/_bencode_pyx.pyx":259 - * cdef char *p - * - * self.maxsize = 0 # <<<<<<<<<<<<<< - * self.size = 0 - * self.tail = NULL - */ + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + static char *__pyx_argnames[] = {"maxsize",0}; + __pyx_v_maxsize = __pyx_d2; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|i", __pyx_argnames, &__pyx_v_maxsize)) return -1; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":259 */ ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->maxsize = 0; - /* "bzrlib/_bencode_pyx.pyx":260 - * - * self.maxsize = 0 - * self.size = 0 # <<<<<<<<<<<<<< - * self.tail = NULL - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":260 */ ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->size = 0; - /* "bzrlib/_bencode_pyx.pyx":261 - * self.maxsize = 0 - * self.size = 0 - * self.tail = NULL # <<<<<<<<<<<<<< - * - * p = malloc(maxsize) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":261 */ ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->tail = NULL; - /* "bzrlib/_bencode_pyx.pyx":263 - * self.tail = NULL - * - * p = malloc(maxsize) # <<<<<<<<<<<<<< - * if p == NULL: - * raise MemoryError('Not enough memory to allocate buffer ' - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":263 */ __pyx_v_p = ((char *)malloc(__pyx_v_maxsize)); - /* "bzrlib/_bencode_pyx.pyx":264 - * - * p = malloc(maxsize) - * if p == NULL: # <<<<<<<<<<<<<< - * raise MemoryError('Not enough memory to allocate buffer ' - * 'for encoder') - */ - __pyx_t_1 = (__pyx_v_p == NULL); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":265 - * p = malloc(maxsize) - * if p == NULL: - * raise MemoryError('Not enough memory to allocate buffer ' # <<<<<<<<<<<<<< - * 'for encoder') - * self.buffer = p - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":264 */ + __pyx_1 = (__pyx_v_p == NULL); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;} + Py_INCREF(__pyx_k18p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k18p); + __pyx_3 = PyObject_CallObject(PyExc_MemoryError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L6:; + __pyx_L2:; - /* "bzrlib/_bencode_pyx.pyx":267 - * raise MemoryError('Not enough memory to allocate buffer ' - * 'for encoder') - * self.buffer = p # <<<<<<<<<<<<<< - * self.maxsize = maxsize - * self.tail = p - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":267 */ ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->buffer = __pyx_v_p; - /* "bzrlib/_bencode_pyx.pyx":268 - * 'for encoder') - * self.buffer = p - * self.maxsize = maxsize # <<<<<<<<<<<<<< - * self.tail = p - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":268 */ ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->maxsize = __pyx_v_maxsize; - /* "bzrlib/_bencode_pyx.pyx":269 - * self.buffer = p - * self.maxsize = maxsize - * self.tail = p # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":269 */ ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->tail = __pyx_v_p; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder.__init__"); __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":271 - * self.tail = p - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * free(self.buffer) - * self.buffer = NULL - */ - -static void __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_1__dealloc__(PyObject *__pyx_v_self) { - __Pyx_RefNannySetupContext("__dealloc__"); - - /* "bzrlib/_bencode_pyx.pyx":272 - * - * def __dealloc__(self): - * free(self.buffer) # <<<<<<<<<<<<<< - * self.buffer = NULL - * self.maxsize = 0 - */ +static void __pyx_f_6bzrlib_12_bencode_pyx_7Encoder___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_f_6bzrlib_12_bencode_pyx_7Encoder___dealloc__(PyObject *__pyx_v_self) { + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":272 */ free(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->buffer); - /* "bzrlib/_bencode_pyx.pyx":273 - * def __dealloc__(self): - * free(self.buffer) - * self.buffer = NULL # <<<<<<<<<<<<<< - * self.maxsize = 0 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":273 */ ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->buffer = NULL; - /* "bzrlib/_bencode_pyx.pyx":274 - * free(self.buffer) - * self.buffer = NULL - * self.maxsize = 0 # <<<<<<<<<<<<<< - * - * def __str__(self): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":274 */ ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->maxsize = 0; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); } -/* "bzrlib/_bencode_pyx.pyx":276 - * self.maxsize = 0 - * - * def __str__(self): # <<<<<<<<<<<<<< - * if self.buffer != NULL and self.size != 0: - * return PyString_FromStringAndSize(self.buffer, self.size) - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_2__str__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_2__str__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__str__"); - - /* "bzrlib/_bencode_pyx.pyx":277 - * - * def __str__(self): - * if self.buffer != NULL and self.size != 0: # <<<<<<<<<<<<<< - * return PyString_FromStringAndSize(self.buffer, self.size) - * else: - */ - __pyx_t_1 = (((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->buffer != NULL); - if (__pyx_t_1) { - __pyx_t_2 = (((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->size != 0); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "bzrlib/_bencode_pyx.pyx":278 - * def __str__(self): - * if self.buffer != NULL and self.size != 0: - * return PyString_FromStringAndSize(self.buffer, self.size) # <<<<<<<<<<<<<< - * else: - * return '' - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyString_FromStringAndSize(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->buffer, ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Encoder___str__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Encoder___str__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = (((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->buffer != NULL); + if (__pyx_1) { + __pyx_1 = (((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->size != 0); + } + if (__pyx_1) { + __pyx_2 = PyString_FromStringAndSize(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->buffer,((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->size); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L2; } /*else*/ { - - /* "bzrlib/_bencode_pyx.pyx":280 - * return PyString_FromStringAndSize(self.buffer, self.size) - * else: - * return '' # <<<<<<<<<<<<<< - * - * cdef int _ensure_buffer(self, int required) except 0: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_15)); - __pyx_r = ((PyObject *)__pyx_kp_s_15); + Py_INCREF(__pyx_k10p); + __pyx_r = __pyx_k10p; goto __pyx_L0; } - __pyx_L5:; + __pyx_L2:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder.__str__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":282 - * return '' - * - * cdef int _ensure_buffer(self, int required) except 0: # <<<<<<<<<<<<<< - * """Ensure that tail of CharTail buffer has enough size. - * If buffer is not big enough then function try to - */ - -static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__ensure_buffer(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self, int __pyx_v_required) { +static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__ensure_buffer(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self,int __pyx_v_required) { char *__pyx_v_new_buffer; int __pyx_v_new_size; int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("_ensure_buffer"); - - /* "bzrlib/_bencode_pyx.pyx":290 - * cdef int new_size - * - * if self.size + required < self.maxsize: # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_1 = ((__pyx_v_self->size + __pyx_v_required) < __pyx_v_self->maxsize); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":291 - * - * if self.size + required < self.maxsize: - * return 1 # <<<<<<<<<<<<<< - * - * new_size = self.maxsize - */ + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":290 */ + __pyx_1 = ((__pyx_v_self->size + __pyx_v_required) < __pyx_v_self->maxsize); + if (__pyx_1) { __pyx_r = 1; goto __pyx_L0; - goto __pyx_L3; + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_bencode_pyx.pyx":293 - * return 1 - * - * new_size = self.maxsize # <<<<<<<<<<<<<< - * while new_size < self.size + required: - * new_size = new_size * 2 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":293 */ __pyx_v_new_size = __pyx_v_self->maxsize; - /* "bzrlib/_bencode_pyx.pyx":294 - * - * new_size = self.maxsize - * while new_size < self.size + required: # <<<<<<<<<<<<<< - * new_size = new_size * 2 - * new_buffer = realloc(self.buffer, new_size) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":294 */ while (1) { - __pyx_t_1 = (__pyx_v_new_size < (__pyx_v_self->size + __pyx_v_required)); - if (!__pyx_t_1) break; - - /* "bzrlib/_bencode_pyx.pyx":295 - * new_size = self.maxsize - * while new_size < self.size + required: - * new_size = new_size * 2 # <<<<<<<<<<<<<< - * new_buffer = realloc(self.buffer, new_size) - * if new_buffer == NULL: - */ + __pyx_1 = (__pyx_v_new_size < (__pyx_v_self->size + __pyx_v_required)); + if (!__pyx_1) break; __pyx_v_new_size = (__pyx_v_new_size * 2); } - /* "bzrlib/_bencode_pyx.pyx":296 - * while new_size < self.size + required: - * new_size = new_size * 2 - * new_buffer = realloc(self.buffer, new_size) # <<<<<<<<<<<<<< - * if new_buffer == NULL: - * raise MemoryError('Cannot realloc buffer for encoder') - */ - __pyx_v_new_buffer = ((char *)realloc(__pyx_v_self->buffer, ((size_t)__pyx_v_new_size))); - - /* "bzrlib/_bencode_pyx.pyx":297 - * new_size = new_size * 2 - * new_buffer = realloc(self.buffer, new_size) - * if new_buffer == NULL: # <<<<<<<<<<<<<< - * raise MemoryError('Cannot realloc buffer for encoder') - * - */ - __pyx_t_1 = (__pyx_v_new_buffer == NULL); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":298 - * new_buffer = realloc(self.buffer, new_size) - * if new_buffer == NULL: - * raise MemoryError('Cannot realloc buffer for encoder') # <<<<<<<<<<<<<< - * - * self.buffer = new_buffer - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_30), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":296 */ + __pyx_v_new_buffer = ((char *)realloc(__pyx_v_self->buffer,__pyx_v_new_size)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":297 */ + __pyx_1 = (__pyx_v_new_buffer == NULL); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;} + Py_INCREF(__pyx_k19p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k19p); + __pyx_3 = PyObject_CallObject(PyExc_MemoryError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;} + goto __pyx_L5; } - __pyx_L6:; + __pyx_L5:; - /* "bzrlib/_bencode_pyx.pyx":300 - * raise MemoryError('Cannot realloc buffer for encoder') - * - * self.buffer = new_buffer # <<<<<<<<<<<<<< - * self.maxsize = new_size - * self.tail = &new_buffer[self.size] - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":300 */ __pyx_v_self->buffer = __pyx_v_new_buffer; - /* "bzrlib/_bencode_pyx.pyx":301 - * - * self.buffer = new_buffer - * self.maxsize = new_size # <<<<<<<<<<<<<< - * self.tail = &new_buffer[self.size] - * return 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":301 */ __pyx_v_self->maxsize = __pyx_v_new_size; - /* "bzrlib/_bencode_pyx.pyx":302 - * self.buffer = new_buffer - * self.maxsize = new_size - * self.tail = &new_buffer[self.size] # <<<<<<<<<<<<<< - * return 1 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":302 */ __pyx_v_self->tail = (&(__pyx_v_new_buffer[__pyx_v_self->size])); - /* "bzrlib/_bencode_pyx.pyx":303 - * self.maxsize = new_size - * self.tail = &new_buffer[self.size] - * return 1 # <<<<<<<<<<<<<< - * - * cdef int _encode_int(self, int x) except 0: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":303 */ __pyx_r = 1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder._ensure_buffer"); __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":305 - * return 1 - * - * cdef int _encode_int(self, int x) except 0: # <<<<<<<<<<<<<< - * """Encode int to bencode string iNNNe - * @param x: value to encode - */ - -static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_int(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self, int __pyx_v_x) { +static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_int(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self,int __pyx_v_x) { int __pyx_v_n; int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_encode_int"); - - /* "bzrlib/_bencode_pyx.pyx":310 - * """ - * cdef int n - * self._ensure_buffer(INT_BUF_SIZE) # <<<<<<<<<<<<<< - * n = snprintf(self.tail, INT_BUF_SIZE, "i%de", x) - * if n < 0: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self, __pyx_e_6bzrlib_12_bencode_pyx_INT_BUF_SIZE); if (unlikely(__pyx_t_1 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_bencode_pyx.pyx":311 - * cdef int n - * self._ensure_buffer(INT_BUF_SIZE) - * n = snprintf(self.tail, INT_BUF_SIZE, "i%de", x) # <<<<<<<<<<<<<< - * if n < 0: - * raise MemoryError('int %d too big to encode' % x) - */ - __pyx_v_n = snprintf(__pyx_v_self->tail, __pyx_e_6bzrlib_12_bencode_pyx_INT_BUF_SIZE, __pyx_k_31, __pyx_v_x); - - /* "bzrlib/_bencode_pyx.pyx":312 - * self._ensure_buffer(INT_BUF_SIZE) - * n = snprintf(self.tail, INT_BUF_SIZE, "i%de", x) - * if n < 0: # <<<<<<<<<<<<<< - * raise MemoryError('int %d too big to encode' % x) - * E_UPDATE_TAIL(self, n) - */ - __pyx_t_2 = (__pyx_v_n < 0); - if (__pyx_t_2) { - - /* "bzrlib/_bencode_pyx.pyx":313 - * n = snprintf(self.tail, INT_BUF_SIZE, "i%de", x) - * if n < 0: - * raise MemoryError('int %d too big to encode' % x) # <<<<<<<<<<<<<< - * E_UPDATE_TAIL(self, n) - * return 1 - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_32), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":310 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self,__pyx_e_6bzrlib_12_bencode_pyx_INT_BUF_SIZE); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":311 */ + __pyx_v_n = snprintf(__pyx_v_self->tail,__pyx_e_6bzrlib_12_bencode_pyx_INT_BUF_SIZE,__pyx_k20,__pyx_v_x); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":312 */ + __pyx_1 = (__pyx_v_n < 0); + if (__pyx_1) { + __pyx_2 = PyInt_FromLong(__pyx_v_x); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k21p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_MemoryError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":314 */ + E_UPDATE_TAIL(__pyx_v_self,__pyx_v_n); - /* "bzrlib/_bencode_pyx.pyx":314 - * if n < 0: - * raise MemoryError('int %d too big to encode' % x) - * E_UPDATE_TAIL(self, n) # <<<<<<<<<<<<<< - * return 1 - * - */ - E_UPDATE_TAIL(__pyx_v_self, __pyx_v_n); - - /* "bzrlib/_bencode_pyx.pyx":315 - * raise MemoryError('int %d too big to encode' % x) - * E_UPDATE_TAIL(self, n) - * return 1 # <<<<<<<<<<<<<< - * - * cdef int _encode_long(self, x) except 0: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":315 */ __pyx_r = 1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder._encode_int"); __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":317 - * return 1 - * - * cdef int _encode_long(self, x) except 0: # <<<<<<<<<<<<<< - * return self._append_string(''.join(('i', str(x), 'e'))) - * - */ - -static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_long(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self, PyObject *__pyx_v_x) { +static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_long(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self,PyObject *__pyx_v_x) { int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("_encode_long"); - - /* "bzrlib/_bencode_pyx.pyx":318 - * - * cdef int _encode_long(self, x) except 0: - * return self._append_string(''.join(('i', str(x), 'e'))) # <<<<<<<<<<<<<< - * - * cdef int _append_string(self, s) except 0: - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_15), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x); - __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__i)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__i)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i)); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_n_s__e)); - PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_n_s__e)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__e)); - __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_append_string(__pyx_v_self, __pyx_t_2); if (unlikely(__pyx_t_4 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_r = __pyx_t_4; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + int __pyx_4; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_x); + __pyx_1 = PyObject_GetAttr(__pyx_k10p, __pyx_n_join); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + Py_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x); + __pyx_3 = PyObject_CallObject(((PyObject *)(&PyString_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + Py_INCREF(__pyx_n_i); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_i); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_3); + Py_INCREF(__pyx_n_e); + PyTuple_SET_ITEM(__pyx_2, 2, __pyx_n_e); + __pyx_3 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_append_string(__pyx_v_self,__pyx_2); if (__pyx_4 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_r = __pyx_4; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder._encode_long"); __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_x); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":320 - * return self._append_string(''.join(('i', str(x), 'e'))) - * - * cdef int _append_string(self, s) except 0: # <<<<<<<<<<<<<< - * cdef Py_ssize_t n - * n = PyString_GET_SIZE(s) - */ - -static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__append_string(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self, PyObject *__pyx_v_s) { +static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__append_string(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self,PyObject *__pyx_v_s) { Py_ssize_t __pyx_v_n; int __pyx_r; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - char *__pyx_t_3; - __Pyx_RefNannySetupContext("_append_string"); - - /* "bzrlib/_bencode_pyx.pyx":322 - * cdef int _append_string(self, s) except 0: - * cdef Py_ssize_t n - * n = PyString_GET_SIZE(s) # <<<<<<<<<<<<<< - * self._ensure_buffer(n) - * memcpy(self.tail, PyString_AS_STRING(s), n) - */ - __pyx_t_1 = PyString_GET_SIZE(__pyx_v_s); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_n = __pyx_t_1; - - /* "bzrlib/_bencode_pyx.pyx":323 - * cdef Py_ssize_t n - * n = PyString_GET_SIZE(s) - * self._ensure_buffer(n) # <<<<<<<<<<<<<< - * memcpy(self.tail, PyString_AS_STRING(s), n) - * E_UPDATE_TAIL(self, n) - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self, __pyx_v_n); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_bencode_pyx.pyx":324 - * n = PyString_GET_SIZE(s) - * self._ensure_buffer(n) - * memcpy(self.tail, PyString_AS_STRING(s), n) # <<<<<<<<<<<<<< - * E_UPDATE_TAIL(self, n) - * return 1 - */ - __pyx_t_3 = PyString_AS_STRING(__pyx_v_s); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - memcpy(__pyx_v_self->tail, __pyx_t_3, __pyx_v_n); - - /* "bzrlib/_bencode_pyx.pyx":325 - * self._ensure_buffer(n) - * memcpy(self.tail, PyString_AS_STRING(s), n) - * E_UPDATE_TAIL(self, n) # <<<<<<<<<<<<<< - * return 1 - * - */ - E_UPDATE_TAIL(__pyx_v_self, __pyx_v_n); - - /* "bzrlib/_bencode_pyx.pyx":326 - * memcpy(self.tail, PyString_AS_STRING(s), n) - * E_UPDATE_TAIL(self, n) - * return 1 # <<<<<<<<<<<<<< - * - * cdef int _encode_string(self, x) except 0: - */ + Py_ssize_t __pyx_1; + int __pyx_2; + char *__pyx_3; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_s); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":322 */ + __pyx_1 = PyString_GET_SIZE(__pyx_v_s); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} + __pyx_v_n = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":323 */ + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self,__pyx_v_n); if (__pyx_2 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":324 */ + __pyx_3 = PyString_AS_STRING(__pyx_v_s); if (__pyx_3 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;} + memcpy(__pyx_v_self->tail,__pyx_3,__pyx_v_n); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":325 */ + E_UPDATE_TAIL(__pyx_v_self,__pyx_v_n); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":326 */ __pyx_r = 1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder._append_string"); __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_s); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":328 - * return 1 - * - * cdef int _encode_string(self, x) except 0: # <<<<<<<<<<<<<< - * cdef int n - * cdef Py_ssize_t x_len - */ - -static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_string(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self, PyObject *__pyx_v_x) { +static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_string(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self,PyObject *__pyx_v_x) { int __pyx_v_n; Py_ssize_t __pyx_v_x_len; int __pyx_r; - Py_ssize_t __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - char *__pyx_t_6; - __Pyx_RefNannySetupContext("_encode_string"); - - /* "bzrlib/_bencode_pyx.pyx":331 - * cdef int n - * cdef Py_ssize_t x_len - * x_len = PyString_GET_SIZE(x) # <<<<<<<<<<<<<< - * self._ensure_buffer(x_len + INT_BUF_SIZE) - * n = snprintf(self.tail, INT_BUF_SIZE, '%d:', x_len) - */ - __pyx_t_1 = PyString_GET_SIZE(__pyx_v_x); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_x_len = __pyx_t_1; - - /* "bzrlib/_bencode_pyx.pyx":332 - * cdef Py_ssize_t x_len - * x_len = PyString_GET_SIZE(x) - * self._ensure_buffer(x_len + INT_BUF_SIZE) # <<<<<<<<<<<<<< - * n = snprintf(self.tail, INT_BUF_SIZE, '%d:', x_len) - * if n < 0: - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self, (__pyx_v_x_len + __pyx_e_6bzrlib_12_bencode_pyx_INT_BUF_SIZE)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_bencode_pyx.pyx":333 - * x_len = PyString_GET_SIZE(x) - * self._ensure_buffer(x_len + INT_BUF_SIZE) - * n = snprintf(self.tail, INT_BUF_SIZE, '%d:', x_len) # <<<<<<<<<<<<<< - * if n < 0: - * raise MemoryError('string %s too big to encode' % x) - */ - __pyx_v_n = snprintf(__pyx_v_self->tail, __pyx_e_6bzrlib_12_bencode_pyx_INT_BUF_SIZE, __pyx_k_33, __pyx_v_x_len); - - /* "bzrlib/_bencode_pyx.pyx":334 - * self._ensure_buffer(x_len + INT_BUF_SIZE) - * n = snprintf(self.tail, INT_BUF_SIZE, '%d:', x_len) - * if n < 0: # <<<<<<<<<<<<<< - * raise MemoryError('string %s too big to encode' % x) - * memcpy((self.tail+n), PyString_AS_STRING(x), x_len) - */ - __pyx_t_3 = (__pyx_v_n < 0); - if (__pyx_t_3) { - - /* "bzrlib/_bencode_pyx.pyx":335 - * n = snprintf(self.tail, INT_BUF_SIZE, '%d:', x_len) - * if n < 0: - * raise MemoryError('string %s too big to encode' % x) # <<<<<<<<<<<<<< - * memcpy((self.tail+n), PyString_AS_STRING(x), x_len) - * E_UPDATE_TAIL(self, n + x_len) - */ - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_34), __pyx_v_x); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; + Py_ssize_t __pyx_1; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + char *__pyx_5; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_x); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":331 */ + __pyx_1 = PyString_GET_SIZE(__pyx_v_x); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;} + __pyx_v_x_len = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":332 */ + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self,(__pyx_v_x_len + __pyx_e_6bzrlib_12_bencode_pyx_INT_BUF_SIZE)); if (__pyx_2 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":333 */ + __pyx_v_n = snprintf(__pyx_v_self->tail,__pyx_e_6bzrlib_12_bencode_pyx_INT_BUF_SIZE,__pyx_k25,__pyx_v_x_len); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":334 */ + __pyx_2 = (__pyx_v_n < 0); + if (__pyx_2) { + __pyx_3 = PyNumber_Remainder(__pyx_k26p, __pyx_v_x); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_MemoryError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":336 */ + __pyx_5 = PyString_AS_STRING(__pyx_v_x); if (__pyx_5 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;} + memcpy((__pyx_v_self->tail + __pyx_v_n),__pyx_5,__pyx_v_x_len); - /* "bzrlib/_bencode_pyx.pyx":336 - * if n < 0: - * raise MemoryError('string %s too big to encode' % x) - * memcpy((self.tail+n), PyString_AS_STRING(x), x_len) # <<<<<<<<<<<<<< - * E_UPDATE_TAIL(self, n + x_len) - * return 1 - */ - __pyx_t_6 = PyString_AS_STRING(__pyx_v_x); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - memcpy(((void *)(__pyx_v_self->tail + __pyx_v_n)), __pyx_t_6, __pyx_v_x_len); - - /* "bzrlib/_bencode_pyx.pyx":337 - * raise MemoryError('string %s too big to encode' % x) - * memcpy((self.tail+n), PyString_AS_STRING(x), x_len) - * E_UPDATE_TAIL(self, n + x_len) # <<<<<<<<<<<<<< - * return 1 - * - */ - E_UPDATE_TAIL(__pyx_v_self, (__pyx_v_n + __pyx_v_x_len)); - - /* "bzrlib/_bencode_pyx.pyx":338 - * memcpy((self.tail+n), PyString_AS_STRING(x), x_len) - * E_UPDATE_TAIL(self, n + x_len) - * return 1 # <<<<<<<<<<<<<< - * - * cdef int _encode_list(self, x) except 0: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":337 */ + E_UPDATE_TAIL(__pyx_v_self,(__pyx_v_n + __pyx_v_x_len)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":338 */ __pyx_r = 1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __pyx_L1:; + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder._encode_string"); __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_x); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":340 - * return 1 - * - * cdef int _encode_list(self, x) except 0: # <<<<<<<<<<<<<< - * self._ensure_buffer(1) - * self.tail[0] = c'l' - */ - -static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_list(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self, PyObject *__pyx_v_x) { +static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_list(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self,PyObject *__pyx_v_x) { PyObject *__pyx_v_i; int __pyx_r; - int __pyx_t_1; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("_encode_list"); - __pyx_v_i = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_bencode_pyx.pyx":341 - * - * cdef int _encode_list(self, x) except 0: - * self._ensure_buffer(1) # <<<<<<<<<<<<<< - * self.tail[0] = c'l' - * E_UPDATE_TAIL(self, 1) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_bencode_pyx.pyx":342 - * cdef int _encode_list(self, x) except 0: - * self._ensure_buffer(1) - * self.tail[0] = c'l' # <<<<<<<<<<<<<< - * E_UPDATE_TAIL(self, 1) - * - */ + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_x); + __pyx_v_i = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":341 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self,1); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":342 */ (__pyx_v_self->tail[0]) = 'l'; - /* "bzrlib/_bencode_pyx.pyx":343 - * self._ensure_buffer(1) - * self.tail[0] = c'l' - * E_UPDATE_TAIL(self, 1) # <<<<<<<<<<<<<< - * - * for i in x: - */ - E_UPDATE_TAIL(__pyx_v_self, 1); - - /* "bzrlib/_bencode_pyx.pyx":345 - * E_UPDATE_TAIL(self, 1) - * - * for i in x: # <<<<<<<<<<<<<< - * self.process(i) - * - */ - if (PyList_CheckExact(__pyx_v_x) || PyTuple_CheckExact(__pyx_v_x)) { - __pyx_t_2 = 0; __pyx_t_3 = __pyx_v_x; __Pyx_INCREF(__pyx_t_3); - } else { - __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":343 */ + E_UPDATE_TAIL(__pyx_v_self,1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":345 */ + __pyx_2 = PyObject_GetIter(__pyx_v_x); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; - } else { - __pyx_t_4 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_4) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_4); + __pyx_3 = PyIter_Next(__pyx_2); + if (!__pyx_3) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;} + break; } - __Pyx_DECREF(__pyx_v_i); - __pyx_v_i = __pyx_t_4; - __pyx_t_4 = 0; - - /* "bzrlib/_bencode_pyx.pyx":346 - * - * for i in x: - * self.process(i) # <<<<<<<<<<<<<< - * - * self._ensure_buffer(1) - */ - __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__process); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_v_i); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_i); - __Pyx_GIVEREF(__pyx_v_i); - __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + Py_DECREF(__pyx_v_i); + __pyx_v_i = __pyx_3; + __pyx_3 = 0; + __pyx_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_process); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;} + Py_INCREF(__pyx_v_i); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_i); + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "bzrlib/_bencode_pyx.pyx":348 - * self.process(i) - * - * self._ensure_buffer(1) # <<<<<<<<<<<<<< - * self.tail[0] = c'e' - * E_UPDATE_TAIL(self, 1) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_bencode_pyx.pyx":349 - * - * self._ensure_buffer(1) - * self.tail[0] = c'e' # <<<<<<<<<<<<<< - * E_UPDATE_TAIL(self, 1) - * return 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":348 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self,1); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":349 */ (__pyx_v_self->tail[0]) = 'e'; - /* "bzrlib/_bencode_pyx.pyx":350 - * self._ensure_buffer(1) - * self.tail[0] = c'e' - * E_UPDATE_TAIL(self, 1) # <<<<<<<<<<<<<< - * return 1 - * - */ - E_UPDATE_TAIL(__pyx_v_self, 1); - - /* "bzrlib/_bencode_pyx.pyx":351 - * self.tail[0] = c'e' - * E_UPDATE_TAIL(self, 1) - * return 1 # <<<<<<<<<<<<<< - * - * cdef int _encode_dict(self, x) except 0: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":350 */ + E_UPDATE_TAIL(__pyx_v_self,1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":351 */ __pyx_r = 1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder._encode_list"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_i); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_i); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_x); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":353 - * return 1 - * - * cdef int _encode_dict(self, x) except 0: # <<<<<<<<<<<<<< - * self._ensure_buffer(1) - * self.tail[0] = c'd' - */ - -static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_dict(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self, PyObject *__pyx_v_x) { +static int __pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_dict(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_self,PyObject *__pyx_v_x) { PyObject *__pyx_v_keys; PyObject *__pyx_v_k; int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("_encode_dict"); - __pyx_v_keys = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_k = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_bencode_pyx.pyx":354 - * - * cdef int _encode_dict(self, x) except 0: - * self._ensure_buffer(1) # <<<<<<<<<<<<<< - * self.tail[0] = c'd' - * E_UPDATE_TAIL(self, 1) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_bencode_pyx.pyx":355 - * cdef int _encode_dict(self, x) except 0: - * self._ensure_buffer(1) - * self.tail[0] = c'd' # <<<<<<<<<<<<<< - * E_UPDATE_TAIL(self, 1) - * - */ + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_x); + __pyx_v_keys = Py_None; Py_INCREF(Py_None); + __pyx_v_k = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":354 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self,1); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":355 */ (__pyx_v_self->tail[0]) = 'd'; - /* "bzrlib/_bencode_pyx.pyx":356 - * self._ensure_buffer(1) - * self.tail[0] = c'd' - * E_UPDATE_TAIL(self, 1) # <<<<<<<<<<<<<< - * - * keys = x.keys() - */ - E_UPDATE_TAIL(__pyx_v_self, 1); - - /* "bzrlib/_bencode_pyx.pyx":358 - * E_UPDATE_TAIL(self, 1) - * - * keys = x.keys() # <<<<<<<<<<<<<< - * keys.sort() - * for k in keys: - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_keys); - __pyx_v_keys = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_bencode_pyx.pyx":359 - * - * keys = x.keys() - * keys.sort() # <<<<<<<<<<<<<< - * for k in keys: - * if not PyString_CheckExact(k): - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_keys, __pyx_n_s__sort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __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 = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_bencode_pyx.pyx":360 - * keys = x.keys() - * keys.sort() - * for k in keys: # <<<<<<<<<<<<<< - * if not PyString_CheckExact(k): - * raise TypeError('key in dict should be string') - */ - if (PyList_CheckExact(__pyx_v_keys) || PyTuple_CheckExact(__pyx_v_keys)) { - __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_2); - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":356 */ + E_UPDATE_TAIL(__pyx_v_self,1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":358 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_x, __pyx_n_keys); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_v_keys); + __pyx_v_keys = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":359 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_keys, __pyx_n_sort); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":360 */ + __pyx_2 = PyObject_GetIter(__pyx_v_keys); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; - } else if (likely(PyTuple_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; - } else { - __pyx_t_3 = PyIter_Next(__pyx_t_2); - if (!__pyx_t_3) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF(__pyx_v_k); - __pyx_v_k = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_bencode_pyx.pyx":361 - * keys.sort() - * for k in keys: - * if not PyString_CheckExact(k): # <<<<<<<<<<<<<< - * raise TypeError('key in dict should be string') - * self._encode_string(k) - */ - __pyx_t_5 = (!PyString_CheckExact(__pyx_v_k)); - if (__pyx_t_5) { - - /* "bzrlib/_bencode_pyx.pyx":362 - * for k in keys: - * if not PyString_CheckExact(k): - * raise TypeError('key in dict should be string') # <<<<<<<<<<<<<< - * self._encode_string(k) - * self.process(x[k]) - */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + __pyx_3 = PyIter_Next(__pyx_2); + if (!__pyx_3) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;} + break; } - __pyx_L5:; - - /* "bzrlib/_bencode_pyx.pyx":363 - * if not PyString_CheckExact(k): - * raise TypeError('key in dict should be string') - * self._encode_string(k) # <<<<<<<<<<<<<< - * self.process(x[k]) - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_encode_string(__pyx_v_self, __pyx_v_k); if (unlikely(__pyx_t_1 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_bencode_pyx.pyx":364 - * raise TypeError('key in dict should be string') - * self._encode_string(k) - * self.process(x[k]) # <<<<<<<<<<<<<< - * - * self._ensure_buffer(1) - */ - __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__process); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetItem(__pyx_v_x, __pyx_v_k); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + Py_DECREF(__pyx_v_k); + __pyx_v_k = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":361 */ + __pyx_1 = (!PyString_CheckExact(__pyx_v_k)); + if (__pyx_1) { + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} + Py_INCREF(__pyx_k30p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k30p); + __pyx_4 = PyObject_CallObject(PyExc_TypeError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L1;} + goto __pyx_L4; + } + __pyx_L4:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":363 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_encode_string(__pyx_v_self,__pyx_v_k); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":364 */ + __pyx_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_process); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(__pyx_v_x, __pyx_v_k); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":366 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self,1); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;} - /* "bzrlib/_bencode_pyx.pyx":366 - * self.process(x[k]) - * - * self._ensure_buffer(1) # <<<<<<<<<<<<<< - * self.tail[0] = c'e' - * E_UPDATE_TAIL(self, 1) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self->__pyx_vtab)->_ensure_buffer(__pyx_v_self, 1); if (unlikely(__pyx_t_1 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_bencode_pyx.pyx":367 - * - * self._ensure_buffer(1) - * self.tail[0] = c'e' # <<<<<<<<<<<<<< - * E_UPDATE_TAIL(self, 1) - * return 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":367 */ (__pyx_v_self->tail[0]) = 'e'; - /* "bzrlib/_bencode_pyx.pyx":368 - * self._ensure_buffer(1) - * self.tail[0] = c'e' - * E_UPDATE_TAIL(self, 1) # <<<<<<<<<<<<<< - * return 1 - * - */ - E_UPDATE_TAIL(__pyx_v_self, 1); - - /* "bzrlib/_bencode_pyx.pyx":369 - * self.tail[0] = c'e' - * E_UPDATE_TAIL(self, 1) - * return 1 # <<<<<<<<<<<<<< - * - * def process(self, object x): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":368 */ + E_UPDATE_TAIL(__pyx_v_self,1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":369 */ __pyx_r = 1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder._encode_dict"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_keys); - __Pyx_DECREF(__pyx_v_k); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_keys); + Py_DECREF(__pyx_v_k); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_x); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":371 - * return 1 - * - * def process(self, object x): # <<<<<<<<<<<<<< - * if Py_EnterRecursiveCall("encode"): - * raise RuntimeError("too deeply nested") - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_3process(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_3process(PyObject *__pyx_v_self, PyObject *__pyx_v_x) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("process"); - - /* "bzrlib/_bencode_pyx.pyx":372 - * - * def process(self, object x): - * if Py_EnterRecursiveCall("encode"): # <<<<<<<<<<<<<< - * raise RuntimeError("too deeply nested") - * try: - */ - __pyx_t_1 = Py_EnterRecursiveCall(__pyx_k__encode); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":373 - * def process(self, object x): - * if Py_EnterRecursiveCall("encode"): - * raise RuntimeError("too deeply nested") # <<<<<<<<<<<<<< - * try: - * if PyString_CheckExact(x): - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Encoder_process(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_7Encoder_process(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_x = 0; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + int __pyx_4; + static char *__pyx_argnames[] = {"x",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_x); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":372 */ + __pyx_1 = Py_EnterRecursiveCall(__pyx_k31); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L1;} + Py_INCREF(__pyx_k5p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k5p); + __pyx_3 = PyObject_CallObject(PyExc_RuntimeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_bencode_pyx.pyx":374 - * if Py_EnterRecursiveCall("encode"): - * raise RuntimeError("too deeply nested") - * try: # <<<<<<<<<<<<<< - * if PyString_CheckExact(x): - * self._encode_string(x) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":374 */ /*try:*/ { - - /* "bzrlib/_bencode_pyx.pyx":375 - * raise RuntimeError("too deeply nested") - * try: - * if PyString_CheckExact(x): # <<<<<<<<<<<<<< - * self._encode_string(x) - * elif PyInt_CheckExact(x): - */ - __pyx_t_1 = PyString_CheckExact(__pyx_v_x); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":376 - * try: - * if PyString_CheckExact(x): - * self._encode_string(x) # <<<<<<<<<<<<<< - * elif PyInt_CheckExact(x): - * self._encode_int(x) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_string(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self), __pyx_v_x); if (unlikely(__pyx_t_1 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L9; - } - - /* "bzrlib/_bencode_pyx.pyx":377 - * if PyString_CheckExact(x): - * self._encode_string(x) - * elif PyInt_CheckExact(x): # <<<<<<<<<<<<<< - * self._encode_int(x) - * elif PyLong_CheckExact(x): - */ - __pyx_t_1 = PyInt_CheckExact(__pyx_v_x); - if (__pyx_t_1) { - - /* "bzrlib/_bencode_pyx.pyx":378 - * self._encode_string(x) - * elif PyInt_CheckExact(x): - * self._encode_int(x) # <<<<<<<<<<<<<< - * elif PyLong_CheckExact(x): - * self._encode_long(x) - */ - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_x); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7;} - __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_int(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self), __pyx_t_1); if (unlikely(__pyx_t_3 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L9; - } - - /* "bzrlib/_bencode_pyx.pyx":379 - * elif PyInt_CheckExact(x): - * self._encode_int(x) - * elif PyLong_CheckExact(x): # <<<<<<<<<<<<<< - * self._encode_long(x) - * elif (PyList_CheckExact(x) or PyTuple_CheckExact(x) - */ - __pyx_t_3 = PyLong_CheckExact(__pyx_v_x); - if (__pyx_t_3) { - - /* "bzrlib/_bencode_pyx.pyx":380 - * self._encode_int(x) - * elif PyLong_CheckExact(x): - * self._encode_long(x) # <<<<<<<<<<<<<< - * elif (PyList_CheckExact(x) or PyTuple_CheckExact(x) - * or StaticTuple_CheckExact(x)): - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_long(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self), __pyx_v_x); if (unlikely(__pyx_t_3 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L9; - } - - /* "bzrlib/_bencode_pyx.pyx":381 - * elif PyLong_CheckExact(x): - * self._encode_long(x) - * elif (PyList_CheckExact(x) or PyTuple_CheckExact(x) # <<<<<<<<<<<<<< - * or StaticTuple_CheckExact(x)): - * self._encode_list(x) - */ - __pyx_t_3 = PyList_CheckExact(__pyx_v_x); - if (!__pyx_t_3) { - - /* "bzrlib/_bencode_pyx.pyx":382 - * self._encode_long(x) - * elif (PyList_CheckExact(x) or PyTuple_CheckExact(x) - * or StaticTuple_CheckExact(x)): # <<<<<<<<<<<<<< - * self._encode_list(x) - * elif PyDict_CheckExact(x): - */ - __pyx_t_1 = PyTuple_CheckExact(__pyx_v_x); - if (!__pyx_t_1) { - __pyx_t_4 = StaticTuple_CheckExact(__pyx_v_x); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_1; + __pyx_1 = PyString_CheckExact(__pyx_v_x); + if (__pyx_1) { + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_string(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self),__pyx_v_x); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; goto __pyx_L4;} + goto __pyx_L6; + } + __pyx_1 = PyInt_CheckExact(__pyx_v_x); + if (__pyx_1) { + __pyx_1 = PyInt_AsLong(__pyx_v_x); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L4;} + __pyx_4 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_int(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self),__pyx_1); if (__pyx_4 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L4;} + goto __pyx_L6; + } + __pyx_1 = PyLong_CheckExact(__pyx_v_x); + if (__pyx_1) { + __pyx_4 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_long(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self),__pyx_v_x); if (__pyx_4 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L4;} + goto __pyx_L6; + } + __pyx_1 = PyList_CheckExact(__pyx_v_x); + if (!__pyx_1) { + __pyx_1 = PyTuple_CheckExact(__pyx_v_x); + if (!__pyx_1) { + __pyx_1 = StaticTuple_CheckExact(__pyx_v_x); } - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = __pyx_t_3; - } - if (__pyx_t_6) { - - /* "bzrlib/_bencode_pyx.pyx":383 - * elif (PyList_CheckExact(x) or PyTuple_CheckExact(x) - * or StaticTuple_CheckExact(x)): - * self._encode_list(x) # <<<<<<<<<<<<<< - * elif PyDict_CheckExact(x): - * self._encode_dict(x) - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_list(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self), __pyx_v_x); if (unlikely(__pyx_t_3 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L9; - } - - /* "bzrlib/_bencode_pyx.pyx":384 - * or StaticTuple_CheckExact(x)): - * self._encode_list(x) - * elif PyDict_CheckExact(x): # <<<<<<<<<<<<<< - * self._encode_dict(x) - * elif PyBool_Check(x): - */ - __pyx_t_3 = PyDict_CheckExact(__pyx_v_x); - if (__pyx_t_3) { - - /* "bzrlib/_bencode_pyx.pyx":385 - * self._encode_list(x) - * elif PyDict_CheckExact(x): - * self._encode_dict(x) # <<<<<<<<<<<<<< - * elif PyBool_Check(x): - * self._encode_int(int(x)) - */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_dict(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self), __pyx_v_x); if (unlikely(__pyx_t_3 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L9; - } - - /* "bzrlib/_bencode_pyx.pyx":386 - * elif PyDict_CheckExact(x): - * self._encode_dict(x) - * elif PyBool_Check(x): # <<<<<<<<<<<<<< - * self._encode_int(int(x)) - * elif isinstance(x, Bencached): - */ - __pyx_t_3 = PyBool_Check(__pyx_v_x); - if (__pyx_t_3) { - - /* "bzrlib/_bencode_pyx.pyx":387 - * self._encode_dict(x) - * elif PyBool_Check(x): - * self._encode_int(int(x)) # <<<<<<<<<<<<<< - * elif isinstance(x, Bencached): - * self._append_string(x.bencoded) - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x); - __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_int(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self), __pyx_t_3); if (unlikely(__pyx_t_1 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L9; - } - - /* "bzrlib/_bencode_pyx.pyx":388 - * elif PyBool_Check(x): - * self._encode_int(int(x)) - * elif isinstance(x, Bencached): # <<<<<<<<<<<<<< - * self._append_string(x.bencoded) - * else: - */ - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__Bencached); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_IsInstance(__pyx_v_x, __pyx_t_7); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_6) { - - /* "bzrlib/_bencode_pyx.pyx":389 - * self._encode_int(int(x)) - * elif isinstance(x, Bencached): - * self._append_string(x.bencoded) # <<<<<<<<<<<<<< - * else: - * raise TypeError('unsupported type %r' % x) - */ - __pyx_t_7 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__bencoded); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_append_string(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self), __pyx_t_7); if (unlikely(__pyx_t_1 == 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L9; + } + if (__pyx_1) { + __pyx_4 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_list(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self),__pyx_v_x); if (__pyx_4 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L4;} + goto __pyx_L6; + } + __pyx_1 = PyDict_CheckExact(__pyx_v_x); + if (__pyx_1) { + __pyx_4 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_dict(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self),__pyx_v_x); if (__pyx_4 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L4;} + goto __pyx_L6; + } + __pyx_1 = PyBool_Check(__pyx_v_x); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L4;} + Py_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x); + __pyx_3 = PyObject_CallObject(((PyObject *)(&PyInt_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L4;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L4;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_encode_int(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self),__pyx_4); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L4;} + goto __pyx_L6; + } + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Bencached); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L4;} + __pyx_4 = PyObject_IsInstance(__pyx_v_x,__pyx_2); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L4;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (__pyx_4) { + __pyx_3 = PyObject_GetAttr(__pyx_v_x, __pyx_n_bencoded); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L4;} + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder *)((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->__pyx_vtab)->_append_string(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self),__pyx_3); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L4;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + goto __pyx_L6; } /*else*/ { - - /* "bzrlib/_bencode_pyx.pyx":391 - * self._append_string(x.bencoded) - * else: - * raise TypeError('unsupported type %r' % x) # <<<<<<<<<<<<<< - * finally: - * Py_LeaveRecursiveCall() - */ - __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_38), __pyx_v_x); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L7;} + __pyx_2 = PyNumber_Remainder(__pyx_k33p, __pyx_v_x); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L4;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L4;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(PyExc_TypeError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L4;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L4;} } - __pyx_L9:; + __pyx_L6:; } - - /* "bzrlib/_bencode_pyx.pyx":393 - * raise TypeError('unsupported type %r' % x) - * finally: - * Py_LeaveRecursiveCall() # <<<<<<<<<<<<<< - * - * - */ /*finally:*/ { int __pyx_why; PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L8; - __pyx_L7: { + __pyx_why = 0; goto __pyx_L5; + __pyx_L4: { __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + Py_XDECREF(__pyx_3); __pyx_3 = 0; + Py_XDECREF(__pyx_2); __pyx_2 = 0; + PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L8; + goto __pyx_L5; } - __pyx_L8:; + __pyx_L5:; Py_LeaveRecursiveCall(); switch (__pyx_why) { case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); __pyx_lineno = __pyx_exc_lineno; __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; - goto __pyx_L1_error; + goto __pyx_L1; } } } - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_7); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder.process"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_bencode_pyx.pyx":248 - * """Bencode encoder""" - * - * cdef readonly char *tail # <<<<<<<<<<<<<< - * cdef readonly int size - * cdef readonly char *buffer - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_4tail___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_4tail___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->tail); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder.tail.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_bencode_pyx.pyx":249 - * - * cdef readonly char *tail - * cdef readonly int size # <<<<<<<<<<<<<< - * cdef readonly char *buffer - * cdef readonly int maxsize - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_4size___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_4size___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder.size.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_bencode_pyx.pyx":250 - * cdef readonly char *tail - * cdef readonly int size - * cdef readonly char *buffer # <<<<<<<<<<<<<< - * cdef readonly int maxsize - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_6buffer___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_6buffer___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyBytes_FromString(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->buffer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder.buffer.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_bencode_pyx.pyx":251 - * cdef readonly int size - * cdef readonly char *buffer - * cdef readonly int maxsize # <<<<<<<<<<<<<< - * - * def __init__(self, int maxsize=INITSIZE): - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_7maxsize___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_7maxsize___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_v_self)->maxsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._bencode_pyx.Encoder.maxsize.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_x); return __pyx_r; } -/* "bzrlib/_bencode_pyx.pyx":396 - * - * - * def bencode(x): # <<<<<<<<<<<<<< - * """Encode Python object x to string""" - * encoder = Encoder() - */ - -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_2bencode(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ -static char __pyx_doc_6bzrlib_12_bencode_pyx_2bencode[] = "Encode Python object x to string"; -static PyMethodDef __pyx_mdef_6bzrlib_12_bencode_pyx_2bencode = {__Pyx_NAMESTR("bencode"), (PyCFunction)__pyx_pf_6bzrlib_12_bencode_pyx_2bencode, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_12_bencode_pyx_2bencode)}; -static PyObject *__pyx_pf_6bzrlib_12_bencode_pyx_2bencode(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *__pyx_v_encoder; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("bencode"); - __pyx_self = __pyx_self; - __pyx_v_encoder = ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_bencode_pyx.pyx":398 - * def bencode(x): - * """Encode Python object x to string""" - * encoder = Encoder() # <<<<<<<<<<<<<< - * encoder.process(x) - * return str(encoder) - */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_12_bencode_pyx_Encoder)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_v_encoder)); - __pyx_v_encoder = ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_bencode_pyx.pyx":399 - * """Encode Python object x to string""" - * encoder = Encoder() - * encoder.process(x) # <<<<<<<<<<<<<< - * return str(encoder) - */ - __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_encoder), __pyx_n_s__process); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x); - __Pyx_GIVEREF(__pyx_v_x); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "bzrlib/_bencode_pyx.pyx":400 - * encoder = Encoder() - * encoder.process(x) - * return str(encoder) # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(((PyObject *)__pyx_v_encoder)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_encoder)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_encoder)); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_bencode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_12_bencode_pyx_bencode[] = "Encode Python object x to string"; +static PyObject *__pyx_f_6bzrlib_12_bencode_pyx_bencode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_x = 0; + PyObject *__pyx_v_encoder; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + static char *__pyx_argnames[] = {"x",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0; + Py_INCREF(__pyx_v_x); + __pyx_v_encoder = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":398 */ + __pyx_1 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_12_bencode_pyx_Encoder), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;} + Py_DECREF(__pyx_v_encoder); + __pyx_v_encoder = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":399 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_encoder, __pyx_n_process); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;} + Py_INCREF(__pyx_v_x); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x); + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":400 */ + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; goto __pyx_L1;} + Py_INCREF(__pyx_v_encoder); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_encoder); + __pyx_2 = PyObject_CallObject(((PyObject *)(&PyString_Type)), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._bencode_pyx.bencode"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_encoder); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_encoder); + Py_DECREF(__pyx_v_x); return __pyx_r; } static struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder __pyx_vtable_6bzrlib_12_bencode_pyx_Decoder; @@ -4267,7 +1877,7 @@ PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)o); - p->__pyx_vtab = __pyx_vtabptr_6bzrlib_12_bencode_pyx_Decoder; + *(struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Decoder **)&p->__pyx_vtab = __pyx_vtabptr_6bzrlib_12_bencode_pyx_Decoder; p->text = Py_None; Py_INCREF(Py_None); return o; } @@ -4275,7 +1885,7 @@ static void __pyx_tp_dealloc_6bzrlib_12_bencode_pyx_Decoder(PyObject *o) { struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *p = (struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)o; Py_XDECREF(p->text); - (*Py_TYPE(o)->tp_free)(o); + (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_6bzrlib_12_bencode_pyx_Decoder(PyObject *o, visitproc v, void *a) { @@ -4289,35 +1899,23 @@ static int __pyx_tp_clear_6bzrlib_12_bencode_pyx_Decoder(PyObject *o) { struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *p = (struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *)o; - PyObject* tmp; - tmp = ((PyObject*)p->text); + PyObject *t; + t = p->text; p->text = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); + Py_XDECREF(t); return 0; } -static PyObject *__pyx_getprop_6bzrlib_12_bencode_pyx_7Decoder_tail(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_4tail___get__(o); -} - -static PyObject *__pyx_getprop_6bzrlib_12_bencode_pyx_7Decoder_size(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_4size___get__(o); -} - -static PyObject *__pyx_getprop_6bzrlib_12_bencode_pyx_7Decoder__yield_tuples(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_13_yield_tuples___get__(o); -} - -static PyMethodDef __pyx_methods_6bzrlib_12_bencode_pyx_Decoder[] = { - {__Pyx_NAMESTR("decode"), (PyCFunction)__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_1decode, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("decode_object"), (PyCFunction)__pyx_pf_6bzrlib_12_bencode_pyx_7Decoder_2decode_object, METH_NOARGS, __Pyx_DOCSTR(0)}, +static struct PyMethodDef __pyx_methods_6bzrlib_12_bencode_pyx_Decoder[] = { + {"decode", (PyCFunction)__pyx_f_6bzrlib_12_bencode_pyx_7Decoder_decode, METH_VARARGS|METH_KEYWORDS, 0}, + {"decode_object", (PyCFunction)__pyx_f_6bzrlib_12_bencode_pyx_7Decoder_decode_object, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_6bzrlib_12_bencode_pyx_Decoder[] = { - {(char *)"tail", __pyx_getprop_6bzrlib_12_bencode_pyx_7Decoder_tail, 0, 0, 0}, - {(char *)"size", __pyx_getprop_6bzrlib_12_bencode_pyx_7Decoder_size, 0, 0, 0}, - {(char *)"_yield_tuples", __pyx_getprop_6bzrlib_12_bencode_pyx_7Decoder__yield_tuples, 0, 0, 0}, +static struct PyMemberDef __pyx_members_6bzrlib_12_bencode_pyx_Decoder[] = { + {"tail", T_STRING, offsetof(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder, tail), READONLY, 0}, + {"size", T_INT, offsetof(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder, size), READONLY, 0}, + {"_yield_tuples", T_INT, offsetof(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder, _yield_tuples), READONLY, 0}, {0, 0, 0, 0, 0} }; @@ -4325,9 +1923,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -4341,28 +1937,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -4374,7 +1958,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; @@ -4399,40 +1983,23 @@ }; static PyBufferProcs __pyx_tp_as_buffer_Decoder = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; -static PyTypeObject __pyx_type_6bzrlib_12_bencode_pyx_Decoder = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._bencode_pyx.Decoder"), /*tp_name*/ +PyTypeObject __pyx_type_6bzrlib_12_bencode_pyx_Decoder = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._bencode_pyx.Decoder", /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_12_bencode_pyx_Decoder, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Decoder, /*tp_as_number*/ &__pyx_tp_as_sequence_Decoder, /*tp_as_sequence*/ @@ -4443,8 +2010,8 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Decoder, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("Bencode decoder"), /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Bencode decoder", /*tp_doc*/ __pyx_tp_traverse_6bzrlib_12_bencode_pyx_Decoder, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_12_bencode_pyx_Decoder, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -4452,14 +2019,14 @@ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6bzrlib_12_bencode_pyx_Decoder, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6bzrlib_12_bencode_pyx_Decoder, /*tp_getset*/ + __pyx_members_6bzrlib_12_bencode_pyx_Decoder, /*tp_members*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_6bzrlib_12_bencode_pyx_7Decoder___init__, /*tp_init*/ + __pyx_f_6bzrlib_12_bencode_pyx_7Decoder___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6bzrlib_12_bencode_pyx_Decoder, /*tp_new*/ 0, /*tp_free*/ @@ -4469,10 +2036,6 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif }; static struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder __pyx_vtable_6bzrlib_12_bencode_pyx_Encoder; @@ -4481,7 +2044,7 @@ PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *)o); - p->__pyx_vtab = __pyx_vtabptr_6bzrlib_12_bencode_pyx_Encoder; + *(struct __pyx_vtabstruct_6bzrlib_12_bencode_pyx_Encoder **)&p->__pyx_vtab = __pyx_vtabptr_6bzrlib_12_bencode_pyx_Encoder; return o; } @@ -4489,41 +2052,25 @@ { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_1__dealloc__(o); + ++o->ob_refcnt; + __pyx_f_6bzrlib_12_bencode_pyx_7Encoder___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); + --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } - (*Py_TYPE(o)->tp_free)(o); -} - -static PyObject *__pyx_getprop_6bzrlib_12_bencode_pyx_7Encoder_tail(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_4tail___get__(o); -} - -static PyObject *__pyx_getprop_6bzrlib_12_bencode_pyx_7Encoder_size(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_4size___get__(o); + (*o->ob_type->tp_free)(o); } -static PyObject *__pyx_getprop_6bzrlib_12_bencode_pyx_7Encoder_buffer(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_6buffer___get__(o); -} - -static PyObject *__pyx_getprop_6bzrlib_12_bencode_pyx_7Encoder_maxsize(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_7maxsize___get__(o); -} - -static PyMethodDef __pyx_methods_6bzrlib_12_bencode_pyx_Encoder[] = { - {__Pyx_NAMESTR("process"), (PyCFunction)__pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_3process, METH_O, __Pyx_DOCSTR(0)}, +static struct PyMethodDef __pyx_methods_6bzrlib_12_bencode_pyx_Encoder[] = { + {"process", (PyCFunction)__pyx_f_6bzrlib_12_bencode_pyx_7Encoder_process, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_6bzrlib_12_bencode_pyx_Encoder[] = { - {(char *)"tail", __pyx_getprop_6bzrlib_12_bencode_pyx_7Encoder_tail, 0, 0, 0}, - {(char *)"size", __pyx_getprop_6bzrlib_12_bencode_pyx_7Encoder_size, 0, 0, 0}, - {(char *)"buffer", __pyx_getprop_6bzrlib_12_bencode_pyx_7Encoder_buffer, 0, 0, 0}, - {(char *)"maxsize", __pyx_getprop_6bzrlib_12_bencode_pyx_7Encoder_maxsize, 0, 0, 0}, +static struct PyMemberDef __pyx_members_6bzrlib_12_bencode_pyx_Encoder[] = { + {"tail", T_STRING, offsetof(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder, tail), READONLY, 0}, + {"size", T_INT, offsetof(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder, size), READONLY, 0}, + {"buffer", T_STRING, offsetof(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder, buffer), READONLY, 0}, + {"maxsize", T_INT, offsetof(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder, maxsize), READONLY, 0}, {0, 0, 0, 0, 0} }; @@ -4531,9 +2078,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -4547,28 +2092,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -4580,7 +2113,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; @@ -4605,52 +2138,35 @@ }; static PyBufferProcs __pyx_tp_as_buffer_Encoder = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; -static PyTypeObject __pyx_type_6bzrlib_12_bencode_pyx_Encoder = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._bencode_pyx.Encoder"), /*tp_name*/ +PyTypeObject __pyx_type_6bzrlib_12_bencode_pyx_Encoder = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._bencode_pyx.Encoder", /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_12_bencode_pyx_Encoder, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Encoder, /*tp_as_number*/ &__pyx_tp_as_sequence_Encoder, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Encoder, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ - __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder_2__str__, /*tp_str*/ + __pyx_f_6bzrlib_12_bencode_pyx_7Encoder___str__, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Encoder, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - __Pyx_DOCSTR("Bencode encoder"), /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "Bencode encoder", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -4658,14 +2174,14 @@ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6bzrlib_12_bencode_pyx_Encoder, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6bzrlib_12_bencode_pyx_Encoder, /*tp_getset*/ + __pyx_members_6bzrlib_12_bencode_pyx_Encoder, /*tp_members*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_6bzrlib_12_bencode_pyx_7Encoder___init__, /*tp_init*/ + __pyx_f_6bzrlib_12_bencode_pyx_7Encoder___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6bzrlib_12_bencode_pyx_Encoder, /*tp_new*/ 0, /*tp_free*/ @@ -4675,738 +2191,118 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif }; -static PyMethodDef __pyx_methods[] = { +static struct PyMethodDef __pyx_methods[] = { + {"bdecode", (PyCFunction)__pyx_f_6bzrlib_12_bencode_pyx_bdecode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_bencode_pyx_bdecode}, + {"bdecode_as_tuple", (PyCFunction)__pyx_f_6bzrlib_12_bencode_pyx_bdecode_as_tuple, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_bencode_pyx_bdecode_as_tuple}, + {"bencode", (PyCFunction)__pyx_f_6bzrlib_12_bencode_pyx_bencode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_bencode_pyx_bencode}, {0, 0, 0, 0} }; -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("_bencode_pyx"), - __Pyx_DOCSTR(__pyx_k_39), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, - {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, - {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, - {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, - {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0}, - {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, - {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0}, - {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0}, - {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0}, - {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0}, - {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0}, - {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0}, - {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0}, - {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0}, - {&__pyx_n_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 1}, - {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, - {&__pyx_n_s__Bencached, __pyx_k__Bencached, sizeof(__pyx_k__Bencached), 0, 0, 1, 1}, - {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1}, - {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____slots__, __pyx_k____slots__, sizeof(__pyx_k____slots__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___append_string, __pyx_k___append_string, sizeof(__pyx_k___append_string), 0, 0, 1, 1}, - {&__pyx_n_s___decode_dict, __pyx_k___decode_dict, sizeof(__pyx_k___decode_dict), 0, 0, 1, 1}, - {&__pyx_n_s___decode_int, __pyx_k___decode_int, sizeof(__pyx_k___decode_int), 0, 0, 1, 1}, - {&__pyx_n_s___decode_list, __pyx_k___decode_list, sizeof(__pyx_k___decode_list), 0, 0, 1, 1}, - {&__pyx_n_s___decode_object, __pyx_k___decode_object, sizeof(__pyx_k___decode_object), 0, 0, 1, 1}, - {&__pyx_n_s___decode_string, __pyx_k___decode_string, sizeof(__pyx_k___decode_string), 0, 0, 1, 1}, - {&__pyx_n_s___encode_dict, __pyx_k___encode_dict, sizeof(__pyx_k___encode_dict), 0, 0, 1, 1}, - {&__pyx_n_s___encode_int, __pyx_k___encode_int, sizeof(__pyx_k___encode_int), 0, 0, 1, 1}, - {&__pyx_n_s___encode_list, __pyx_k___encode_list, sizeof(__pyx_k___encode_list), 0, 0, 1, 1}, - {&__pyx_n_s___encode_long, __pyx_k___encode_long, sizeof(__pyx_k___encode_long), 0, 0, 1, 1}, - {&__pyx_n_s___encode_string, __pyx_k___encode_string, sizeof(__pyx_k___encode_string), 0, 0, 1, 1}, - {&__pyx_n_s___ensure_buffer, __pyx_k___ensure_buffer, sizeof(__pyx_k___ensure_buffer), 0, 0, 1, 1}, - {&__pyx_n_s___read_digits, __pyx_k___read_digits, sizeof(__pyx_k___read_digits), 0, 0, 1, 1}, - {&__pyx_n_s___yield_tuples, __pyx_k___yield_tuples, sizeof(__pyx_k___yield_tuples), 0, 0, 1, 1}, - {&__pyx_n_s__bdecode, __pyx_k__bdecode, sizeof(__pyx_k__bdecode), 0, 0, 1, 1}, - {&__pyx_n_s__bdecode_as_tuple, __pyx_k__bdecode_as_tuple, sizeof(__pyx_k__bdecode_as_tuple), 0, 0, 1, 1}, - {&__pyx_n_s__bencode, __pyx_k__bencode, sizeof(__pyx_k__bencode), 0, 0, 1, 1}, - {&__pyx_n_s__bencoded, __pyx_k__bencoded, sizeof(__pyx_k__bencoded), 0, 0, 1, 1}, - {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1}, - {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1}, - {&__pyx_n_s__e, __pyx_k__e, sizeof(__pyx_k__e), 0, 0, 1, 1}, - {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1}, - {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1}, - {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1}, - {&__pyx_n_s__maxsize, __pyx_k__maxsize, sizeof(__pyx_k__maxsize), 0, 0, 1, 1}, - {&__pyx_n_s__object, __pyx_k__object, sizeof(__pyx_k__object), 0, 0, 1, 1}, - {&__pyx_n_s__process, __pyx_k__process, sizeof(__pyx_k__process), 0, 0, 1, 1}, - {&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1}, - {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1}, - {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1}, - {&__pyx_n_s__sort, __pyx_k__sort, sizeof(__pyx_k__sort), 0, 0, 1, 1}, - {&__pyx_n_s__tail, __pyx_k__tail, sizeof(__pyx_k__tail), 0, 0, 1, 1}, - {&__pyx_n_s__text, __pyx_k__text, sizeof(__pyx_k__text), 0, 0, 1, 1}, - {&__pyx_n_s__yield_tuples, __pyx_k__yield_tuples, sizeof(__pyx_k__yield_tuples), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "bzrlib/_bencode_pyx.pyx":82 - * """ - * if not PyString_CheckExact(s): - * raise TypeError("String required") # <<<<<<<<<<<<<< - * - * self.text = s - */ - __pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); - PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2)); - - /* "bzrlib/_bencode_pyx.pyx":92 - * result = self._decode_object() - * if self.size != 0: - * raise ValueError('junk in stream') # <<<<<<<<<<<<<< - * return result - * - */ - __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4)); - - /* "bzrlib/_bencode_pyx.pyx":102 - * - * if 0 == self.size: - * raise ValueError('stream underflow') # <<<<<<<<<<<<<< - * - * if Py_EnterRecursiveCall("_decode_object"): - */ - __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_6)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, ((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); - - /* "bzrlib/_bencode_pyx.pyx":105 - * - * if Py_EnterRecursiveCall("_decode_object"): - * raise RuntimeError("too deeply nested") # <<<<<<<<<<<<<< - * try: - * ch = self.tail[0] - */ - __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); - PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); - - /* "bzrlib/_bencode_pyx.pyx":162 - * n = strtol(self.tail, &next_tail, 10) - * if next_tail == NULL or next_tail[0] != c':': - * raise ValueError('string len not terminated by ":"') # <<<<<<<<<<<<<< - * # strtol allows leading zeros, so validate that we don't have that - * if (self.tail[0] == c'0' - */ - __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); - PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); - - /* "bzrlib/_bencode_pyx.pyx":166 - * if (self.tail[0] == c'0' - * and (n != 0 or (next_tail - self.tail != 1))): - * raise ValueError('leading zeros are not allowed') # <<<<<<<<<<<<<< - * D_UPDATE_TAIL(self, next_tail - self.tail + 1) - * if n == 0: - */ - __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_14)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); - PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_s_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14)); - - /* "bzrlib/_bencode_pyx.pyx":171 - * return '' - * if n > self.size: - * raise ValueError('stream underflow') # <<<<<<<<<<<<<< - * if n < 0: - * raise ValueError('string size below zero: %d' % n) - */ - __pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_16)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16)); - - /* "bzrlib/_bencode_pyx.pyx":195 - * PyList_Append(result, self._decode_object()) - * - * raise ValueError('malformed list') # <<<<<<<<<<<<<< - * - * cdef object _decode_dict(self): - */ - __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_19)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_18)); - PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_s_18)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19)); - - /* "bzrlib/_bencode_pyx.pyx":211 - * # keys should be strings only - * if self.tail[0] < c'0' or self.tail[0] > c'9': - * raise ValueError('key was not a simple string.') # <<<<<<<<<<<<<< - * key = self._decode_string() - * if lastkey >= key: - */ - __pyx_k_tuple_21 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_21)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_20)); - PyTuple_SET_ITEM(__pyx_k_tuple_21, 0, ((PyObject *)__pyx_kp_s_20)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21)); - - /* "bzrlib/_bencode_pyx.pyx":214 - * key = self._decode_string() - * if lastkey >= key: - * raise ValueError('dict keys disordered') # <<<<<<<<<<<<<< - * else: - * lastkey = key - */ - __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_23)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_22)); - PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_kp_s_22)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_22)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23)); - - /* "bzrlib/_bencode_pyx.pyx":220 - * result[key] = value - * - * raise ValueError('malformed dict') # <<<<<<<<<<<<<< - * - * - */ - __pyx_k_tuple_25 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_25)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_24)); - PyTuple_SET_ITEM(__pyx_k_tuple_25, 0, ((PyObject *)__pyx_kp_s_24)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_24)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25)); - - /* "bzrlib/_bencode_pyx.pyx":265 - * p = malloc(maxsize) - * if p == NULL: - * raise MemoryError('Not enough memory to allocate buffer ' # <<<<<<<<<<<<<< - * 'for encoder') - * self.buffer = p - */ - __pyx_k_tuple_28 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_28)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_27)); - PyTuple_SET_ITEM(__pyx_k_tuple_28, 0, ((PyObject *)__pyx_kp_s_27)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28)); - - /* "bzrlib/_bencode_pyx.pyx":298 - * new_buffer = realloc(self.buffer, new_size) - * if new_buffer == NULL: - * raise MemoryError('Cannot realloc buffer for encoder') # <<<<<<<<<<<<<< - * - * self.buffer = new_buffer - */ - __pyx_k_tuple_30 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_30)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_29)); - PyTuple_SET_ITEM(__pyx_k_tuple_30, 0, ((PyObject *)__pyx_kp_s_29)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30)); - - /* "bzrlib/_bencode_pyx.pyx":362 - * for k in keys: - * if not PyString_CheckExact(k): - * raise TypeError('key in dict should be string') # <<<<<<<<<<<<<< - * self._encode_string(k) - * self.process(x[k]) - */ - __pyx_k_tuple_36 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_36)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_35)); - PyTuple_SET_ITEM(__pyx_k_tuple_36, 0, ((PyObject *)__pyx_kp_s_35)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36)); - - /* "bzrlib/_bencode_pyx.pyx":373 - * def process(self, object x): - * if Py_EnterRecursiveCall("encode"): - * raise RuntimeError("too deeply nested") # <<<<<<<<<<<<<< - * try: - * if PyString_CheckExact(x): - */ - __pyx_k_tuple_37 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_37)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); - PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} +static void __pyx_init_filenames(void); /*proto*/ -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC init_bencode_pyx(void); /*proto*/ -PyMODINIT_FUNC init_bencode_pyx(void) -#else -PyMODINIT_FUNC PyInit__bencode_pyx(void); /*proto*/ -PyMODINIT_FUNC PyInit__bencode_pyx(void) -#endif -{ - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__bencode_pyx(void)", __LINE__, __FILE__); - #endif - __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;} - __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;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_bencode_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_39), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_bencode_pyx(void) { + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + PyObject *__pyx_6 = 0; + __pyx_init_filenames(); + __pyx_m = Py_InitModule4("_bencode_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_bzrlib___bencode_pyx) { - 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;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ + __pyx_b = PyImport_AddModule("__builtin__"); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; __pyx_vtabptr_6bzrlib_12_bencode_pyx_Decoder = &__pyx_vtable_6bzrlib_12_bencode_pyx_Decoder; - __pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._decode_object = (PyObject *(*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_object; - __pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._read_digits = (int (*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *, char))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__read_digits; - __pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._decode_int = (PyObject *(*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_int; - __pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._decode_string = (PyObject *(*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_string; - __pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._decode_list = (PyObject *(*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_list; - __pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._decode_dict = (PyObject *(*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Decoder *))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_dict; - if (PyType_Ready(&__pyx_type_6bzrlib_12_bencode_pyx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - { - PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6bzrlib_12_bencode_pyx_Decoder, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_6bzrlib_12_bencode_pyx_7Decoder___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_6bzrlib_12_bencode_pyx_7Decoder___init__.doc = __pyx_doc_6bzrlib_12_bencode_pyx_7Decoder___init__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6bzrlib_12_bencode_pyx_7Decoder___init__; - } - } - if (__Pyx_SetVtable(__pyx_type_6bzrlib_12_bencode_pyx_Decoder.tp_dict, __pyx_vtabptr_6bzrlib_12_bencode_pyx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Decoder", (PyObject *)&__pyx_type_6bzrlib_12_bencode_pyx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._decode_object = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_object; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._read_digits = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__read_digits; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._decode_int = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_int; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._decode_string = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_string; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._decode_list = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_list; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Decoder._decode_dict = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Decoder__decode_dict; + __pyx_type_6bzrlib_12_bencode_pyx_Decoder.tp_free = _PyObject_GC_Del; + if (PyType_Ready(&__pyx_type_6bzrlib_12_bencode_pyx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} + if (__Pyx_SetVtable(__pyx_type_6bzrlib_12_bencode_pyx_Decoder.tp_dict, __pyx_vtabptr_6bzrlib_12_bencode_pyx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "Decoder", (PyObject *)&__pyx_type_6bzrlib_12_bencode_pyx_Decoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;} __pyx_ptype_6bzrlib_12_bencode_pyx_Decoder = &__pyx_type_6bzrlib_12_bencode_pyx_Decoder; __pyx_vtabptr_6bzrlib_12_bencode_pyx_Encoder = &__pyx_vtable_6bzrlib_12_bencode_pyx_Encoder; - __pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._ensure_buffer = (int (*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, int))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__ensure_buffer; - __pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._encode_int = (int (*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, int))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_int; - __pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._encode_long = (int (*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, PyObject *))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_long; - __pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._append_string = (int (*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, PyObject *))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__append_string; - __pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._encode_string = (int (*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, PyObject *))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_string; - __pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._encode_list = (int (*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, PyObject *))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_list; - __pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._encode_dict = (int (*)(struct __pyx_obj_6bzrlib_12_bencode_pyx_Encoder *, PyObject *))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_dict; - if (PyType_Ready(&__pyx_type_6bzrlib_12_bencode_pyx_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - { - PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6bzrlib_12_bencode_pyx_Encoder, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_6bzrlib_12_bencode_pyx_7Encoder___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_6bzrlib_12_bencode_pyx_7Encoder___init__.doc = __pyx_doc_6bzrlib_12_bencode_pyx_7Encoder___init__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6bzrlib_12_bencode_pyx_7Encoder___init__; - } - } - if (__Pyx_SetVtable(__pyx_type_6bzrlib_12_bencode_pyx_Encoder.tp_dict, __pyx_vtabptr_6bzrlib_12_bencode_pyx_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "Encoder", (PyObject *)&__pyx_type_6bzrlib_12_bencode_pyx_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._ensure_buffer = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__ensure_buffer; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._encode_int = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_int; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._encode_long = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_long; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._append_string = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__append_string; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._encode_string = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_string; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._encode_list = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_list; + *(void(**)(void))&__pyx_vtable_6bzrlib_12_bencode_pyx_Encoder._encode_dict = (void(*)(void))__pyx_f_6bzrlib_12_bencode_pyx_7Encoder__encode_dict; + if (PyType_Ready(&__pyx_type_6bzrlib_12_bencode_pyx_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;} + if (__Pyx_SetVtable(__pyx_type_6bzrlib_12_bencode_pyx_Encoder.tp_dict, __pyx_vtabptr_6bzrlib_12_bencode_pyx_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "Encoder", (PyObject *)&__pyx_type_6bzrlib_12_bencode_pyx_Encoder) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;} __pyx_ptype_6bzrlib_12_bencode_pyx_Encoder = &__pyx_type_6bzrlib_12_bencode_pyx_Encoder; - /*--- Type import code ---*/ - __pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple = __Pyx_ImportType("bzrlib._static_tuple_c", "StaticTuple", sizeof(StaticTuple), 0); if (unlikely(!__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "bzrlib/_bencode_pyx.pyx":66 - * import_static_tuple_c - * - * import_static_tuple_c() # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = import_static_tuple_c(); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_bencode_pyx.pyx":223 - * - * - * def bdecode(object s): # <<<<<<<<<<<<<< - * """Decode string x to Python object""" - * return Decoder(s).decode() - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_12_bencode_pyx_bdecode, NULL, __pyx_n_s_40); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__bdecode, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_bencode_pyx.pyx":228 - * - * - * def bdecode_as_tuple(object s): # <<<<<<<<<<<<<< - * """Decode string x to Python object, using tuples rather than lists.""" - * return Decoder(s, True).decode() - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_12_bencode_pyx_1bdecode_as_tuple, NULL, __pyx_n_s_40); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__bdecode_as_tuple, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_bencode_pyx.pyx":233 - * - * - * class Bencached(object): # <<<<<<<<<<<<<< - * __slots__ = ['bencoded'] - * - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - - /* "bzrlib/_bencode_pyx.pyx":234 - * - * class Bencached(object): - * __slots__ = ['bencoded'] # <<<<<<<<<<<<<< - * - * def __init__(self, s): - */ - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__bencoded)); - PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__bencoded)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bencoded)); - if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____slots__, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - - /* "bzrlib/_bencode_pyx.pyx":236 - * __slots__ = ['bencoded'] - * - * def __init__(self, s): # <<<<<<<<<<<<<< - * self.bencoded = s - * - */ - __pyx_t_3 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6bzrlib_12_bencode_pyx_9Bencached___init__, NULL, __pyx_n_s_40); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____init__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "bzrlib/_bencode_pyx.pyx":233 - * - * - * class Bencached(object): # <<<<<<<<<<<<<< - * __slots__ = ['bencoded'] - * - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_builtin_object); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_object); - __Pyx_GIVEREF(__pyx_builtin_object); - __pyx_t_4 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2), __pyx_n_s__Bencached, __pyx_n_s_40); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Bencached, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - - /* "bzrlib/_bencode_pyx.pyx":253 - * cdef readonly int maxsize - * - * def __init__(self, int maxsize=INITSIZE): # <<<<<<<<<<<<<< - * """Initialize encoder engine - * @param maxsize: initial size of internal char buffer - */ - __pyx_k_26 = __pyx_e_6bzrlib_12_bencode_pyx_INITSIZE; - - /* "bzrlib/_bencode_pyx.pyx":396 - * - * - * def bencode(x): # <<<<<<<<<<<<<< - * """Encode Python object x to string""" - * encoder = Encoder() - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_12_bencode_pyx_2bencode, NULL, __pyx_n_s_40); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__bencode, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_bencode_pyx.pyx":1 - * # Copyright (C) 2007, 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<< - * # - * # This program is free software; you can redistribute it and/or modify - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - 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;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - if (__pyx_m) { - __Pyx_AddTraceback("init bzrlib._bencode_pyx"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init bzrlib._bencode_pyx"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} + __pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple = __Pyx_ImportType("bzrlib._static_tuple_c", "StaticTuple", sizeof(StaticTuple)); if (!__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; goto __pyx_L1;} -/* Runtime support code */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":66 */ + __pyx_1 = import_static_tuple_c(); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;} -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":77 */ + __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;} + __pyx_d1 = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":233 */ + __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_object); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4); + __pyx_4 = 0; + __pyx_4 = __Pyx_CreateClass(__pyx_5, __pyx_3, __pyx_n_Bencached, "bzrlib._bencode_pyx"); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":234 */ + __pyx_5 = PyList_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} + Py_INCREF(__pyx_n_bencoded); + PyList_SET_ITEM(__pyx_5, 0, __pyx_n_bencoded); + if (PyObject_SetAttr(__pyx_4, __pyx_n___slots__, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":236 */ + __pyx_5 = PyCFunction_New(&__pyx_mdef_6bzrlib_12_bencode_pyx_9Bencached___init__, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;} + __pyx_6 = PyMethod_New(__pyx_5, 0, __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + if (PyObject_SetAttr(__pyx_4, __pyx_n___init__, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_Bencached, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":253 */ + __pyx_d2 = __pyx_e_6bzrlib_12_bencode_pyx_INITSIZE; -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_bencode_pyx.pyx":396 */ + return; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); + Py_XDECREF(__pyx_6); + __Pyx_AddTraceback("bzrlib._bencode_pyx"); } -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} +static char *__pyx_filenames[] = { + "_bencode_pyx.pyx", + "_static_tuple_c.pxd", +}; -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} +/* Runtime support code */ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } - -#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); @@ -5447,13 +2343,12 @@ Py_INCREF(type); } else { - type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else - type = (PyObject*) Py_TYPE(type); + type = (PyObject*) type->ob_type; Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, @@ -5462,8 +2357,7 @@ } #endif } - - __Pyx_ErrRestore(type, value, tb); + PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); @@ -5472,605 +2366,73 @@ return; } -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; -} -#endif - -static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) { - PyObject *metaclass; - /* Default metaclass */ -#if PY_MAJOR_VERSION < 3 - if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) { - PyObject *base = PyTuple_GET_ITEM(bases, 0); - metaclass = PyObject_GetAttrString(base, "__class__"); - if (!metaclass) { - PyErr_Clear(); - metaclass = (PyObject*) Py_TYPE(base); - } - } else { - metaclass = (PyObject *) &PyClass_Type; - } -#else - if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) { - PyObject *base = PyTuple_GET_ITEM(bases, 0); - metaclass = (PyObject*) Py_TYPE(base); - } else { - metaclass = (PyObject *) &PyType_Type; - } -#endif - Py_INCREF(metaclass); - return metaclass; -} - -static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, - PyObject *modname) { +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { PyObject *result; - PyObject *metaclass; - - if (PyDict_SetItemString(dict, "__module__", modname) < 0) - return NULL; - - /* Python2 __metaclass__ */ - metaclass = PyDict_GetItemString(dict, "__metaclass__"); - if (metaclass) { - Py_INCREF(metaclass); - } else { - metaclass = __Pyx_FindPy2Metaclass(bases); - } - result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL); - Py_DECREF(metaclass); + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); return result; } - -static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) { - __pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType); - if (op == NULL) - return NULL; - op->func.m_ml = ml; - Py_XINCREF(self); - op->func.m_self = self; - Py_XINCREF(module); - op->func.m_module = module; - PyObject_GC_Track(op); - return (PyObject *)op; -} - -static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) { - PyObject_GC_UnTrack(m); - Py_XDECREF(m->func.m_self); - Py_XDECREF(m->func.m_module); - PyObject_GC_Del(m); -} - -static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) { - if (obj == Py_None) - obj = NULL; - return PyMethod_New(func, obj, type); -} - -static int __pyx_binding_PyCFunctionType_init(void) { - __pyx_binding_PyCFunctionType_type = PyCFunction_Type; - __pyx_binding_PyCFunctionType_type.tp_name = __Pyx_NAMESTR("cython_binding_builtin_function_or_method"); - __pyx_binding_PyCFunctionType_type.tp_dealloc = (destructor)__pyx_binding_PyCFunctionType_dealloc; - __pyx_binding_PyCFunctionType_type.tp_descr_get = __pyx_binding_PyCFunctionType_descr_get; - if (PyType_Ready(&__pyx_binding_PyCFunctionType_type) < 0) { - return -1; +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + if (!*t->p) + return -1; + if (t->i) + PyString_InternInPlace(t->p); + ++t; } - __pyx_binding_PyCFunctionType = &__pyx_binding_PyCFunctionType_type; return 0; - -} - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) + PyObject *pycobj = 0; + int result; + + pycobj = PyCObject_FromVoidPtr(vtable, 0); + if (!pycobj) goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) + if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0) goto bad; - Py_DECREF(ob); - return 0; + result = 0; + goto done; + bad: - Py_XDECREF(ob); - return -1; + result = -1; +done: + Py_XDECREF(pycobj); + return result; } #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size, int strict) +static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, + long size) { PyObject *py_module = 0; PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - + py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; + result = PyObject_GetAttrString(py_module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, + PyErr_Format(PyExc_TypeError, "%s.%s is not a type object", module_name, class_name); goto bad; } - if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); - #else - PyErr_WarnEx(NULL, warning, 0); - #endif - } - else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s has the wrong size, try recompiling", + if (((PyTypeObject *)result)->tp_basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%s.%s does not appear to be the correct type object", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: - Py_XDECREF(py_module); Py_XDECREF(result); return 0; } @@ -6078,82 +2440,78 @@ #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { +static PyObject *__Pyx_ImportModule(char *name) { PyObject *py_name = 0; - PyObject *py_module = 0; - - #if PY_MAJOR_VERSION < 3 + py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif if (!py_name) goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; + return PyImport_Import(py_name); bad: Py_XDECREF(py_name); return 0; } #endif +static PyObject *__Pyx_CreateClass( + PyObject *bases, PyObject *dict, PyObject *name, char *modname) +{ + PyObject *py_modname; + PyObject *result = 0; + + py_modname = PyString_FromString(modname); + if (!py_modname) + goto bad; + if (PyDict_SetItemString(dict, "__module__", py_modname) < 0) + goto bad; + result = PyClass_New(bases, dict, name); +bad: + Py_XDECREF(py_modname); + return result; +} + #include "compile.h" #include "frameobject.h" #include "traceback.h" -static void __Pyx_AddTraceback(const char *funcname) { +static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; + PyObject *empty_tuple = 0; + PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } + py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; + empty_tuple = PyTuple_New(0); + if (!empty_tuple) goto bad; + empty_string = PyString_FromString(""); + if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + empty_string, /*PyObject *code,*/ + empty_tuple, /*PyObject *consts,*/ + empty_tuple, /*PyObject *names,*/ + empty_tuple, /*PyObject *varnames,*/ + empty_tuple, /*PyObject *freevars,*/ + empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ + empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ + PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ @@ -6164,128 +2522,8 @@ bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); + Py_XDECREF(empty_tuple); + Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} - -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff -Nru bzr-2.5.0/bzrlib/branch.py bzr-2.6.0~beta1/bzrlib/branch.py --- bzr-2.5.0/bzrlib/branch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/branch.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2011 Canonical Ltd +# Copyright (C) 2005-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -766,24 +766,6 @@ """Print `file` to stdout.""" raise NotImplementedError(self.print_file) - @deprecated_method(deprecated_in((2, 4, 0))) - def set_revision_history(self, rev_history): - """See Branch.set_revision_history.""" - self._set_revision_history(rev_history) - - @needs_write_lock - def _set_revision_history(self, rev_history): - if len(rev_history) == 0: - revid = _mod_revision.NULL_REVISION - else: - revid = rev_history[-1] - if rev_history != self._lefthand_history(revid): - raise errors.NotLefthandHistory(rev_history) - self.set_last_revision_info(len(rev_history), revid) - self._cache_revision_history(rev_history) - for hook in Branch.hooks['set_rh']: - hook(self, rev_history) - @needs_write_lock def set_last_revision_info(self, revno, revision_id): """Set the last revision of this branch. @@ -1013,16 +995,6 @@ """ raise NotImplementedError(self._gen_revision_history) - @deprecated_method(deprecated_in((2, 5, 0))) - @needs_read_lock - def revision_history(self): - """Return sequence of revision ids on this branch. - - This method will cache the revision history for as long as it is safe to - do so. - """ - return self._revision_history() - def _revision_history(self): if 'evil' in debug.debug_flags: mutter_callsite(3, "revision_history scales with history.") @@ -1617,22 +1589,6 @@ def __ne__(self, other): return not (self == other) - @classmethod - @deprecated_method(deprecated_in((2, 4, 0))) - def get_default_format(klass): - """Return the current default format.""" - return format_registry.get_default() - - @classmethod - @deprecated_method(deprecated_in((2, 4, 0))) - def get_formats(klass): - """Get all the known formats. - - Warning: This triggers a load of all lazy registered formats: do not - use except when that is desireed. - """ - return format_registry._get_all() - def get_reference(self, controldir, name=None): """Get the target reference of the branch in controldir. @@ -1726,21 +1682,6 @@ """ raise NotImplementedError(self.open) - @classmethod - @deprecated_method(deprecated_in((2, 4, 0))) - def register_format(klass, format): - """Register a metadir format. - - See MetaDirBranchFormatFactory for the ability to register a format - without loading the code the format needs until it is actually used. - """ - format_registry.register(format) - - @classmethod - @deprecated_method(deprecated_in((2, 4, 0))) - def set_default_format(klass, format): - format_registry.set_default(format) - def supports_set_append_revisions_only(self): """True if this format supports set_append_revisions_only.""" return False @@ -1805,8 +1746,8 @@ class BranchHooks(Hooks): """A dictionary mapping hook name to a list of callables for branch hooks. - e.g. ['set_rh'] Is the list of items to be called when the - set_revision_history function is invoked. + e.g. ['post_push'] Is the list of items to be called when the + push function is invoked. """ def __init__(self): @@ -1816,12 +1757,6 @@ notified. """ Hooks.__init__(self, "bzrlib.branch", "Branch.hooks") - self.add_hook('set_rh', - "Invoked whenever the revision history has been set via " - "set_revision_history. The api signature is (branch, " - "revision_history), and the branch will be write-locked. " - "The set_rh hook can be expensive for bzr to trigger, a better " - "hook to use is Branch.post_change_branch_tip.", (0, 15)) self.add_hook('open', "Called with the Branch object that has been opened after a " "branch is opened.", (1, 8)) @@ -2045,7 +1980,7 @@ def _initialize_helper(self, a_bzrdir, utf8_files, name=None, repository=None): - """Initialize a branch in a bzrdir, with specified files + """Initialize a branch in a control dir, with specified files :param a_bzrdir: The bzrdir to initialize the branch in :param utf8_files: The files to create as a list of @@ -2481,6 +2416,7 @@ self.control_files = _control_files self._transport = _control_files._transport self.repository = _repository + self.conf_store = None Branch.__init__(self, possible_transports) def __str__(self): @@ -2502,7 +2438,9 @@ return _mod_config.TransportConfig(self._transport, 'branch.conf') def _get_config_store(self): - return _mod_config.BranchStore(self) + if self.conf_store is None: + self.conf_store = _mod_config.BranchStore(self) + return self.conf_store def is_locked(self): return self.control_files.is_locked() @@ -2557,6 +2495,8 @@ @only_raises(errors.LockNotHeld, errors.LockBroken) def unlock(self): + if self.conf_store is not None: + self.conf_store.save_changes() try: self.control_files.unlock() finally: @@ -2773,12 +2713,6 @@ else: return (0, _mod_revision.NULL_REVISION) - @deprecated_method(deprecated_in((2, 4, 0))) - @needs_write_lock - def set_revision_history(self, rev_history): - """See Branch.set_revision_history.""" - self._set_revision_history(rev_history) - def _set_revision_history(self, rev_history): if 'evil' in debug.debug_flags: mutter_callsite(3, "set_revision_history scales with history.") @@ -2797,8 +2731,6 @@ self._write_revision_history(rev_history) self._clear_cached_state() self._cache_revision_history(rev_history) - for hook in Branch.hooks['set_rh']: - hook(self, rev_history) if Branch.hooks['post_change_branch_tip']: self._run_post_change_branch_tip_hooks(old_revno, old_revid) @@ -3142,14 +3074,6 @@ :ivar tag_updates: A dict with new tags, see BasicTags.merge_to """ - @deprecated_method(deprecated_in((2, 3, 0))) - def __int__(self): - """Return the relative change in revno. - - :deprecated: Use `new_revno` and `old_revno` instead. - """ - return self.new_revno - self.old_revno - def report(self, to_file): tag_conflicts = getattr(self, "tag_conflicts", None) tag_updates = getattr(self, "tag_updates", None) @@ -3185,14 +3109,6 @@ target, otherwise it will be None. """ - @deprecated_method(deprecated_in((2, 3, 0))) - def __int__(self): - """Return the relative change in revno. - - :deprecated: Use `new_revno` and `old_revno` instead. - """ - return self.new_revno - self.old_revno - def report(self, to_file): # TODO: This function gets passed a to_file, but then # ignores it and calls note() instead. This is also @@ -3245,9 +3161,13 @@ # Copy source data into target new_branch._write_last_revision_info(*branch.last_revision_info()) - new_branch.set_parent(branch.get_parent()) - new_branch.set_bound_location(branch.get_bound_location()) - new_branch.set_push_location(branch.get_push_location()) + new_branch.lock_write() + try: + new_branch.set_parent(branch.get_parent()) + new_branch.set_bound_location(branch.get_bound_location()) + new_branch.set_push_location(branch.get_push_location()) + finally: + new_branch.unlock() # New branch has no tags by default new_branch.tags._set_tag_dict({}) @@ -3259,11 +3179,15 @@ # Clean up old files new_branch._transport.delete('revision-history') + branch.lock_write() try: - branch.set_parent(None) - except errors.NoSuchFile: - pass - branch.set_bound_location(None) + try: + branch.set_parent(None) + except errors.NoSuchFile: + pass + branch.set_bound_location(None) + finally: + branch.unlock() class Converter6to7(object): diff -Nru bzr-2.5.0/bzrlib/_btree_serializer_pyx.c bzr-2.6.0~beta1/bzrlib/_btree_serializer_pyx.c --- bzr-2.5.0/bzrlib/_btree_serializer_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_btree_serializer_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:41 2012 */ +/* Generated by Cython 0.13 on Thu May 26 17:26:28 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -126,20 +126,15 @@ #define PyBytes_Repr PyString_Repr #define PyBytes_Concat PyString_Concat #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif + #ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - #if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) @@ -156,7 +151,7 @@ #endif #if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject + #define PyBoolObject PyLongObject #endif @@ -168,25 +163,6 @@ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif @@ -225,11 +201,6 @@ #include "string.h" #include "_static_tuple_c.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - - /* inline attribute */ #ifndef CYTHON_INLINE #if defined(__GNUC__) @@ -239,7 +210,7 @@ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else - #define CYTHON_INLINE + #define CYTHON_INLINE #endif #endif @@ -247,14 +218,14 @@ #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) # else -# define CYTHON_UNUSED +# define CYTHON_UNUSED # endif #endif @@ -279,7 +250,7 @@ #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -308,7 +279,7 @@ /* Type declarations */ -/* "bzrlib/_btree_serializer_pyx.pyx":337 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":337 * # One slightly ugly option would be to cache block offsets in a global. * # However, that leads to thread-safety issues, etc. * ctypedef struct gc_chk_sha1_record: # <<<<<<<<<<<<<< @@ -324,7 +295,7 @@ char sha1[20]; } __pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record; -/* "bzrlib/_btree_serializer_pyx.pyx":123 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":123 * * * cdef class BTreeLeafParser: # <<<<<<<<<<<<<< @@ -345,7 +316,7 @@ int _header_found; }; -/* "bzrlib/_btree_serializer_pyx.pyx":518 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":518 * * * cdef class GCCHKSHA1LeafNode: # <<<<<<<<<<<<<< @@ -378,7 +349,7 @@ static struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *__pyx_vtabptr_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode; -/* "bzrlib/_btree_serializer_pyx.pyx":123 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":123 * * * cdef class BTreeLeafParser: # <<<<<<<<<<<<<< @@ -440,17 +411,12 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, PyObject* kw_name); /*proto*/ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ @@ -533,6 +499,11 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); @@ -598,7 +569,7 @@ static unsigned int __pyx_f_6bzrlib_21_btree_serializer_pyx__sha1_to_uint(char *); /*proto*/ static PyObject *__pyx_f_6bzrlib_21_btree_serializer_pyx__format_record(__pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *); /*proto*/ #define __Pyx_MODULE_NAME "bzrlib._btree_serializer_pyx" -static int __pyx_module_is_main_bzrlib___btree_serializer_pyx = 0; +int __pyx_module_is_main_bzrlib___btree_serializer_pyx = 0; /* Implementation of bzrlib._btree_serializer_pyx */ static PyObject *__pyx_builtin_AssertionError; @@ -609,40 +580,45 @@ static char __pyx_k_2[] = "invalid key, wanted segment from "; static char __pyx_k_3[] = "sha1:"; static char __pyx_k_4[] = "last < self._start"; -static char __pyx_k_6[] = "type=leaf"; -static char __pyx_k_7[] = "Node did not start with \"type=leaf\": %r"; -static char __pyx_k_8[] = "Failed to find the value area"; -static char __pyx_k_10[] = " 0 0"; -static char __pyx_k_12[] = "invalid key, loop_counter != self.ref_list_length"; -static char __pyx_k_14[] = "unexpected reference data present"; -static char __pyx_k_16[] = "self.bytes is not a string."; -static char __pyx_k_18[] = "not a 40-byte hex digest"; -static char __pyx_k_20[] = "not a 20-byte binary digest"; -static char __pyx_k_22[] = "sha1_bin must be a str of exactly 20 bytes"; -static char __pyx_k_24[] = "%s %u %u %u"; -static char __pyx_k_25[] = "%lu %u %u %u"; -static char __pyx_k_26[] = "_record_to_value_and_refs"; -static char __pyx_k_27[] = "key %r is not present"; -static char __pyx_k_28[] = "We only support parsing plain 8-bit strings."; -static char __pyx_k_30[] = "type=leaf\n"; -static char __pyx_k_31[] = "bytes did not start with 'type=leaf\\n': %r"; -static char __pyx_k_32[] = "Something went wrong while parsing."; -static char __pyx_k_34[] = "line did not start with sha1: %r"; -static char __pyx_k_35[] = "Line did not contain 40 hex bytes"; -static char __pyx_k_37[] = "We failed to unhexlify"; -static char __pyx_k_39[] = "only 1 null, not 2 as expected"; -static char __pyx_k_41[] = "Failed to parse block offset"; -static char __pyx_k_43[] = "Failed to parse block length"; -static char __pyx_k_46[] = "Failed to parse record end"; -static char __pyx_k_48[] = "We expected a tuple() or StaticTuple() for node not: %s"; -static char __pyx_k_49[] = "With ref_lists, we expected 4 entries not: %s"; -static char __pyx_k_50[] = "Without ref_lists, we need at least 3 entries not: %s"; -static char __pyx_k_51[] = "\000"; -static char __pyx_k_52[] = "We expect references to be tuples not: %s"; -static char __pyx_k_53[] = "We expect reference bits to be strings not: %s"; -static char __pyx_k_54[] = "Expected a plain str for value not: %s"; -static char __pyx_k_55[] = "Pyrex extensions to btree node parsing."; -static char __pyx_k_56[] = "bzrlib._btree_serializer_pyx"; +static char __pyx_k_5[] = "type=leaf"; +static char __pyx_k_6[] = "Node did not start with \"type=leaf\": %r"; +static char __pyx_k_7[] = "Failed to find the value area"; +static char __pyx_k_8[] = " 0 0"; +static char __pyx_k_9[] = "invalid key, loop_counter != self.ref_list_length"; +static char __pyx_k_10[] = "unexpected reference data present"; +static char __pyx_k_11[] = "self.bytes is not a string."; +static char __pyx_k_12[] = "not a 40-byte hex digest"; +static char __pyx_k_13[] = "not a 20-byte binary digest"; +static char __pyx_k_14[] = "sha1_bin must be a str of exactly 20 bytes"; +static char __pyx_k_15[] = "%s %u %u %u"; +static char __pyx_k_16[] = "%lu %u %u %u"; +static char __pyx_k_17[] = "_record_to_value_and_refs"; +static char __pyx_k_18[] = "key %r is not present"; +static char __pyx_k_19[] = "We only support parsing plain 8-bit strings."; +static char __pyx_k_20[] = "type=leaf\n"; +static char __pyx_k_21[] = "bytes did not start with 'type=leaf\\n': %r"; +static char __pyx_k_22[] = "Something went wrong while parsing."; +static char __pyx_k_23[] = "line did not start with sha1: %r"; +static char __pyx_k_24[] = "Line did not contain 40 hex bytes"; +static char __pyx_k_25[] = "We failed to unhexlify"; +static char __pyx_k_26[] = "only 1 null, not 2 as expected"; +static char __pyx_k_27[] = "Failed to parse block offset"; +static char __pyx_k_28[] = "Failed to parse block length"; +static char __pyx_k_29[] = "Failed to parse record end"; +static char __pyx_k_30[] = "We expected a tuple() or StaticTuple() for node not: %s"; +static char __pyx_k_31[] = "With ref_lists, we expected 4 entries not: %s"; +static char __pyx_k_32[] = "Without ref_lists, we need at least 3 entries not: %s"; +static char __pyx_k_33[] = "\000"; +static char __pyx_k_34[] = "We expect references to be tuples not: %s"; +static char __pyx_k_35[] = "We expect reference bits to be strings not: %s"; +static char __pyx_k_36[] = "Expected a plain str for value not: %s"; +static char __pyx_k_37[] = "Pyrex extensions to btree node parsing."; +static char __pyx_k_38[] = "_py_unhexlify (line 386)"; +static char __pyx_k_39[] = "_py_hexlify (line 409)"; +static char __pyx_k_40[] = "_py_key_to_sha1 (line 446)"; +static char __pyx_k_41[] = "_py_sha1_to_key (line 482)"; +static char __pyx_k_42[] = "_parse_into_chk (line 838)"; +static char __pyx_k_43[] = "_flatten_node (line 845)"; static char __pyx_k__sys[] = "sys"; static char __pyx_k__join[] = "join"; static char __pyx_k__keys[] = "keys"; @@ -689,38 +665,42 @@ static char __pyx_k__0123456789abcdef[] = "0123456789abcdef"; static char __pyx_k___offset_for_sha1[] = "_offset_for_sha1"; static char __pyx_k___parse_one_entry[] = "_parse_one_entry"; -static char __pyx_k___parse_leaf_lines[] = "_parse_leaf_lines"; static PyObject *__pyx_kp_s_1; +static PyObject *__pyx_kp_s_10; +static PyObject *__pyx_kp_s_11; static PyObject *__pyx_kp_s_12; +static PyObject *__pyx_kp_s_13; static PyObject *__pyx_kp_s_14; -static PyObject *__pyx_kp_s_16; +static PyObject *__pyx_n_s_17; static PyObject *__pyx_kp_s_18; +static PyObject *__pyx_kp_s_19; static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_kp_s_20; +static PyObject *__pyx_kp_s_21; static PyObject *__pyx_kp_s_22; -static PyObject *__pyx_n_s_26; +static PyObject *__pyx_kp_s_23; +static PyObject *__pyx_kp_s_24; +static PyObject *__pyx_kp_s_25; +static PyObject *__pyx_kp_s_26; static PyObject *__pyx_kp_s_27; static PyObject *__pyx_kp_s_28; +static PyObject *__pyx_kp_s_29; +static PyObject *__pyx_kp_s_30; static PyObject *__pyx_kp_s_31; static PyObject *__pyx_kp_s_32; +static PyObject *__pyx_kp_s_33; static PyObject *__pyx_kp_s_34; static PyObject *__pyx_kp_s_35; -static PyObject *__pyx_kp_s_37; -static PyObject *__pyx_kp_s_39; +static PyObject *__pyx_kp_s_36; +static PyObject *__pyx_kp_u_38; +static PyObject *__pyx_kp_u_39; static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_41; -static PyObject *__pyx_kp_s_43; -static PyObject *__pyx_kp_s_46; -static PyObject *__pyx_kp_s_48; -static PyObject *__pyx_kp_s_49; -static PyObject *__pyx_kp_s_50; -static PyObject *__pyx_kp_s_51; -static PyObject *__pyx_kp_s_52; -static PyObject *__pyx_kp_s_53; -static PyObject *__pyx_kp_s_54; -static PyObject *__pyx_n_s_56; +static PyObject *__pyx_kp_u_40; +static PyObject *__pyx_kp_u_41; +static PyObject *__pyx_kp_u_42; +static PyObject *__pyx_kp_u_43; +static PyObject *__pyx_kp_s_6; static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_kp_s_8; +static PyObject *__pyx_kp_s_9; static PyObject *__pyx_n_s__AssertionError; static PyObject *__pyx_n_s__KeyError; static PyObject *__pyx_n_s__TypeError; @@ -737,7 +717,6 @@ static PyObject *__pyx_n_s___offset_for_sha1; static PyObject *__pyx_n_s___parse_bytes; static PyObject *__pyx_n_s___parse_into_chk; -static PyObject *__pyx_n_s___parse_leaf_lines; static PyObject *__pyx_n_s___parse_one_entry; static PyObject *__pyx_n_s___py_hexlify; static PyObject *__pyx_n_s___py_key_to_sha1; @@ -769,28 +748,8 @@ static PyObject *__pyx_n_s__sys; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; -static PyObject *__pyx_int_2147483648; -static PyObject *__pyx_int_4294967295; -static PyObject *__pyx_k_tuple_5; -static PyObject *__pyx_k_tuple_9; -static PyObject *__pyx_k_tuple_11; -static PyObject *__pyx_k_tuple_13; -static PyObject *__pyx_k_tuple_15; -static PyObject *__pyx_k_tuple_17; -static PyObject *__pyx_k_tuple_19; -static PyObject *__pyx_k_tuple_21; -static PyObject *__pyx_k_tuple_23; -static PyObject *__pyx_k_tuple_29; -static PyObject *__pyx_k_tuple_33; -static PyObject *__pyx_k_tuple_36; -static PyObject *__pyx_k_tuple_38; -static PyObject *__pyx_k_tuple_40; -static PyObject *__pyx_k_tuple_42; -static PyObject *__pyx_k_tuple_44; -static PyObject *__pyx_k_tuple_45; -static PyObject *__pyx_k_tuple_47; -/* "bzrlib/_btree_serializer_pyx.pyx":81 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":81 * * # TODO: Find some way to import this from _dirstate_helpers * cdef void* _my_memrchr(void *s, int c, size_t n): # cannot_raise # <<<<<<<<<<<<<< @@ -805,7 +764,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("_my_memrchr"); - /* "bzrlib/_btree_serializer_pyx.pyx":87 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":87 * cdef char *start * * start = s # <<<<<<<<<<<<<< @@ -814,7 +773,7 @@ */ __pyx_v_start = ((char *)__pyx_v_s); - /* "bzrlib/_btree_serializer_pyx.pyx":88 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":88 * * start = s * pos = start + n - 1 # <<<<<<<<<<<<<< @@ -823,7 +782,7 @@ */ __pyx_v_pos = ((__pyx_v_start + __pyx_v_n) - 1); - /* "bzrlib/_btree_serializer_pyx.pyx":89 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":89 * start = s * pos = start + n - 1 * while pos >= start: # <<<<<<<<<<<<<< @@ -834,7 +793,7 @@ __pyx_t_1 = (__pyx_v_pos >= __pyx_v_start); if (!__pyx_t_1) break; - /* "bzrlib/_btree_serializer_pyx.pyx":90 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":90 * pos = start + n - 1 * while pos >= start: * if pos[0] == c: # <<<<<<<<<<<<<< @@ -844,7 +803,7 @@ __pyx_t_1 = ((__pyx_v_pos[0]) == __pyx_v_c); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":91 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":91 * while pos >= start: * if pos[0] == c: * return pos # <<<<<<<<<<<<<< @@ -857,7 +816,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":92 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":92 * if pos[0] == c: * return pos * pos = pos - 1 # <<<<<<<<<<<<<< @@ -867,7 +826,7 @@ __pyx_v_pos = (__pyx_v_pos - 1); } - /* "bzrlib/_btree_serializer_pyx.pyx":93 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":93 * return pos * pos = pos - 1 * return NULL # <<<<<<<<<<<<<< @@ -883,7 +842,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":97 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":97 * * # TODO: Import this from _dirstate_helpers when it is merged * cdef object safe_string_from_size(char *s, Py_ssize_t size): # <<<<<<<<<<<<<< @@ -899,7 +858,7 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("safe_string_from_size"); - /* "bzrlib/_btree_serializer_pyx.pyx":98 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":98 * # TODO: Import this from _dirstate_helpers when it is merged * cdef object safe_string_from_size(char *s, Py_ssize_t size): * if size < 0: # <<<<<<<<<<<<<< @@ -909,7 +868,7 @@ __pyx_t_1 = (__pyx_v_size < 0); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":101 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":101 * raise AssertionError( * 'tried to create a string with an invalid size: %d @0x%x' * % (size, s)) # <<<<<<<<<<<<<< @@ -921,24 +880,24 @@ __pyx_t_3 = PyInt_FromLong(((int)__pyx_v_s)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -946,7 +905,7 @@ } __pyx_L3:; - /* "bzrlib/_btree_serializer_pyx.pyx":102 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":102 * 'tried to create a string with an invalid size: %d @0x%x' * % (size, s)) * return PyString_FromStringAndSize(s, size) # <<<<<<<<<<<<<< @@ -974,7 +933,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":105 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":105 * * * cdef object safe_interned_string_from_size(char *s, Py_ssize_t size): # <<<<<<<<<<<<<< @@ -993,7 +952,7 @@ __Pyx_RefNannySetupContext("safe_interned_string_from_size"); __pyx_v_result = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":107 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":107 * cdef object safe_interned_string_from_size(char *s, Py_ssize_t size): * cdef PyObject *py_str * if size < 0: # <<<<<<<<<<<<<< @@ -1003,7 +962,7 @@ __pyx_t_1 = (__pyx_v_size < 0); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":110 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":110 * raise AssertionError( * 'tried to create a string with an invalid size: %d @0x%x' * % (size, s)) # <<<<<<<<<<<<<< @@ -1015,24 +974,24 @@ __pyx_t_3 = PyInt_FromLong(((int)__pyx_v_s)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1040,7 +999,7 @@ } __pyx_L3:; - /* "bzrlib/_btree_serializer_pyx.pyx":111 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":111 * 'tried to create a string with an invalid size: %d @0x%x' * % (size, s)) * py_str = PyString_FromStringAndSize_ptr(s, size) # <<<<<<<<<<<<<< @@ -1049,7 +1008,7 @@ */ __pyx_v_py_str = PyString_FromStringAndSize(__pyx_v_s, __pyx_v_size); - /* "bzrlib/_btree_serializer_pyx.pyx":112 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":112 * % (size, s)) * py_str = PyString_FromStringAndSize_ptr(s, size) * PyString_InternInPlace(&py_str) # <<<<<<<<<<<<<< @@ -1058,7 +1017,7 @@ */ PyString_InternInPlace((&__pyx_v_py_str)); - /* "bzrlib/_btree_serializer_pyx.pyx":113 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":113 * py_str = PyString_FromStringAndSize_ptr(s, size) * PyString_InternInPlace(&py_str) * result = py_str # <<<<<<<<<<<<<< @@ -1069,7 +1028,7 @@ __Pyx_DECREF(__pyx_v_result); __pyx_v_result = ((PyObject *)__pyx_v_py_str); - /* "bzrlib/_btree_serializer_pyx.pyx":116 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":116 * # Casting a PyObject* to an triggers an INCREF from Pyrex, so we * # DECREF it to avoid geting immortal strings * Py_DECREF_ptr(py_str) # <<<<<<<<<<<<<< @@ -1078,7 +1037,7 @@ */ Py_DECREF(__pyx_v_py_str); - /* "bzrlib/_btree_serializer_pyx.pyx":117 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":117 * # DECREF it to avoid geting immortal strings * Py_DECREF_ptr(py_str) * return result # <<<<<<<<<<<<<< @@ -1105,7 +1064,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":153 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":153 * cdef int _header_found * * def __init__(self, bytes, key_length, ref_list_length): # <<<<<<<<<<<<<< @@ -1173,7 +1132,7 @@ return -1; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_btree_serializer_pyx.pyx":154 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":154 * * def __init__(self, bytes, key_length, ref_list_length): * self.bytes = bytes # <<<<<<<<<<<<<< @@ -1186,7 +1145,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->bytes); ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->bytes = __pyx_v_bytes; - /* "bzrlib/_btree_serializer_pyx.pyx":155 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":155 * def __init__(self, bytes, key_length, ref_list_length): * self.bytes = bytes * self.key_length = key_length # <<<<<<<<<<<<<< @@ -1196,7 +1155,7 @@ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_key_length); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->key_length = __pyx_t_1; - /* "bzrlib/_btree_serializer_pyx.pyx":156 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":156 * self.bytes = bytes * self.key_length = key_length * self.ref_list_length = ref_list_length # <<<<<<<<<<<<<< @@ -1206,7 +1165,7 @@ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ref_list_length); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->ref_list_length = __pyx_t_1; - /* "bzrlib/_btree_serializer_pyx.pyx":157 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":157 * self.key_length = key_length * self.ref_list_length = ref_list_length * self.keys = [] # <<<<<<<<<<<<<< @@ -1221,7 +1180,7 @@ ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->keys = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":158 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":158 * self.ref_list_length = ref_list_length * self.keys = [] * self._cur_str = NULL # <<<<<<<<<<<<<< @@ -1230,7 +1189,7 @@ */ ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->_cur_str = NULL; - /* "bzrlib/_btree_serializer_pyx.pyx":159 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":159 * self.keys = [] * self._cur_str = NULL * self._end_str = NULL # <<<<<<<<<<<<<< @@ -1239,7 +1198,7 @@ */ ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->_end_str = NULL; - /* "bzrlib/_btree_serializer_pyx.pyx":160 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":160 * self._cur_str = NULL * self._end_str = NULL * self._header_found = 0 # <<<<<<<<<<<<<< @@ -1259,7 +1218,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":163 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":163 * # keys are tuples * * cdef extract_key(self, char * last): # <<<<<<<<<<<<<< @@ -1286,7 +1245,7 @@ __pyx_v_failure_string = Py_None; __Pyx_INCREF(Py_None); __pyx_v_key_element = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":173 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":173 * cdef StaticTuple key * * key = StaticTuple_New(self.key_length) # <<<<<<<<<<<<<< @@ -1299,7 +1258,7 @@ __pyx_v_key = ((StaticTuple *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":174 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":174 * * key = StaticTuple_New(self.key_length) * for loop_counter from 0 <= loop_counter < self.key_length: # <<<<<<<<<<<<<< @@ -1309,7 +1268,7 @@ __pyx_t_2 = __pyx_v_self->key_length; for (__pyx_v_loop_counter = 0; __pyx_v_loop_counter < __pyx_t_2; __pyx_v_loop_counter++) { - /* "bzrlib/_btree_serializer_pyx.pyx":176 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":176 * for loop_counter from 0 <= loop_counter < self.key_length: * # grab a key segment * temp_ptr = memchr(self._start, c'\0', last - self._start) # <<<<<<<<<<<<<< @@ -1318,7 +1277,7 @@ */ __pyx_v_temp_ptr = ((char *)memchr(__pyx_v_self->_start, '\x00', (__pyx_v_last - __pyx_v_self->_start))); - /* "bzrlib/_btree_serializer_pyx.pyx":177 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":177 * # grab a key segment * temp_ptr = memchr(self._start, c'\0', last - self._start) * if temp_ptr == NULL: # <<<<<<<<<<<<<< @@ -1328,7 +1287,7 @@ __pyx_t_3 = (__pyx_v_temp_ptr == NULL); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":178 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":178 * temp_ptr = memchr(self._start, c'\0', last - self._start) * if temp_ptr == NULL: * if loop_counter + 1 == self.key_length: # <<<<<<<<<<<<<< @@ -1338,7 +1297,7 @@ __pyx_t_3 = ((__pyx_v_loop_counter + 1) == __pyx_v_self->key_length); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":180 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":180 * if loop_counter + 1 == self.key_length: * # capture to last * temp_ptr = last # <<<<<<<<<<<<<< @@ -1350,7 +1309,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":185 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":185 * failure_string = ("invalid key, wanted segment from " + * repr(safe_string_from_size(self._start, * last - self._start))) # <<<<<<<<<<<<<< @@ -1369,7 +1328,7 @@ __pyx_v_failure_string = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":186 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":186 * repr(safe_string_from_size(self._start, * last - self._start))) * raise AssertionError(failure_string) # <<<<<<<<<<<<<< @@ -1377,13 +1336,13 @@ * if (self.key_length == 1 */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_failure_string); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_failure_string); __Pyx_GIVEREF(__pyx_v_failure_string); - __pyx_t_4 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1393,7 +1352,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":188 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":188 * raise AssertionError(failure_string) * # capture the key string * if (self.key_length == 1 # <<<<<<<<<<<<<< @@ -1403,7 +1362,7 @@ __pyx_t_3 = (__pyx_v_self->key_length == 1); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":189 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":189 * # capture the key string * if (self.key_length == 1 * and (temp_ptr - self._start) == 45 # <<<<<<<<<<<<<< @@ -1413,7 +1372,7 @@ __pyx_t_5 = ((__pyx_v_temp_ptr - __pyx_v_self->_start) == 45); if (__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":190 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":190 * if (self.key_length == 1 * and (temp_ptr - self._start) == 45 * and strncmp(self._start, 'sha1:', 5) == 0): # <<<<<<<<<<<<<< @@ -1431,7 +1390,7 @@ } if (__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":192 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":192 * and strncmp(self._start, 'sha1:', 5) == 0): * key_element = safe_string_from_size(self._start, * temp_ptr - self._start) # <<<<<<<<<<<<<< @@ -1447,7 +1406,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":195 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":195 * else: * key_element = safe_interned_string_from_size(self._start, * temp_ptr - self._start) # <<<<<<<<<<<<<< @@ -1462,7 +1421,7 @@ } __pyx_L7:; - /* "bzrlib/_btree_serializer_pyx.pyx":197 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":197 * temp_ptr - self._start) * # advance our pointer * self._start = temp_ptr + 1 # <<<<<<<<<<<<<< @@ -1471,7 +1430,7 @@ */ __pyx_v_self->_start = (__pyx_v_temp_ptr + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":198 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":198 * # advance our pointer * self._start = temp_ptr + 1 * Py_INCREF(key_element) # <<<<<<<<<<<<<< @@ -1480,7 +1439,7 @@ */ Py_INCREF(__pyx_v_key_element); - /* "bzrlib/_btree_serializer_pyx.pyx":199 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":199 * self._start = temp_ptr + 1 * Py_INCREF(key_element) * StaticTuple_SET_ITEM(key, loop_counter, key_element) # <<<<<<<<<<<<<< @@ -1490,7 +1449,7 @@ StaticTuple_SET_ITEM(__pyx_v_key, __pyx_v_loop_counter, __pyx_v_key_element); } - /* "bzrlib/_btree_serializer_pyx.pyx":200 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":200 * Py_INCREF(key_element) * StaticTuple_SET_ITEM(key, loop_counter, key_element) * key = StaticTuple_Intern(key) # <<<<<<<<<<<<<< @@ -1503,7 +1462,7 @@ __pyx_v_key = ((StaticTuple *)__pyx_t_4); __pyx_t_4 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":201 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":201 * StaticTuple_SET_ITEM(key, loop_counter, key_element) * key = StaticTuple_Intern(key) * return key # <<<<<<<<<<<<<< @@ -1531,7 +1490,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":203 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":203 * return key * * cdef int process_line(self) except -1: # <<<<<<<<<<<<<< @@ -1558,7 +1517,6 @@ int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("process_line"); __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); __pyx_v_value = Py_None; __Pyx_INCREF(Py_None); @@ -1566,7 +1524,7 @@ __pyx_v_ref_list = Py_None; __Pyx_INCREF(Py_None); __pyx_v_node_value = ((StaticTuple *)Py_None); __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":212 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":212 * cdef Py_ssize_t str_len * * self._start = self._cur_str # <<<<<<<<<<<<<< @@ -1575,7 +1533,7 @@ */ __pyx_v_self->_start = __pyx_v_self->_cur_str; - /* "bzrlib/_btree_serializer_pyx.pyx":214 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":214 * self._start = self._cur_str * # Find the next newline * last = memchr(self._start, c'\n', self._end_str - self._start) # <<<<<<<<<<<<<< @@ -1584,7 +1542,7 @@ */ __pyx_v_last = ((char *)memchr(__pyx_v_self->_start, '\n', (__pyx_v_self->_end_str - __pyx_v_self->_start))); - /* "bzrlib/_btree_serializer_pyx.pyx":215 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":215 * # Find the next newline * last = memchr(self._start, c'\n', self._end_str - self._start) * if last == NULL: # <<<<<<<<<<<<<< @@ -1594,7 +1552,7 @@ __pyx_t_1 = (__pyx_v_last == NULL); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":217 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":217 * if last == NULL: * # Process until the end of the file * last = self._end_str # <<<<<<<<<<<<<< @@ -1603,7 +1561,7 @@ */ __pyx_v_last = __pyx_v_self->_end_str; - /* "bzrlib/_btree_serializer_pyx.pyx":218 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":218 * # Process until the end of the file * last = self._end_str * self._cur_str = self._end_str # <<<<<<<<<<<<<< @@ -1615,7 +1573,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":221 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":221 * else: * # And the next string is right after it * self._cur_str = last + 1 # <<<<<<<<<<<<<< @@ -1626,7 +1584,7 @@ } __pyx_L3:; - /* "bzrlib/_btree_serializer_pyx.pyx":224 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":224 * # The last character is right before the '\n' * * if last == self._start: # <<<<<<<<<<<<<< @@ -1636,7 +1594,7 @@ __pyx_t_1 = (__pyx_v_last == __pyx_v_self->_start); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":226 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":226 * if last == self._start: * # parsed it all. * return 0 # <<<<<<<<<<<<<< @@ -1649,7 +1607,7 @@ } __pyx_L4:; - /* "bzrlib/_btree_serializer_pyx.pyx":227 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":227 * # parsed it all. * return 0 * if last < self._start: # <<<<<<<<<<<<<< @@ -1659,23 +1617,29 @@ __pyx_t_1 = (__pyx_v_last < __pyx_v_self->_start); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":229 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":229 * if last < self._start: * # Unexpected error condition - fail * raise AssertionError("last < self._start") # <<<<<<<<<<<<<< * if 0 == self._header_found: * # The first line in a leaf node is the header "type=leaf\n" */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":230 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":230 * # Unexpected error condition - fail * raise AssertionError("last < self._start") * if 0 == self._header_found: # <<<<<<<<<<<<<< @@ -1685,17 +1649,17 @@ __pyx_t_1 = (0 == __pyx_v_self->_header_found); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":232 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":232 * if 0 == self._header_found: * # The first line in a leaf node is the header "type=leaf\n" * if strncmp("type=leaf", self._start, last - self._start) == 0: # <<<<<<<<<<<<<< * self._header_found = 1 * return 0 */ - __pyx_t_1 = (strncmp(__pyx_k_6, __pyx_v_self->_start, (__pyx_v_last - __pyx_v_self->_start)) == 0); + __pyx_t_1 = (strncmp(__pyx_k_5, __pyx_v_self->_start, (__pyx_v_last - __pyx_v_self->_start)) == 0); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":233 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":233 * # The first line in a leaf node is the header "type=leaf\n" * if strncmp("type=leaf", self._start, last - self._start) == 0: * self._header_found = 1 # <<<<<<<<<<<<<< @@ -1704,7 +1668,7 @@ */ __pyx_v_self->_header_found = 1; - /* "bzrlib/_btree_serializer_pyx.pyx":234 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":234 * if strncmp("type=leaf", self._start, last - self._start) == 0: * self._header_found = 1 * return 0 # <<<<<<<<<<<<<< @@ -1717,28 +1681,28 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":237 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":237 * else: * raise AssertionError('Node did not start with "type=leaf": %r' * % (safe_string_from_size(self._start, last - self._start))) # <<<<<<<<<<<<<< * * key = self.extract_key(last) */ - __pyx_t_2 = __pyx_f_6bzrlib_21_btree_serializer_pyx_safe_string_from_size(__pyx_v_self->_start, (__pyx_v_last - __pyx_v_self->_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_6bzrlib_21_btree_serializer_pyx_safe_string_from_size(__pyx_v_self->_start, (__pyx_v_last - __pyx_v_self->_start)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L7:; @@ -1746,20 +1710,20 @@ } __pyx_L6:; - /* "bzrlib/_btree_serializer_pyx.pyx":239 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":239 * % (safe_string_from_size(self._start, last - self._start))) * * key = self.extract_key(last) # <<<<<<<<<<<<<< * # find the value area * temp_ptr = _my_memrchr(self._start, c'\0', last - self._start) */ - __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self->__pyx_vtab)->extract_key(__pyx_v_self, __pyx_v_last); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self->__pyx_vtab)->extract_key(__pyx_v_self, __pyx_v_last); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_key = __pyx_t_2; + __pyx_t_2 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":241 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":241 * key = self.extract_key(last) * # find the value area * temp_ptr = _my_memrchr(self._start, c'\0', last - self._start) # <<<<<<<<<<<<<< @@ -1768,7 +1732,7 @@ */ __pyx_v_temp_ptr = ((char *)__pyx_f_6bzrlib_21_btree_serializer_pyx__my_memrchr(__pyx_v_self->_start, '\x00', (__pyx_v_last - __pyx_v_self->_start))); - /* "bzrlib/_btree_serializer_pyx.pyx":242 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":242 * # find the value area * temp_ptr = _my_memrchr(self._start, c'\0', last - self._start) * if temp_ptr == NULL: # <<<<<<<<<<<<<< @@ -1778,15 +1742,21 @@ __pyx_t_1 = (__pyx_v_temp_ptr == NULL); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":244 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":244 * if temp_ptr == NULL: * # Invalid line * raise AssertionError("Failed to find the value area") # <<<<<<<<<<<<<< * else: * # Because of how conversions were done, we ended up with *lots* of */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_7)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1794,7 +1764,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":252 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":252 * # something like '12607215 328306 0 0', which ends up consuming 1MB * # of memory, just for those strings. * str_len = last - temp_ptr - 1 # <<<<<<<<<<<<<< @@ -1803,7 +1773,7 @@ */ __pyx_v_str_len = ((__pyx_v_last - __pyx_v_temp_ptr) - 1); - /* "bzrlib/_btree_serializer_pyx.pyx":253 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":253 * # of memory, just for those strings. * str_len = last - temp_ptr - 1 * if (str_len > 4 # <<<<<<<<<<<<<< @@ -1813,21 +1783,21 @@ __pyx_t_1 = (__pyx_v_str_len > 4); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":254 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":254 * str_len = last - temp_ptr - 1 * if (str_len > 4 * and strncmp(" 0 0", last - 4, 4) == 0): # <<<<<<<<<<<<<< * # This drops peak mem for bzr.dev from 87.4MB => 86.2MB * # For Launchpad 236MB => 232MB */ - __pyx_t_4 = (strncmp(__pyx_k_10, (__pyx_v_last - 4), 4) == 0); + __pyx_t_4 = (strncmp(__pyx_k_8, (__pyx_v_last - 4), 4) == 0); __pyx_t_5 = __pyx_t_4; } else { __pyx_t_5 = __pyx_t_1; } if (__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":257 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":257 * # This drops peak mem for bzr.dev from 87.4MB => 86.2MB * # For Launchpad 236MB => 232MB * value = safe_interned_string_from_size(temp_ptr + 1, str_len) # <<<<<<<<<<<<<< @@ -1843,7 +1813,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":259 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":259 * value = safe_interned_string_from_size(temp_ptr + 1, str_len) * else: * value = safe_string_from_size(temp_ptr + 1, str_len) # <<<<<<<<<<<<<< @@ -1858,7 +1828,7 @@ } __pyx_L9:; - /* "bzrlib/_btree_serializer_pyx.pyx":261 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":261 * value = safe_string_from_size(temp_ptr + 1, str_len) * # shrink the references end point * last = temp_ptr # <<<<<<<<<<<<<< @@ -1869,7 +1839,7 @@ } __pyx_L8:; - /* "bzrlib/_btree_serializer_pyx.pyx":263 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":263 * last = temp_ptr * * if self.ref_list_length: # <<<<<<<<<<<<<< @@ -1878,7 +1848,7 @@ */ if (__pyx_v_self->ref_list_length) { - /* "bzrlib/_btree_serializer_pyx.pyx":264 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":264 * * if self.ref_list_length: * ref_lists = StaticTuple_New(self.ref_list_length) # <<<<<<<<<<<<<< @@ -1891,7 +1861,7 @@ __pyx_v_ref_lists = ((StaticTuple *)__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":265 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":265 * if self.ref_list_length: * ref_lists = StaticTuple_New(self.ref_list_length) * loop_counter = 0 # <<<<<<<<<<<<<< @@ -1900,7 +1870,7 @@ */ __pyx_v_loop_counter = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":266 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":266 * ref_lists = StaticTuple_New(self.ref_list_length) * loop_counter = 0 * while loop_counter < self.ref_list_length: # <<<<<<<<<<<<<< @@ -1911,7 +1881,7 @@ __pyx_t_5 = (__pyx_v_loop_counter < __pyx_v_self->ref_list_length); if (!__pyx_t_5) break; - /* "bzrlib/_btree_serializer_pyx.pyx":267 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":267 * loop_counter = 0 * while loop_counter < self.ref_list_length: * ref_list = [] # <<<<<<<<<<<<<< @@ -1924,7 +1894,7 @@ __pyx_v_ref_list = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":269 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":269 * ref_list = [] * # extract a reference list * loop_counter = loop_counter + 1 # <<<<<<<<<<<<<< @@ -1933,7 +1903,7 @@ */ __pyx_v_loop_counter = (__pyx_v_loop_counter + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":270 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":270 * # extract a reference list * loop_counter = loop_counter + 1 * if last < self._start: # <<<<<<<<<<<<<< @@ -1943,23 +1913,29 @@ __pyx_t_5 = (__pyx_v_last < __pyx_v_self->_start); if (__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":271 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":271 * loop_counter = loop_counter + 1 * if last < self._start: * raise AssertionError("last < self._start") # <<<<<<<<<<<<<< * # find the next reference list end point: * temp_ptr = memchr(self._start, c'\t', last - self._start) */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "bzrlib/_btree_serializer_pyx.pyx":273 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":273 * raise AssertionError("last < self._start") * # find the next reference list end point: * temp_ptr = memchr(self._start, c'\t', last - self._start) # <<<<<<<<<<<<<< @@ -1968,7 +1944,7 @@ */ __pyx_v_temp_ptr = ((char *)memchr(__pyx_v_self->_start, '\t', (__pyx_v_last - __pyx_v_self->_start))); - /* "bzrlib/_btree_serializer_pyx.pyx":274 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":274 * # find the next reference list end point: * temp_ptr = memchr(self._start, c'\t', last - self._start) * if temp_ptr == NULL: # <<<<<<<<<<<<<< @@ -1978,7 +1954,7 @@ __pyx_t_5 = (__pyx_v_temp_ptr == NULL); if (__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":276 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":276 * if temp_ptr == NULL: * # Only valid for the last list * if loop_counter != self.ref_list_length: # <<<<<<<<<<<<<< @@ -1988,15 +1964,21 @@ __pyx_t_5 = (__pyx_v_loop_counter != __pyx_v_self->ref_list_length); if (__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":278 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":278 * if loop_counter != self.ref_list_length: * # Invalid line * raise AssertionError( # <<<<<<<<<<<<<< * "invalid key, loop_counter != self.ref_list_length") * else: */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2004,7 +1986,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":282 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":282 * else: * # scan to the end of the ref list area * ref_ptr = last # <<<<<<<<<<<<<< @@ -2013,7 +1995,7 @@ */ __pyx_v_ref_ptr = __pyx_v_last; - /* "bzrlib/_btree_serializer_pyx.pyx":283 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":283 * # scan to the end of the ref list area * ref_ptr = last * next_start = last # <<<<<<<<<<<<<< @@ -2027,7 +2009,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":286 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":286 * else: * # scan to the end of this ref list * ref_ptr = temp_ptr # <<<<<<<<<<<<<< @@ -2036,7 +2018,7 @@ */ __pyx_v_ref_ptr = __pyx_v_temp_ptr; - /* "bzrlib/_btree_serializer_pyx.pyx":287 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":287 * # scan to the end of this ref list * ref_ptr = temp_ptr * next_start = temp_ptr + 1 # <<<<<<<<<<<<<< @@ -2047,7 +2029,7 @@ } __pyx_L14:; - /* "bzrlib/_btree_serializer_pyx.pyx":289 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":289 * next_start = temp_ptr + 1 * # Now, there may be multiple keys in the ref list. * while self._start < ref_ptr: # <<<<<<<<<<<<<< @@ -2058,7 +2040,7 @@ __pyx_t_5 = (__pyx_v_self->_start < __pyx_v_ref_ptr); if (!__pyx_t_5) break; - /* "bzrlib/_btree_serializer_pyx.pyx":292 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":292 * # loop finding keys and extracting them * temp_ptr = memchr(self._start, c'\r', * ref_ptr - self._start) # <<<<<<<<<<<<<< @@ -2067,7 +2049,7 @@ */ __pyx_v_temp_ptr = ((char *)memchr(__pyx_v_self->_start, '\r', (__pyx_v_ref_ptr - __pyx_v_self->_start))); - /* "bzrlib/_btree_serializer_pyx.pyx":293 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":293 * temp_ptr = memchr(self._start, c'\r', * ref_ptr - self._start) * if temp_ptr == NULL: # <<<<<<<<<<<<<< @@ -2077,7 +2059,7 @@ __pyx_t_5 = (__pyx_v_temp_ptr == NULL); if (__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":295 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":295 * if temp_ptr == NULL: * # key runs to the end * temp_ptr = ref_ptr # <<<<<<<<<<<<<< @@ -2089,7 +2071,7 @@ } __pyx_L18:; - /* "bzrlib/_btree_serializer_pyx.pyx":297 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":297 * temp_ptr = ref_ptr * * PyList_Append(ref_list, self.extract_key(temp_ptr)) # <<<<<<<<<<<<<< @@ -2102,7 +2084,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "bzrlib/_btree_serializer_pyx.pyx":298 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":298 * * PyList_Append(ref_list, self.extract_key(temp_ptr)) * ref_list = StaticTuple_Intern(StaticTuple(*ref_list)) # <<<<<<<<<<<<<< @@ -2121,7 +2103,7 @@ __pyx_v_ref_list = __pyx_t_3; __pyx_t_3 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":299 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":299 * PyList_Append(ref_list, self.extract_key(temp_ptr)) * ref_list = StaticTuple_Intern(StaticTuple(*ref_list)) * Py_INCREF(ref_list) # <<<<<<<<<<<<<< @@ -2130,7 +2112,7 @@ */ Py_INCREF(__pyx_v_ref_list); - /* "bzrlib/_btree_serializer_pyx.pyx":300 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":300 * ref_list = StaticTuple_Intern(StaticTuple(*ref_list)) * Py_INCREF(ref_list) * StaticTuple_SET_ITEM(ref_lists, loop_counter - 1, ref_list) # <<<<<<<<<<<<<< @@ -2139,7 +2121,7 @@ */ StaticTuple_SET_ITEM(__pyx_v_ref_lists, (__pyx_v_loop_counter - 1), __pyx_v_ref_list); - /* "bzrlib/_btree_serializer_pyx.pyx":302 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":302 * StaticTuple_SET_ITEM(ref_lists, loop_counter - 1, ref_list) * # prepare for the next reference list * self._start = next_start # <<<<<<<<<<<<<< @@ -2149,7 +2131,7 @@ __pyx_v_self->_start = __pyx_v_next_start; } - /* "bzrlib/_btree_serializer_pyx.pyx":303 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":303 * # prepare for the next reference list * self._start = next_start * node_value = StaticTuple(value, ref_lists) # <<<<<<<<<<<<<< @@ -2157,16 +2139,16 @@ * if last != self._start: */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __Pyx_INCREF(((PyObject *)__pyx_v_ref_lists)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_ref_lists)); __Pyx_GIVEREF(((PyObject *)__pyx_v_ref_lists)); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_node_value)); __pyx_v_node_value = ((StaticTuple *)__pyx_t_2); __pyx_t_2 = 0; @@ -2174,7 +2156,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":305 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":305 * node_value = StaticTuple(value, ref_lists) * else: * if last != self._start: # <<<<<<<<<<<<<< @@ -2184,73 +2166,76 @@ __pyx_t_5 = (__pyx_v_last != __pyx_v_self->_start); if (__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":307 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":307 * if last != self._start: * # unexpected reference data present * raise AssertionError("unexpected reference data present") # <<<<<<<<<<<<<< * node_value = StaticTuple(value, StaticTuple()) * PyList_Append(self.keys, StaticTuple(key, node_value)) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L19; } __pyx_L19:; - /* "bzrlib/_btree_serializer_pyx.pyx":308 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":308 * # unexpected reference data present * raise AssertionError("unexpected reference data present") * node_value = StaticTuple(value, StaticTuple()) # <<<<<<<<<<<<<< * PyList_Append(self.keys, StaticTuple(key, node_value)) * return 0 */ - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_node_value)); - __pyx_v_node_value = ((StaticTuple *)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_node_value = ((StaticTuple *)__pyx_t_3); + __pyx_t_3 = 0; } __pyx_L10:; - /* "bzrlib/_btree_serializer_pyx.pyx":309 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":309 * raise AssertionError("unexpected reference data present") * node_value = StaticTuple(value, StaticTuple()) * PyList_Append(self.keys, StaticTuple(key, node_value)) # <<<<<<<<<<<<<< * return 0 * */ - __pyx_t_2 = __pyx_v_self->keys; - __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); __Pyx_INCREF(((PyObject *)__pyx_v_node_value)); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_node_value)); __Pyx_GIVEREF(((PyObject *)__pyx_v_node_value)); - __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_6 = PyList_Append(__pyx_t_2, __pyx_t_7); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = PyList_Append(__pyx_v_self->keys, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":310 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":310 * node_value = StaticTuple(value, StaticTuple()) * PyList_Append(self.keys, StaticTuple(key, node_value)) * return 0 # <<<<<<<<<<<<<< @@ -2265,7 +2250,6 @@ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.BTreeLeafParser.process_line"); __pyx_r = -1; __pyx_L0:; @@ -2278,7 +2262,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":312 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":312 * return 0 * * def parse(self): # <<<<<<<<<<<<<< @@ -2286,71 +2270,69 @@ * if not PyString_CheckExact(self.bytes): */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_15BTreeLeafParser_1parse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_15BTreeLeafParser_1parse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_15BTreeLeafParser_parse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_15BTreeLeafParser_parse(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { Py_ssize_t __pyx_v_byte_count; PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - char *__pyx_t_3; - int __pyx_t_4; + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + char *__pyx_t_4; + int __pyx_t_5; __Pyx_RefNannySetupContext("parse"); - /* "bzrlib/_btree_serializer_pyx.pyx":314 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":314 * def parse(self): * cdef Py_ssize_t byte_count * if not PyString_CheckExact(self.bytes): # <<<<<<<<<<<<<< * raise AssertionError('self.bytes is not a string.') * byte_count = PyString_Size(self.bytes) */ - __pyx_t_1 = ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->bytes; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = (!PyString_CheckExact(__pyx_t_1)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { + __pyx_t_1 = (!PyString_CheckExact(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->bytes)); + if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":315 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":315 * cdef Py_ssize_t byte_count * if not PyString_CheckExact(self.bytes): * raise AssertionError('self.bytes is not a string.') # <<<<<<<<<<<<<< * byte_count = PyString_Size(self.bytes) * self._cur_str = PyString_AsString(self.bytes) */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_11)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":316 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":316 * if not PyString_CheckExact(self.bytes): * raise AssertionError('self.bytes is not a string.') * byte_count = PyString_Size(self.bytes) # <<<<<<<<<<<<<< * self._cur_str = PyString_AsString(self.bytes) * # This points to the last character in the string */ - __pyx_t_1 = ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->bytes; - __Pyx_INCREF(__pyx_t_1); - __pyx_v_byte_count = PyString_Size(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_byte_count = PyString_Size(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->bytes); - /* "bzrlib/_btree_serializer_pyx.pyx":317 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":317 * raise AssertionError('self.bytes is not a string.') * byte_count = PyString_Size(self.bytes) * self._cur_str = PyString_AsString(self.bytes) # <<<<<<<<<<<<<< * # This points to the last character in the string * self._end_str = self._cur_str + byte_count */ - __pyx_t_1 = ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->bytes; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = PyString_AsString(__pyx_t_1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->_cur_str = __pyx_t_3; + __pyx_t_4 = PyString_AsString(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->bytes); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->_cur_str = __pyx_t_4; - /* "bzrlib/_btree_serializer_pyx.pyx":319 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":319 * self._cur_str = PyString_AsString(self.bytes) * # This points to the last character in the string * self._end_str = self._cur_str + byte_count # <<<<<<<<<<<<<< @@ -2359,7 +2341,7 @@ */ ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->_end_str = (((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->_cur_str + __pyx_v_byte_count); - /* "bzrlib/_btree_serializer_pyx.pyx":320 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":320 * # This points to the last character in the string * self._end_str = self._cur_str + byte_count * while self._cur_str < self._end_str: # <<<<<<<<<<<<<< @@ -2367,20 +2349,20 @@ * return self.keys */ while (1) { - __pyx_t_2 = (((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->_cur_str < ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->_end_str); - if (!__pyx_t_2) break; + __pyx_t_1 = (((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->_cur_str < ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->_end_str); + if (!__pyx_t_1) break; - /* "bzrlib/_btree_serializer_pyx.pyx":321 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":321 * self._end_str = self._cur_str + byte_count * while self._cur_str < self._end_str: * self.process_line() # <<<<<<<<<<<<<< * return self.keys * */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->__pyx_vtab)->process_line(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = ((struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)->__pyx_vtab)->process_line(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_v_self)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "bzrlib/_btree_serializer_pyx.pyx":322 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":322 * while self._cur_str < self._end_str: * self.process_line() * return self.keys # <<<<<<<<<<<<<< @@ -2395,7 +2377,8 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.BTreeLeafParser.parse"); __pyx_r = NULL; __pyx_L0:; @@ -2404,7 +2387,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":325 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":325 * * * def _parse_leaf_lines(bytes, key_length, ref_list_length): # <<<<<<<<<<<<<< @@ -2413,7 +2396,6 @@ */ static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__parse_leaf_lines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_6bzrlib_21_btree_serializer_pyx__parse_leaf_lines = {__Pyx_NAMESTR("_parse_leaf_lines"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx__parse_leaf_lines, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__parse_leaf_lines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bytes = 0; PyObject *__pyx_v_key_length = 0; @@ -2476,7 +2458,7 @@ __pyx_L4_argument_unpacking_done:; __pyx_v_parser = ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)Py_None); __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":326 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":326 * * def _parse_leaf_lines(bytes, key_length, ref_list_length): * parser = BTreeLeafParser(bytes, key_length, ref_list_length) # <<<<<<<<<<<<<< @@ -2484,7 +2466,7 @@ * */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_bytes); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bytes); __Pyx_GIVEREF(__pyx_v_bytes); @@ -2494,14 +2476,14 @@ __Pyx_INCREF(__pyx_v_ref_list_length); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_ref_list_length); __Pyx_GIVEREF(__pyx_v_ref_list_length); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_parser)); __pyx_v_parser = ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *)__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":327 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":327 * def _parse_leaf_lines(bytes, key_length, ref_list_length): * parser = BTreeLeafParser(bytes, key_length, ref_list_length) * return parser.parse() # <<<<<<<<<<<<<< @@ -2532,7 +2514,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":349 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":349 * _hexbuf = '0123456789abcdef' * * cdef _populate_unhexbuf(): # <<<<<<<<<<<<<< @@ -2545,7 +2527,7 @@ PyObject *__pyx_r = NULL; __Pyx_RefNannySetupContext("_populate_unhexbuf"); - /* "bzrlib/_btree_serializer_pyx.pyx":351 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":351 * cdef _populate_unhexbuf(): * cdef int i * for i from 0 <= i < 256: # <<<<<<<<<<<<<< @@ -2554,7 +2536,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < 256; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":352 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":352 * cdef int i * for i from 0 <= i < 256: * _unhexbuf[i] = -1 # <<<<<<<<<<<<<< @@ -2564,7 +2546,7 @@ (__pyx_v_6bzrlib_21_btree_serializer_pyx__unhexbuf[__pyx_v_i]) = -1; } - /* "bzrlib/_btree_serializer_pyx.pyx":353 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":353 * for i from 0 <= i < 256: * _unhexbuf[i] = -1 * for i from 0 <= i < 10: # 0123456789 => map to the raw number # <<<<<<<<<<<<<< @@ -2573,7 +2555,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < 10; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":354 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":354 * _unhexbuf[i] = -1 * for i from 0 <= i < 10: # 0123456789 => map to the raw number * _unhexbuf[(i + c'0')] = i # <<<<<<<<<<<<<< @@ -2583,7 +2565,7 @@ (__pyx_v_6bzrlib_21_btree_serializer_pyx__unhexbuf[(__pyx_v_i + '0')]) = __pyx_v_i; } - /* "bzrlib/_btree_serializer_pyx.pyx":355 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":355 * for i from 0 <= i < 10: # 0123456789 => map to the raw number * _unhexbuf[(i + c'0')] = i * for i from 10 <= i < 16: # abcdef => 10, 11, 12, 13, 14, 15, 16 # <<<<<<<<<<<<<< @@ -2592,7 +2574,7 @@ */ for (__pyx_v_i = 10; __pyx_v_i < 16; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":356 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":356 * _unhexbuf[(i + c'0')] = i * for i from 10 <= i < 16: # abcdef => 10, 11, 12, 13, 14, 15, 16 * _unhexbuf[(i - 10 + c'a')] = i # <<<<<<<<<<<<<< @@ -2602,7 +2584,7 @@ (__pyx_v_6bzrlib_21_btree_serializer_pyx__unhexbuf[((__pyx_v_i - 10) + 'a')]) = __pyx_v_i; } - /* "bzrlib/_btree_serializer_pyx.pyx":357 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":357 * for i from 10 <= i < 16: # abcdef => 10, 11, 12, 13, 14, 15, 16 * _unhexbuf[(i - 10 + c'a')] = i * for i from 10 <= i < 16: # ABCDEF => 10, 11, 12, 13, 14, 15, 16 # <<<<<<<<<<<<<< @@ -2611,7 +2593,7 @@ */ for (__pyx_v_i = 10; __pyx_v_i < 16; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":358 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":358 * _unhexbuf[(i - 10 + c'a')] = i * for i from 10 <= i < 16: # ABCDEF => 10, 11, 12, 13, 14, 15, 16 * _unhexbuf[(i - 10 + c'A')] = i # <<<<<<<<<<<<<< @@ -2627,7 +2609,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":362 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":362 * * * cdef int _unhexlify_sha1(char *as_hex, char *as_bin): # cannot_raise # <<<<<<<<<<<<<< @@ -2646,7 +2628,7 @@ int __pyx_t_3; __Pyx_RefNannySetupContext("_unhexlify_sha1"); - /* "bzrlib/_btree_serializer_pyx.pyx":374 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":374 * # binascii does this using isupper() and tolower() and ?: syntax. I'm * # guessing a simple lookup array should be faster. * j = 0 # <<<<<<<<<<<<<< @@ -2655,7 +2637,7 @@ */ __pyx_v_j = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":375 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":375 * # guessing a simple lookup array should be faster. * j = 0 * for i from 0 <= i < 20: # <<<<<<<<<<<<<< @@ -2664,7 +2646,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < 20; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":376 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":376 * j = 0 * for i from 0 <= i < 20: * top = _unhexbuf[(as_hex[j])] # <<<<<<<<<<<<<< @@ -2673,7 +2655,7 @@ */ __pyx_v_top = (__pyx_v_6bzrlib_21_btree_serializer_pyx__unhexbuf[((unsigned char)(__pyx_v_as_hex[__pyx_v_j]))]); - /* "bzrlib/_btree_serializer_pyx.pyx":377 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":377 * for i from 0 <= i < 20: * top = _unhexbuf[(as_hex[j])] * j = j + 1 # <<<<<<<<<<<<<< @@ -2682,7 +2664,7 @@ */ __pyx_v_j = (__pyx_v_j + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":378 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":378 * top = _unhexbuf[(as_hex[j])] * j = j + 1 * bot = _unhexbuf[(as_hex[j])] # <<<<<<<<<<<<<< @@ -2691,7 +2673,7 @@ */ __pyx_v_bot = (__pyx_v_6bzrlib_21_btree_serializer_pyx__unhexbuf[((unsigned char)(__pyx_v_as_hex[__pyx_v_j]))]); - /* "bzrlib/_btree_serializer_pyx.pyx":379 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":379 * j = j + 1 * bot = _unhexbuf[(as_hex[j])] * j = j + 1 # <<<<<<<<<<<<<< @@ -2700,7 +2682,7 @@ */ __pyx_v_j = (__pyx_v_j + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":380 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":380 * bot = _unhexbuf[(as_hex[j])] * j = j + 1 * if top == -1 or bot == -1: # <<<<<<<<<<<<<< @@ -2716,7 +2698,7 @@ } if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":381 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":381 * j = j + 1 * if top == -1 or bot == -1: * return 0 # <<<<<<<<<<<<<< @@ -2729,7 +2711,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":382 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":382 * if top == -1 or bot == -1: * return 0 * as_bin[i] = ((top << 4) + bot); # <<<<<<<<<<<<<< @@ -2739,7 +2721,7 @@ (__pyx_v_as_bin[__pyx_v_i]) = ((unsigned char)((__pyx_v_top << 4) + __pyx_v_bot)); } - /* "bzrlib/_btree_serializer_pyx.pyx":383 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":383 * return 0 * as_bin[i] = ((top << 4) + bot); * return 1 # <<<<<<<<<<<<<< @@ -2755,7 +2737,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":386 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":386 * * * def _py_unhexlify(as_hex): # <<<<<<<<<<<<<< @@ -2763,10 +2745,9 @@ * if len(as_hex) != 40 or not PyString_CheckExact(as_hex): */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_1_py_unhexlify(PyObject *__pyx_self, PyObject *__pyx_v_as_hex); /*proto*/ -static char __pyx_doc_6bzrlib_21_btree_serializer_pyx_1_py_unhexlify[] = "For the test infrastructure, just thunks to _unhexlify_sha1"; -static PyMethodDef __pyx_mdef_6bzrlib_21_btree_serializer_pyx_1_py_unhexlify = {__Pyx_NAMESTR("_py_unhexlify"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_1_py_unhexlify, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx_1_py_unhexlify)}; -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_1_py_unhexlify(PyObject *__pyx_self, PyObject *__pyx_v_as_hex) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_unhexlify(PyObject *__pyx_self, PyObject *__pyx_v_as_hex); /*proto*/ +static char __pyx_doc_6bzrlib_21_btree_serializer_pyx__py_unhexlify[] = "For the test infrastructure, just thunks to _unhexlify_sha1"; +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_unhexlify(PyObject *__pyx_self, PyObject *__pyx_v_as_hex) { PyObject *__pyx_v_as_bin; PyObject *__pyx_r = NULL; Py_ssize_t __pyx_t_1; @@ -2774,12 +2755,13 @@ int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; + PyObject *__pyx_t_6 = NULL; + int __pyx_t_7; __Pyx_RefNannySetupContext("_py_unhexlify"); __pyx_self = __pyx_self; __pyx_v_as_bin = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":388 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":388 * def _py_unhexlify(as_hex): * """For the test infrastructure, just thunks to _unhexlify_sha1""" * if len(as_hex) != 40 or not PyString_CheckExact(as_hex): # <<<<<<<<<<<<<< @@ -2796,46 +2778,52 @@ } if (__pyx_t_4) { - /* "bzrlib/_btree_serializer_pyx.pyx":389 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":389 * """For the test infrastructure, just thunks to _unhexlify_sha1""" * if len(as_hex) != 40 or not PyString_CheckExact(as_hex): * raise ValueError('not a 40-byte hex digest') # <<<<<<<<<<<<<< * as_bin = PyString_FromStringAndSize(NULL, 20) * if _unhexlify_sha1(PyString_AS_STRING(as_hex), PyString_AS_STRING(as_bin)): */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_12)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); + __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":390 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":390 * if len(as_hex) != 40 or not PyString_CheckExact(as_hex): * raise ValueError('not a 40-byte hex digest') * as_bin = PyString_FromStringAndSize(NULL, 20) # <<<<<<<<<<<<<< * if _unhexlify_sha1(PyString_AS_STRING(as_hex), PyString_AS_STRING(as_bin)): * return as_bin */ - __pyx_t_5 = PyString_FromStringAndSize(NULL, 20); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyString_FromStringAndSize(NULL, 20); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_v_as_bin); - __pyx_v_as_bin = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_as_bin = __pyx_t_6; + __pyx_t_6 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":391 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":391 * raise ValueError('not a 40-byte hex digest') * as_bin = PyString_FromStringAndSize(NULL, 20) * if _unhexlify_sha1(PyString_AS_STRING(as_hex), PyString_AS_STRING(as_bin)): # <<<<<<<<<<<<<< * return as_bin * return None */ - __pyx_t_6 = __pyx_f_6bzrlib_21_btree_serializer_pyx__unhexlify_sha1(PyString_AS_STRING(__pyx_v_as_hex), PyString_AS_STRING(__pyx_v_as_bin)); - if (__pyx_t_6) { + __pyx_t_7 = __pyx_f_6bzrlib_21_btree_serializer_pyx__unhexlify_sha1(PyString_AS_STRING(__pyx_v_as_hex), PyString_AS_STRING(__pyx_v_as_bin)); + if (__pyx_t_7) { - /* "bzrlib/_btree_serializer_pyx.pyx":392 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":392 * as_bin = PyString_FromStringAndSize(NULL, 20) * if _unhexlify_sha1(PyString_AS_STRING(as_hex), PyString_AS_STRING(as_bin)): * return as_bin # <<<<<<<<<<<<<< @@ -2850,7 +2838,7 @@ } __pyx_L6:; - /* "bzrlib/_btree_serializer_pyx.pyx":393 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":393 * if _unhexlify_sha1(PyString_AS_STRING(as_hex), PyString_AS_STRING(as_bin)): * return as_bin * return None # <<<<<<<<<<<<<< @@ -2866,6 +2854,7 @@ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("bzrlib._btree_serializer_pyx._py_unhexlify"); __pyx_r = NULL; __pyx_L0:; @@ -2875,7 +2864,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":396 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":396 * * * cdef void _hexlify_sha1(char *as_bin, char *as_hex): # cannot_raise # <<<<<<<<<<<<<< @@ -2889,7 +2878,7 @@ char __pyx_v_c; __Pyx_RefNannySetupContext("_hexlify_sha1"); - /* "bzrlib/_btree_serializer_pyx.pyx":400 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":400 * cdef char c * * j = 0 # <<<<<<<<<<<<<< @@ -2898,7 +2887,7 @@ */ __pyx_v_j = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":401 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":401 * * j = 0 * for i from 0 <= i < 20: # <<<<<<<<<<<<<< @@ -2907,7 +2896,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < 20; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":402 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":402 * j = 0 * for i from 0 <= i < 20: * c = as_bin[i] # <<<<<<<<<<<<<< @@ -2916,7 +2905,7 @@ */ __pyx_v_c = (__pyx_v_as_bin[__pyx_v_i]); - /* "bzrlib/_btree_serializer_pyx.pyx":403 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":403 * for i from 0 <= i < 20: * c = as_bin[i] * as_hex[j] = _hexbuf[(c>>4)&0xf] # <<<<<<<<<<<<<< @@ -2925,7 +2914,7 @@ */ (__pyx_v_as_hex[__pyx_v_j]) = (__pyx_v_6bzrlib_21_btree_serializer_pyx__hexbuf[((__pyx_v_c >> 4) & 0xf)]); - /* "bzrlib/_btree_serializer_pyx.pyx":404 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":404 * c = as_bin[i] * as_hex[j] = _hexbuf[(c>>4)&0xf] * j = j + 1 # <<<<<<<<<<<<<< @@ -2934,7 +2923,7 @@ */ __pyx_v_j = (__pyx_v_j + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":405 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":405 * as_hex[j] = _hexbuf[(c>>4)&0xf] * j = j + 1 * as_hex[j] = _hexbuf[(c)&0xf] # <<<<<<<<<<<<<< @@ -2943,7 +2932,7 @@ */ (__pyx_v_as_hex[__pyx_v_j]) = (__pyx_v_6bzrlib_21_btree_serializer_pyx__hexbuf[(__pyx_v_c & 0xf)]); - /* "bzrlib/_btree_serializer_pyx.pyx":406 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":406 * j = j + 1 * as_hex[j] = _hexbuf[(c)&0xf] * j = j + 1 # <<<<<<<<<<<<<< @@ -2956,7 +2945,7 @@ __Pyx_RefNannyFinishContext(); } -/* "bzrlib/_btree_serializer_pyx.pyx":409 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":409 * * * def _py_hexlify(as_bin): # <<<<<<<<<<<<<< @@ -2964,10 +2953,9 @@ * if len(as_bin) != 20 or not PyString_CheckExact(as_bin): */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_2_py_hexlify(PyObject *__pyx_self, PyObject *__pyx_v_as_bin); /*proto*/ -static char __pyx_doc_6bzrlib_21_btree_serializer_pyx_2_py_hexlify[] = "For test infrastructure, thunk to _hexlify_sha1"; -static PyMethodDef __pyx_mdef_6bzrlib_21_btree_serializer_pyx_2_py_hexlify = {__Pyx_NAMESTR("_py_hexlify"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_2_py_hexlify, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx_2_py_hexlify)}; -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_2_py_hexlify(PyObject *__pyx_self, PyObject *__pyx_v_as_bin) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_hexlify(PyObject *__pyx_self, PyObject *__pyx_v_as_bin); /*proto*/ +static char __pyx_doc_6bzrlib_21_btree_serializer_pyx__py_hexlify[] = "For test infrastructure, thunk to _hexlify_sha1"; +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_hexlify(PyObject *__pyx_self, PyObject *__pyx_v_as_bin) { PyObject *__pyx_v_as_hex; PyObject *__pyx_r = NULL; Py_ssize_t __pyx_t_1; @@ -2975,11 +2963,12 @@ int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_py_hexlify"); __pyx_self = __pyx_self; __pyx_v_as_hex = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":411 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":411 * def _py_hexlify(as_bin): * """For test infrastructure, thunk to _hexlify_sha1""" * if len(as_bin) != 20 or not PyString_CheckExact(as_bin): # <<<<<<<<<<<<<< @@ -2996,36 +2985,42 @@ } if (__pyx_t_4) { - /* "bzrlib/_btree_serializer_pyx.pyx":412 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":412 * """For test infrastructure, thunk to _hexlify_sha1""" * if len(as_bin) != 20 or not PyString_CheckExact(as_bin): * raise ValueError('not a 20-byte binary digest') # <<<<<<<<<<<<<< * as_hex = PyString_FromStringAndSize(NULL, 40) * _hexlify_sha1(PyString_AS_STRING(as_bin), PyString_AS_STRING(as_hex)) */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); + __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":413 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":413 * if len(as_bin) != 20 or not PyString_CheckExact(as_bin): * raise ValueError('not a 20-byte binary digest') * as_hex = PyString_FromStringAndSize(NULL, 40) # <<<<<<<<<<<<<< * _hexlify_sha1(PyString_AS_STRING(as_bin), PyString_AS_STRING(as_hex)) * return as_hex */ - __pyx_t_5 = PyString_FromStringAndSize(NULL, 40); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = PyString_FromStringAndSize(NULL, 40); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_v_as_hex); - __pyx_v_as_hex = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_as_hex = __pyx_t_6; + __pyx_t_6 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":414 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":414 * raise ValueError('not a 20-byte binary digest') * as_hex = PyString_FromStringAndSize(NULL, 40) * _hexlify_sha1(PyString_AS_STRING(as_bin), PyString_AS_STRING(as_hex)) # <<<<<<<<<<<<<< @@ -3034,7 +3029,7 @@ */ __pyx_f_6bzrlib_21_btree_serializer_pyx__hexlify_sha1(PyString_AS_STRING(__pyx_v_as_bin), PyString_AS_STRING(__pyx_v_as_hex)); - /* "bzrlib/_btree_serializer_pyx.pyx":415 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":415 * as_hex = PyString_FromStringAndSize(NULL, 40) * _hexlify_sha1(PyString_AS_STRING(as_bin), PyString_AS_STRING(as_hex)) * return as_hex # <<<<<<<<<<<<<< @@ -3050,6 +3045,7 @@ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("bzrlib._btree_serializer_pyx._py_hexlify"); __pyx_r = NULL; __pyx_L0:; @@ -3059,7 +3055,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":418 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":418 * * * cdef int _key_to_sha1(key, char *sha1): # cannot_raise # <<<<<<<<<<<<<< @@ -3075,7 +3071,7 @@ int __pyx_t_2; __Pyx_RefNannySetupContext("_key_to_sha1"); - /* "bzrlib/_btree_serializer_pyx.pyx":428 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":428 * cdef PyObject *p_val * * if StaticTuple_CheckExact(key) and StaticTuple_GET_SIZE(key) == 1: # <<<<<<<<<<<<<< @@ -3091,7 +3087,7 @@ } if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":429 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":429 * * if StaticTuple_CheckExact(key) and StaticTuple_GET_SIZE(key) == 1: * p_val = StaticTuple_GET_ITEM(key, 0) # <<<<<<<<<<<<<< @@ -3103,7 +3099,7 @@ goto __pyx_L3; } - /* "bzrlib/_btree_serializer_pyx.pyx":430 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":430 * if StaticTuple_CheckExact(key) and StaticTuple_GET_SIZE(key) == 1: * p_val = StaticTuple_GET_ITEM(key, 0) * elif (PyTuple_CheckExact(key) and PyTuple_GET_SIZE(key) == 1): # <<<<<<<<<<<<<< @@ -3118,7 +3114,7 @@ } if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":431 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":431 * p_val = StaticTuple_GET_ITEM(key, 0) * elif (PyTuple_CheckExact(key) and PyTuple_GET_SIZE(key) == 1): * p_val = PyTuple_GET_ITEM_ptr_object(key, 0) # <<<<<<<<<<<<<< @@ -3130,7 +3126,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":434 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":434 * else: * # Not a tuple or a StaticTuple * return 0 # <<<<<<<<<<<<<< @@ -3142,7 +3138,7 @@ } __pyx_L3:; - /* "bzrlib/_btree_serializer_pyx.pyx":435 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":435 * # Not a tuple or a StaticTuple * return 0 * if (PyString_CheckExact_ptr(p_val) and PyString_GET_SIZE_ptr(p_val) == 45): # <<<<<<<<<<<<<< @@ -3157,7 +3153,7 @@ } if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":436 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":436 * return 0 * if (PyString_CheckExact_ptr(p_val) and PyString_GET_SIZE_ptr(p_val) == 45): * c_val = PyString_AS_STRING_ptr(p_val) # <<<<<<<<<<<<<< @@ -3169,7 +3165,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":438 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":438 * c_val = PyString_AS_STRING_ptr(p_val) * else: * return 0 # <<<<<<<<<<<<<< @@ -3181,7 +3177,7 @@ } __pyx_L4:; - /* "bzrlib/_btree_serializer_pyx.pyx":439 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":439 * else: * return 0 * if strncmp(c_val, 'sha1:', 5) != 0: # <<<<<<<<<<<<<< @@ -3191,7 +3187,7 @@ __pyx_t_2 = (strncmp(__pyx_v_c_val, __pyx_k_3, 5) != 0); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":440 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":440 * return 0 * if strncmp(c_val, 'sha1:', 5) != 0: * return 0 # <<<<<<<<<<<<<< @@ -3204,7 +3200,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":441 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":441 * if strncmp(c_val, 'sha1:', 5) != 0: * return 0 * if not _unhexlify_sha1(c_val + 5, sha1): # <<<<<<<<<<<<<< @@ -3214,7 +3210,7 @@ __pyx_t_2 = (!__pyx_f_6bzrlib_21_btree_serializer_pyx__unhexlify_sha1((__pyx_v_c_val + 5), __pyx_v_sha1)); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":442 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":442 * return 0 * if not _unhexlify_sha1(c_val + 5, sha1): * return 0 # <<<<<<<<<<<<<< @@ -3227,7 +3223,7 @@ } __pyx_L6:; - /* "bzrlib/_btree_serializer_pyx.pyx":443 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":443 * if not _unhexlify_sha1(c_val + 5, sha1): * return 0 * return 1 # <<<<<<<<<<<<<< @@ -3247,7 +3243,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":446 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":446 * * * def _py_key_to_sha1(key): # <<<<<<<<<<<<<< @@ -3255,10 +3251,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_3_py_key_to_sha1(PyObject *__pyx_self, PyObject *__pyx_v_key); /*proto*/ -static char __pyx_doc_6bzrlib_21_btree_serializer_pyx_3_py_key_to_sha1[] = "Map a key to a simple sha1 string.\n\n This is a testing thunk to the C function.\n "; -static PyMethodDef __pyx_mdef_6bzrlib_21_btree_serializer_pyx_3_py_key_to_sha1 = {__Pyx_NAMESTR("_py_key_to_sha1"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_3_py_key_to_sha1, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx_3_py_key_to_sha1)}; -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_3_py_key_to_sha1(PyObject *__pyx_self, PyObject *__pyx_v_key) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_key_to_sha1(PyObject *__pyx_self, PyObject *__pyx_v_key); /*proto*/ +static char __pyx_doc_6bzrlib_21_btree_serializer_pyx__py_key_to_sha1[] = "Map a key to a simple sha1 string.\n\n This is a testing thunk to the C function.\n "; +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_key_to_sha1(PyObject *__pyx_self, PyObject *__pyx_v_key) { PyObject *__pyx_v_as_bin_sha; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; @@ -3267,7 +3262,7 @@ __pyx_self = __pyx_self; __pyx_v_as_bin_sha = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":451 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":451 * This is a testing thunk to the C function. * """ * as_bin_sha = PyString_FromStringAndSize(NULL, 20) # <<<<<<<<<<<<<< @@ -3280,7 +3275,7 @@ __pyx_v_as_bin_sha = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":452 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":452 * """ * as_bin_sha = PyString_FromStringAndSize(NULL, 20) * if _key_to_sha1(key, PyString_AS_STRING(as_bin_sha)): # <<<<<<<<<<<<<< @@ -3290,7 +3285,7 @@ __pyx_t_2 = __pyx_f_6bzrlib_21_btree_serializer_pyx__key_to_sha1(__pyx_v_key, PyString_AS_STRING(__pyx_v_as_bin_sha)); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":453 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":453 * as_bin_sha = PyString_FromStringAndSize(NULL, 20) * if _key_to_sha1(key, PyString_AS_STRING(as_bin_sha)): * return as_bin_sha # <<<<<<<<<<<<<< @@ -3305,7 +3300,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":454 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":454 * if _key_to_sha1(key, PyString_AS_STRING(as_bin_sha)): * return as_bin_sha * return None # <<<<<<<<<<<<<< @@ -3330,7 +3325,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":457 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":457 * * * cdef StaticTuple _sha1_to_key(char *sha1): # <<<<<<<<<<<<<< @@ -3348,7 +3343,7 @@ __pyx_v_key = ((StaticTuple *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_hexxed = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":462 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":462 * cdef object hexxed * cdef char *c_buf * hexxed = PyString_FromStringAndSize(NULL, 45) # <<<<<<<<<<<<<< @@ -3361,7 +3356,7 @@ __pyx_v_hexxed = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":463 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":463 * cdef char *c_buf * hexxed = PyString_FromStringAndSize(NULL, 45) * c_buf = PyString_AS_STRING(hexxed) # <<<<<<<<<<<<<< @@ -3370,7 +3365,7 @@ */ __pyx_v_c_buf = PyString_AS_STRING(__pyx_v_hexxed); - /* "bzrlib/_btree_serializer_pyx.pyx":464 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":464 * hexxed = PyString_FromStringAndSize(NULL, 45) * c_buf = PyString_AS_STRING(hexxed) * memcpy(c_buf, 'sha1:', 5) # <<<<<<<<<<<<<< @@ -3379,7 +3374,7 @@ */ memcpy(__pyx_v_c_buf, __pyx_k_3, 5); - /* "bzrlib/_btree_serializer_pyx.pyx":465 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":465 * c_buf = PyString_AS_STRING(hexxed) * memcpy(c_buf, 'sha1:', 5) * _hexlify_sha1(sha1, c_buf+5) # <<<<<<<<<<<<<< @@ -3388,7 +3383,7 @@ */ __pyx_f_6bzrlib_21_btree_serializer_pyx__hexlify_sha1(__pyx_v_sha1, (__pyx_v_c_buf + 5)); - /* "bzrlib/_btree_serializer_pyx.pyx":466 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":466 * memcpy(c_buf, 'sha1:', 5) * _hexlify_sha1(sha1, c_buf+5) * key = StaticTuple_New(1) # <<<<<<<<<<<<<< @@ -3401,7 +3396,7 @@ __pyx_v_key = ((StaticTuple *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":467 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":467 * _hexlify_sha1(sha1, c_buf+5) * key = StaticTuple_New(1) * Py_INCREF(hexxed) # <<<<<<<<<<<<<< @@ -3410,7 +3405,7 @@ */ Py_INCREF(__pyx_v_hexxed); - /* "bzrlib/_btree_serializer_pyx.pyx":468 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":468 * key = StaticTuple_New(1) * Py_INCREF(hexxed) * StaticTuple_SET_ITEM(key, 0, hexxed) # <<<<<<<<<<<<<< @@ -3419,7 +3414,7 @@ */ StaticTuple_SET_ITEM(__pyx_v_key, 0, __pyx_v_hexxed); - /* "bzrlib/_btree_serializer_pyx.pyx":478 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":478 * # We *could* hang the PyObject form off of the gc_chk_sha1_record for ones * # that we have deserialized. Something to think about, at least. * key = StaticTuple_Intern(key) # <<<<<<<<<<<<<< @@ -3432,7 +3427,7 @@ __pyx_v_key = ((StaticTuple *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":479 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":479 * # that we have deserialized. Something to think about, at least. * key = StaticTuple_Intern(key) * return key # <<<<<<<<<<<<<< @@ -3458,7 +3453,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":482 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":482 * * * def _py_sha1_to_key(sha1_bin): # <<<<<<<<<<<<<< @@ -3466,19 +3461,19 @@ * if not PyString_CheckExact(sha1_bin) or PyString_GET_SIZE(sha1_bin) != 20: */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_4_py_sha1_to_key(PyObject *__pyx_self, PyObject *__pyx_v_sha1_bin); /*proto*/ -static char __pyx_doc_6bzrlib_21_btree_serializer_pyx_4_py_sha1_to_key[] = "Test thunk to check the sha1 mapping."; -static PyMethodDef __pyx_mdef_6bzrlib_21_btree_serializer_pyx_4_py_sha1_to_key = {__Pyx_NAMESTR("_py_sha1_to_key"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_4_py_sha1_to_key, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx_4_py_sha1_to_key)}; -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_4_py_sha1_to_key(PyObject *__pyx_self, PyObject *__pyx_v_sha1_bin) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_sha1_to_key(PyObject *__pyx_self, PyObject *__pyx_v_sha1_bin); /*proto*/ +static char __pyx_doc_6bzrlib_21_btree_serializer_pyx__py_sha1_to_key[] = "Test thunk to check the sha1 mapping."; +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_sha1_to_key(PyObject *__pyx_self, PyObject *__pyx_v_sha1_bin) { PyObject *__pyx_r = NULL; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_py_sha1_to_key"); __pyx_self = __pyx_self; - /* "bzrlib/_btree_serializer_pyx.pyx":484 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":484 * def _py_sha1_to_key(sha1_bin): * """Test thunk to check the sha1 mapping.""" * if not PyString_CheckExact(sha1_bin) or PyString_GET_SIZE(sha1_bin) != 20: # <<<<<<<<<<<<<< @@ -3494,23 +3489,29 @@ } if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":485 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":485 * """Test thunk to check the sha1 mapping.""" * if not PyString_CheckExact(sha1_bin) or PyString_GET_SIZE(sha1_bin) != 20: * raise ValueError('sha1_bin must be a str of exactly 20 bytes') # <<<<<<<<<<<<<< * return _sha1_to_key(PyString_AS_STRING(sha1_bin)) * */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_14)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_14)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":486 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":486 * if not PyString_CheckExact(sha1_bin) or PyString_GET_SIZE(sha1_bin) != 20: * raise ValueError('sha1_bin must be a str of exactly 20 bytes') * return _sha1_to_key(PyString_AS_STRING(sha1_bin)) # <<<<<<<<<<<<<< @@ -3518,16 +3519,17 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = ((PyObject *)__pyx_f_6bzrlib_21_btree_serializer_pyx__sha1_to_key(PyString_AS_STRING(__pyx_v_sha1_bin))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_5 = ((PyObject *)__pyx_f_6bzrlib_21_btree_serializer_pyx__sha1_to_key(PyString_AS_STRING(__pyx_v_sha1_bin))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("bzrlib._btree_serializer_pyx._py_sha1_to_key"); __pyx_r = NULL; __pyx_L0:; @@ -3536,7 +3538,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":489 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":489 * * * cdef unsigned int _sha1_to_uint(char *sha1): # cannot_raise # <<<<<<<<<<<<<< @@ -3549,7 +3551,7 @@ unsigned int __pyx_r; __Pyx_RefNannySetupContext("_sha1_to_uint"); - /* "bzrlib/_btree_serializer_pyx.pyx":495 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":495 * | (((sha1[1]) & 0xff) << 16) * | (((sha1[2]) & 0xff) << 8) * | (((sha1[3]) & 0xff) << 0)) # <<<<<<<<<<<<<< @@ -3558,7 +3560,7 @@ */ __pyx_v_val = (((((((unsigned int)(__pyx_v_sha1[0])) & 0xff) << 24) | ((((unsigned int)(__pyx_v_sha1[1])) & 0xff) << 16)) | ((((unsigned int)(__pyx_v_sha1[2])) & 0xff) << 8)) | ((((unsigned int)(__pyx_v_sha1[3])) & 0xff) << 0)); - /* "bzrlib/_btree_serializer_pyx.pyx":496 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":496 * | (((sha1[2]) & 0xff) << 8) * | (((sha1[3]) & 0xff) << 0)) * return val # <<<<<<<<<<<<<< @@ -3574,7 +3576,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":499 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":499 * * * cdef _format_record(gc_chk_sha1_record *record): # <<<<<<<<<<<<<< @@ -3586,30 +3588,24 @@ PyObject *__pyx_v_block_offset_str; PyObject *__pyx_v_value; PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; + PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_format_record"); __pyx_v_block_offset_str = Py_None; __Pyx_INCREF(Py_None); __pyx_v_value = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":502 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":502 * # This is inefficient to go from a logical state back to a * # string, but it makes things work a bit better internally for now. * if record.block_offset >= 0xFFFFFFFF: # <<<<<<<<<<<<<< * # %llu is what we really want, but unfortunately it was only added * # in python 2.7... :( */ - __pyx_t_1 = PyLong_FromLongLong(__pyx_v_record->block_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_4294967295, Py_GE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { + __pyx_t_1 = (__pyx_v_record->block_offset >= 0xFFFFFFFF); + if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":505 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":505 * # %llu is what we really want, but unfortunately it was only added * # in python 2.7... :( * block_offset_str = str(record.block_offset) # <<<<<<<<<<<<<< @@ -3618,26 +3614,26 @@ */ __pyx_t_2 = PyLong_FromLongLong(__pyx_v_record->block_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_block_offset_str); __pyx_v_block_offset_str = __pyx_t_2; __pyx_t_2 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":509 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":509 * PyString_AS_STRING(block_offset_str), * record.block_length, * record.record_start, record.record_end) # <<<<<<<<<<<<<< * else: * value = PyString_FromFormat('%lu %u %u %u', */ - __pyx_t_2 = PyString_FromFormat(__pyx_k_24, PyString_AS_STRING(__pyx_v_block_offset_str), __pyx_v_record->block_length, __pyx_v_record->record_start, __pyx_v_record->record_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyString_FromFormat(__pyx_k_15, PyString_AS_STRING(__pyx_v_block_offset_str), __pyx_v_record->block_length, __pyx_v_record->record_start, __pyx_v_record->record_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_value); __pyx_v_value = __pyx_t_2; @@ -3646,14 +3642,14 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":514 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":514 * record.block_offset, * record.block_length, * record.record_start, record.record_end) # <<<<<<<<<<<<<< * return value * */ - __pyx_t_2 = PyString_FromFormat(__pyx_k_25, ((unsigned long)__pyx_v_record->block_offset), __pyx_v_record->block_length, __pyx_v_record->record_start, __pyx_v_record->record_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyString_FromFormat(__pyx_k_16, ((unsigned long)__pyx_v_record->block_offset), __pyx_v_record->block_length, __pyx_v_record->record_start, __pyx_v_record->record_end); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_value); __pyx_v_value = __pyx_t_2; @@ -3661,7 +3657,7 @@ } __pyx_L3:; - /* "bzrlib/_btree_serializer_pyx.pyx":515 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":515 * record.block_length, * record.record_start, record.record_end) * return value # <<<<<<<<<<<<<< @@ -3676,8 +3672,8 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("bzrlib._btree_serializer_pyx._format_record"); __pyx_r = 0; __pyx_L0:; @@ -3688,37 +3684,75 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":536 - * cdef unsigned char offsets[257] +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":522 * - * def __sizeof__(self): # <<<<<<<<<<<<<< - * # :( Why doesn't Pyrex let me do a simple sizeof(GCCHKSHA1LeafNode) - * # like Cython? Explicitly enumerating everything here seems to leave my + * cdef gc_chk_sha1_record *records + * cdef public object last_key # <<<<<<<<<<<<<< + * cdef gc_chk_sha1_record *last_record + * cdef public int num_records */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key___get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__sizeof__"); - - /* "bzrlib/_btree_serializer_pyx.pyx":546 - * # return (sizeof(GCCHKSHA1LeafNode) - * # + sizeof(gc_chk_sha1_record)*self.num_records) - * return (sizeof(PyObject) + sizeof(void*) + sizeof(int) # <<<<<<<<<<<<<< - * + sizeof(gc_chk_sha1_record*) + sizeof(PyObject *) - * + sizeof(gc_chk_sha1_record*) + sizeof(char) - */ + __Pyx_RefNannySetupContext("__get__"); __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); + __pyx_r = ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key; + goto __pyx_L0; - /* "bzrlib/_btree_serializer_pyx.pyx":550 - * + sizeof(gc_chk_sha1_record*) + sizeof(char) - * + sizeof(unsigned char)*257 - * + sizeof(gc_chk_sha1_record)*self.num_records) # <<<<<<<<<<<<<< - * - * def __dealloc__(self): + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + __Pyx_RefNannySetupContext("__set__"); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); + __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); + ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key = __pyx_v_value; + + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key___del__(PyObject *__pyx_v_self); /*proto*/ +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key___del__(PyObject *__pyx_v_self) { + int __pyx_r; + __Pyx_RefNannySetupContext("__del__"); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); + __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); + ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key = Py_None; + + __pyx_r = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":524 + * cdef public object last_key + * cdef gc_chk_sha1_record *last_record + * cdef public int num_records # <<<<<<<<<<<<<< + * # This is the number of bits to shift to get to the interesting byte. A + * # value of 24 means that the very first byte changes across all keys. */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((((((((((sizeof(PyObject)) + (sizeof(void *))) + (sizeof(int))) + (sizeof(__pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *))) + (sizeof(PyObject *))) + (sizeof(__pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *))) + (sizeof(char))) + ((sizeof(unsigned char)) * 257)) + ((sizeof(__pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record)) * ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->num_records))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_11num_records___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_11num_records___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->num_records); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -3728,7 +3762,7 @@ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode.__sizeof__"); + __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode.num_records.__get__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -3736,39 +3770,155 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":552 - * + sizeof(gc_chk_sha1_record)*self.num_records) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self.records != NULL: - * PyMem_Free(self.records) - */ - -static void __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_1__dealloc__(PyObject *__pyx_v_self) { +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_11num_records___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_11num_records___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; int __pyx_t_1; - __Pyx_RefNannySetupContext("__dealloc__"); - - /* "bzrlib/_btree_serializer_pyx.pyx":553 - * - * def __dealloc__(self): - * if self.records != NULL: # <<<<<<<<<<<<<< - * PyMem_Free(self.records) - * self.records = NULL - */ - __pyx_t_1 = (((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->records != NULL); - if (__pyx_t_1) { + __Pyx_RefNannySetupContext("__set__"); + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->num_records = __pyx_t_1; - /* "bzrlib/_btree_serializer_pyx.pyx":554 - * def __dealloc__(self): - * if self.records != NULL: - * PyMem_Free(self.records) # <<<<<<<<<<<<<< - * self.records = NULL - * - */ + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode.num_records.__set__"); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":530 + * # ignore. 0 means that at least the first 3 bytes are identical, though + * # that is going to be very rare + * cdef public unsigned char common_shift # <<<<<<<<<<<<<< + * # This maps an interesting byte to the first record that matches. + * # Equivalent to bisect.bisect_left(self.records, sha1), though only taking + */ + +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_12common_shift___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_12common_shift___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->common_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode.common_shift.__get__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_12common_shift___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_12common_shift___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + unsigned char __pyx_t_1; + __Pyx_RefNannySetupContext("__set__"); + __pyx_t_1 = __Pyx_PyInt_AsUnsignedChar(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->common_shift = __pyx_t_1; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode.common_shift.__set__"); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":536 + * cdef unsigned char offsets[257] + * + * def __sizeof__(self): # <<<<<<<<<<<<<< + * # :( Why doesn't Pyrex let me do a simple sizeof(GCCHKSHA1LeafNode) + * # like Cython? Explicitly enumerating everything here seems to leave my + */ + +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__sizeof__"); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":546 + * # return (sizeof(GCCHKSHA1LeafNode) + * # + sizeof(gc_chk_sha1_record)*self.num_records) + * return (sizeof(PyObject) + sizeof(void*) + sizeof(int) # <<<<<<<<<<<<<< + * + sizeof(gc_chk_sha1_record*) + sizeof(PyObject *) + * + sizeof(gc_chk_sha1_record*) + sizeof(char) + */ + __Pyx_XDECREF(__pyx_r); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":550 + * + sizeof(gc_chk_sha1_record*) + sizeof(char) + * + sizeof(unsigned char)*257 + * + sizeof(gc_chk_sha1_record)*self.num_records) # <<<<<<<<<<<<<< + * + * def __dealloc__(self): + */ + __pyx_t_1 = __Pyx_PyInt_FromSize_t((((((((((sizeof(PyObject)) + (sizeof(void *))) + (sizeof(int))) + (sizeof(__pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *))) + (sizeof(PyObject *))) + (sizeof(__pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *))) + (sizeof(char))) + ((sizeof(unsigned char)) * 257)) + ((sizeof(__pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record)) * ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->num_records))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode.__sizeof__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":552 + * + sizeof(gc_chk_sha1_record)*self.num_records) + * + * def __dealloc__(self): # <<<<<<<<<<<<<< + * if self.records != NULL: + * PyMem_Free(self.records) + */ + +static void __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___dealloc__(PyObject *__pyx_v_self) { + int __pyx_t_1; + __Pyx_RefNannySetupContext("__dealloc__"); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":553 + * + * def __dealloc__(self): + * if self.records != NULL: # <<<<<<<<<<<<<< + * PyMem_Free(self.records) + * self.records = NULL + */ + __pyx_t_1 = (((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->records != NULL); + if (__pyx_t_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":554 + * def __dealloc__(self): + * if self.records != NULL: + * PyMem_Free(self.records) # <<<<<<<<<<<<<< + * self.records = NULL + * + */ PyMem_Free(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->records); - /* "bzrlib/_btree_serializer_pyx.pyx":555 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":555 * if self.records != NULL: * PyMem_Free(self.records) * self.records = NULL # <<<<<<<<<<<<<< @@ -3783,7 +3933,7 @@ __Pyx_RefNannyFinishContext(); } -/* "bzrlib/_btree_serializer_pyx.pyx":557 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":557 * self.records = NULL * * def __init__(self, bytes): # <<<<<<<<<<<<<< @@ -3791,8 +3941,8 @@ * self.last_key = None */ -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_2__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_2__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bytes = 0; int __pyx_r; PyObject *__pyx_t_1 = NULL; @@ -3830,7 +3980,7 @@ return -1; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_btree_serializer_pyx.pyx":558 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":558 * * def __init__(self, bytes): * self._parse_bytes(bytes) # <<<<<<<<<<<<<< @@ -3841,7 +3991,7 @@ __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":559 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":559 * def __init__(self, bytes): * self._parse_bytes(bytes) * self.last_key = None # <<<<<<<<<<<<<< @@ -3854,7 +4004,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key = Py_None; - /* "bzrlib/_btree_serializer_pyx.pyx":560 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":560 * self._parse_bytes(bytes) * self.last_key = None * self.last_record = NULL # <<<<<<<<<<<<<< @@ -3874,7 +4024,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":563 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":563 * * property min_key: * def __get__(self): # <<<<<<<<<<<<<< @@ -3889,7 +4039,7 @@ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__"); - /* "bzrlib/_btree_serializer_pyx.pyx":564 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":564 * property min_key: * def __get__(self): * if self.num_records > 0: # <<<<<<<<<<<<<< @@ -3899,7 +4049,7 @@ __pyx_t_1 = (((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->num_records > 0); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":565 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":565 * def __get__(self): * if self.num_records > 0: * return _sha1_to_key(self.records[0].sha1) # <<<<<<<<<<<<<< @@ -3916,7 +4066,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":566 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":566 * if self.num_records > 0: * return _sha1_to_key(self.records[0].sha1) * return None # <<<<<<<<<<<<<< @@ -3940,7 +4090,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":569 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":569 * * property max_key: * def __get__(self): # <<<<<<<<<<<<<< @@ -3955,7 +4105,7 @@ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__"); - /* "bzrlib/_btree_serializer_pyx.pyx":570 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":570 * property max_key: * def __get__(self): * if self.num_records > 0: # <<<<<<<<<<<<<< @@ -3965,7 +4115,7 @@ __pyx_t_1 = (((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->num_records > 0); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":571 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":571 * def __get__(self): * if self.num_records > 0: * return _sha1_to_key(self.records[self.num_records-1].sha1) # <<<<<<<<<<<<<< @@ -3982,7 +4132,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":572 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":572 * if self.num_records > 0: * return _sha1_to_key(self.records[self.num_records-1].sha1) * return None # <<<<<<<<<<<<<< @@ -4006,7 +4156,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":574 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":574 * return None * * cdef StaticTuple _record_to_value_and_refs(self, # <<<<<<<<<<<<<< @@ -4025,7 +4175,7 @@ __pyx_v_empty = ((StaticTuple *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_value = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":579 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":579 * cdef StaticTuple value_and_refs * cdef StaticTuple empty * value_and_refs = StaticTuple_New(2) # <<<<<<<<<<<<<< @@ -4038,7 +4188,7 @@ __pyx_v_value_and_refs = ((StaticTuple *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":580 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":580 * cdef StaticTuple empty * value_and_refs = StaticTuple_New(2) * value = _format_record(record) # <<<<<<<<<<<<<< @@ -4051,7 +4201,7 @@ __pyx_v_value = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":581 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":581 * value_and_refs = StaticTuple_New(2) * value = _format_record(record) * Py_INCREF(value) # <<<<<<<<<<<<<< @@ -4060,7 +4210,7 @@ */ Py_INCREF(__pyx_v_value); - /* "bzrlib/_btree_serializer_pyx.pyx":582 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":582 * value = _format_record(record) * Py_INCREF(value) * StaticTuple_SET_ITEM(value_and_refs, 0, value) # <<<<<<<<<<<<<< @@ -4069,7 +4219,7 @@ */ StaticTuple_SET_ITEM(__pyx_v_value_and_refs, 0, __pyx_v_value); - /* "bzrlib/_btree_serializer_pyx.pyx":584 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":584 * StaticTuple_SET_ITEM(value_and_refs, 0, value) * # Always empty refs * empty = StaticTuple_New(0) # <<<<<<<<<<<<<< @@ -4082,7 +4232,7 @@ __pyx_v_empty = ((StaticTuple *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":585 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":585 * # Always empty refs * empty = StaticTuple_New(0) * Py_INCREF(empty) # <<<<<<<<<<<<<< @@ -4091,7 +4241,7 @@ */ Py_INCREF(((PyObject *)__pyx_v_empty)); - /* "bzrlib/_btree_serializer_pyx.pyx":586 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":586 * empty = StaticTuple_New(0) * Py_INCREF(empty) * StaticTuple_SET_ITEM(value_and_refs, 1, empty) # <<<<<<<<<<<<<< @@ -4100,7 +4250,7 @@ */ StaticTuple_SET_ITEM(__pyx_v_value_and_refs, 1, ((PyObject *)__pyx_v_empty)); - /* "bzrlib/_btree_serializer_pyx.pyx":587 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":587 * Py_INCREF(empty) * StaticTuple_SET_ITEM(value_and_refs, 1, empty) * return value_and_refs # <<<<<<<<<<<<<< @@ -4127,7 +4277,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":589 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":589 * return value_and_refs * * cdef StaticTuple _record_to_item(self, gc_chk_sha1_record *record): # <<<<<<<<<<<<<< @@ -4146,7 +4296,7 @@ __pyx_v_key = ((StaticTuple *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_value_and_refs = ((StaticTuple *)Py_None); __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":596 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":596 * cdef StaticTuple value_and_refs * cdef object value * key = _sha1_to_key(record.sha1) # <<<<<<<<<<<<<< @@ -4159,7 +4309,7 @@ __pyx_v_key = ((StaticTuple *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":597 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":597 * cdef object value * key = _sha1_to_key(record.sha1) * item = StaticTuple_New(2) # <<<<<<<<<<<<<< @@ -4172,7 +4322,7 @@ __pyx_v_item = ((StaticTuple *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":598 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":598 * key = _sha1_to_key(record.sha1) * item = StaticTuple_New(2) * Py_INCREF(key) # <<<<<<<<<<<<<< @@ -4181,7 +4331,7 @@ */ Py_INCREF(((PyObject *)__pyx_v_key)); - /* "bzrlib/_btree_serializer_pyx.pyx":599 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":599 * item = StaticTuple_New(2) * Py_INCREF(key) * StaticTuple_SET_ITEM(item, 0, key) # <<<<<<<<<<<<<< @@ -4190,7 +4340,7 @@ */ StaticTuple_SET_ITEM(__pyx_v_item, 0, ((PyObject *)__pyx_v_key)); - /* "bzrlib/_btree_serializer_pyx.pyx":600 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":600 * Py_INCREF(key) * StaticTuple_SET_ITEM(item, 0, key) * value_and_refs = self._record_to_value_and_refs(record) # <<<<<<<<<<<<<< @@ -4203,7 +4353,7 @@ __pyx_v_value_and_refs = ((StaticTuple *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":601 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":601 * StaticTuple_SET_ITEM(item, 0, key) * value_and_refs = self._record_to_value_and_refs(record) * Py_INCREF(value_and_refs) # <<<<<<<<<<<<<< @@ -4212,7 +4362,7 @@ */ Py_INCREF(((PyObject *)__pyx_v_value_and_refs)); - /* "bzrlib/_btree_serializer_pyx.pyx":602 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":602 * value_and_refs = self._record_to_value_and_refs(record) * Py_INCREF(value_and_refs) * StaticTuple_SET_ITEM(item, 1, value_and_refs) # <<<<<<<<<<<<<< @@ -4221,7 +4371,7 @@ */ StaticTuple_SET_ITEM(__pyx_v_item, 1, ((PyObject *)__pyx_v_value_and_refs)); - /* "bzrlib/_btree_serializer_pyx.pyx":603 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":603 * Py_INCREF(value_and_refs) * StaticTuple_SET_ITEM(item, 1, value_and_refs) * return item # <<<<<<<<<<<<<< @@ -4248,7 +4398,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":605 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":605 * return item * * cdef gc_chk_sha1_record* _lookup_record(self, char *sha1) except? NULL: # <<<<<<<<<<<<<< @@ -4268,7 +4418,7 @@ int __pyx_t_2; __Pyx_RefNannySetupContext("_lookup_record"); - /* "bzrlib/_btree_serializer_pyx.pyx":619 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":619 * # the offset array dropped us from 23us to 20us and 156 comparisions * # (1.3/key) * offset = self._offset_for_sha1(sha1) # <<<<<<<<<<<<<< @@ -4278,7 +4428,7 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self->__pyx_vtab)->_offset_for_sha1(__pyx_v_self, __pyx_v_sha1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_offset = __pyx_t_1; - /* "bzrlib/_btree_serializer_pyx.pyx":620 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":620 * # (1.3/key) * offset = self._offset_for_sha1(sha1) * lo = self.offsets[offset] # <<<<<<<<<<<<<< @@ -4287,7 +4437,7 @@ */ __pyx_v_lo = (__pyx_v_self->offsets[__pyx_v_offset]); - /* "bzrlib/_btree_serializer_pyx.pyx":621 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":621 * offset = self._offset_for_sha1(sha1) * lo = self.offsets[offset] * hi = self.offsets[offset+1] # <<<<<<<<<<<<<< @@ -4296,7 +4446,7 @@ */ __pyx_v_hi = (__pyx_v_self->offsets[(__pyx_v_offset + 1)]); - /* "bzrlib/_btree_serializer_pyx.pyx":622 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":622 * lo = self.offsets[offset] * hi = self.offsets[offset+1] * if hi == 255: # <<<<<<<<<<<<<< @@ -4306,7 +4456,7 @@ __pyx_t_2 = (__pyx_v_hi == 255); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":627 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":627 * # note that if 'lo' == 255, that is ok, because we can start * # searching from that part of the list. * hi = self.num_records # <<<<<<<<<<<<<< @@ -4318,7 +4468,7 @@ } __pyx_L3:; - /* "bzrlib/_btree_serializer_pyx.pyx":628 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":628 * # searching from that part of the list. * hi = self.num_records * local_n_cmp = 0 # <<<<<<<<<<<<<< @@ -4327,7 +4477,7 @@ */ __pyx_v_local_n_cmp = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":629 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":629 * hi = self.num_records * local_n_cmp = 0 * while lo < hi: # <<<<<<<<<<<<<< @@ -4338,7 +4488,7 @@ __pyx_t_2 = (__pyx_v_lo < __pyx_v_hi); if (!__pyx_t_2) break; - /* "bzrlib/_btree_serializer_pyx.pyx":630 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":630 * local_n_cmp = 0 * while lo < hi: * mid = (lo + hi) / 2 # <<<<<<<<<<<<<< @@ -4347,7 +4497,7 @@ */ __pyx_v_mid = __Pyx_div_long((__pyx_v_lo + __pyx_v_hi), 2); - /* "bzrlib/_btree_serializer_pyx.pyx":631 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":631 * while lo < hi: * mid = (lo + hi) / 2 * the_cmp = memcmp(self.records[mid].sha1, sha1, 20) # <<<<<<<<<<<<<< @@ -4356,7 +4506,7 @@ */ __pyx_v_the_cmp = memcmp((__pyx_v_self->records[__pyx_v_mid]).sha1, __pyx_v_sha1, 20); - /* "bzrlib/_btree_serializer_pyx.pyx":632 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":632 * mid = (lo + hi) / 2 * the_cmp = memcmp(self.records[mid].sha1, sha1, 20) * if the_cmp == 0: # <<<<<<<<<<<<<< @@ -4366,7 +4516,7 @@ __pyx_t_2 = (__pyx_v_the_cmp == 0); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":633 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":633 * the_cmp = memcmp(self.records[mid].sha1, sha1, 20) * if the_cmp == 0: * return &self.records[mid] # <<<<<<<<<<<<<< @@ -4378,7 +4528,7 @@ goto __pyx_L6; } - /* "bzrlib/_btree_serializer_pyx.pyx":634 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":634 * if the_cmp == 0: * return &self.records[mid] * elif the_cmp < 0: # <<<<<<<<<<<<<< @@ -4388,7 +4538,7 @@ __pyx_t_2 = (__pyx_v_the_cmp < 0); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":635 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":635 * return &self.records[mid] * elif the_cmp < 0: * lo = mid + 1 # <<<<<<<<<<<<<< @@ -4400,7 +4550,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":637 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":637 * lo = mid + 1 * else: * hi = mid # <<<<<<<<<<<<<< @@ -4412,7 +4562,7 @@ __pyx_L6:; } - /* "bzrlib/_btree_serializer_pyx.pyx":638 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":638 * else: * hi = mid * return NULL # <<<<<<<<<<<<<< @@ -4432,7 +4582,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":640 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":640 * return NULL * * def __contains__(self, key): # <<<<<<<<<<<<<< @@ -4440,8 +4590,8 @@ * cdef gc_chk_sha1_record *record */ -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_3__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_3__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { char __pyx_v_sha1[20]; __pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *__pyx_v_record; int __pyx_r; @@ -4450,7 +4600,7 @@ int __pyx_t_3; __Pyx_RefNannySetupContext("__contains__"); - /* "bzrlib/_btree_serializer_pyx.pyx":643 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":643 * cdef char sha1[20] * cdef gc_chk_sha1_record *record * if _key_to_sha1(key, sha1): # <<<<<<<<<<<<<< @@ -4460,7 +4610,7 @@ __pyx_t_1 = __pyx_f_6bzrlib_21_btree_serializer_pyx__key_to_sha1(__pyx_v_key, __pyx_v_sha1); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":645 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":645 * if _key_to_sha1(key, sha1): * # If it isn't a sha1 key, then it won't be in this leaf node * record = self._lookup_record(sha1) # <<<<<<<<<<<<<< @@ -4470,7 +4620,7 @@ __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->__pyx_vtab)->_lookup_record(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self), __pyx_v_sha1); if (unlikely(__pyx_t_2 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_record = __pyx_t_2; - /* "bzrlib/_btree_serializer_pyx.pyx":646 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":646 * # If it isn't a sha1 key, then it won't be in this leaf node * record = self._lookup_record(sha1) * if record != NULL: # <<<<<<<<<<<<<< @@ -4480,7 +4630,7 @@ __pyx_t_3 = (__pyx_v_record != NULL); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":647 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":647 * record = self._lookup_record(sha1) * if record != NULL: * self.last_key = key # <<<<<<<<<<<<<< @@ -4493,7 +4643,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key = __pyx_v_key; - /* "bzrlib/_btree_serializer_pyx.pyx":648 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":648 * if record != NULL: * self.last_key = key * self.last_record = record # <<<<<<<<<<<<<< @@ -4502,7 +4652,7 @@ */ ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_record = __pyx_v_record; - /* "bzrlib/_btree_serializer_pyx.pyx":649 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":649 * self.last_key = key * self.last_record = record * return True # <<<<<<<<<<<<<< @@ -4518,7 +4668,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":650 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":650 * self.last_record = record * return True * return False # <<<<<<<<<<<<<< @@ -4538,7 +4688,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":652 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":652 * return False * * def __getitem__(self, key): # <<<<<<<<<<<<<< @@ -4546,8 +4696,8 @@ * cdef gc_chk_sha1_record *record */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_4__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_4__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { char __pyx_v_sha1[20]; __pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *__pyx_v_record; PyObject *__pyx_r = NULL; @@ -4560,7 +4710,7 @@ PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("__getitem__"); - /* "bzrlib/_btree_serializer_pyx.pyx":655 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":655 * cdef char sha1[20] * cdef gc_chk_sha1_record *record * record = NULL # <<<<<<<<<<<<<< @@ -4569,7 +4719,7 @@ */ __pyx_v_record = NULL; - /* "bzrlib/_btree_serializer_pyx.pyx":656 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":656 * cdef gc_chk_sha1_record *record * record = NULL * if self.last_record != NULL and key is self.last_key: # <<<<<<<<<<<<<< @@ -4585,7 +4735,7 @@ } if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":657 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":657 * record = NULL * if self.last_record != NULL and key is self.last_key: * record = self.last_record # <<<<<<<<<<<<<< @@ -4596,7 +4746,7 @@ goto __pyx_L5; } - /* "bzrlib/_btree_serializer_pyx.pyx":658 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":658 * if self.last_record != NULL and key is self.last_key: * record = self.last_record * elif _key_to_sha1(key, sha1): # <<<<<<<<<<<<<< @@ -4606,7 +4756,7 @@ __pyx_t_4 = __pyx_f_6bzrlib_21_btree_serializer_pyx__key_to_sha1(__pyx_v_key, __pyx_v_sha1); if (__pyx_t_4) { - /* "bzrlib/_btree_serializer_pyx.pyx":659 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":659 * record = self.last_record * elif _key_to_sha1(key, sha1): * record = self._lookup_record(sha1) # <<<<<<<<<<<<<< @@ -4619,7 +4769,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":660 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":660 * elif _key_to_sha1(key, sha1): * record = self._lookup_record(sha1) * if record == NULL: # <<<<<<<<<<<<<< @@ -4629,7 +4779,7 @@ __pyx_t_3 = (__pyx_v_record == NULL); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":661 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":661 * record = self._lookup_record(sha1) * if record == NULL: * raise KeyError('key %r is not present' % (key,)) # <<<<<<<<<<<<<< @@ -4637,21 +4787,21 @@ * */ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); - __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7)); __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_Call(__pyx_builtin_KeyError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_7, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4659,7 +4809,7 @@ } __pyx_L6:; - /* "bzrlib/_btree_serializer_pyx.pyx":662 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":662 * if record == NULL: * raise KeyError('key %r is not present' % (key,)) * return self._record_to_value_and_refs(record) # <<<<<<<<<<<<<< @@ -4686,7 +4836,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":664 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":664 * return self._record_to_value_and_refs(record) * * def __len__(self): # <<<<<<<<<<<<<< @@ -4694,12 +4844,12 @@ * */ -static Py_ssize_t __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_5__len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_5__len__(PyObject *__pyx_v_self) { +static Py_ssize_t __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; __Pyx_RefNannySetupContext("__len__"); - /* "bzrlib/_btree_serializer_pyx.pyx":665 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":665 * * def __len__(self): * return self.num_records # <<<<<<<<<<<<<< @@ -4715,7 +4865,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":667 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":667 * return self.num_records * * def all_keys(self): # <<<<<<<<<<<<<< @@ -4723,8 +4873,8 @@ * result = [] */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_6all_keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_6all_keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_all_keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_all_keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { int __pyx_v_i; PyObject *__pyx_v_result; PyObject *__pyx_r = NULL; @@ -4732,9 +4882,9 @@ int __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("all_keys"); - __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":669 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":669 * def all_keys(self): * cdef int i * result = [] # <<<<<<<<<<<<<< @@ -4747,7 +4897,7 @@ __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":670 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":670 * cdef int i * result = [] * for i from 0 <= i < self.num_records: # <<<<<<<<<<<<<< @@ -4757,7 +4907,7 @@ __pyx_t_2 = ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->num_records; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":671 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":671 * result = [] * for i from 0 <= i < self.num_records: * PyList_Append(result, _sha1_to_key(self.records[i].sha1)) # <<<<<<<<<<<<<< @@ -4770,7 +4920,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "bzrlib/_btree_serializer_pyx.pyx":672 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":672 * for i from 0 <= i < self.num_records: * PyList_Append(result, _sha1_to_key(self.records[i].sha1)) * return result # <<<<<<<<<<<<<< @@ -4795,7 +4945,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":674 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":674 * return result * * def all_items(self): # <<<<<<<<<<<<<< @@ -4803,8 +4953,8 @@ * result = [] */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_7all_items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_7all_items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_all_items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_all_items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { int __pyx_v_i; PyObject *__pyx_v_result; StaticTuple *__pyx_v_item; @@ -4813,10 +4963,10 @@ int __pyx_t_2; int __pyx_t_3; __Pyx_RefNannySetupContext("all_items"); - __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_item = ((StaticTuple *)Py_None); __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":676 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":676 * def all_items(self): * cdef int i * result = [] # <<<<<<<<<<<<<< @@ -4829,7 +4979,7 @@ __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":677 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":677 * cdef int i * result = [] * for i from 0 <= i < self.num_records: # <<<<<<<<<<<<<< @@ -4839,7 +4989,7 @@ __pyx_t_2 = ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->num_records; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":678 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":678 * result = [] * for i from 0 <= i < self.num_records: * item = self._record_to_item(&self.records[i]) # <<<<<<<<<<<<<< @@ -4852,7 +5002,7 @@ __pyx_v_item = ((StaticTuple *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":679 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":679 * for i from 0 <= i < self.num_records: * item = self._record_to_item(&self.records[i]) * PyList_Append(result, item) # <<<<<<<<<<<<<< @@ -4862,7 +5012,7 @@ __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_v_item)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - /* "bzrlib/_btree_serializer_pyx.pyx":680 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":680 * item = self._record_to_item(&self.records[i]) * PyList_Append(result, item) * return result # <<<<<<<<<<<<<< @@ -4888,7 +5038,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":682 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":682 * return result * * cdef int _count_records(self, char *c_content, char *c_end): # cannot_raise # <<<<<<<<<<<<<< @@ -4905,7 +5055,7 @@ int __pyx_t_3; __Pyx_RefNannySetupContext("_count_records"); - /* "bzrlib/_btree_serializer_pyx.pyx":687 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":687 * cdef int num_records * * c_cur = c_content # <<<<<<<<<<<<<< @@ -4914,7 +5064,7 @@ */ __pyx_v_c_cur = __pyx_v_c_content; - /* "bzrlib/_btree_serializer_pyx.pyx":688 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":688 * * c_cur = c_content * num_records = 0 # <<<<<<<<<<<<<< @@ -4923,7 +5073,7 @@ */ __pyx_v_num_records = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":689 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":689 * c_cur = c_content * num_records = 0 * while c_cur != NULL and c_cur < c_end: # <<<<<<<<<<<<<< @@ -4940,7 +5090,7 @@ } if (!__pyx_t_3) break; - /* "bzrlib/_btree_serializer_pyx.pyx":690 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":690 * num_records = 0 * while c_cur != NULL and c_cur < c_end: * c_cur = memchr(c_cur, c'\n', c_end - c_cur); # <<<<<<<<<<<<<< @@ -4949,7 +5099,7 @@ */ __pyx_v_c_cur = ((char *)memchr(__pyx_v_c_cur, '\n', (__pyx_v_c_end - __pyx_v_c_cur))); - /* "bzrlib/_btree_serializer_pyx.pyx":691 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":691 * while c_cur != NULL and c_cur < c_end: * c_cur = memchr(c_cur, c'\n', c_end - c_cur); * if c_cur == NULL: # <<<<<<<<<<<<<< @@ -4959,7 +5109,7 @@ __pyx_t_3 = (__pyx_v_c_cur == NULL); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":692 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":692 * c_cur = memchr(c_cur, c'\n', c_end - c_cur); * if c_cur == NULL: * break # <<<<<<<<<<<<<< @@ -4971,7 +5121,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":693 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":693 * if c_cur == NULL: * break * c_cur = c_cur + 1 # <<<<<<<<<<<<<< @@ -4980,7 +5130,7 @@ */ __pyx_v_c_cur = (__pyx_v_c_cur + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":694 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":694 * break * c_cur = c_cur + 1 * num_records = num_records + 1 # <<<<<<<<<<<<<< @@ -4991,7 +5141,7 @@ } __pyx_L4_break:; - /* "bzrlib/_btree_serializer_pyx.pyx":695 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":695 * c_cur = c_cur + 1 * num_records = num_records + 1 * return num_records # <<<<<<<<<<<<<< @@ -5007,7 +5157,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":697 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":697 * return num_records * * cdef _parse_bytes(self, bytes): # <<<<<<<<<<<<<< @@ -5026,15 +5176,15 @@ PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; char *__pyx_t_8; __Pyx_RefNannySetupContext("_parse_bytes"); - /* "bzrlib/_btree_serializer_pyx.pyx":707 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":707 * cdef gc_chk_sha1_record *cur_record * * if not PyString_CheckExact(bytes): # <<<<<<<<<<<<<< @@ -5044,23 +5194,29 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_bytes)); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":708 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":708 * * if not PyString_CheckExact(bytes): * raise TypeError('We only support parsing plain 8-bit strings.') # <<<<<<<<<<<<<< * # Pass 1, count how many records there will be * n_bytes = PyString_GET_SIZE(bytes) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_19)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_btree_serializer_pyx.pyx":710 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":710 * raise TypeError('We only support parsing plain 8-bit strings.') * # Pass 1, count how many records there will be * n_bytes = PyString_GET_SIZE(bytes) # <<<<<<<<<<<<<< @@ -5069,7 +5225,7 @@ */ __pyx_v_n_bytes = PyString_GET_SIZE(__pyx_v_bytes); - /* "bzrlib/_btree_serializer_pyx.pyx":711 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":711 * # Pass 1, count how many records there will be * n_bytes = PyString_GET_SIZE(bytes) * c_bytes = PyString_AS_STRING(bytes) # <<<<<<<<<<<<<< @@ -5078,7 +5234,7 @@ */ __pyx_v_c_bytes = PyString_AS_STRING(__pyx_v_bytes); - /* "bzrlib/_btree_serializer_pyx.pyx":712 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":712 * n_bytes = PyString_GET_SIZE(bytes) * c_bytes = PyString_AS_STRING(bytes) * c_end = c_bytes + n_bytes # <<<<<<<<<<<<<< @@ -5087,49 +5243,49 @@ */ __pyx_v_c_end = (__pyx_v_c_bytes + __pyx_v_n_bytes); - /* "bzrlib/_btree_serializer_pyx.pyx":713 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":713 * c_bytes = PyString_AS_STRING(bytes) * c_end = c_bytes + n_bytes * if strncmp(c_bytes, 'type=leaf\n', 10): # <<<<<<<<<<<<<< * raise ValueError("bytes did not start with 'type=leaf\\n': %r" * % (bytes[:10],)) */ - __pyx_t_3 = strncmp(__pyx_v_c_bytes, __pyx_k_30, 10); - if (__pyx_t_3) { + __pyx_t_4 = strncmp(__pyx_v_c_bytes, __pyx_k_20, 10); + if (__pyx_t_4) { - /* "bzrlib/_btree_serializer_pyx.pyx":715 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":715 * if strncmp(c_bytes, 'type=leaf\n', 10): * raise ValueError("bytes did not start with 'type=leaf\\n': %r" * % (bytes[:10],)) # <<<<<<<<<<<<<< * c_cur = c_bytes + 10 * num_records = self._count_records(c_cur, c_end) */ - __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_v_bytes, 0, 10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(__pyx_v_bytes, 0, 10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_31), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; - /* "bzrlib/_btree_serializer_pyx.pyx":716 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":716 * raise ValueError("bytes did not start with 'type=leaf\\n': %r" * % (bytes[:10],)) * c_cur = c_bytes + 10 # <<<<<<<<<<<<<< @@ -5138,7 +5294,7 @@ */ __pyx_v_c_cur = (__pyx_v_c_bytes + 10); - /* "bzrlib/_btree_serializer_pyx.pyx":717 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":717 * % (bytes[:10],)) * c_cur = c_bytes + 10 * num_records = self._count_records(c_cur, c_end) # <<<<<<<<<<<<<< @@ -5147,7 +5303,7 @@ */ __pyx_v_num_records = ((struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self->__pyx_vtab)->_count_records(__pyx_v_self, __pyx_v_c_cur, __pyx_v_c_end); - /* "bzrlib/_btree_serializer_pyx.pyx":719 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":719 * num_records = self._count_records(c_cur, c_end) * # Now allocate the memory for these items, and go to town * self.records = PyMem_Malloc(num_records * # <<<<<<<<<<<<<< @@ -5156,7 +5312,7 @@ */ __pyx_v_self->records = ((__pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *)PyMem_Malloc((__pyx_v_num_records * ((sizeof(unsigned short)) + (sizeof(__pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record)))))); - /* "bzrlib/_btree_serializer_pyx.pyx":721 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":721 * self.records = PyMem_Malloc(num_records * * (sizeof(unsigned short) + sizeof(gc_chk_sha1_record))) * self.num_records = num_records # <<<<<<<<<<<<<< @@ -5165,7 +5321,7 @@ */ __pyx_v_self->num_records = __pyx_v_num_records; - /* "bzrlib/_btree_serializer_pyx.pyx":722 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":722 * (sizeof(unsigned short) + sizeof(gc_chk_sha1_record))) * self.num_records = num_records * cur_record = self.records # <<<<<<<<<<<<<< @@ -5174,7 +5330,7 @@ */ __pyx_v_cur_record = __pyx_v_self->records; - /* "bzrlib/_btree_serializer_pyx.pyx":723 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":723 * self.num_records = num_records * cur_record = self.records * entry = 0 # <<<<<<<<<<<<<< @@ -5183,7 +5339,7 @@ */ __pyx_v_entry = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":724 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":724 * cur_record = self.records * entry = 0 * while c_cur != NULL and c_cur < c_end and entry < num_records: # <<<<<<<<<<<<<< @@ -5206,7 +5362,7 @@ } if (!__pyx_t_5) break; - /* "bzrlib/_btree_serializer_pyx.pyx":725 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":725 * entry = 0 * while c_cur != NULL and c_cur < c_end and entry < num_records: * c_cur = self._parse_one_entry(c_cur, c_end, cur_record) # <<<<<<<<<<<<<< @@ -5216,7 +5372,7 @@ __pyx_t_8 = ((struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self->__pyx_vtab)->_parse_one_entry(__pyx_v_self, __pyx_v_c_cur, __pyx_v_c_end, __pyx_v_cur_record); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_c_cur = __pyx_t_8; - /* "bzrlib/_btree_serializer_pyx.pyx":726 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":726 * while c_cur != NULL and c_cur < c_end and entry < num_records: * c_cur = self._parse_one_entry(c_cur, c_end, cur_record) * cur_record = cur_record + 1 # <<<<<<<<<<<<<< @@ -5225,7 +5381,7 @@ */ __pyx_v_cur_record = (__pyx_v_cur_record + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":727 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":727 * c_cur = self._parse_one_entry(c_cur, c_end, cur_record) * cur_record = cur_record + 1 * entry = entry + 1 # <<<<<<<<<<<<<< @@ -5235,7 +5391,7 @@ __pyx_v_entry = (__pyx_v_entry + 1); } - /* "bzrlib/_btree_serializer_pyx.pyx":728 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":728 * cur_record = cur_record + 1 * entry = entry + 1 * if (entry != self.num_records # <<<<<<<<<<<<<< @@ -5245,7 +5401,7 @@ __pyx_t_5 = (__pyx_v_entry != __pyx_v_self->num_records); if (!__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":730 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":730 * if (entry != self.num_records * or c_cur != c_end * or cur_record != self.records + self.num_records): # <<<<<<<<<<<<<< @@ -5265,15 +5421,21 @@ } if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":731 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":731 * or c_cur != c_end * or cur_record != self.records + self.num_records): * raise ValueError('Something went wrong while parsing.') # <<<<<<<<<<<<<< * # Pass 3: build the offset map * self._compute_common() */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_33), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_22)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_22)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_22)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5281,7 +5443,7 @@ } __pyx_L7:; - /* "bzrlib/_btree_serializer_pyx.pyx":733 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":733 * raise ValueError('Something went wrong while parsing.') * # Pass 3: build the offset map * self._compute_common() # <<<<<<<<<<<<<< @@ -5296,7 +5458,7 @@ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode._parse_bytes"); __pyx_r = 0; __pyx_L0:; @@ -5305,7 +5467,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":735 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":735 * self._compute_common() * * cdef char *_parse_one_entry(self, char *c_cur, char *c_end, # <<<<<<<<<<<<<< @@ -5324,7 +5486,7 @@ int __pyx_t_6; __Pyx_RefNannySetupContext("_parse_one_entry"); - /* "bzrlib/_btree_serializer_pyx.pyx":742 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":742 * """ * cdef char *c_next * if strncmp(c_cur, 'sha1:', 5): # <<<<<<<<<<<<<< @@ -5334,7 +5496,7 @@ __pyx_t_1 = strncmp(__pyx_v_c_cur, __pyx_k_3, 5); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":744 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":744 * if strncmp(c_cur, 'sha1:', 5): * raise ValueError('line did not start with sha1: %r' * % (safe_string_from_size(c_cur, 10),)) # <<<<<<<<<<<<<< @@ -5344,21 +5506,21 @@ __pyx_t_2 = __pyx_f_6bzrlib_21_btree_serializer_pyx_safe_string_from_size(__pyx_v_c_cur, 10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_34), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5366,7 +5528,7 @@ } __pyx_L3:; - /* "bzrlib/_btree_serializer_pyx.pyx":745 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":745 * raise ValueError('line did not start with sha1: %r' * % (safe_string_from_size(c_cur, 10),)) * c_cur = c_cur + 5 # <<<<<<<<<<<<<< @@ -5375,7 +5537,7 @@ */ __pyx_v_c_cur = (__pyx_v_c_cur + 5); - /* "bzrlib/_btree_serializer_pyx.pyx":746 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":746 * % (safe_string_from_size(c_cur, 10),)) * c_cur = c_cur + 5 * c_next = memchr(c_cur, c'\0', c_end - c_cur) # <<<<<<<<<<<<<< @@ -5384,7 +5546,7 @@ */ __pyx_v_c_next = ((char *)memchr(__pyx_v_c_cur, '\x00', (__pyx_v_c_end - __pyx_v_c_cur))); - /* "bzrlib/_btree_serializer_pyx.pyx":747 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":747 * c_cur = c_cur + 5 * c_next = memchr(c_cur, c'\0', c_end - c_cur) * if c_next == NULL or (c_next - c_cur != 40): # <<<<<<<<<<<<<< @@ -5400,23 +5562,29 @@ } if (__pyx_t_6) { - /* "bzrlib/_btree_serializer_pyx.pyx":748 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":748 * c_next = memchr(c_cur, c'\0', c_end - c_cur) * if c_next == NULL or (c_next - c_cur != 40): * raise ValueError('Line did not contain 40 hex bytes') # <<<<<<<<<<<<<< * if not _unhexlify_sha1(c_cur, cur_record.sha1): * raise ValueError('We failed to unhexlify') */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_24)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_24)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_24)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L4; } __pyx_L4:; - /* "bzrlib/_btree_serializer_pyx.pyx":749 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":749 * if c_next == NULL or (c_next - c_cur != 40): * raise ValueError('Line did not contain 40 hex bytes') * if not _unhexlify_sha1(c_cur, cur_record.sha1): # <<<<<<<<<<<<<< @@ -5426,15 +5594,21 @@ __pyx_t_6 = (!__pyx_f_6bzrlib_21_btree_serializer_pyx__unhexlify_sha1(__pyx_v_c_cur, __pyx_v_cur_record->sha1)); if (__pyx_t_6) { - /* "bzrlib/_btree_serializer_pyx.pyx":750 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":750 * raise ValueError('Line did not contain 40 hex bytes') * if not _unhexlify_sha1(c_cur, cur_record.sha1): * raise ValueError('We failed to unhexlify') # <<<<<<<<<<<<<< * c_cur = c_next + 1 * if c_cur[0] != c'\0': */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_25)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_25)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5442,7 +5616,7 @@ } __pyx_L5:; - /* "bzrlib/_btree_serializer_pyx.pyx":751 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":751 * if not _unhexlify_sha1(c_cur, cur_record.sha1): * raise ValueError('We failed to unhexlify') * c_cur = c_next + 1 # <<<<<<<<<<<<<< @@ -5451,7 +5625,7 @@ */ __pyx_v_c_cur = (__pyx_v_c_next + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":752 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":752 * raise ValueError('We failed to unhexlify') * c_cur = c_next + 1 * if c_cur[0] != c'\0': # <<<<<<<<<<<<<< @@ -5461,23 +5635,29 @@ __pyx_t_6 = ((__pyx_v_c_cur[0]) != '\x00'); if (__pyx_t_6) { - /* "bzrlib/_btree_serializer_pyx.pyx":753 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":753 * c_cur = c_next + 1 * if c_cur[0] != c'\0': * raise ValueError('only 1 null, not 2 as expected') # <<<<<<<<<<<<<< * c_cur = c_cur + 1 * cur_record.block_offset = strtoll(c_cur, &c_next, 10) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_26)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_26)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_26)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "bzrlib/_btree_serializer_pyx.pyx":754 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":754 * if c_cur[0] != c'\0': * raise ValueError('only 1 null, not 2 as expected') * c_cur = c_cur + 1 # <<<<<<<<<<<<<< @@ -5486,7 +5666,7 @@ */ __pyx_v_c_cur = (__pyx_v_c_cur + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":755 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":755 * raise ValueError('only 1 null, not 2 as expected') * c_cur = c_cur + 1 * cur_record.block_offset = strtoll(c_cur, &c_next, 10) # <<<<<<<<<<<<<< @@ -5495,7 +5675,7 @@ */ __pyx_v_cur_record->block_offset = strtoll(__pyx_v_c_cur, (&__pyx_v_c_next), 10); - /* "bzrlib/_btree_serializer_pyx.pyx":756 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":756 * c_cur = c_cur + 1 * cur_record.block_offset = strtoll(c_cur, &c_next, 10) * if c_cur == c_next or c_next[0] != c' ': # <<<<<<<<<<<<<< @@ -5511,15 +5691,21 @@ } if (__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":757 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":757 * cur_record.block_offset = strtoll(c_cur, &c_next, 10) * if c_cur == c_next or c_next[0] != c' ': * raise ValueError('Failed to parse block offset') # <<<<<<<<<<<<<< * c_cur = c_next + 1 * cur_record.block_length = strtoul(c_cur, &c_next, 10) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_42), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_27)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_27)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5527,7 +5713,7 @@ } __pyx_L7:; - /* "bzrlib/_btree_serializer_pyx.pyx":758 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":758 * if c_cur == c_next or c_next[0] != c' ': * raise ValueError('Failed to parse block offset') * c_cur = c_next + 1 # <<<<<<<<<<<<<< @@ -5536,7 +5722,7 @@ */ __pyx_v_c_cur = (__pyx_v_c_next + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":759 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":759 * raise ValueError('Failed to parse block offset') * c_cur = c_next + 1 * cur_record.block_length = strtoul(c_cur, &c_next, 10) # <<<<<<<<<<<<<< @@ -5545,7 +5731,7 @@ */ __pyx_v_cur_record->block_length = strtoul(__pyx_v_c_cur, (&__pyx_v_c_next), 10); - /* "bzrlib/_btree_serializer_pyx.pyx":760 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":760 * c_cur = c_next + 1 * cur_record.block_length = strtoul(c_cur, &c_next, 10) * if c_cur == c_next or c_next[0] != c' ': # <<<<<<<<<<<<<< @@ -5561,23 +5747,29 @@ } if (__pyx_t_4) { - /* "bzrlib/_btree_serializer_pyx.pyx":761 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":761 * cur_record.block_length = strtoul(c_cur, &c_next, 10) * if c_cur == c_next or c_next[0] != c' ': * raise ValueError('Failed to parse block length') # <<<<<<<<<<<<<< * c_cur = c_next + 1 * cur_record.record_start = strtoul(c_cur, &c_next, 10) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_28)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_28)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; - /* "bzrlib/_btree_serializer_pyx.pyx":762 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":762 * if c_cur == c_next or c_next[0] != c' ': * raise ValueError('Failed to parse block length') * c_cur = c_next + 1 # <<<<<<<<<<<<<< @@ -5586,7 +5778,7 @@ */ __pyx_v_c_cur = (__pyx_v_c_next + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":763 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":763 * raise ValueError('Failed to parse block length') * c_cur = c_next + 1 * cur_record.record_start = strtoul(c_cur, &c_next, 10) # <<<<<<<<<<<<<< @@ -5595,7 +5787,7 @@ */ __pyx_v_cur_record->record_start = strtoul(__pyx_v_c_cur, (&__pyx_v_c_next), 10); - /* "bzrlib/_btree_serializer_pyx.pyx":764 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":764 * c_cur = c_next + 1 * cur_record.record_start = strtoul(c_cur, &c_next, 10) * if c_cur == c_next or c_next[0] != c' ': # <<<<<<<<<<<<<< @@ -5611,15 +5803,21 @@ } if (__pyx_t_6) { - /* "bzrlib/_btree_serializer_pyx.pyx":765 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":765 * cur_record.record_start = strtoul(c_cur, &c_next, 10) * if c_cur == c_next or c_next[0] != c' ': * raise ValueError('Failed to parse block length') # <<<<<<<<<<<<<< * c_cur = c_next + 1 * cur_record.record_end = strtoul(c_cur, &c_next, 10) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_28)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_28)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5627,7 +5825,7 @@ } __pyx_L9:; - /* "bzrlib/_btree_serializer_pyx.pyx":766 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":766 * if c_cur == c_next or c_next[0] != c' ': * raise ValueError('Failed to parse block length') * c_cur = c_next + 1 # <<<<<<<<<<<<<< @@ -5636,7 +5834,7 @@ */ __pyx_v_c_cur = (__pyx_v_c_next + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":767 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":767 * raise ValueError('Failed to parse block length') * c_cur = c_next + 1 * cur_record.record_end = strtoul(c_cur, &c_next, 10) # <<<<<<<<<<<<<< @@ -5645,7 +5843,7 @@ */ __pyx_v_cur_record->record_end = strtoul(__pyx_v_c_cur, (&__pyx_v_c_next), 10); - /* "bzrlib/_btree_serializer_pyx.pyx":768 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":768 * c_cur = c_next + 1 * cur_record.record_end = strtoul(c_cur, &c_next, 10) * if c_cur == c_next or c_next[0] != c'\n': # <<<<<<<<<<<<<< @@ -5661,23 +5859,29 @@ } if (__pyx_t_5) { - /* "bzrlib/_btree_serializer_pyx.pyx":769 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":769 * cur_record.record_end = strtoul(c_cur, &c_next, 10) * if c_cur == c_next or c_next[0] != c'\n': * raise ValueError('Failed to parse record end') # <<<<<<<<<<<<<< * c_cur = c_next + 1 * return c_cur */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_29)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_29)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } __pyx_L10:; - /* "bzrlib/_btree_serializer_pyx.pyx":770 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":770 * if c_cur == c_next or c_next[0] != c'\n': * raise ValueError('Failed to parse record end') * c_cur = c_next + 1 # <<<<<<<<<<<<<< @@ -5686,7 +5890,7 @@ */ __pyx_v_c_cur = (__pyx_v_c_next + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":771 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":771 * raise ValueError('Failed to parse record end') * c_cur = c_next + 1 * return c_cur # <<<<<<<<<<<<<< @@ -5708,7 +5912,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":773 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":773 * return c_cur * * cdef int _offset_for_sha1(self, char *sha1) except -1: # <<<<<<<<<<<<<< @@ -5722,7 +5926,7 @@ int __pyx_r; __Pyx_RefNannySetupContext("_offset_for_sha1"); - /* "bzrlib/_btree_serializer_pyx.pyx":777 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":777 * cdef int this_offset * cdef unsigned int as_uint * as_uint = _sha1_to_uint(sha1) # <<<<<<<<<<<<<< @@ -5731,7 +5935,7 @@ */ __pyx_v_as_uint = __pyx_f_6bzrlib_21_btree_serializer_pyx__sha1_to_uint(__pyx_v_sha1); - /* "bzrlib/_btree_serializer_pyx.pyx":778 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":778 * cdef unsigned int as_uint * as_uint = _sha1_to_uint(sha1) * this_offset = (as_uint >> self.common_shift) & 0xFF # <<<<<<<<<<<<<< @@ -5740,7 +5944,7 @@ */ __pyx_v_this_offset = ((__pyx_v_as_uint >> __pyx_v_self->common_shift) & 0xFF); - /* "bzrlib/_btree_serializer_pyx.pyx":779 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":779 * as_uint = _sha1_to_uint(sha1) * this_offset = (as_uint >> self.common_shift) & 0xFF * return this_offset # <<<<<<<<<<<<<< @@ -5756,7 +5960,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":781 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":781 * return this_offset * * def _get_offset_for_sha1(self, sha1): # <<<<<<<<<<<<<< @@ -5764,14 +5968,14 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8_get_offset_for_sha1(PyObject *__pyx_v_self, PyObject *__pyx_v_sha1); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8_get_offset_for_sha1(PyObject *__pyx_v_self, PyObject *__pyx_v_sha1) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__get_offset_for_sha1(PyObject *__pyx_v_self, PyObject *__pyx_v_sha1); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__get_offset_for_sha1(PyObject *__pyx_v_self, PyObject *__pyx_v_sha1) { PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_get_offset_for_sha1"); - /* "bzrlib/_btree_serializer_pyx.pyx":782 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":782 * * def _get_offset_for_sha1(self, sha1): * return self._offset_for_sha1(PyString_AS_STRING(sha1)) # <<<<<<<<<<<<<< @@ -5798,7 +6002,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":784 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":784 * return self._offset_for_sha1(PyString_AS_STRING(sha1)) * * cdef _compute_common(self): # <<<<<<<<<<<<<< @@ -5818,14 +6022,11 @@ PyObject *__pyx_r = NULL; int __pyx_t_1; int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; + int __pyx_t_3; + int __pyx_t_4; __Pyx_RefNannySetupContext("_compute_common"); - /* "bzrlib/_btree_serializer_pyx.pyx":798 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":798 * # By XORing the records together, we can determine what bits are set in * # all of them * if self.num_records < 2: # <<<<<<<<<<<<<< @@ -5835,7 +6036,7 @@ __pyx_t_1 = (__pyx_v_self->num_records < 2); if (__pyx_t_1) { - /* "bzrlib/_btree_serializer_pyx.pyx":801 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":801 * # Everything is in common if you have 0 or 1 leaves * # So we'll always just shift to the first byte * self.common_shift = 24 # <<<<<<<<<<<<<< @@ -5847,7 +6048,7 @@ } /*else*/ { - /* "bzrlib/_btree_serializer_pyx.pyx":803 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":803 * self.common_shift = 24 * else: * common_mask = 0xFFFFFFFF # <<<<<<<<<<<<<< @@ -5856,7 +6057,7 @@ */ __pyx_v_common_mask = 0xFFFFFFFF; - /* "bzrlib/_btree_serializer_pyx.pyx":804 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":804 * else: * common_mask = 0xFFFFFFFF * first = _sha1_to_uint(self.records[0].sha1) # <<<<<<<<<<<<<< @@ -5865,7 +6066,7 @@ */ __pyx_v_first = __pyx_f_6bzrlib_21_btree_serializer_pyx__sha1_to_uint((__pyx_v_self->records[0]).sha1); - /* "bzrlib/_btree_serializer_pyx.pyx":805 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":805 * common_mask = 0xFFFFFFFF * first = _sha1_to_uint(self.records[0].sha1) * for i from 0 < i < self.num_records: # <<<<<<<<<<<<<< @@ -5875,7 +6076,7 @@ __pyx_t_2 = __pyx_v_self->num_records; for (__pyx_v_i = 0+1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":806 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":806 * first = _sha1_to_uint(self.records[0].sha1) * for i from 0 < i < self.num_records: * this = _sha1_to_uint(self.records[i].sha1) # <<<<<<<<<<<<<< @@ -5884,7 +6085,7 @@ */ __pyx_v_this = __pyx_f_6bzrlib_21_btree_serializer_pyx__sha1_to_uint((__pyx_v_self->records[__pyx_v_i]).sha1); - /* "bzrlib/_btree_serializer_pyx.pyx":807 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":807 * for i from 0 < i < self.num_records: * this = _sha1_to_uint(self.records[i].sha1) * common_mask = (~(first ^ this)) & common_mask # <<<<<<<<<<<<<< @@ -5894,7 +6095,7 @@ __pyx_v_common_mask = ((~(__pyx_v_first ^ __pyx_v_this)) & __pyx_v_common_mask); } - /* "bzrlib/_btree_serializer_pyx.pyx":808 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":808 * this = _sha1_to_uint(self.records[i].sha1) * common_mask = (~(first ^ this)) & common_mask * common_shift = 24 # <<<<<<<<<<<<<< @@ -5903,7 +6104,7 @@ */ __pyx_v_common_shift = 24; - /* "bzrlib/_btree_serializer_pyx.pyx":809 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":809 * common_mask = (~(first ^ this)) & common_mask * common_shift = 24 * while common_mask & 0x80000000 and common_shift > 0: # <<<<<<<<<<<<<< @@ -5911,22 +6112,15 @@ * common_shift = common_shift - 1 */ while (1) { - __pyx_t_3 = PyLong_FromUnsignedLong(__pyx_v_common_mask); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_And(__pyx_t_3, __pyx_int_2147483648); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_1) { - __pyx_t_5 = (__pyx_v_common_shift > 0); - __pyx_t_6 = __pyx_t_5; + if ((__pyx_v_common_mask & 0x80000000)) { + __pyx_t_1 = (__pyx_v_common_shift > 0); + __pyx_t_3 = __pyx_t_1; } else { - __pyx_t_6 = __pyx_t_1; + __pyx_t_3 = (__pyx_v_common_mask & 0x80000000); } - if (!__pyx_t_6) break; + if (!__pyx_t_3) break; - /* "bzrlib/_btree_serializer_pyx.pyx":810 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":810 * common_shift = 24 * while common_mask & 0x80000000 and common_shift > 0: * common_mask = common_mask << 1 # <<<<<<<<<<<<<< @@ -5935,7 +6129,7 @@ */ __pyx_v_common_mask = (__pyx_v_common_mask << 1); - /* "bzrlib/_btree_serializer_pyx.pyx":811 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":811 * while common_mask & 0x80000000 and common_shift > 0: * common_mask = common_mask << 1 * common_shift = common_shift - 1 # <<<<<<<<<<<<<< @@ -5945,7 +6139,7 @@ __pyx_v_common_shift = (__pyx_v_common_shift - 1); } - /* "bzrlib/_btree_serializer_pyx.pyx":812 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":812 * common_mask = common_mask << 1 * common_shift = common_shift - 1 * self.common_shift = common_shift # <<<<<<<<<<<<<< @@ -5956,7 +6150,7 @@ } __pyx_L3:; - /* "bzrlib/_btree_serializer_pyx.pyx":813 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":813 * common_shift = common_shift - 1 * self.common_shift = common_shift * offset = 0 # <<<<<<<<<<<<<< @@ -5965,7 +6159,7 @@ */ __pyx_v_offset = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":814 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":814 * self.common_shift = common_shift * offset = 0 * max_offset = self.num_records # <<<<<<<<<<<<<< @@ -5974,17 +6168,17 @@ */ __pyx_v_max_offset = __pyx_v_self->num_records; - /* "bzrlib/_btree_serializer_pyx.pyx":819 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":819 * # It means that if we have >255 records we have to bisect the second * # half of the list, but this is going to be very rare in practice. * if max_offset > 255: # <<<<<<<<<<<<<< * max_offset = 255 * for i from 0 <= i < max_offset: */ - __pyx_t_6 = (__pyx_v_max_offset > 255); - if (__pyx_t_6) { + __pyx_t_3 = (__pyx_v_max_offset > 255); + if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":820 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":820 * # half of the list, but this is going to be very rare in practice. * if max_offset > 255: * max_offset = 255 # <<<<<<<<<<<<<< @@ -5996,7 +6190,7 @@ } __pyx_L8:; - /* "bzrlib/_btree_serializer_pyx.pyx":821 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":821 * if max_offset > 255: * max_offset = 255 * for i from 0 <= i < max_offset: # <<<<<<<<<<<<<< @@ -6006,17 +6200,17 @@ __pyx_t_2 = __pyx_v_max_offset; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":822 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":822 * max_offset = 255 * for i from 0 <= i < max_offset: * this_offset = self._offset_for_sha1(self.records[i].sha1) # <<<<<<<<<<<<<< * while offset <= this_offset: * self.offsets[offset] = i */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self->__pyx_vtab)->_offset_for_sha1(__pyx_v_self, (__pyx_v_self->records[__pyx_v_i]).sha1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_this_offset = __pyx_t_7; + __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self->__pyx_vtab)->_offset_for_sha1(__pyx_v_self, (__pyx_v_self->records[__pyx_v_i]).sha1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_this_offset = __pyx_t_4; - /* "bzrlib/_btree_serializer_pyx.pyx":823 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":823 * for i from 0 <= i < max_offset: * this_offset = self._offset_for_sha1(self.records[i].sha1) * while offset <= this_offset: # <<<<<<<<<<<<<< @@ -6024,10 +6218,10 @@ * offset = offset + 1 */ while (1) { - __pyx_t_6 = (__pyx_v_offset <= __pyx_v_this_offset); - if (!__pyx_t_6) break; + __pyx_t_3 = (__pyx_v_offset <= __pyx_v_this_offset); + if (!__pyx_t_3) break; - /* "bzrlib/_btree_serializer_pyx.pyx":824 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":824 * this_offset = self._offset_for_sha1(self.records[i].sha1) * while offset <= this_offset: * self.offsets[offset] = i # <<<<<<<<<<<<<< @@ -6036,7 +6230,7 @@ */ (__pyx_v_self->offsets[__pyx_v_offset]) = __pyx_v_i; - /* "bzrlib/_btree_serializer_pyx.pyx":825 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":825 * while offset <= this_offset: * self.offsets[offset] = i * offset = offset + 1 # <<<<<<<<<<<<<< @@ -6047,7 +6241,7 @@ } } - /* "bzrlib/_btree_serializer_pyx.pyx":826 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":826 * self.offsets[offset] = i * offset = offset + 1 * while offset < 257: # <<<<<<<<<<<<<< @@ -6055,10 +6249,10 @@ * offset = offset + 1 */ while (1) { - __pyx_t_6 = (__pyx_v_offset < 257); - if (!__pyx_t_6) break; + __pyx_t_3 = (__pyx_v_offset < 257); + if (!__pyx_t_3) break; - /* "bzrlib/_btree_serializer_pyx.pyx":827 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":827 * offset = offset + 1 * while offset < 257: * self.offsets[offset] = max_offset # <<<<<<<<<<<<<< @@ -6067,7 +6261,7 @@ */ (__pyx_v_self->offsets[__pyx_v_offset]) = __pyx_v_max_offset; - /* "bzrlib/_btree_serializer_pyx.pyx":828 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":828 * while offset < 257: * self.offsets[offset] = max_offset * offset = offset + 1 # <<<<<<<<<<<<<< @@ -6080,8 +6274,6 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode._compute_common"); __pyx_r = 0; __pyx_L0:; @@ -6090,7 +6282,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":830 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":830 * offset = offset + 1 * * def _get_offsets(self): # <<<<<<<<<<<<<< @@ -6098,17 +6290,17 @@ * result = [] */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_9_get_offsets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_9_get_offsets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__get_offsets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__get_offsets(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { int __pyx_v_i; PyObject *__pyx_v_result; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; __Pyx_RefNannySetupContext("_get_offsets"); - __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_result = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":832 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":832 * def _get_offsets(self): * cdef int i * result = [] # <<<<<<<<<<<<<< @@ -6121,7 +6313,7 @@ __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":833 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":833 * cdef int i * result = [] * for i from 0 <= i < 257: # <<<<<<<<<<<<<< @@ -6130,7 +6322,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < 257; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":834 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":834 * result = [] * for i from 0 <= i < 257: * PyList_Append(result, self.offsets[i]) # <<<<<<<<<<<<<< @@ -6143,7 +6335,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - /* "bzrlib/_btree_serializer_pyx.pyx":835 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":835 * for i from 0 <= i < 257: * PyList_Append(result, self.offsets[i]) * return result # <<<<<<<<<<<<<< @@ -6168,175 +6360,20 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":522 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":838 * - * cdef gc_chk_sha1_record *records - * cdef public object last_key # <<<<<<<<<<<<<< - * cdef gc_chk_sha1_record *last_record - * cdef public int num_records + * + * def _parse_into_chk(bytes, key_length, ref_list_length): # <<<<<<<<<<<<<< + * """Parse into a format optimized for chk records.""" + * assert key_length == 1 */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); - __pyx_r = ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannySetupContext("__set__"); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); - ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key_2__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key_2__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannySetupContext("__del__"); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key); - ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->last_key = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_btree_serializer_pyx.pyx":524 - * cdef public object last_key - * cdef gc_chk_sha1_record *last_record - * cdef public int num_records # <<<<<<<<<<<<<< - * # This is the number of bits to shift to get to the interesting byte. A - * # value of 24 means that the very first byte changes across all keys. - */ - -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_11num_records___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_11num_records___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->num_records); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode.num_records.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_11num_records_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_11num_records_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->num_records = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode.num_records.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_btree_serializer_pyx.pyx":530 - * # ignore. 0 means that at least the first 3 bytes are identical, though - * # that is going to be very rare - * cdef public unsigned char common_shift # <<<<<<<<<<<<<< - * # This maps an interesting byte to the first record that matches. - * # Equivalent to bisect.bisect_left(self.records, sha1), though only taking - */ - -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_12common_shift___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_12common_shift___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->common_shift); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode.common_shift.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_12common_shift_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_12common_shift_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - unsigned char __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyInt_AsUnsignedChar(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *)__pyx_v_self)->common_shift = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode.common_shift.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_btree_serializer_pyx.pyx":838 - * - * - * def _parse_into_chk(bytes, key_length, ref_list_length): # <<<<<<<<<<<<<< - * """Parse into a format optimized for chk records.""" - * assert key_length == 1 - */ - -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_5_parse_into_chk(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_21_btree_serializer_pyx_5_parse_into_chk[] = "Parse into a format optimized for chk records."; -static PyMethodDef __pyx_mdef_6bzrlib_21_btree_serializer_pyx_5_parse_into_chk = {__Pyx_NAMESTR("_parse_into_chk"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_5_parse_into_chk, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx_5_parse_into_chk)}; -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_5_parse_into_chk(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_bytes = 0; - PyObject *__pyx_v_key_length = 0; - PyObject *__pyx_v_ref_list_length = 0; +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__parse_into_chk(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_21_btree_serializer_pyx__parse_into_chk[] = "Parse into a format optimized for chk records."; +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__parse_into_chk(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_bytes = 0; + PyObject *__pyx_v_key_length = 0; + PyObject *__pyx_v_ref_list_length = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; @@ -6394,14 +6431,14 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_btree_serializer_pyx.pyx":840 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":840 * def _parse_into_chk(bytes, key_length, ref_list_length): * """Parse into a format optimized for chk records.""" * assert key_length == 1 # <<<<<<<<<<<<<< * assert ref_list_length == 0 * return GCCHKSHA1LeafNode(bytes) */ - #ifndef CYTHON_WITHOUT_ASSERTIONS + #ifndef PYREX_WITHOUT_ASSERTIONS __pyx_t_1 = PyObject_RichCompare(__pyx_v_key_length, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -6412,14 +6449,14 @@ } #endif - /* "bzrlib/_btree_serializer_pyx.pyx":841 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":841 * """Parse into a format optimized for chk records.""" * assert key_length == 1 * assert ref_list_length == 0 # <<<<<<<<<<<<<< * return GCCHKSHA1LeafNode(bytes) * */ - #ifndef CYTHON_WITHOUT_ASSERTIONS + #ifndef PYREX_WITHOUT_ASSERTIONS __pyx_t_1 = PyObject_RichCompare(__pyx_v_ref_list_length, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -6430,7 +6467,7 @@ } #endif - /* "bzrlib/_btree_serializer_pyx.pyx":842 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":842 * assert key_length == 1 * assert ref_list_length == 0 * return GCCHKSHA1LeafNode(bytes) # <<<<<<<<<<<<<< @@ -6439,13 +6476,13 @@ */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_bytes); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_bytes); __Pyx_GIVEREF(__pyx_v_bytes); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; @@ -6463,7 +6500,7 @@ return __pyx_r; } -/* "bzrlib/_btree_serializer_pyx.pyx":845 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":845 * * * def _flatten_node(node, reference_lists): # <<<<<<<<<<<<<< @@ -6471,10 +6508,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_6_flatten_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_21_btree_serializer_pyx_6_flatten_node[] = "Convert a node into the serialized form.\n\n :param node: A tuple representing a node:\n (index, key_tuple, value, references)\n :param reference_lists: Does this index have reference lists?\n :return: (string_key, flattened)\n string_key The serialized key for referencing this node\n flattened A string with the serialized form for the contents\n "; -static PyMethodDef __pyx_mdef_6bzrlib_21_btree_serializer_pyx_6_flatten_node = {__Pyx_NAMESTR("_flatten_node"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_6_flatten_node, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx_6_flatten_node)}; -static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx_6_flatten_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__flatten_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_21_btree_serializer_pyx__flatten_node[] = "Convert a node into the serialized form.\n\n :param node: A tuple representing a node:\n (index, key_tuple, value, references)\n :param reference_lists: Does this index have reference lists?\n :return: (string_key, flattened)\n string_key The serialized key for referencing this node\n flattened A string with the serialized form for the contents\n "; +static PyObject *__pyx_pf_6bzrlib_21_btree_serializer_pyx__flatten_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_node = 0; PyObject *__pyx_v_reference_lists = 0; int __pyx_v_have_reference_lists; @@ -6562,7 +6598,7 @@ __pyx_v_val = Py_None; __Pyx_INCREF(Py_None); __pyx_v_line = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_btree_serializer_pyx.pyx":869 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":869 * cdef Py_ssize_t ref_bit_len * * if not PyTuple_CheckExact(node) and not StaticTuple_CheckExact(node): # <<<<<<<<<<<<<< @@ -6578,23 +6614,23 @@ } if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":871 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":871 * if not PyTuple_CheckExact(node) and not StaticTuple_CheckExact(node): * raise TypeError('We expected a tuple() or StaticTuple() for node not: %s' * % type(node)) # <<<<<<<<<<<<<< * node_len = len(node) * have_reference_lists = reference_lists */ - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_48), ((PyObject *)Py_TYPE(__pyx_v_node))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), ((PyObject *)Py_TYPE(__pyx_v_node))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -6602,7 +6638,7 @@ } __pyx_L6:; - /* "bzrlib/_btree_serializer_pyx.pyx":872 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":872 * raise TypeError('We expected a tuple() or StaticTuple() for node not: %s' * % type(node)) * node_len = len(node) # <<<<<<<<<<<<<< @@ -6612,7 +6648,7 @@ __pyx_t_6 = PyObject_Length(__pyx_v_node); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_node_len = __pyx_t_6; - /* "bzrlib/_btree_serializer_pyx.pyx":873 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":873 * % type(node)) * node_len = len(node) * have_reference_lists = reference_lists # <<<<<<<<<<<<<< @@ -6622,7 +6658,7 @@ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_reference_lists); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_have_reference_lists = __pyx_t_7; - /* "bzrlib/_btree_serializer_pyx.pyx":874 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":874 * node_len = len(node) * have_reference_lists = reference_lists * if have_reference_lists: # <<<<<<<<<<<<<< @@ -6631,7 +6667,7 @@ */ if (__pyx_v_have_reference_lists) { - /* "bzrlib/_btree_serializer_pyx.pyx":875 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":875 * have_reference_lists = reference_lists * if have_reference_lists: * if node_len != 4: # <<<<<<<<<<<<<< @@ -6641,7 +6677,7 @@ __pyx_t_3 = (__pyx_v_node_len != 4); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":877 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":877 * if node_len != 4: * raise ValueError('With ref_lists, we expected 4 entries not: %s' * % len(node)) # <<<<<<<<<<<<<< @@ -6651,17 +6687,17 @@ __pyx_t_6 = PyObject_Length(__pyx_v_node); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_31), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5)); __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -6671,7 +6707,7 @@ goto __pyx_L7; } - /* "bzrlib/_btree_serializer_pyx.pyx":878 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":878 * raise ValueError('With ref_lists, we expected 4 entries not: %s' * % len(node)) * elif node_len < 3: # <<<<<<<<<<<<<< @@ -6681,7 +6717,7 @@ __pyx_t_3 = (__pyx_v_node_len < 3); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":880 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":880 * elif node_len < 3: * raise ValueError('Without ref_lists, we need at least 3 entries not: %s' * % len(node)) # <<<<<<<<<<<<<< @@ -6691,17 +6727,17 @@ __pyx_t_6 = PyObject_Length(__pyx_v_node); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_50), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_32), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -6709,31 +6745,31 @@ } __pyx_L7:; - /* "bzrlib/_btree_serializer_pyx.pyx":891 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":891 * # We *could* do more work on our own, and grab the actual items * # lists. For now, just ask people to use a better compiler. :) * string_key = '\0'.join(node[1]) # <<<<<<<<<<<<<< * * # TODO: instead of using string joins, precompute the final string length, */ - __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_51), __pyx_n_s__join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_33), __pyx_n_s__join); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_node, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_string_key); __pyx_v_string_key = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":905 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":905 * # ref := BYTES (NULL BYTES)* * # value := BYTES * refs_len = 0 # <<<<<<<<<<<<<< @@ -6742,7 +6778,7 @@ */ __pyx_v_refs_len = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":906 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":906 * # value := BYTES * refs_len = 0 * if have_reference_lists: # <<<<<<<<<<<<<< @@ -6751,7 +6787,7 @@ */ if (__pyx_v_have_reference_lists) { - /* "bzrlib/_btree_serializer_pyx.pyx":908 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":908 * if have_reference_lists: * # Figure out how many bytes it will take to store the references * ref_lists = node[3] # <<<<<<<<<<<<<< @@ -6764,7 +6800,7 @@ __pyx_v_ref_lists = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":909 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":909 * # Figure out how many bytes it will take to store the references * ref_lists = node[3] * next_len = len(ref_lists) # TODO: use a Py function # <<<<<<<<<<<<<< @@ -6774,7 +6810,7 @@ __pyx_t_6 = PyObject_Length(__pyx_v_ref_lists); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_next_len = __pyx_t_6; - /* "bzrlib/_btree_serializer_pyx.pyx":910 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":910 * ref_lists = node[3] * next_len = len(ref_lists) # TODO: use a Py function * if next_len > 0: # <<<<<<<<<<<<<< @@ -6784,7 +6820,7 @@ __pyx_t_3 = (__pyx_v_next_len > 0); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":914 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":914 * # Otherwise we will need (len - 1) '\t' characters to separate * # the reference lists * refs_len = refs_len + (next_len - 1) # <<<<<<<<<<<<<< @@ -6793,7 +6829,7 @@ */ __pyx_v_refs_len = (__pyx_v_refs_len + (__pyx_v_next_len - 1)); - /* "bzrlib/_btree_serializer_pyx.pyx":915 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":915 * # the reference lists * refs_len = refs_len + (next_len - 1) * for ref_list in ref_lists: # <<<<<<<<<<<<<< @@ -6825,7 +6861,7 @@ __pyx_v_ref_list = __pyx_t_8; __pyx_t_8 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":916 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":916 * refs_len = refs_len + (next_len - 1) * for ref_list in ref_lists: * next_len = len(ref_list) # <<<<<<<<<<<<<< @@ -6835,7 +6871,7 @@ __pyx_t_9 = PyObject_Length(__pyx_v_ref_list); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_next_len = __pyx_t_9; - /* "bzrlib/_btree_serializer_pyx.pyx":917 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":917 * for ref_list in ref_lists: * next_len = len(ref_list) * if next_len > 0: # <<<<<<<<<<<<<< @@ -6845,7 +6881,7 @@ __pyx_t_3 = (__pyx_v_next_len > 0); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":920 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":920 * # We will need (len - 1) '\r' characters to separate the * # references * refs_len = refs_len + (next_len - 1) # <<<<<<<<<<<<<< @@ -6854,7 +6890,7 @@ */ __pyx_v_refs_len = (__pyx_v_refs_len + (__pyx_v_next_len - 1)); - /* "bzrlib/_btree_serializer_pyx.pyx":921 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":921 * # references * refs_len = refs_len + (next_len - 1) * for reference in ref_list: # <<<<<<<<<<<<<< @@ -6886,7 +6922,7 @@ __pyx_v_reference = __pyx_t_4; __pyx_t_4 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":922 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":922 * refs_len = refs_len + (next_len - 1) * for reference in ref_list: * if (not PyTuple_CheckExact(reference) # <<<<<<<<<<<<<< @@ -6896,7 +6932,7 @@ __pyx_t_3 = (!PyTuple_CheckExact(__pyx_v_reference)); if (__pyx_t_3) { - /* "bzrlib/_btree_serializer_pyx.pyx":923 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":923 * for reference in ref_list: * if (not PyTuple_CheckExact(reference) * and not StaticTuple_CheckExact(reference)): # <<<<<<<<<<<<<< @@ -6910,23 +6946,23 @@ } if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":926 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":926 * raise TypeError( * 'We expect references to be tuples not: %s' * % type(reference)) # <<<<<<<<<<<<<< * next_len = len(reference) * if next_len > 0: */ - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_52), ((PyObject *)Py_TYPE(__pyx_v_reference))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_34), ((PyObject *)Py_TYPE(__pyx_v_reference))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); + __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -6934,7 +6970,7 @@ } __pyx_L16:; - /* "bzrlib/_btree_serializer_pyx.pyx":927 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":927 * 'We expect references to be tuples not: %s' * % type(reference)) * next_len = len(reference) # <<<<<<<<<<<<<< @@ -6944,7 +6980,7 @@ __pyx_t_11 = PyObject_Length(__pyx_v_reference); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_next_len = __pyx_t_11; - /* "bzrlib/_btree_serializer_pyx.pyx":928 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":928 * % type(reference)) * next_len = len(reference) * if next_len > 0: # <<<<<<<<<<<<<< @@ -6954,7 +6990,7 @@ __pyx_t_2 = (__pyx_v_next_len > 0); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":931 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":931 * # We will need (len - 1) '\x00' characters to * # separate the reference key * refs_len = refs_len + (next_len - 1) # <<<<<<<<<<<<<< @@ -6963,7 +6999,7 @@ */ __pyx_v_refs_len = (__pyx_v_refs_len + (__pyx_v_next_len - 1)); - /* "bzrlib/_btree_serializer_pyx.pyx":932 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":932 * # separate the reference key * refs_len = refs_len + (next_len - 1) * for ref_bit in reference: # <<<<<<<<<<<<<< @@ -6995,7 +7031,7 @@ __pyx_v_ref_bit = __pyx_t_10; __pyx_t_10 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":933 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":933 * refs_len = refs_len + (next_len - 1) * for ref_bit in reference: * if not PyString_CheckExact(ref_bit): # <<<<<<<<<<<<<< @@ -7005,23 +7041,23 @@ __pyx_t_2 = (!PyString_CheckExact(__pyx_v_ref_bit)); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":936 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":936 * raise TypeError('We expect reference bits' * ' to be strings not: %s' * % type(ref_bit)) # <<<<<<<<<<<<<< * refs_len = refs_len + PyString_GET_SIZE(ref_bit) * */ - __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_53), ((PyObject *)Py_TYPE(__pyx_v_ref_bit))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_35), ((PyObject *)Py_TYPE(__pyx_v_ref_bit))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); + __Pyx_GOTREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_10)); __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_Raise(__pyx_t_10, 0, 0); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7029,7 +7065,7 @@ } __pyx_L20:; - /* "bzrlib/_btree_serializer_pyx.pyx":937 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":937 * ' to be strings not: %s' * % type(ref_bit)) * refs_len = refs_len + PyString_GET_SIZE(ref_bit) # <<<<<<<<<<<<<< @@ -7056,7 +7092,7 @@ } __pyx_L9:; - /* "bzrlib/_btree_serializer_pyx.pyx":940 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":940 * * # So we have the (key NULL refs NULL value LF) * key_len = PyString_Size(string_key) # <<<<<<<<<<<<<< @@ -7065,7 +7101,7 @@ */ __pyx_v_key_len = PyString_Size(__pyx_v_string_key); - /* "bzrlib/_btree_serializer_pyx.pyx":941 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":941 * # So we have the (key NULL refs NULL value LF) * key_len = PyString_Size(string_key) * val = node[2] # <<<<<<<<<<<<<< @@ -7078,7 +7114,7 @@ __pyx_v_val = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":942 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":942 * key_len = PyString_Size(string_key) * val = node[2] * if not PyString_CheckExact(val): # <<<<<<<<<<<<<< @@ -7088,23 +7124,23 @@ __pyx_t_2 = (!PyString_CheckExact(__pyx_v_val)); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":944 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":944 * if not PyString_CheckExact(val): * raise TypeError('Expected a plain str for value not: %s' * % type(val)) # <<<<<<<<<<<<<< * value = PyString_AS_STRING(val) * value_len = PyString_GET_SIZE(val) */ - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)Py_TYPE(__pyx_v_val))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_36), ((PyObject *)Py_TYPE(__pyx_v_val))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_GOTREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_5)); __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7112,7 +7148,7 @@ } __pyx_L21:; - /* "bzrlib/_btree_serializer_pyx.pyx":945 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":945 * raise TypeError('Expected a plain str for value not: %s' * % type(val)) * value = PyString_AS_STRING(val) # <<<<<<<<<<<<<< @@ -7121,7 +7157,7 @@ */ __pyx_v_value = PyString_AS_STRING(__pyx_v_val); - /* "bzrlib/_btree_serializer_pyx.pyx":946 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":946 * % type(val)) * value = PyString_AS_STRING(val) * value_len = PyString_GET_SIZE(val) # <<<<<<<<<<<<<< @@ -7130,7 +7166,7 @@ */ __pyx_v_value_len = PyString_GET_SIZE(__pyx_v_val); - /* "bzrlib/_btree_serializer_pyx.pyx":947 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":947 * value = PyString_AS_STRING(val) * value_len = PyString_GET_SIZE(val) * flat_len = (key_len + 1 + refs_len + 1 + value_len + 1) # <<<<<<<<<<<<<< @@ -7139,7 +7175,7 @@ */ __pyx_v_flat_len = (((((__pyx_v_key_len + 1) + __pyx_v_refs_len) + 1) + __pyx_v_value_len) + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":948 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":948 * value_len = PyString_GET_SIZE(val) * flat_len = (key_len + 1 + refs_len + 1 + value_len + 1) * line = PyString_FromStringAndSize(NULL, flat_len) # <<<<<<<<<<<<<< @@ -7152,7 +7188,7 @@ __pyx_v_line = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":950 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":950 * line = PyString_FromStringAndSize(NULL, flat_len) * # Get a pointer to the new buffer * out = PyString_AsString(line) # <<<<<<<<<<<<<< @@ -7162,7 +7198,7 @@ __pyx_t_13 = PyString_AsString(__pyx_v_line); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_out = __pyx_t_13; - /* "bzrlib/_btree_serializer_pyx.pyx":951 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":951 * # Get a pointer to the new buffer * out = PyString_AsString(line) * memcpy(out, PyString_AsString(string_key), key_len) # <<<<<<<<<<<<<< @@ -7172,7 +7208,7 @@ __pyx_t_13 = PyString_AsString(__pyx_v_string_key); if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} memcpy(__pyx_v_out, __pyx_t_13, __pyx_v_key_len); - /* "bzrlib/_btree_serializer_pyx.pyx":952 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":952 * out = PyString_AsString(line) * memcpy(out, PyString_AsString(string_key), key_len) * out = out + key_len # <<<<<<<<<<<<<< @@ -7181,7 +7217,7 @@ */ __pyx_v_out = (__pyx_v_out + __pyx_v_key_len); - /* "bzrlib/_btree_serializer_pyx.pyx":953 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":953 * memcpy(out, PyString_AsString(string_key), key_len) * out = out + key_len * out[0] = c'\0' # <<<<<<<<<<<<<< @@ -7190,7 +7226,7 @@ */ (__pyx_v_out[0]) = '\x00'; - /* "bzrlib/_btree_serializer_pyx.pyx":954 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":954 * out = out + key_len * out[0] = c'\0' * out = out + 1 # <<<<<<<<<<<<<< @@ -7199,7 +7235,7 @@ */ __pyx_v_out = (__pyx_v_out + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":955 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":955 * out[0] = c'\0' * out = out + 1 * if refs_len > 0: # <<<<<<<<<<<<<< @@ -7209,7 +7245,7 @@ __pyx_t_2 = (__pyx_v_refs_len > 0); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":956 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":956 * out = out + 1 * if refs_len > 0: * first_ref_list = 1 # <<<<<<<<<<<<<< @@ -7218,7 +7254,7 @@ */ __pyx_v_first_ref_list = 1; - /* "bzrlib/_btree_serializer_pyx.pyx":957 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":957 * if refs_len > 0: * first_ref_list = 1 * for ref_list in ref_lists: # <<<<<<<<<<<<<< @@ -7250,7 +7286,7 @@ __pyx_v_ref_list = __pyx_t_8; __pyx_t_8 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":958 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":958 * first_ref_list = 1 * for ref_list in ref_lists: * if first_ref_list == 0: # <<<<<<<<<<<<<< @@ -7260,7 +7296,7 @@ __pyx_t_2 = (__pyx_v_first_ref_list == 0); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":959 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":959 * for ref_list in ref_lists: * if first_ref_list == 0: * out[0] = c'\t' # <<<<<<<<<<<<<< @@ -7269,7 +7305,7 @@ */ (__pyx_v_out[0]) = '\t'; - /* "bzrlib/_btree_serializer_pyx.pyx":960 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":960 * if first_ref_list == 0: * out[0] = c'\t' * out = out + 1 # <<<<<<<<<<<<<< @@ -7281,7 +7317,7 @@ } __pyx_L25:; - /* "bzrlib/_btree_serializer_pyx.pyx":961 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":961 * out[0] = c'\t' * out = out + 1 * first_ref_list = 0 # <<<<<<<<<<<<<< @@ -7290,7 +7326,7 @@ */ __pyx_v_first_ref_list = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":962 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":962 * out = out + 1 * first_ref_list = 0 * first_reference = 1 # <<<<<<<<<<<<<< @@ -7299,7 +7335,7 @@ */ __pyx_v_first_reference = 1; - /* "bzrlib/_btree_serializer_pyx.pyx":963 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":963 * first_ref_list = 0 * first_reference = 1 * for reference in ref_list: # <<<<<<<<<<<<<< @@ -7331,7 +7367,7 @@ __pyx_v_reference = __pyx_t_4; __pyx_t_4 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":964 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":964 * first_reference = 1 * for reference in ref_list: * if first_reference == 0: # <<<<<<<<<<<<<< @@ -7341,7 +7377,7 @@ __pyx_t_2 = (__pyx_v_first_reference == 0); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":965 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":965 * for reference in ref_list: * if first_reference == 0: * out[0] = c'\r' # <<<<<<<<<<<<<< @@ -7350,7 +7386,7 @@ */ (__pyx_v_out[0]) = '\r'; - /* "bzrlib/_btree_serializer_pyx.pyx":966 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":966 * if first_reference == 0: * out[0] = c'\r' * out = out + 1 # <<<<<<<<<<<<<< @@ -7362,7 +7398,7 @@ } __pyx_L28:; - /* "bzrlib/_btree_serializer_pyx.pyx":967 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":967 * out[0] = c'\r' * out = out + 1 * first_reference = 0 # <<<<<<<<<<<<<< @@ -7371,7 +7407,7 @@ */ __pyx_v_first_reference = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":968 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":968 * out = out + 1 * first_reference = 0 * next_len = len(reference) # <<<<<<<<<<<<<< @@ -7381,7 +7417,7 @@ __pyx_t_11 = PyObject_Length(__pyx_v_reference); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_next_len = __pyx_t_11; - /* "bzrlib/_btree_serializer_pyx.pyx":969 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":969 * first_reference = 0 * next_len = len(reference) * for i from 0 <= i < next_len: # <<<<<<<<<<<<<< @@ -7391,7 +7427,7 @@ __pyx_t_11 = __pyx_v_next_len; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_11; __pyx_v_i++) { - /* "bzrlib/_btree_serializer_pyx.pyx":970 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":970 * next_len = len(reference) * for i from 0 <= i < next_len: * if i != 0: # <<<<<<<<<<<<<< @@ -7401,7 +7437,7 @@ __pyx_t_2 = (__pyx_v_i != 0); if (__pyx_t_2) { - /* "bzrlib/_btree_serializer_pyx.pyx":971 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":971 * for i from 0 <= i < next_len: * if i != 0: * out[0] = c'\x00' # <<<<<<<<<<<<<< @@ -7410,7 +7446,7 @@ */ (__pyx_v_out[0]) = '\x00'; - /* "bzrlib/_btree_serializer_pyx.pyx":972 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":972 * if i != 0: * out[0] = c'\x00' * out = out + 1 # <<<<<<<<<<<<<< @@ -7422,7 +7458,7 @@ } __pyx_L31:; - /* "bzrlib/_btree_serializer_pyx.pyx":973 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":973 * out[0] = c'\x00' * out = out + 1 * ref_bit = reference[i] # <<<<<<<<<<<<<< @@ -7435,7 +7471,7 @@ __pyx_v_ref_bit = __pyx_t_4; __pyx_t_4 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":974 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":974 * out = out + 1 * ref_bit = reference[i] * ref_bit_len = PyString_GET_SIZE(ref_bit) # <<<<<<<<<<<<<< @@ -7444,7 +7480,7 @@ */ __pyx_v_ref_bit_len = PyString_GET_SIZE(__pyx_v_ref_bit); - /* "bzrlib/_btree_serializer_pyx.pyx":975 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":975 * ref_bit = reference[i] * ref_bit_len = PyString_GET_SIZE(ref_bit) * memcpy(out, PyString_AS_STRING(ref_bit), ref_bit_len) # <<<<<<<<<<<<<< @@ -7453,7 +7489,7 @@ */ memcpy(__pyx_v_out, PyString_AS_STRING(__pyx_v_ref_bit), __pyx_v_ref_bit_len); - /* "bzrlib/_btree_serializer_pyx.pyx":976 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":976 * ref_bit_len = PyString_GET_SIZE(ref_bit) * memcpy(out, PyString_AS_STRING(ref_bit), ref_bit_len) * out = out + ref_bit_len # <<<<<<<<<<<<<< @@ -7470,7 +7506,7 @@ } __pyx_L22:; - /* "bzrlib/_btree_serializer_pyx.pyx":977 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":977 * memcpy(out, PyString_AS_STRING(ref_bit), ref_bit_len) * out = out + ref_bit_len * out[0] = c'\0' # <<<<<<<<<<<<<< @@ -7479,7 +7515,7 @@ */ (__pyx_v_out[0]) = '\x00'; - /* "bzrlib/_btree_serializer_pyx.pyx":978 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":978 * out = out + ref_bit_len * out[0] = c'\0' * out = out + 1 # <<<<<<<<<<<<<< @@ -7488,7 +7524,7 @@ */ __pyx_v_out = (__pyx_v_out + 1); - /* "bzrlib/_btree_serializer_pyx.pyx":979 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":979 * out[0] = c'\0' * out = out + 1 * memcpy(out, value, value_len) # <<<<<<<<<<<<<< @@ -7497,7 +7533,7 @@ */ memcpy(__pyx_v_out, __pyx_v_value, __pyx_v_value_len); - /* "bzrlib/_btree_serializer_pyx.pyx":980 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":980 * out = out + 1 * memcpy(out, value, value_len) * out = out + value_len # <<<<<<<<<<<<<< @@ -7506,7 +7542,7 @@ */ __pyx_v_out = (__pyx_v_out + __pyx_v_value_len); - /* "bzrlib/_btree_serializer_pyx.pyx":981 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":981 * memcpy(out, value, value_len) * out = out + value_len * out[0] = c'\n' # <<<<<<<<<<<<<< @@ -7514,21 +7550,21 @@ */ (__pyx_v_out[0]) = '\n'; - /* "bzrlib/_btree_serializer_pyx.pyx":982 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":982 * out = out + value_len * out[0] = c'\n' * return string_key, line # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_string_key); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_string_key); __Pyx_GIVEREF(__pyx_v_string_key); __Pyx_INCREF(__pyx_v_line); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_line); __Pyx_GIVEREF(__pyx_v_line); - __pyx_r = ((PyObject *)__pyx_t_5); + __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; @@ -7599,7 +7635,7 @@ } static PyMethodDef __pyx_methods_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser[] = { - {__Pyx_NAMESTR("parse"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_15BTreeLeafParser_1parse, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("parse"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_15BTreeLeafParser_parse, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -7701,7 +7737,7 @@ #endif }; -static PyTypeObject __pyx_type_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser = { +PyTypeObject __pyx_type_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("bzrlib._btree_serializer_pyx.BTreeLeafParser"), /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser), /*tp_basicsize*/ @@ -7725,7 +7761,7 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_BTreeLeafParser, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ __Pyx_DOCSTR("Parse the leaf nodes of a BTree index.\n\n :ivar bytes: The PyString object containing the uncompressed text for the\n node.\n :ivar key_length: An integer describing how many pieces the keys have for\n this index.\n :ivar ref_list_length: An integer describing how many references this index\n contains.\n :ivar keys: A PyList of keys found in this node.\n\n :ivar _cur_str: A pointer to the start of the next line to parse\n :ivar _end_str: A pointer to the end of bytes\n :ivar _start: Pointer to the location within the current line while\n parsing.\n :ivar _header_found: True when we have parsed the header for this node\n "), /*tp_doc*/ __pyx_tp_traverse_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser, /*tp_clear*/ @@ -7774,7 +7810,7 @@ PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); - __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_1__dealloc__(o); + __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); @@ -7822,10 +7858,10 @@ static int __pyx_setprop_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_last_key(PyObject *o, PyObject *v, void *x) { if (v) { - return __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key_1__set__(o, v); + return __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key___set__(o, v); } else { - return __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key_2__del__(o); + return __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8last_key___del__(o); } } @@ -7835,7 +7871,7 @@ static int __pyx_setprop_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_num_records(PyObject *o, PyObject *v, void *x) { if (v) { - return __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_11num_records_1__set__(o, v); + return __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_11num_records___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); @@ -7849,7 +7885,7 @@ static int __pyx_setprop_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_common_shift(PyObject *o, PyObject *v, void *x) { if (v) { - return __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_12common_shift_1__set__(o, v); + return __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_12common_shift___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); @@ -7859,10 +7895,10 @@ static PyMethodDef __pyx_methods_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode[] = { {__Pyx_NAMESTR("__sizeof__"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___sizeof__, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("all_keys"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_6all_keys, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("all_items"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_7all_items, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("_get_offset_for_sha1"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_8_get_offset_for_sha1, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("_get_offsets"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_9_get_offsets, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("all_keys"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_all_keys, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("all_items"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_all_items, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_offset_for_sha1"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__get_offset_for_sha1, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_get_offsets"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__get_offsets, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -7934,21 +7970,21 @@ }; static PySequenceMethods __pyx_tp_as_sequence_GCCHKSHA1LeafNode = { - __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_5__len__, /*sq_length*/ + __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ - __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_3__contains__, /*sq_contains*/ + __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_GCCHKSHA1LeafNode = { - __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_5__len__, /*mp_length*/ - __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_4__getitem__, /*mp_subscript*/ + __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___len__, /*mp_length*/ + __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; @@ -7973,7 +8009,7 @@ #endif }; -static PyTypeObject __pyx_type_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode = { +PyTypeObject __pyx_type_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("bzrlib._btree_serializer_pyx.GCCHKSHA1LeafNode"), /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode), /*tp_basicsize*/ @@ -7997,7 +8033,7 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_GCCHKSHA1LeafNode, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ __Pyx_DOCSTR("Track all the entries for a given leaf node."), /*tp_doc*/ __pyx_tp_traverse_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode, /*tp_clear*/ @@ -8013,7 +8049,7 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode_2__init__, /*tp_init*/ + __pyx_pf_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode, /*tp_new*/ 0, /*tp_free*/ @@ -8030,6 +8066,13 @@ }; static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("_parse_leaf_lines"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx__parse_leaf_lines, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_py_unhexlify"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_unhexlify, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx__py_unhexlify)}, + {__Pyx_NAMESTR("_py_hexlify"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_hexlify, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx__py_hexlify)}, + {__Pyx_NAMESTR("_py_key_to_sha1"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_key_to_sha1, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx__py_key_to_sha1)}, + {__Pyx_NAMESTR("_py_sha1_to_key"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx__py_sha1_to_key, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx__py_sha1_to_key)}, + {__Pyx_NAMESTR("_parse_into_chk"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx__parse_into_chk, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx__parse_into_chk)}, + {__Pyx_NAMESTR("_flatten_node"), (PyCFunction)__pyx_pf_6bzrlib_21_btree_serializer_pyx__flatten_node, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_btree_serializer_pyx__flatten_node)}, {0, 0, 0, 0} }; @@ -8037,7 +8080,7 @@ static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, __Pyx_NAMESTR("_btree_serializer_pyx"), - __Pyx_DOCSTR(__pyx_k_55), /* m_doc */ + __Pyx_DOCSTR(__pyx_k_37), /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ @@ -8049,36 +8092,41 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, + {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, + {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, + {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, - {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, + {&__pyx_n_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 1}, {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, + {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0}, + {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0}, {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0}, - {&__pyx_n_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 1}, + {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0}, + {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0}, + {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0}, + {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0}, {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0}, {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0}, + {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0}, + {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0}, {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0}, {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0}, + {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0}, {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0}, {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0}, - {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0}, - {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0}, + {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0}, + {&__pyx_kp_u_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 1, 0, 0}, + {&__pyx_kp_u_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 1, 0, 0}, {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0}, - {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0}, - {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0}, - {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0}, - {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0}, - {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0}, - {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0}, - {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0}, - {&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0}, - {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0}, - {&__pyx_n_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 1}, + {&__pyx_kp_u_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 1, 0, 0}, + {&__pyx_kp_u_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 1, 0, 0}, + {&__pyx_kp_u_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 1, 0, 0}, + {&__pyx_kp_u_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 1, 0, 0}, + {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, + {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, {&__pyx_n_s__AssertionError, __pyx_k__AssertionError, sizeof(__pyx_k__AssertionError), 0, 0, 1, 1}, {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1}, {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, @@ -8095,7 +8143,6 @@ {&__pyx_n_s___offset_for_sha1, __pyx_k___offset_for_sha1, sizeof(__pyx_k___offset_for_sha1), 0, 0, 1, 1}, {&__pyx_n_s___parse_bytes, __pyx_k___parse_bytes, sizeof(__pyx_k___parse_bytes), 0, 0, 1, 1}, {&__pyx_n_s___parse_into_chk, __pyx_k___parse_into_chk, sizeof(__pyx_k___parse_into_chk), 0, 0, 1, 1}, - {&__pyx_n_s___parse_leaf_lines, __pyx_k___parse_leaf_lines, sizeof(__pyx_k___parse_leaf_lines), 0, 0, 1, 1}, {&__pyx_n_s___parse_one_entry, __pyx_k___parse_one_entry, sizeof(__pyx_k___parse_one_entry), 0, 0, 1, 1}, {&__pyx_n_s___py_hexlify, __pyx_k___py_hexlify, sizeof(__pyx_k___py_hexlify), 0, 0, 1, 1}, {&__pyx_n_s___py_key_to_sha1, __pyx_k___py_key_to_sha1, sizeof(__pyx_k___py_key_to_sha1), 0, 0, 1, 1}, @@ -8137,273 +8184,10 @@ return -1; } -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "bzrlib/_btree_serializer_pyx.pyx":229 - * if last < self._start: - * # Unexpected error condition - fail - * raise AssertionError("last < self._start") # <<<<<<<<<<<<<< - * if 0 == self._header_found: - * # The first line in a leaf node is the header "type=leaf\n" - */ - __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); - PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - - /* "bzrlib/_btree_serializer_pyx.pyx":244 - * if temp_ptr == NULL: - * # Invalid line - * raise AssertionError("Failed to find the value area") # <<<<<<<<<<<<<< - * else: - * # Because of how conversions were done, we ended up with *lots* of - */ - __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); - PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); - - /* "bzrlib/_btree_serializer_pyx.pyx":271 - * loop_counter = loop_counter + 1 - * if last < self._start: - * raise AssertionError("last < self._start") # <<<<<<<<<<<<<< - * # find the next reference list end point: - * temp_ptr = memchr(self._start, c'\t', last - self._start) - */ - __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); - PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - - /* "bzrlib/_btree_serializer_pyx.pyx":278 - * if loop_counter != self.ref_list_length: - * # Invalid line - * raise AssertionError( # <<<<<<<<<<<<<< - * "invalid key, loop_counter != self.ref_list_length") - * else: - */ - __pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_13)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); - PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13)); - - /* "bzrlib/_btree_serializer_pyx.pyx":307 - * if last != self._start: - * # unexpected reference data present - * raise AssertionError("unexpected reference data present") # <<<<<<<<<<<<<< - * node_value = StaticTuple(value, StaticTuple()) - * PyList_Append(self.keys, StaticTuple(key, node_value)) - */ - __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_14)); - PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); - - /* "bzrlib/_btree_serializer_pyx.pyx":315 - * cdef Py_ssize_t byte_count - * if not PyString_CheckExact(self.bytes): - * raise AssertionError('self.bytes is not a string.') # <<<<<<<<<<<<<< - * byte_count = PyString_Size(self.bytes) - * self._cur_str = PyString_AsString(self.bytes) - */ - __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); - PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); - - /* "bzrlib/_btree_serializer_pyx.pyx":389 - * """For the test infrastructure, just thunks to _unhexlify_sha1""" - * if len(as_hex) != 40 or not PyString_CheckExact(as_hex): - * raise ValueError('not a 40-byte hex digest') # <<<<<<<<<<<<<< - * as_bin = PyString_FromStringAndSize(NULL, 20) - * if _unhexlify_sha1(PyString_AS_STRING(as_hex), PyString_AS_STRING(as_bin)): - */ - __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_19)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_18)); - PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_s_18)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19)); - - /* "bzrlib/_btree_serializer_pyx.pyx":412 - * """For test infrastructure, thunk to _hexlify_sha1""" - * if len(as_bin) != 20 or not PyString_CheckExact(as_bin): - * raise ValueError('not a 20-byte binary digest') # <<<<<<<<<<<<<< - * as_hex = PyString_FromStringAndSize(NULL, 40) - * _hexlify_sha1(PyString_AS_STRING(as_bin), PyString_AS_STRING(as_hex)) - */ - __pyx_k_tuple_21 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_21)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_20)); - PyTuple_SET_ITEM(__pyx_k_tuple_21, 0, ((PyObject *)__pyx_kp_s_20)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21)); - - /* "bzrlib/_btree_serializer_pyx.pyx":485 - * """Test thunk to check the sha1 mapping.""" - * if not PyString_CheckExact(sha1_bin) or PyString_GET_SIZE(sha1_bin) != 20: - * raise ValueError('sha1_bin must be a str of exactly 20 bytes') # <<<<<<<<<<<<<< - * return _sha1_to_key(PyString_AS_STRING(sha1_bin)) - * - */ - __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_23)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_22)); - PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_kp_s_22)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_22)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23)); - - /* "bzrlib/_btree_serializer_pyx.pyx":708 - * - * if not PyString_CheckExact(bytes): - * raise TypeError('We only support parsing plain 8-bit strings.') # <<<<<<<<<<<<<< - * # Pass 1, count how many records there will be - * n_bytes = PyString_GET_SIZE(bytes) - */ - __pyx_k_tuple_29 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_29)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_28)); - PyTuple_SET_ITEM(__pyx_k_tuple_29, 0, ((PyObject *)__pyx_kp_s_28)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29)); - - /* "bzrlib/_btree_serializer_pyx.pyx":731 - * or c_cur != c_end - * or cur_record != self.records + self.num_records): - * raise ValueError('Something went wrong while parsing.') # <<<<<<<<<<<<<< - * # Pass 3: build the offset map - * self._compute_common() - */ - __pyx_k_tuple_33 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_33)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_32)); - PyTuple_SET_ITEM(__pyx_k_tuple_33, 0, ((PyObject *)__pyx_kp_s_32)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33)); - - /* "bzrlib/_btree_serializer_pyx.pyx":748 - * c_next = memchr(c_cur, c'\0', c_end - c_cur) - * if c_next == NULL or (c_next - c_cur != 40): - * raise ValueError('Line did not contain 40 hex bytes') # <<<<<<<<<<<<<< - * if not _unhexlify_sha1(c_cur, cur_record.sha1): - * raise ValueError('We failed to unhexlify') - */ - __pyx_k_tuple_36 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_36)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_35)); - PyTuple_SET_ITEM(__pyx_k_tuple_36, 0, ((PyObject *)__pyx_kp_s_35)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_35)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36)); - - /* "bzrlib/_btree_serializer_pyx.pyx":750 - * raise ValueError('Line did not contain 40 hex bytes') - * if not _unhexlify_sha1(c_cur, cur_record.sha1): - * raise ValueError('We failed to unhexlify') # <<<<<<<<<<<<<< - * c_cur = c_next + 1 - * if c_cur[0] != c'\0': - */ - __pyx_k_tuple_38 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_38)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_37)); - PyTuple_SET_ITEM(__pyx_k_tuple_38, 0, ((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38)); - - /* "bzrlib/_btree_serializer_pyx.pyx":753 - * c_cur = c_next + 1 - * if c_cur[0] != c'\0': - * raise ValueError('only 1 null, not 2 as expected') # <<<<<<<<<<<<<< - * c_cur = c_cur + 1 - * cur_record.block_offset = strtoll(c_cur, &c_next, 10) - */ - __pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_40)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_39)); - PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_s_39)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40)); - - /* "bzrlib/_btree_serializer_pyx.pyx":757 - * cur_record.block_offset = strtoll(c_cur, &c_next, 10) - * if c_cur == c_next or c_next[0] != c' ': - * raise ValueError('Failed to parse block offset') # <<<<<<<<<<<<<< - * c_cur = c_next + 1 - * cur_record.block_length = strtoul(c_cur, &c_next, 10) - */ - __pyx_k_tuple_42 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_42)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_41)); - PyTuple_SET_ITEM(__pyx_k_tuple_42, 0, ((PyObject *)__pyx_kp_s_41)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42)); - - /* "bzrlib/_btree_serializer_pyx.pyx":761 - * cur_record.block_length = strtoul(c_cur, &c_next, 10) - * if c_cur == c_next or c_next[0] != c' ': - * raise ValueError('Failed to parse block length') # <<<<<<<<<<<<<< - * c_cur = c_next + 1 - * cur_record.record_start = strtoul(c_cur, &c_next, 10) - */ - __pyx_k_tuple_44 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_44)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_43)); - PyTuple_SET_ITEM(__pyx_k_tuple_44, 0, ((PyObject *)__pyx_kp_s_43)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44)); - - /* "bzrlib/_btree_serializer_pyx.pyx":765 - * cur_record.record_start = strtoul(c_cur, &c_next, 10) - * if c_cur == c_next or c_next[0] != c' ': - * raise ValueError('Failed to parse block length') # <<<<<<<<<<<<<< - * c_cur = c_next + 1 - * cur_record.record_end = strtoul(c_cur, &c_next, 10) - */ - __pyx_k_tuple_45 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_45)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_43)); - PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, ((PyObject *)__pyx_kp_s_43)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45)); - - /* "bzrlib/_btree_serializer_pyx.pyx":769 - * cur_record.record_end = strtoul(c_cur, &c_next, 10) - * if c_cur == c_next or c_next[0] != c'\n': - * raise ValueError('Failed to parse record end') # <<<<<<<<<<<<<< - * c_cur = c_next + 1 - * return c_cur - */ - __pyx_k_tuple_47 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_47)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_46)); - PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, ((PyObject *)__pyx_kp_s_46)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_46)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_4294967295 = PyInt_FromString((char *)"4294967295", 0, 0); if (unlikely(!__pyx_int_4294967295)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; @@ -8419,6 +8203,8 @@ { PyObject *__pyx_t_1 = NULL; int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; #if CYTHON_REFNANNY void* __pyx_refnanny = NULL; __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -8444,7 +8230,7 @@ #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_btree_serializer_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_55), 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_btree_serializer_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_37), 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -8462,19 +8248,23 @@ } /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser = &__pyx_vtable_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser; + #if PY_MAJOR_VERSION >= 3 __pyx_vtable_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser.extract_key = (PyObject *(*)(struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *, char *))__pyx_f_6bzrlib_21_btree_serializer_pyx_15BTreeLeafParser_extract_key; __pyx_vtable_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser.process_line = (int (*)(struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser *))__pyx_f_6bzrlib_21_btree_serializer_pyx_15BTreeLeafParser_process_line; + #else + *(void(**)(void))&__pyx_vtable_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser.extract_key = (void(*)(void))__pyx_f_6bzrlib_21_btree_serializer_pyx_15BTreeLeafParser_extract_key; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser.process_line = (void(*)(void))__pyx_f_6bzrlib_21_btree_serializer_pyx_15BTreeLeafParser_process_line; + #endif if (PyType_Ready(&__pyx_type_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetVtable(__pyx_type_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser.tp_dict, __pyx_vtabptr_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "BTreeLeafParser", (PyObject *)&__pyx_type_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser = &__pyx_type_6bzrlib_21_btree_serializer_pyx_BTreeLeafParser; __pyx_vtabptr_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode = &__pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode; + #if PY_MAJOR_VERSION >= 3 __pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._record_to_value_and_refs = (StaticTuple *(*)(struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *, __pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__record_to_value_and_refs; __pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._record_to_item = (StaticTuple *(*)(struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *, __pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__record_to_item; __pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._lookup_record = (__pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *(*)(struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *, char *))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__lookup_record; @@ -8483,7 +8273,17 @@ __pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._parse_one_entry = (char *(*)(struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *, char *, char *, __pyx_t_6bzrlib_21_btree_serializer_pyx_gc_chk_sha1_record *))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__parse_one_entry; __pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._offset_for_sha1 = (int (*)(struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *, char *))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__offset_for_sha1; __pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._compute_common = (PyObject *(*)(struct __pyx_obj_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode *))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__compute_common; - if (PyType_Ready(&__pyx_type_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + #else + *(void(**)(void))&__pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._record_to_value_and_refs = (void(*)(void))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__record_to_value_and_refs; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._record_to_item = (void(*)(void))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__record_to_item; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._lookup_record = (void(*)(void))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__lookup_record; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._count_records = (void(*)(void))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__count_records; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._parse_bytes = (void(*)(void))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__parse_bytes; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._parse_one_entry = (void(*)(void))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__parse_one_entry; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._offset_for_sha1 = (void(*)(void))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__offset_for_sha1; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode._compute_common = (void(*)(void))__pyx_f_6bzrlib_21_btree_serializer_pyx_17GCCHKSHA1LeafNode__compute_common; + #endif + if (PyType_Ready(&__pyx_type_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetVtable(__pyx_type_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode.tp_dict, __pyx_vtabptr_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "GCCHKSHA1LeafNode", (PyObject *)&__pyx_type_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode = &__pyx_type_6bzrlib_21_btree_serializer_pyx_GCCHKSHA1LeafNode; @@ -8492,7 +8292,7 @@ /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "bzrlib/_btree_serializer_pyx.pyx":77 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":77 * # have to worry about exception checking. * ## extern cdef class StaticTuple * import sys # <<<<<<<<<<<<<< @@ -8504,7 +8304,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":120 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":120 * * # This sets up the StaticTuple C_API functionality * import_static_tuple_c() # <<<<<<<<<<<<<< @@ -8513,19 +8313,7 @@ */ __pyx_t_2 = import_static_tuple_c(); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_btree_serializer_pyx.pyx":325 - * - * - * def _parse_leaf_lines(bytes, key_length, ref_list_length): # <<<<<<<<<<<<<< - * parser = BTreeLeafParser(bytes, key_length, ref_list_length) - * return parser.parse() - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_btree_serializer_pyx__parse_leaf_lines, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___parse_leaf_lines, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_btree_serializer_pyx.pyx":347 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":347 * cdef int _unhexbuf[256] * cdef char *_hexbuf * _hexbuf = '0123456789abcdef' # <<<<<<<<<<<<<< @@ -8534,7 +8322,7 @@ */ __pyx_v_6bzrlib_21_btree_serializer_pyx__hexbuf = __pyx_k__0123456789abcdef; - /* "bzrlib/_btree_serializer_pyx.pyx":359 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":359 * for i from 10 <= i < 16: # ABCDEF => 10, 11, 12, 13, 14, 15, 16 * _unhexbuf[(i - 10 + c'A')] = i * _populate_unhexbuf() # <<<<<<<<<<<<<< @@ -8545,90 +8333,62 @@ __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_btree_serializer_pyx.pyx":386 - * - * - * def _py_unhexlify(as_hex): # <<<<<<<<<<<<<< - * """For the test infrastructure, just thunks to _unhexlify_sha1""" - * if len(as_hex) != 40 or not PyString_CheckExact(as_hex): - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_btree_serializer_pyx_1_py_unhexlify, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___py_unhexlify, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_btree_serializer_pyx.pyx":409 - * - * - * def _py_hexlify(as_bin): # <<<<<<<<<<<<<< - * """For test infrastructure, thunk to _hexlify_sha1""" - * if len(as_bin) != 20 or not PyString_CheckExact(as_bin): - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_btree_serializer_pyx_2_py_hexlify, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___py_hexlify, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_btree_serializer_pyx.pyx":446 - * - * - * def _py_key_to_sha1(key): # <<<<<<<<<<<<<< - * """Map a key to a simple sha1 string. - * - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_btree_serializer_pyx_3_py_key_to_sha1, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___py_key_to_sha1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_btree_serializer_pyx.pyx":482 - * - * - * def _py_sha1_to_key(sha1_bin): # <<<<<<<<<<<<<< - * """Test thunk to check the sha1 mapping.""" - * if not PyString_CheckExact(sha1_bin) or PyString_GET_SIZE(sha1_bin) != 20: - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_btree_serializer_pyx_4_py_sha1_to_key, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___py_sha1_to_key, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_btree_serializer_pyx.pyx":838 - * - * - * def _parse_into_chk(bytes, key_length, ref_list_length): # <<<<<<<<<<<<<< - * """Parse into a format optimized for chk records.""" - * assert key_length == 1 - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_btree_serializer_pyx_5_parse_into_chk, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___parse_into_chk, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_btree_serializer_pyx.pyx":845 - * - * - * def _flatten_node(node, reference_lists): # <<<<<<<<<<<<<< - * """Convert a node into the serialized form. - * - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_btree_serializer_pyx_6_flatten_node, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___flatten_node, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_btree_serializer_pyx.pyx":1 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_btree_serializer_pyx.pyx":1 * # Copyright (C) 2008, 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<< * # * # This program is free software; you can redistribute it and/or modify */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s___py_unhexlify); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_38), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s___py_hexlify); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __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;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_39), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s___py_key_to_sha1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_40), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s___py_sha1_to_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __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;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_41), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s___parse_into_chk); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_42), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s___flatten_node); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __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;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_43), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { __Pyx_AddTraceback("init bzrlib._btree_serializer_pyx"); Py_DECREF(__pyx_m); __pyx_m = 0; @@ -8654,142 +8414,18 @@ return result; } -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AS_STRING(kw_name)); #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; } -#endif static void __Pyx_RaiseArgtupleInvalid( const char* func_name, @@ -8821,19 +8457,6 @@ func_name, more_or_less, num_expected, number, num_found); } -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], @@ -8966,6 +8589,143 @@ return module; } +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} + +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} + + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + Py_XINCREF(type); + Py_XINCREF(value); + Py_XINCREF(tb); + /* First, check the traceback argument, replacing None with NULL. */ + if (tb == Py_None) { + Py_DECREF(tb); + tb = 0; + } + else if (tb != NULL && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + /* Next, replace a missing value with None */ + if (value == NULL) { + value = Py_None; + Py_INCREF(value); + } + #if PY_VERSION_HEX < 0x02050000 + if (!PyClass_Check(type)) + #else + if (!PyType_Check(type)) + #endif + { + /* Raising an instance. The value should be a dummy. */ + if (value != Py_None) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + /* Normalize to raise , */ + Py_DECREF(value); + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } + else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} + +#else /* Python 3+ */ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (!PyExceptionClass_Check(type)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + + PyErr_SetObject(type, value); + + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } + +bad: + return; +} +#endif + static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { const unsigned char neg_one = (unsigned char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -9429,13 +9189,13 @@ if (!result) goto bad; if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, + PyErr_Format(PyExc_TypeError, "%s.%s is not a type object", module_name, class_name); goto bad; } if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), + PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); #if PY_VERSION_HEX < 0x02050000 @@ -9445,7 +9205,7 @@ #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, + PyErr_Format(PyExc_ValueError, "%s.%s has the wrong size, try recompiling", module_name, class_name); goto bad; diff -Nru bzr-2.5.0/bzrlib/builtins.py bzr-2.6.0~beta1/bzrlib/builtins.py --- bzr-2.5.0/bzrlib/builtins.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/builtins.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2011 Canonical Ltd +# Copyright (C) 2005-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -86,27 +86,27 @@ def _get_branch_location(control_dir, possible_transports=None): """Return location of branch for this control dir.""" try: - this_branch = control_dir.open_branch( - possible_transports=possible_transports) - # This may be a heavy checkout, where we want the master branch - master_location = this_branch.get_bound_location() - if master_location is not None: - return master_location - # If not, use a local sibling - return this_branch.base + target = control_dir.get_branch_reference() except errors.NotBranchError: - format = control_dir.find_branch_format() - if getattr(format, 'get_reference', None) is not None: - return format.get_reference(control_dir) - else: - return control_dir.root_transport.base + return control_dir.root_transport.base + if target is not None: + return target + this_branch = control_dir.open_branch( + possible_transports=possible_transports) + # This may be a heavy checkout, where we want the master branch + master_location = this_branch.get_bound_location() + if master_location is not None: + return master_location + # If not, use a local sibling + return this_branch.base def _is_colocated(control_dir, possible_transports=None): """Check if the branch in control_dir is colocated. :param control_dir: Control directory - :return: Boolean indicating whether + :return: Tuple with boolean indicating whether the branch is colocated + and the full URL to the actual branch """ # This path is meant to be relative to the existing branch this_url = _get_branch_location(control_dir, @@ -132,8 +132,7 @@ def lookup_new_sibling_branch(control_dir, location, possible_transports=None): """Lookup the location for a new sibling branch. - :param control_dir: Control directory relative to which to look up - the name. + :param control_dir: Control directory to find sibling branches from :param location: Name of the new branch :return: Full location to the new branch """ @@ -149,9 +148,9 @@ return location -def lookup_sibling_branch(control_dir, location, possible_transports=None): - """Lookup sibling branch. - +def open_sibling_branch(control_dir, location, possible_transports=None): + """Open a branch, possibly a sibling of another. + :param control_dir: Control directory relative to which to lookup the location. :param location: Location to look up @@ -162,20 +161,63 @@ return control_dir.open_branch(location, possible_transports=possible_transports) except (errors.NotBranchError, errors.NoColocatedBranchSupport): + this_url = _get_branch_location(control_dir) + return Branch.open( + urlutils.join( + this_url, '..', urlutils.escape(location))) + + +def open_nearby_branch(near=None, location=None, possible_transports=None): + """Open a nearby branch. + + :param near: Optional location of container from which to open branch + :param location: Location of the branch + :return: Branch instance + """ + if near is None: + if location is None: + location = "." try: - return Branch.open(location) + return Branch.open(location, + possible_transports=possible_transports) except errors.NotBranchError: - this_url = _get_branch_location(control_dir) - return Branch.open( - urlutils.join( - this_url, '..', urlutils.escape(location))) + near = "." + cdir = controldir.ControlDir.open(near, + possible_transports=possible_transports) + return open_sibling_branch(cdir, location, + possible_transports=possible_transports) -@symbol_versioning.deprecated_function(symbol_versioning.deprecated_in((2, 3, 0))) -def tree_files(file_list, default_branch=u'.', canonicalize=True, - apply_view=True): - return internal_tree_files(file_list, default_branch, canonicalize, - apply_view) +def iter_sibling_branches(control_dir, possible_transports=None): + """Iterate over the siblings of a branch. + + :param control_dir: Control directory for which to look up the siblings + :return: Iterator over tuples with branch name and branch object + """ + seen_urls = set() + try: + reference = control_dir.get_branch_reference() + except errors.NotBranchError: + # There is no active branch, just return the colocated branches. + for name, branch in control_dir.get_branches().iteritems(): + yield name, branch + return + if reference is not None: + ref_branch = Branch.open(reference, + possible_transports=possible_transports) + else: + ref_branch = None + if ref_branch is None or ref_branch.name: + if ref_branch is not None: + control_dir = ref_branch.bzrdir + for name, branch in control_dir.get_branches().iteritems(): + yield name, branch + else: + repo = ref_branch.bzrdir.find_repository() + for branch in repo.find_branches(using=True): + name = urlutils.relative_url(repo.user_url, + branch.user_url).rstrip("/") + yield name, branch def tree_files_for_add(file_list): @@ -243,36 +285,6 @@ return rev_tree -# XXX: Bad function name; should possibly also be a class method of -# WorkingTree rather than a function. -@symbol_versioning.deprecated_function(symbol_versioning.deprecated_in((2, 3, 0))) -def internal_tree_files(file_list, default_branch=u'.', canonicalize=True, - apply_view=True): - """Convert command-line paths to a WorkingTree and relative paths. - - Deprecated: use WorkingTree.open_containing_paths instead. - - This is typically used for command-line processors that take one or - more filenames, and infer the workingtree that contains them. - - The filenames given are not required to exist. - - :param file_list: Filenames to convert. - - :param default_branch: Fallback tree path to use if file_list is empty or - None. - - :param apply_view: if True and a view is set, apply it or check that - specified files are within it - - :return: workingtree, [relative_paths] - """ - return WorkingTree.open_containing_paths( - file_list, default_directory='.', - canonicalize=True, - apply_view=True) - - def _get_view_info_for_change_reporter(tree): """Get the view information from a tree for change reporting.""" view_info = None @@ -356,7 +368,7 @@ This will produce the same results as calling 'bzr diff --summarize'. """ - # TODO: --no-recurse, --recurse options + # TODO: --no-recurse/-N, --recurse options takes_args = ['file*'] takes_options = ['show-ids', 'revision', 'change', 'verbose', @@ -791,7 +803,8 @@ takes_args = ['file*'] takes_options = [ Option('no-recurse', - help="Don't recursively add the contents of directories."), + help="Don't recursively add the contents of directories.", + short_name='N'), Option('dry-run', help="Show what would be done, but don't actually do anything."), 'verbose', @@ -937,21 +950,21 @@ tree = work_tree extra_trees = [] + self.add_cleanup(tree.lock_read().unlock) if file_list is not None: file_ids = tree.paths2ids(file_list, trees=extra_trees, require_versioned=True) # find_ids_across_trees may include some paths that don't # exist in 'tree'. - entries = sorted( - (tree.id2path(file_id), tree.inventory[file_id]) - for file_id in file_ids if tree.has_id(file_id)) + entries = tree.iter_entries_by_dir(specific_file_ids=file_ids) else: - entries = tree.inventory.entries() + entries = tree.iter_entries_by_dir() - self.cleanup_now() - for path, entry in entries: + for path, entry in sorted(entries): if kind and kind != entry.kind: continue + if path == "": + continue if show_ids: self.outf.write('%-50s %s\n' % (path, entry.file_id)) else: @@ -1029,12 +1042,11 @@ and rel_names[0].lower() == rel_names[1].lower()): into_existing = False else: - inv = tree.inventory # 'fix' the case of a potential 'from' from_id = tree.path2id( tree.get_canonical_inventory_path(rel_names[0])) if (not osutils.lexists(names_list[0]) and - from_id and inv.get_file_kind(from_id) == "directory"): + from_id and tree.stored_kind(from_id) == "directory"): into_existing = False # move/rename if into_existing: @@ -1206,6 +1218,8 @@ # Remembers if asked explicitly or no previous location is set if (remember or (remember is None and branch_to.get_parent() is None)): + # FIXME: This shouldn't be done before the pull + # succeeds... -- vila 2012-01-02 branch_to.set_parent(branch_from.base) if revision is not None: @@ -1540,9 +1554,8 @@ active_branch = dir.open_branch(name="") except errors.NotBranchError: active_branch = None - branches = dir.get_branches() names = {} - for name, branch in branches.iteritems(): + for name, branch in iter_sibling_branches(dir): if name == "": continue active = (active_branch is not None and @@ -1649,10 +1662,8 @@ def run(self, dir=u'.'): tree = WorkingTree.open_containing(dir)[0] self.add_cleanup(tree.lock_read().unlock) - new_inv = tree.inventory old_tree = tree.basis_tree() self.add_cleanup(old_tree.lock_read().unlock) - old_inv = old_tree.inventory renames = [] iterator = tree.iter_changes(old_tree, include_unchanged=True) for f, paths, c, v, p, n, k, e in iterator: @@ -2043,7 +2054,7 @@ RegistryOption('format', help='Specify a format for this branch. ' 'See "help formats".', - lazy_registry=('bzrlib.bzrdir', 'format_registry'), + lazy_registry=('bzrlib.controldir', 'format_registry'), converter=lambda name: controldir.format_registry.make_bzrdir(name), value_switches=True, title="Branch format", @@ -2372,7 +2383,7 @@ self.add_cleanup(tree.lock_read().unlock) old = tree.basis_tree() self.add_cleanup(old.lock_read().unlock) - for path, ie in old.inventory.iter_entries(): + for path, ie in old.iter_entries_by_dir(): if not tree.has_id(ie.file_id): self.outf.write(path) if show_ids: @@ -2416,14 +2427,13 @@ self.add_cleanup(wt.lock_read().unlock) basis = wt.basis_tree() self.add_cleanup(basis.lock_read().unlock) - basis_inv = basis.inventory - inv = wt.inventory - for file_id in inv: - if basis_inv.has_id(file_id): + root_id = wt.get_root_id() + for file_id in wt.all_file_ids(): + if basis.has_id(file_id): continue - if inv.is_root(file_id) and len(basis_inv) == 0: + if root_id == file_id: continue - path = inv.id2path(file_id) + path = wt.id2path(file_id) if not os.access(osutils.pathjoin(wt.basedir, path), os.F_OK): continue if null: @@ -2791,7 +2801,7 @@ self.add_cleanup(b.lock_read().unlock) rev1, rev2 = _get_revision_range(revision, b, self.name()) - if b.get_config().validate_signatures_in_log(): + if b.get_config_stack().get('validate_signatures_in_log'): signatures = True if signatures: @@ -3517,8 +3527,8 @@ tokens = fixed_bug.split(':') if len(tokens) == 1: if default_bugtracker is None: - branch_config = branch.get_config() - default_bugtracker = branch_config.get_user_option( + branch_config = branch.get_config_stack() + default_bugtracker = branch_config.get( "bugtracker") if default_bugtracker is None: raise errors.BzrCommandError(gettext( @@ -3863,7 +3873,9 @@ if directory is None: c = Branch.open_containing(u'.')[0].get_config_stack() else: - c = Branch.open(directory).get_config_stack() + b = Branch.open(directory) + self.add_cleanup(b.lock_write().unlock) + c = b.get_config_stack() else: c = _mod_config.GlobalStack() c.set('email', name) @@ -4676,7 +4688,8 @@ if tree.kind(file_id) != "directory": continue - for name, ie in tree.inventory.iter_entries(file_id): + # FIXME: Support nested trees + for name, ie in tree.root_inventory.iter_entries(file_id): interesting_ids.add(ie.file_id) new_conflicts = conflicts.select_conflicts(tree, file_list)[0] else: @@ -5263,10 +5276,12 @@ else: if location is None: if b.get_bound_location() is not None: - raise errors.BzrCommandError(gettext('Branch is already bound')) + raise errors.BzrCommandError( + gettext('Branch is already bound')) else: - raise errors.BzrCommandError(gettext('No location supplied ' - 'and no previous location known')) + raise errors.BzrCommandError( + gettext('No location supplied' + ' and no previous location known')) b_other = Branch.open(location) try: b.bind(b_other) @@ -5476,12 +5491,13 @@ help="Protocol to serve.", lazy_registry=('bzrlib.transport', 'transport_server_registry'), value_switches=True), + Option('listen', + help='Listen for connections on nominated address.', type=str), Option('port', - help='Listen for connections on nominated port of the form ' - '[hostname:]portnumber. Passing 0 as the port number will ' - 'result in a dynamically allocated port. The default port ' - 'depends on the protocol.', - type=str), + help='Listen for connections on nominated port. Passing 0 as ' + 'the port number will result in a dynamically allocated ' + 'port. The default port depends on the protocol.', + type=int), custom_help('directory', help='Serve contents of this directory.'), Option('allow-writes', @@ -5497,50 +5513,18 @@ help='Override the default idle client timeout (5min).'), ] - def get_host_and_port(self, port): - """Return the host and port to run the smart server on. - - If 'port' is None, None will be returned for the host and port. - - If 'port' has a colon in it, the string before the colon will be - interpreted as the host. - - :param port: A string of the port to run the server on. - :return: A tuple of (host, port), where 'host' is a host name or IP, - and port is an integer TCP/IP port. - """ - host = None - if port is not None: - if ':' in port: - host, port = port.split(':') - port = int(port) - return host, port - - def run(self, port=None, inet=False, directory=None, allow_writes=False, - protocol=None, client_timeout=None): + def run(self, listen=None, port=None, inet=False, directory=None, + allow_writes=False, protocol=None, client_timeout=None): from bzrlib import transport if directory is None: directory = os.getcwd() if protocol is None: protocol = transport.transport_server_registry.get() - host, port = self.get_host_and_port(port) url = transport.location_to_url(directory) if not allow_writes: url = 'readonly+' + url t = transport.get_transport_from_url(url) - try: - protocol(t, host, port, inet, client_timeout) - except TypeError, e: - # We use symbol_versioning.deprecated_in just so that people - # grepping can find it here. - # symbol_versioning.deprecated_in((2, 5, 0)) - symbol_versioning.warn( - 'Got TypeError(%s)\ntrying to call protocol: %s.%s\n' - 'Most likely it needs to be updated to support a' - ' "timeout" parameter (added in bzr 2.5.0)' - % (e, protocol.__module__, protocol), - DeprecationWarning) - protocol(t, host, port, inet) + protocol(t, listen, port, inet, client_timeout) class cmd_join(Command): @@ -5682,6 +5666,7 @@ if public_branch is None: public_branch = stored_public_branch elif stored_public_branch is None: + # FIXME: Should be done only if we succeed ? -- vila 2012-01-03 branch.set_public_branch(public_branch) if not include_bundle and public_branch is None: raise errors.BzrCommandError(gettext('No public branch specified or' @@ -6247,7 +6232,12 @@ possible_transports=possible_transports, source_branch=branch).open_branch() else: - to_branch = lookup_sibling_branch(control_dir, to_location) + try: + to_branch = Branch.open(to_location, + possible_transports=possible_transports) + except errors.NotBranchError: + to_branch = open_sibling_branch(control_dir, to_location, + possible_transports=possible_transports) if revision is not None: revision = revision.as_revision_id(to_branch) switch.switch(control_dir, to_branch, force, revision_id=revision) @@ -6450,13 +6440,23 @@ takes_args = ["location?"] + takes_options = ['directory', + Option('force', help='Remove branch even if it is the active branch.')] + aliases = ["rmbranch"] - def run(self, location=None): - if location is None: - location = "." - cdir = controldir.ControlDir.open_containing(location)[0] - cdir.destroy_branch() + def run(self, directory=None, location=None, force=False): + br = open_nearby_branch(near=directory, location=location) + if not force and br.bzrdir.has_workingtree(): + try: + active_branch = br.bzrdir.open_branch(name="") + except errors.NotBranchError: + active_branch = None + if (active_branch is not None and + br.control_url == active_branch.control_url): + raise errors.BzrCommandError( + gettext("Branch is active. Use --force to remove it.")) + br.bzrdir.destroy_branch(br.name) class cmd_shelve(Command): @@ -6692,8 +6692,7 @@ ('cmd_resolve', ['resolved'], 'bzrlib.conflicts'), ('cmd_conflicts', [], 'bzrlib.conflicts'), ('cmd_sign_my_commits', [], 'bzrlib.commit_signature_commands'), - ('cmd_verify_signatures', [], - 'bzrlib.commit_signature_commands'), + ('cmd_verify_signatures', [], 'bzrlib.commit_signature_commands'), ('cmd_test_script', [], 'bzrlib.cmd_test_script'), ]: builtin_command_registry.register_lazy(name, aliases, module_name) diff -Nru bzr-2.5.0/bzrlib/bundle/bundle_data.py bzr-2.6.0~beta1/bzrlib/bundle/bundle_data.py --- bzr-2.5.0/bzrlib/bundle/bundle_data.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/bundle/bundle_data.py 2012-03-15 10:00:24.000000000 +0000 @@ -576,6 +576,9 @@ return None return new_path + def get_root_id(self): + return self.path2id('') + def path2id(self, path): """Return the id of the file present at path in the target tree.""" file_id = self._new_id.get(path) @@ -586,10 +589,7 @@ return None if old_path in self.deleted: return None - if getattr(self.base_tree, 'path2id', None) is not None: - return self.base_tree.path2id(old_path) - else: - return self.base_tree.inventory.path2id(old_path) + return self.base_tree.path2id(old_path) def id2path(self, file_id): """Return the new path in the target tree of the file with id file_id""" @@ -625,14 +625,14 @@ """ base_id = self.old_contents_id(file_id) if (base_id is not None and - base_id != self.base_tree.inventory.root.file_id): + base_id != self.base_tree.get_root_id()): patch_original = self.base_tree.get_file(base_id) else: patch_original = None file_patch = self.patches.get(self.id2path(file_id)) if file_patch is None: if (patch_original is None and - self.get_kind(file_id) == 'directory'): + self.kind(file_id) == 'directory'): return StringIO() if patch_original is None: raise AssertionError("None: %s" % file_id) @@ -651,17 +651,24 @@ except KeyError: return self.base_tree.get_symlink_target(file_id) - def get_kind(self, file_id): + def kind(self, file_id): if file_id in self._kinds: return self._kinds[file_id] - return self.base_tree.inventory[file_id].kind + return self.base_tree.kind(file_id) + + def get_file_revision(self, file_id): + path = self.id2path(file_id) + if path in self._last_changed: + return self._last_changed[path] + else: + return self.base_tree.get_file_revision(file_id) def is_executable(self, file_id): path = self.id2path(file_id) if path in self._executable: return self._executable[path] else: - return self.base_tree.inventory[file_id].executable + return self.base_tree.is_executable(file_id) def get_last_changed(self, file_id): path = self.id2path(file_id) @@ -680,10 +687,9 @@ if new_path not in self.patches: # If the entry does not have a patch, then the # contents must be the same as in the base_tree - ie = self.base_tree.inventory[file_id] - if ie.text_size is None: - return ie.text_size, ie.text_sha1 - return int(ie.text_size), ie.text_sha1 + text_size = self.base_tree.get_file_size(file_id) + text_sha1 = self.base_tree.get_file_sha1(file_id) + return text_size, text_sha1 fileobj = self.get_file(file_id) content = fileobj.read() return len(content), sha_string(content) @@ -694,7 +700,6 @@ This need to be called before ever accessing self.inventory """ from os.path import dirname, basename - base_inv = self.base_tree.inventory inv = Inventory(None, self.revision_id) def add_entry(file_id): @@ -707,7 +712,7 @@ parent_path = dirname(path) parent_id = self.path2id(parent_path) - kind = self.get_kind(file_id) + kind = self.kind(file_id) revision_id = self.get_last_changed(file_id) name = basename(path) @@ -741,9 +746,11 @@ # at that instant inventory = property(_get_inventory) - def __iter__(self): - for path, entry in self.inventory.iter_entries(): - yield entry.file_id + root_inventory = property(_get_inventory) + + def all_file_ids(self): + return set( + [entry.file_id for path, entry in self.inventory.iter_entries()]) def list_files(self, include_root=False, from_dir=None, recursive=True): # The only files returned by this are those from the version diff -Nru bzr-2.5.0/bzrlib/bundle/serializer/v08.py bzr-2.6.0~beta1/bzrlib/bundle/serializer/v08.py --- bzr-2.5.0/bzrlib/bundle/serializer/v08.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/bundle/serializer/v08.py 2012-03-15 10:00:24.000000000 +0000 @@ -287,13 +287,15 @@ def finish_action(action, file_id, kind, meta_modified, text_modified, old_path, new_path): - entry = new_tree.inventory[file_id] - if entry.revision != default_revision_id: - action.add_utf8_property('last-changed', entry.revision) + revision = new_tree.get_file_revision(file_id) + if revision != default_revision_id: + action.add_utf8_property('last-changed', revision) if meta_modified: - action.add_bool_property('executable', entry.executable) + action.add_bool_property('executable', + new_tree.is_executable(file_id)) if text_modified and kind == "symlink": - action.add_property('target', entry.symlink_target) + action.add_property('target', + new_tree.get_symlink_target(file_id)) if text_modified and kind == "file": do_diff(file_id, old_path, new_path, action, force_binary) else: @@ -324,15 +326,14 @@ path, path) for path, file_id, kind in delta.unchanged: - ie = new_tree.inventory[file_id] - new_rev = getattr(ie, 'revision', None) + new_rev = new_tree.get_file_revision(file_id) if new_rev is None: continue - old_rev = getattr(old_tree.inventory[ie.file_id], 'revision', None) + old_rev = old_tree.get_file_revision(file_id) if new_rev != old_rev: - action = Action('modified', [ie.kind, - new_tree.id2path(ie.file_id)]) - action.add_utf8_property('last-changed', ie.revision) + action = Action('modified', [new_tree.kind(file_id), + new_tree.id2path(file_id)]) + action.add_utf8_property('last-changed', new_rev) action.write(self.to_file) diff -Nru bzr-2.5.0/bzrlib/bzrdir.py bzr-2.6.0~beta1/bzrlib/bzrdir.py --- bzr-2.5.0/bzrlib/bzrdir.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/bzrdir.py 2012-03-15 10:00:24.000000000 +0000 @@ -465,10 +465,6 @@ stacked=stacked) return result - @deprecated_method(deprecated_in((2, 3, 0))) - def generate_backup_name(self, base): - return self._available_backup_name(base) - def _available_backup_name(self, base): """Find a non-existing backup file name based on base. @@ -1234,16 +1230,6 @@ """The known .bzr formats.""" @classmethod - @deprecated_method(deprecated_in((2, 4, 0))) - def register_bzrdir_format(klass, format): - klass.formats.register(format.get_format_string(), format) - - @classmethod - @deprecated_method(deprecated_in((2, 4, 0))) - def unregister_bzrdir_format(klass, format): - klass.formats.remove(format.get_format_string()) - - @classmethod def probe_transport(klass, transport): """Return the .bzrdir style format present in a directory.""" try: @@ -1370,7 +1356,7 @@ :param shared_repo: Control whether made repositories are shared or not. :param vfs_only: If True do not attempt to use a smart server - :return: repo, bzrdir, require_stacking, repository_policy. repo is + :return: repo, controldir, require_stacking, repository_policy. repo is None if none was created or found, bzrdir is always valid. require_stacking is the result of examining the stacked_on parameter and any stacking policy found for the target. diff -Nru bzr-2.5.0/bzrlib/_chk_map_pyx.c bzr-2.6.0~beta1/bzrlib/_chk_map_pyx.c --- bzr-2.5.0/bzrlib/_chk_map_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_chk_map_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,1060 +1,427 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:39 2012 */ +/* Generated by Pyrex 0.9.8.5 on Fri Oct 8 14:01:05 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif - -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif - -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif - +#include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif - -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include -#define __PYX_HAVE_API__bzrlib___chk_map_pyx #include "python-compat.h" #include "_static_tuple_c.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - - -/* inline attribute */ -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -/* unused attribute */ -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - -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*/ +typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ -/* Type Conversion Predeclarations */ - -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - static PyObject *__pyx_m; static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "_chk_map_pyx.pyx", - "_static_tuple_c.pxd", -}; - -/* Type declarations */ - -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif - -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); - end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static char *__pyx_filename; +static char **__pyx_f; static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} - - -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - - -#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { - PyObject *r; - if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { - r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { - r = PySequence_GetItem(o, i); - } - else { - r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); - } - return r; -} - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ +static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); +static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); +static PyObject *__Pyx_ImportModule(char *name); /*proto*/ -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); +static void __Pyx_AddTraceback(char *funcname); /*proto*/ -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); +/* Declarations from bzrlib._static_tuple_c */ -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); +static PyTypeObject *__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple = 0; -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +/* Declarations from bzrlib._chk_map_pyx */ -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ -static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ +/* Declarations from implementation of bzrlib._chk_map_pyx */ -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ +static PyObject *__pyx_v_6bzrlib_12_chk_map_pyx_crc32; +static PyObject *__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode; +static PyObject *__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode; +static PyObject *__pyx_v_6bzrlib_12_chk_map_pyx__unknown; +static void *__pyx_f_6bzrlib_12_chk_map_pyx__my_memrchr(void *,int,size_t); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx_safe_interned_string_from_size(char *,Py_ssize_t); /*proto*/ +static int __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line(char **,char *,char *); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__import_globals(void); /*proto*/ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from bzrlib._static_tuple_c */ +static char __pyx_k1[] = "tried to create a string with an invalid size: %d @0x%x"; +static char __pyx_k2[] = "%08X"; +static char __pyx_k3[] = "Missing %s line\n"; +static char __pyx_k4[] = "%s line not a proper int\n"; +static char __pyx_k5[] = "bzrlib"; +static char __pyx_k6[] = "chk_map"; +static char __pyx_k7[] = "LeafNode"; +static char __pyx_k8[] = "InternalNode"; +static char __pyx_k9[] = "_unknown"; +static char __pyx_k10[] = "search_key_func"; +static char __pyx_k11[] = "bytes must be a plain string not %s"; +static char __pyx_k12[] = "chkleaf:\n"; +static char __pyx_k13[] = "not a serialised leaf node: %r"; +static char __pyx_k14[] = "bytes does not end in a newline"; +static char __pyx_k15[] = "maximum_size"; +static char __pyx_k16[] = "width"; +static char __pyx_k17[] = "length"; +static char __pyx_k18[] = "Missing the prefix line\n"; +static char __pyx_k19[] = "append"; +static char __pyx_k20[] = "Prefix has too many nulls versus width"; +static char __pyx_k21[] = "null line\n"; +static char __pyx_k22[] = "fail to find the num value lines null"; +static char __pyx_k23[] = "num value lines"; +static char __pyx_k24[] = "missing trailing newline"; +static char __pyx_k25[] = "bad no null, bad"; +static char __pyx_k26[] = "Too many bits for entry"; +static char __pyx_k27[] = "bad no null"; +static char __pyx_k28[] = "Incorrect number of elements (%d vs %d)"; +static char __pyx_k29[] = "item count (%d) mismatch for key %s, bytes %r"; +static char __pyx_k30[] = "_items"; +static char __pyx_k31[] = "_len"; +static char __pyx_k32[] = "_maximum_size"; +static char __pyx_k33[] = "_key"; +static char __pyx_k34[] = "_key_width"; +static char __pyx_k35[] = "_raw_size"; +static char __pyx_k36[] = "_search_prefix"; +static char __pyx_k37[] = "_common_serialised_prefix"; +static char __pyx_k38[] = "_current_size"; +static char __pyx_k39[] = "_current_size computed incorrectly %d != %d"; +static char __pyx_k40[] = "key %r is not a StaticTuple"; +static char __pyx_k41[] = "chknode:\n"; +static char __pyx_k42[] = "not a serialised internal node: %r"; +static char __pyx_k43[] = "intern"; +static char __pyx_k44[] = "_node_width"; +static char __pyx_k45[] = "bytes must be a string, got %r"; +static char __pyx_k46[] = "No kind section found."; +static char __pyx_k47[] = "Kind section should end with \": \", got %r"; +static char __pyx_k48[] = "no newline after file-id"; +static char __pyx_k49[] = "no newline after parent_str"; +static char __pyx_k50[] = "no newline after name str"; +static char __pyx_k51[] = "zlib"; +static char __pyx_k52[] = "crc32"; + +static PyObject *__pyx_n_InternalNode; +static PyObject *__pyx_n_LeafNode; +static PyObject *__pyx_n__common_serialised_prefix; +static PyObject *__pyx_n__current_size; +static PyObject *__pyx_n__items; +static PyObject *__pyx_n__key; +static PyObject *__pyx_n__key_width; +static PyObject *__pyx_n__len; +static PyObject *__pyx_n__maximum_size; +static PyObject *__pyx_n__node_width; +static PyObject *__pyx_n__raw_size; +static PyObject *__pyx_n__search_prefix; +static PyObject *__pyx_n__unknown; +static PyObject *__pyx_n_append; +static PyObject *__pyx_n_bzrlib; +static PyObject *__pyx_n_chk_map; +static PyObject *__pyx_n_crc32; +static PyObject *__pyx_n_intern; +static PyObject *__pyx_n_search_key_func; +static PyObject *__pyx_n_zlib; + +static PyObject *__pyx_k1p; +static PyObject *__pyx_k3p; +static PyObject *__pyx_k4p; +static PyObject *__pyx_k11p; +static PyObject *__pyx_k13p; +static PyObject *__pyx_k14p; +static PyObject *__pyx_k18p; +static PyObject *__pyx_k20p; +static PyObject *__pyx_k21p; +static PyObject *__pyx_k22p; +static PyObject *__pyx_k24p; +static PyObject *__pyx_k25p; +static PyObject *__pyx_k26p; +static PyObject *__pyx_k27p; +static PyObject *__pyx_k28p; +static PyObject *__pyx_k29p; +static PyObject *__pyx_k39p; +static PyObject *__pyx_k40p; +static PyObject *__pyx_k42p; +static PyObject *__pyx_k45p; +static PyObject *__pyx_k46p; +static PyObject *__pyx_k47p; +static PyObject *__pyx_k48p; +static PyObject *__pyx_k49p; +static PyObject *__pyx_k50p; -/* Module declarations from bzrlib._static_tuple_c */ +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_InternalNode, 1, __pyx_k8, sizeof(__pyx_k8)}, + {&__pyx_n_LeafNode, 1, __pyx_k7, sizeof(__pyx_k7)}, + {&__pyx_n__common_serialised_prefix, 1, __pyx_k37, sizeof(__pyx_k37)}, + {&__pyx_n__current_size, 1, __pyx_k38, sizeof(__pyx_k38)}, + {&__pyx_n__items, 1, __pyx_k30, sizeof(__pyx_k30)}, + {&__pyx_n__key, 1, __pyx_k33, sizeof(__pyx_k33)}, + {&__pyx_n__key_width, 1, __pyx_k34, sizeof(__pyx_k34)}, + {&__pyx_n__len, 1, __pyx_k31, sizeof(__pyx_k31)}, + {&__pyx_n__maximum_size, 1, __pyx_k32, sizeof(__pyx_k32)}, + {&__pyx_n__node_width, 1, __pyx_k44, sizeof(__pyx_k44)}, + {&__pyx_n__raw_size, 1, __pyx_k35, sizeof(__pyx_k35)}, + {&__pyx_n__search_prefix, 1, __pyx_k36, sizeof(__pyx_k36)}, + {&__pyx_n__unknown, 1, __pyx_k9, sizeof(__pyx_k9)}, + {&__pyx_n_append, 1, __pyx_k19, sizeof(__pyx_k19)}, + {&__pyx_n_bzrlib, 1, __pyx_k5, sizeof(__pyx_k5)}, + {&__pyx_n_chk_map, 1, __pyx_k6, sizeof(__pyx_k6)}, + {&__pyx_n_crc32, 1, __pyx_k52, sizeof(__pyx_k52)}, + {&__pyx_n_intern, 1, __pyx_k43, sizeof(__pyx_k43)}, + {&__pyx_n_search_key_func, 1, __pyx_k10, sizeof(__pyx_k10)}, + {&__pyx_n_zlib, 1, __pyx_k51, sizeof(__pyx_k51)}, + {&__pyx_k1p, 0, __pyx_k1, sizeof(__pyx_k1)}, + {&__pyx_k3p, 0, __pyx_k3, sizeof(__pyx_k3)}, + {&__pyx_k4p, 0, __pyx_k4, sizeof(__pyx_k4)}, + {&__pyx_k11p, 0, __pyx_k11, sizeof(__pyx_k11)}, + {&__pyx_k13p, 0, __pyx_k13, sizeof(__pyx_k13)}, + {&__pyx_k14p, 0, __pyx_k14, sizeof(__pyx_k14)}, + {&__pyx_k18p, 0, __pyx_k18, sizeof(__pyx_k18)}, + {&__pyx_k20p, 0, __pyx_k20, sizeof(__pyx_k20)}, + {&__pyx_k21p, 0, __pyx_k21, sizeof(__pyx_k21)}, + {&__pyx_k22p, 0, __pyx_k22, sizeof(__pyx_k22)}, + {&__pyx_k24p, 0, __pyx_k24, sizeof(__pyx_k24)}, + {&__pyx_k25p, 0, __pyx_k25, sizeof(__pyx_k25)}, + {&__pyx_k26p, 0, __pyx_k26, sizeof(__pyx_k26)}, + {&__pyx_k27p, 0, __pyx_k27, sizeof(__pyx_k27)}, + {&__pyx_k28p, 0, __pyx_k28, sizeof(__pyx_k28)}, + {&__pyx_k29p, 0, __pyx_k29, sizeof(__pyx_k29)}, + {&__pyx_k39p, 0, __pyx_k39, sizeof(__pyx_k39)}, + {&__pyx_k40p, 0, __pyx_k40, sizeof(__pyx_k40)}, + {&__pyx_k42p, 0, __pyx_k42, sizeof(__pyx_k42)}, + {&__pyx_k45p, 0, __pyx_k45, sizeof(__pyx_k45)}, + {&__pyx_k46p, 0, __pyx_k46, sizeof(__pyx_k46)}, + {&__pyx_k47p, 0, __pyx_k47, sizeof(__pyx_k47)}, + {&__pyx_k48p, 0, __pyx_k48, sizeof(__pyx_k48)}, + {&__pyx_k49p, 0, __pyx_k49, sizeof(__pyx_k49)}, + {&__pyx_k50p, 0, __pyx_k50, sizeof(__pyx_k50)}, + {0, 0, 0, 0} +}; -static PyTypeObject *__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple = 0; -/* Module declarations from bzrlib._chk_map_pyx */ +static PyObject *__pyx_d1; +static PyObject *__pyx_d2; -static PyObject *__pyx_v_6bzrlib_12_chk_map_pyx_crc32 = 0; -static PyObject *__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode = 0; -static PyObject *__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode = 0; -static PyObject *__pyx_v_6bzrlib_12_chk_map_pyx__unknown = 0; -static void *__pyx_f_6bzrlib_12_chk_map_pyx__my_memrchr(void *, int, size_t); /*proto*/ -static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx_safe_interned_string_from_size(char *, Py_ssize_t); /*proto*/ -static int __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line(char **, char *, char *); /*proto*/ -static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__import_globals(void); /*proto*/ -#define __Pyx_MODULE_NAME "bzrlib._chk_map_pyx" -static int __pyx_module_is_main_bzrlib___chk_map_pyx = 0; /* Implementation of bzrlib._chk_map_pyx */ -static PyObject *__pyx_builtin_AssertionError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_TypeError; -static char __pyx_k_1[] = "tried to create a string with an invalid size: %d @0x%x"; -static char __pyx_k_2[] = "%08X"; -static char __pyx_k_3[] = "Missing %s line\n"; -static char __pyx_k_4[] = "%s line not a proper int\n"; -static char __pyx_k_5[] = "bytes must be a plain string not %s"; -static char __pyx_k_6[] = "chkleaf:\n"; -static char __pyx_k_7[] = "not a serialised leaf node: %r"; -static char __pyx_k_8[] = "bytes does not end in a newline"; -static char __pyx_k_10[] = "Missing the prefix line\n"; -static char __pyx_k_12[] = "Prefix has too many nulls versus width"; -static char __pyx_k_14[] = "null line\n"; -static char __pyx_k_16[] = "fail to find the num value lines null"; -static char __pyx_k_18[] = "num value lines"; -static char __pyx_k_19[] = "missing trailing newline"; -static char __pyx_k_21[] = "bad no null, bad"; -static char __pyx_k_23[] = "Too many bits for entry"; -static char __pyx_k_25[] = "bad no null"; -static char __pyx_k_27[] = "Incorrect number of elements (%d vs %d)"; -static char __pyx_k_28[] = "item count (%d) mismatch for key %s, bytes %r"; -static char __pyx_k_29[] = "_common_serialised_prefix"; -static char __pyx_k_30[] = "_current_size computed incorrectly %d != %d"; -static char __pyx_k_31[] = "key %r is not a StaticTuple"; -static char __pyx_k_32[] = "chknode:\n"; -static char __pyx_k_33[] = "not a serialised internal node: %r"; -static char __pyx_k_38[] = "bytes must be a string, got %r"; -static char __pyx_k_39[] = "No kind section found."; -static char __pyx_k_41[] = "Kind section should end with \": \", got %r"; -static char __pyx_k_42[] = "no newline after file-id"; -static char __pyx_k_44[] = "no newline after parent_str"; -static char __pyx_k_46[] = "no newline after name str"; -static char __pyx_k_48[] = "bzrlib._chk_map_pyx"; -static char __pyx_k_49[] = "_deserialise_leaf_node"; -static char __pyx_k_50[] = "_deserialise_internal_node"; -static char __pyx_k__key[] = "key"; -static char __pyx_k___key[] = "_key"; -static char __pyx_k___len[] = "_len"; -static char __pyx_k__zlib[] = "zlib"; -static char __pyx_k__bytes[] = "bytes"; -static char __pyx_k__crc32[] = "crc32"; -static char __pyx_k__width[] = "width"; -static char __pyx_k___items[] = "_items"; -static char __pyx_k__append[] = "append"; -static char __pyx_k__bzrlib[] = "bzrlib"; -static char __pyx_k__intern[] = "intern"; -static char __pyx_k__length[] = "length"; -static char __pyx_k__chk_map[] = "chk_map"; -static char __pyx_k__LeafNode[] = "LeafNode"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k___unknown[] = "_unknown"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k___raw_size[] = "_raw_size"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k___key_width[] = "_key_width"; -static char __pyx_k___node_width[] = "_node_width"; -static char __pyx_k__InternalNode[] = "InternalNode"; -static char __pyx_k__maximum_size[] = "maximum_size"; -static char __pyx_k___current_size[] = "_current_size"; -static char __pyx_k___maximum_size[] = "_maximum_size"; -static char __pyx_k__AssertionError[] = "AssertionError"; -static char __pyx_k___search_key_16[] = "_search_key_16"; -static char __pyx_k___search_prefix[] = "_search_prefix"; -static char __pyx_k___search_key_255[] = "_search_key_255"; -static char __pyx_k__search_key_func[] = "search_key_func"; -static char __pyx_k___bytes_to_text_key[] = "_bytes_to_text_key"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_kp_s_10; -static PyObject *__pyx_kp_s_12; -static PyObject *__pyx_kp_s_14; -static PyObject *__pyx_kp_s_16; -static PyObject *__pyx_kp_s_19; -static PyObject *__pyx_kp_s_21; -static PyObject *__pyx_kp_s_23; -static PyObject *__pyx_kp_s_25; -static PyObject *__pyx_kp_s_27; -static PyObject *__pyx_kp_s_28; -static PyObject *__pyx_n_s_29; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_30; -static PyObject *__pyx_kp_s_31; -static PyObject *__pyx_kp_s_33; -static PyObject *__pyx_kp_s_38; -static PyObject *__pyx_kp_s_39; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_41; -static PyObject *__pyx_kp_s_42; -static PyObject *__pyx_kp_s_44; -static PyObject *__pyx_kp_s_46; -static PyObject *__pyx_n_s_48; -static PyObject *__pyx_n_s_49; -static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_n_s_50; -static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_kp_s_8; -static PyObject *__pyx_n_s__AssertionError; -static PyObject *__pyx_n_s__InternalNode; -static PyObject *__pyx_n_s__LeafNode; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___bytes_to_text_key; -static PyObject *__pyx_n_s___current_size; -static PyObject *__pyx_n_s___items; -static PyObject *__pyx_n_s___key; -static PyObject *__pyx_n_s___key_width; -static PyObject *__pyx_n_s___len; -static PyObject *__pyx_n_s___maximum_size; -static PyObject *__pyx_n_s___node_width; -static PyObject *__pyx_n_s___raw_size; -static PyObject *__pyx_n_s___search_key_16; -static PyObject *__pyx_n_s___search_key_255; -static PyObject *__pyx_n_s___search_prefix; -static PyObject *__pyx_n_s___unknown; -static PyObject *__pyx_n_s__append; -static PyObject *__pyx_n_s__bytes; -static PyObject *__pyx_n_s__bzrlib; -static PyObject *__pyx_n_s__chk_map; -static PyObject *__pyx_n_s__crc32; -static PyObject *__pyx_n_s__intern; -static PyObject *__pyx_n_s__key; -static PyObject *__pyx_n_s__search_key_func; -static PyObject *__pyx_n_s__zlib; -static PyObject *__pyx_k_tuple_9; -static PyObject *__pyx_k_tuple_11; -static PyObject *__pyx_k_tuple_13; -static PyObject *__pyx_k_tuple_15; -static PyObject *__pyx_k_tuple_17; -static PyObject *__pyx_k_tuple_20; -static PyObject *__pyx_k_tuple_22; -static PyObject *__pyx_k_tuple_24; -static PyObject *__pyx_k_tuple_26; -static PyObject *__pyx_k_tuple_34; -static PyObject *__pyx_k_tuple_35; -static PyObject *__pyx_k_tuple_36; -static PyObject *__pyx_k_tuple_37; -static PyObject *__pyx_k_tuple_40; -static PyObject *__pyx_k_tuple_43; -static PyObject *__pyx_k_tuple_45; -static PyObject *__pyx_k_tuple_47; - -/* "bzrlib/_chk_map_pyx.pyx":71 - * - * # We shouldn't just copy this from _dirstate_helpers_pyx - * cdef void* _my_memrchr(void *s, int c, size_t n): # cannot_raise # <<<<<<<<<<<<<< - * # memrchr seems to be a GNU extension, so we have to implement it ourselves - * cdef char *pos - */ -static void *__pyx_f_6bzrlib_12_chk_map_pyx__my_memrchr(void *__pyx_v_s, int __pyx_v_c, size_t __pyx_v_n) { +static void *__pyx_f_6bzrlib_12_chk_map_pyx__my_memrchr(void *__pyx_v_s,int __pyx_v_c,size_t __pyx_v_n) { char *__pyx_v_pos; char *__pyx_v_start; void *__pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("_my_memrchr"); + int __pyx_1; - /* "bzrlib/_chk_map_pyx.pyx":76 - * cdef char *start - * - * start = s # <<<<<<<<<<<<<< - * pos = start + n - 1 - * while pos >= start: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":76 */ __pyx_v_start = ((char *)__pyx_v_s); - /* "bzrlib/_chk_map_pyx.pyx":77 - * - * start = s - * pos = start + n - 1 # <<<<<<<<<<<<<< - * while pos >= start: - * if pos[0] == c: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":77 */ __pyx_v_pos = ((__pyx_v_start + __pyx_v_n) - 1); - /* "bzrlib/_chk_map_pyx.pyx":78 - * start = s - * pos = start + n - 1 - * while pos >= start: # <<<<<<<<<<<<<< - * if pos[0] == c: - * return pos - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":78 */ while (1) { - __pyx_t_1 = (__pyx_v_pos >= __pyx_v_start); - if (!__pyx_t_1) break; + __pyx_1 = (__pyx_v_pos >= __pyx_v_start); + if (!__pyx_1) break; - /* "bzrlib/_chk_map_pyx.pyx":79 - * pos = start + n - 1 - * while pos >= start: - * if pos[0] == c: # <<<<<<<<<<<<<< - * return pos - * pos = pos - 1 - */ - __pyx_t_1 = ((__pyx_v_pos[0]) == __pyx_v_c); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":80 - * while pos >= start: - * if pos[0] == c: - * return pos # <<<<<<<<<<<<<< - * pos = pos - 1 - * return NULL - */ - __pyx_r = ((void *)__pyx_v_pos); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":79 */ + __pyx_1 = ((__pyx_v_pos[0]) == __pyx_v_c); + if (__pyx_1) { + __pyx_r = __pyx_v_pos; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; - /* "bzrlib/_chk_map_pyx.pyx":81 - * if pos[0] == c: - * return pos - * pos = pos - 1 # <<<<<<<<<<<<<< - * return NULL - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":81 */ __pyx_v_pos = (__pyx_v_pos - 1); } - /* "bzrlib/_chk_map_pyx.pyx":82 - * return pos - * pos = pos - 1 - * return NULL # <<<<<<<<<<<<<< - * - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":82 */ __pyx_r = NULL; goto __pyx_L0; __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "bzrlib/_chk_map_pyx.pyx":85 - * - * - * cdef object safe_interned_string_from_size(char *s, Py_ssize_t size): # <<<<<<<<<<<<<< - * cdef PyObject *py_str - * if size < 0: - */ - -static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx_safe_interned_string_from_size(char *__pyx_v_s, Py_ssize_t __pyx_v_size) { +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx_safe_interned_string_from_size(char *__pyx_v_s,Py_ssize_t __pyx_v_size) { PyObject *__pyx_v_py_str; PyObject *__pyx_v_result; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("safe_interned_string_from_size"); - __pyx_v_result = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_chk_map_pyx.pyx":87 - * cdef object safe_interned_string_from_size(char *s, Py_ssize_t size): - * cdef PyObject *py_str - * if size < 0: # <<<<<<<<<<<<<< - * raise AssertionError( - * 'tried to create a string with an invalid size: %d @0x%x' - */ - __pyx_t_1 = (__pyx_v_size < 0); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":90 - * raise AssertionError( - * 'tried to create a string with an invalid size: %d @0x%x' - * % (size, s)) # <<<<<<<<<<<<<< - * py_str = PyString_FromStringAndSize_ptr(s, size) - * PyString_InternInPlace(&py_str) - */ - __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong(((int)__pyx_v_s)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + __pyx_v_result = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":87 */ + __pyx_1 = (__pyx_v_size < 0); + if (__pyx_1) { + __pyx_2 = PyInt_FromSsize_t(__pyx_v_size); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(((int)__pyx_v_s)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_2 = 0; + __pyx_3 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k1p, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(PyExc_AssertionError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":91 */ + __pyx_v_py_str = PyString_FromStringAndSize(__pyx_v_s,__pyx_v_size); - /* "bzrlib/_chk_map_pyx.pyx":91 - * 'tried to create a string with an invalid size: %d @0x%x' - * % (size, s)) - * py_str = PyString_FromStringAndSize_ptr(s, size) # <<<<<<<<<<<<<< - * PyString_InternInPlace(&py_str) - * result = py_str - */ - __pyx_v_py_str = PyString_FromStringAndSize(__pyx_v_s, __pyx_v_size); - - /* "bzrlib/_chk_map_pyx.pyx":92 - * % (size, s)) - * py_str = PyString_FromStringAndSize_ptr(s, size) - * PyString_InternInPlace(&py_str) # <<<<<<<<<<<<<< - * result = py_str - * # Casting a PyObject* to an triggers an INCREF from Pyrex, so we - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":92 */ PyString_InternInPlace((&__pyx_v_py_str)); - /* "bzrlib/_chk_map_pyx.pyx":93 - * py_str = PyString_FromStringAndSize_ptr(s, size) - * PyString_InternInPlace(&py_str) - * result = py_str # <<<<<<<<<<<<<< - * # Casting a PyObject* to an triggers an INCREF from Pyrex, so we - * # DECREF it to avoid geting immortal strings - */ - __Pyx_INCREF(((PyObject *)__pyx_v_py_str)); - __Pyx_DECREF(__pyx_v_result); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":93 */ + Py_INCREF(((PyObject *)__pyx_v_py_str)); + Py_DECREF(__pyx_v_result); __pyx_v_result = ((PyObject *)__pyx_v_py_str); - /* "bzrlib/_chk_map_pyx.pyx":96 - * # Casting a PyObject* to an triggers an INCREF from Pyrex, so we - * # DECREF it to avoid geting immortal strings - * Py_DECREF_ptr(py_str) # <<<<<<<<<<<<<< - * return result - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":96 */ Py_DECREF(__pyx_v_py_str); - /* "bzrlib/_chk_map_pyx.pyx":97 - * # DECREF it to avoid geting immortal strings - * Py_DECREF_ptr(py_str) - * return result # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_result); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":97 */ + Py_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._chk_map_pyx.safe_interned_string_from_size"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_result); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_result); return __pyx_r; } -/* "bzrlib/_chk_map_pyx.pyx":100 - * - * - * def _search_key_16(key): # <<<<<<<<<<<<<< - * """See chk_map._search_key_16.""" - * cdef Py_ssize_t num_bits - */ - -static PyObject *__pyx_pf_6bzrlib_12_chk_map_pyx__search_key_16(PyObject *__pyx_self, PyObject *__pyx_v_key); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__search_key_16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6bzrlib_12_chk_map_pyx__search_key_16[] = "See chk_map._search_key_16."; -static PyMethodDef __pyx_mdef_6bzrlib_12_chk_map_pyx__search_key_16 = {__Pyx_NAMESTR("_search_key_16"), (PyCFunction)__pyx_pf_6bzrlib_12_chk_map_pyx__search_key_16, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_12_chk_map_pyx__search_key_16)}; -static PyObject *__pyx_pf_6bzrlib_12_chk_map_pyx__search_key_16(PyObject *__pyx_self, PyObject *__pyx_v_key) { +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__search_key_16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; Py_ssize_t __pyx_v_num_bits; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_num_out_bytes; unsigned long __pyx_v_crc_val; char *__pyx_v_c_out; PyObject *__pyx_v_out; - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_search_key_16"); - __pyx_self = __pyx_self; - __pyx_v_out = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_chk_map_pyx.pyx":109 - * cdef char *c_out - * - * num_bits = len(key) # <<<<<<<<<<<<<< - * # 4 bytes per crc32, and another 1 byte between bits - * num_out_bytes = (9 * num_bits) - 1 - */ - __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_num_bits = __pyx_t_1; - - /* "bzrlib/_chk_map_pyx.pyx":111 - * num_bits = len(key) - * # 4 bytes per crc32, and another 1 byte between bits - * num_out_bytes = (9 * num_bits) - 1 # <<<<<<<<<<<<<< - * out = PyString_FromStringAndSize(NULL, num_out_bytes) - * c_out = PyString_AS_STRING(out) - */ + PyObject *__pyx_r; + Py_ssize_t __pyx_1; + PyObject *__pyx_2 = 0; + int __pyx_3; + PyObject *__pyx_4 = 0; + static char *__pyx_argnames[] = {"key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return 0; + Py_INCREF(__pyx_v_key); + __pyx_v_out = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":109 */ + __pyx_1 = PyObject_Length(__pyx_v_key); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;} + __pyx_v_num_bits = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":111 */ __pyx_v_num_out_bytes = ((9 * __pyx_v_num_bits) - 1); - /* "bzrlib/_chk_map_pyx.pyx":112 - * # 4 bytes per crc32, and another 1 byte between bits - * num_out_bytes = (9 * num_bits) - 1 - * out = PyString_FromStringAndSize(NULL, num_out_bytes) # <<<<<<<<<<<<<< - * c_out = PyString_AS_STRING(out) - * for i from 0 <= i < num_bits: - */ - __pyx_t_2 = PyString_FromStringAndSize(NULL, __pyx_v_num_out_bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_out); - __pyx_v_out = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":113 - * num_out_bytes = (9 * num_bits) - 1 - * out = PyString_FromStringAndSize(NULL, num_out_bytes) - * c_out = PyString_AS_STRING(out) # <<<<<<<<<<<<<< - * for i from 0 <= i < num_bits: - * if i > 0: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":112 */ + __pyx_2 = PyString_FromStringAndSize(NULL,__pyx_v_num_out_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} + Py_DECREF(__pyx_v_out); + __pyx_v_out = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":113 */ __pyx_v_c_out = PyString_AS_STRING(__pyx_v_out); - /* "bzrlib/_chk_map_pyx.pyx":114 - * out = PyString_FromStringAndSize(NULL, num_out_bytes) - * c_out = PyString_AS_STRING(out) - * for i from 0 <= i < num_bits: # <<<<<<<<<<<<<< - * if i > 0: - * c_out[0] = c'\x00' - */ - __pyx_t_1 = __pyx_v_num_bits; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - - /* "bzrlib/_chk_map_pyx.pyx":115 - * c_out = PyString_AS_STRING(out) - * for i from 0 <= i < num_bits: - * if i > 0: # <<<<<<<<<<<<<< - * c_out[0] = c'\x00' - * c_out = c_out + 1 - */ - __pyx_t_3 = (__pyx_v_i > 0); - if (__pyx_t_3) { - - /* "bzrlib/_chk_map_pyx.pyx":116 - * for i from 0 <= i < num_bits: - * if i > 0: - * c_out[0] = c'\x00' # <<<<<<<<<<<<<< - * c_out = c_out + 1 - * crc_val = PyInt_AS_LONG(crc32(key[i])) - */ - (__pyx_v_c_out[0]) = '\x00'; - - /* "bzrlib/_chk_map_pyx.pyx":117 - * if i > 0: - * c_out[0] = c'\x00' - * c_out = c_out + 1 # <<<<<<<<<<<<<< - * crc_val = PyInt_AS_LONG(crc32(key[i])) - * # Hex(val) order - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":114 */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_num_bits; ++__pyx_v_i) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":115 */ + __pyx_3 = (__pyx_v_i > 0); + if (__pyx_3) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":116 */ + (__pyx_v_c_out[0]) = '\x000'; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":117 */ __pyx_v_c_out = (__pyx_v_c_out + 1); - goto __pyx_L7; + goto __pyx_L4; } - __pyx_L7:; + __pyx_L4:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":118 */ + __pyx_2 = __Pyx_GetItemInt(__pyx_v_key, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_v_6bzrlib_12_chk_map_pyx_crc32, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_v_crc_val = PyInt_AS_LONG(__pyx_2); + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "bzrlib/_chk_map_pyx.pyx":118 - * c_out[0] = c'\x00' - * c_out = c_out + 1 - * crc_val = PyInt_AS_LONG(crc32(key[i])) # <<<<<<<<<<<<<< - * # Hex(val) order - * sprintf(c_out, '%08X', crc_val) - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_key, __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_v_6bzrlib_12_chk_map_pyx_crc32, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_v_crc_val = PyInt_AS_LONG(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":120 - * crc_val = PyInt_AS_LONG(crc32(key[i])) - * # Hex(val) order - * sprintf(c_out, '%08X', crc_val) # <<<<<<<<<<<<<< - * c_out = c_out + 8 - * return out - */ - sprintf(__pyx_v_c_out, __pyx_k_2, __pyx_v_crc_val); - - /* "bzrlib/_chk_map_pyx.pyx":121 - * # Hex(val) order - * sprintf(c_out, '%08X', crc_val) - * c_out = c_out + 8 # <<<<<<<<<<<<<< - * return out - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":120 */ + sprintf(__pyx_v_c_out,__pyx_k2,__pyx_v_crc_val); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":121 */ __pyx_v_c_out = (__pyx_v_c_out + 8); } - /* "bzrlib/_chk_map_pyx.pyx":122 - * sprintf(c_out, '%08X', crc_val) - * c_out = c_out + 8 - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_out); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":122 */ + Py_INCREF(__pyx_v_out); __pyx_r = __pyx_v_out; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._chk_map_pyx._search_key_16"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_out); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_chk_map_pyx.pyx":125 - * - * - * def _search_key_255(key): # <<<<<<<<<<<<<< - * """See chk_map._search_key_255.""" - * cdef Py_ssize_t num_bits - */ - -static PyObject *__pyx_pf_6bzrlib_12_chk_map_pyx_1_search_key_255(PyObject *__pyx_self, PyObject *__pyx_v_key); /*proto*/ -static char __pyx_doc_6bzrlib_12_chk_map_pyx_1_search_key_255[] = "See chk_map._search_key_255."; -static PyMethodDef __pyx_mdef_6bzrlib_12_chk_map_pyx_1_search_key_255 = {__Pyx_NAMESTR("_search_key_255"), (PyCFunction)__pyx_pf_6bzrlib_12_chk_map_pyx_1_search_key_255, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_12_chk_map_pyx_1_search_key_255)}; -static PyObject *__pyx_pf_6bzrlib_12_chk_map_pyx_1_search_key_255(PyObject *__pyx_self, PyObject *__pyx_v_key) { +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__search_key_255(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_12_chk_map_pyx__search_key_255[] = "See chk_map._search_key_255."; +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__search_key_255(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; Py_ssize_t __pyx_v_num_bits; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_j; @@ -1062,472 +429,223 @@ unsigned long __pyx_v_crc_val; char *__pyx_v_c_out; PyObject *__pyx_v_out; - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_search_key_255"); - __pyx_self = __pyx_self; - __pyx_v_out = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_chk_map_pyx.pyx":134 - * cdef char *c_out - * - * num_bits = len(key) # <<<<<<<<<<<<<< - * # 4 bytes per crc32, and another 1 byte between bits - * num_out_bytes = (5 * num_bits) - 1 - */ - __pyx_t_1 = PyObject_Length(__pyx_v_key); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_num_bits = __pyx_t_1; - - /* "bzrlib/_chk_map_pyx.pyx":136 - * num_bits = len(key) - * # 4 bytes per crc32, and another 1 byte between bits - * num_out_bytes = (5 * num_bits) - 1 # <<<<<<<<<<<<<< - * out = PyString_FromStringAndSize(NULL, num_out_bytes) - * c_out = PyString_AS_STRING(out) - */ + PyObject *__pyx_r; + Py_ssize_t __pyx_1; + PyObject *__pyx_2 = 0; + int __pyx_3; + PyObject *__pyx_4 = 0; + static char *__pyx_argnames[] = {"key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return 0; + Py_INCREF(__pyx_v_key); + __pyx_v_out = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":134 */ + __pyx_1 = PyObject_Length(__pyx_v_key); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;} + __pyx_v_num_bits = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":136 */ __pyx_v_num_out_bytes = ((5 * __pyx_v_num_bits) - 1); - /* "bzrlib/_chk_map_pyx.pyx":137 - * # 4 bytes per crc32, and another 1 byte between bits - * num_out_bytes = (5 * num_bits) - 1 - * out = PyString_FromStringAndSize(NULL, num_out_bytes) # <<<<<<<<<<<<<< - * c_out = PyString_AS_STRING(out) - * for i from 0 <= i < num_bits: - */ - __pyx_t_2 = PyString_FromStringAndSize(NULL, __pyx_v_num_out_bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_out); - __pyx_v_out = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":138 - * num_out_bytes = (5 * num_bits) - 1 - * out = PyString_FromStringAndSize(NULL, num_out_bytes) - * c_out = PyString_AS_STRING(out) # <<<<<<<<<<<<<< - * for i from 0 <= i < num_bits: - * if i > 0: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":137 */ + __pyx_2 = PyString_FromStringAndSize(NULL,__pyx_v_num_out_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L1;} + Py_DECREF(__pyx_v_out); + __pyx_v_out = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":138 */ __pyx_v_c_out = PyString_AS_STRING(__pyx_v_out); - /* "bzrlib/_chk_map_pyx.pyx":139 - * out = PyString_FromStringAndSize(NULL, num_out_bytes) - * c_out = PyString_AS_STRING(out) - * for i from 0 <= i < num_bits: # <<<<<<<<<<<<<< - * if i > 0: - * c_out[0] = c'\x00' - */ - __pyx_t_1 = __pyx_v_num_bits; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - - /* "bzrlib/_chk_map_pyx.pyx":140 - * c_out = PyString_AS_STRING(out) - * for i from 0 <= i < num_bits: - * if i > 0: # <<<<<<<<<<<<<< - * c_out[0] = c'\x00' - * c_out = c_out + 1 - */ - __pyx_t_3 = (__pyx_v_i > 0); - if (__pyx_t_3) { - - /* "bzrlib/_chk_map_pyx.pyx":141 - * for i from 0 <= i < num_bits: - * if i > 0: - * c_out[0] = c'\x00' # <<<<<<<<<<<<<< - * c_out = c_out + 1 - * crc_val = PyInt_AS_LONG(crc32(key[i])) - */ - (__pyx_v_c_out[0]) = '\x00'; - - /* "bzrlib/_chk_map_pyx.pyx":142 - * if i > 0: - * c_out[0] = c'\x00' - * c_out = c_out + 1 # <<<<<<<<<<<<<< - * crc_val = PyInt_AS_LONG(crc32(key[i])) - * # MSB order - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":139 */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_num_bits; ++__pyx_v_i) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":140 */ + __pyx_3 = (__pyx_v_i > 0); + if (__pyx_3) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":141 */ + (__pyx_v_c_out[0]) = '\x000'; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":142 */ __pyx_v_c_out = (__pyx_v_c_out + 1); - goto __pyx_L7; + goto __pyx_L4; } - __pyx_L7:; + __pyx_L4:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":143 */ + __pyx_2 = __Pyx_GetItemInt(__pyx_v_key, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_v_6bzrlib_12_chk_map_pyx_crc32, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_v_crc_val = PyInt_AS_LONG(__pyx_2); + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "bzrlib/_chk_map_pyx.pyx":143 - * c_out[0] = c'\x00' - * c_out = c_out + 1 - * crc_val = PyInt_AS_LONG(crc32(key[i])) # <<<<<<<<<<<<<< - * # MSB order - * c_out[0] = (crc_val >> 24) & 0xFF - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_key, __pyx_v_i, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_v_6bzrlib_12_chk_map_pyx_crc32, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_v_crc_val = PyInt_AS_LONG(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":145 - * crc_val = PyInt_AS_LONG(crc32(key[i])) - * # MSB order - * c_out[0] = (crc_val >> 24) & 0xFF # <<<<<<<<<<<<<< - * c_out[1] = (crc_val >> 16) & 0xFF - * c_out[2] = (crc_val >> 8) & 0xFF - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":145 */ (__pyx_v_c_out[0]) = ((__pyx_v_crc_val >> 24) & 0xFF); - /* "bzrlib/_chk_map_pyx.pyx":146 - * # MSB order - * c_out[0] = (crc_val >> 24) & 0xFF - * c_out[1] = (crc_val >> 16) & 0xFF # <<<<<<<<<<<<<< - * c_out[2] = (crc_val >> 8) & 0xFF - * c_out[3] = (crc_val >> 0) & 0xFF - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":146 */ (__pyx_v_c_out[1]) = ((__pyx_v_crc_val >> 16) & 0xFF); - /* "bzrlib/_chk_map_pyx.pyx":147 - * c_out[0] = (crc_val >> 24) & 0xFF - * c_out[1] = (crc_val >> 16) & 0xFF - * c_out[2] = (crc_val >> 8) & 0xFF # <<<<<<<<<<<<<< - * c_out[3] = (crc_val >> 0) & 0xFF - * for j from 0 <= j < 4: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":147 */ (__pyx_v_c_out[2]) = ((__pyx_v_crc_val >> 8) & 0xFF); - /* "bzrlib/_chk_map_pyx.pyx":148 - * c_out[1] = (crc_val >> 16) & 0xFF - * c_out[2] = (crc_val >> 8) & 0xFF - * c_out[3] = (crc_val >> 0) & 0xFF # <<<<<<<<<<<<<< - * for j from 0 <= j < 4: - * if c_out[j] == c'\n': - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":148 */ (__pyx_v_c_out[3]) = ((__pyx_v_crc_val >> 0) & 0xFF); - /* "bzrlib/_chk_map_pyx.pyx":149 - * c_out[2] = (crc_val >> 8) & 0xFF - * c_out[3] = (crc_val >> 0) & 0xFF - * for j from 0 <= j < 4: # <<<<<<<<<<<<<< - * if c_out[j] == c'\n': - * c_out[j] = c'_' - */ - for (__pyx_v_j = 0; __pyx_v_j < 4; __pyx_v_j++) { - - /* "bzrlib/_chk_map_pyx.pyx":150 - * c_out[3] = (crc_val >> 0) & 0xFF - * for j from 0 <= j < 4: - * if c_out[j] == c'\n': # <<<<<<<<<<<<<< - * c_out[j] = c'_' - * c_out = c_out + 4 - */ - __pyx_t_3 = ((__pyx_v_c_out[__pyx_v_j]) == '\n'); - if (__pyx_t_3) { - - /* "bzrlib/_chk_map_pyx.pyx":151 - * for j from 0 <= j < 4: - * if c_out[j] == c'\n': - * c_out[j] = c'_' # <<<<<<<<<<<<<< - * c_out = c_out + 4 - * return out - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":149 */ + for (__pyx_v_j = 0; __pyx_v_j < 4; ++__pyx_v_j) { + __pyx_3 = ((__pyx_v_c_out[__pyx_v_j]) == '\n'); + if (__pyx_3) { (__pyx_v_c_out[__pyx_v_j]) = '_'; - goto __pyx_L10; + goto __pyx_L7; } - __pyx_L10:; + __pyx_L7:; } - /* "bzrlib/_chk_map_pyx.pyx":152 - * if c_out[j] == c'\n': - * c_out[j] = c'_' - * c_out = c_out + 4 # <<<<<<<<<<<<<< - * return out - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":152 */ __pyx_v_c_out = (__pyx_v_c_out + 4); } - /* "bzrlib/_chk_map_pyx.pyx":153 - * c_out[j] = c'_' - * c_out = c_out + 4 - * return out # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_out); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":153 */ + Py_INCREF(__pyx_v_out); __pyx_r = __pyx_v_out; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._chk_map_pyx._search_key_255"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_out); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_out); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_chk_map_pyx.pyx":156 - * - * - * cdef int _get_int_from_line(char **cur, char *end, char *message) except -1: # <<<<<<<<<<<<<< - * """Read a positive integer from the data stream. - * - */ - -static int __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line(char **__pyx_v_cur, char *__pyx_v_end, char *__pyx_v_message) { +static int __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line(char **__pyx_v_cur,char *__pyx_v_end,char *__pyx_v_message) { int __pyx_v_value; char *__pyx_v_next_line; char *__pyx_v_next; int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("_get_int_from_line"); - - /* "bzrlib/_chk_map_pyx.pyx":167 - * cdef char *next_line, *next - * - * next_line = memchr(cur[0], c'\n', end - cur[0]) # <<<<<<<<<<<<<< - * if next_line == NULL: - * raise ValueError("Missing %s line\n" % message) - */ - __pyx_v_next_line = ((char *)memchr((__pyx_v_cur[0]), '\n', (__pyx_v_end - (__pyx_v_cur[0])))); - - /* "bzrlib/_chk_map_pyx.pyx":168 - * - * next_line = memchr(cur[0], c'\n', end - cur[0]) - * if next_line == NULL: # <<<<<<<<<<<<<< - * raise ValueError("Missing %s line\n" % message) - * - */ - __pyx_t_1 = (__pyx_v_next_line == NULL); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":169 - * next_line = memchr(cur[0], c'\n', end - cur[0]) - * if next_line == NULL: - * raise ValueError("Missing %s line\n" % message) # <<<<<<<<<<<<<< - * - * value = strtol(cur[0], &next, 10) - */ - __pyx_t_2 = PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":167 */ + __pyx_v_next_line = ((char *)memchr((__pyx_v_cur[0]),'\n',(__pyx_v_end - (__pyx_v_cur[0])))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":168 */ + __pyx_1 = (__pyx_v_next_line == NULL); + if (__pyx_1) { + __pyx_2 = PyString_FromString(__pyx_v_message); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k3p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":171 */ + __pyx_v_value = strtol((__pyx_v_cur[0]),(&__pyx_v_next),10); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":172 */ + __pyx_1 = (__pyx_v_next != __pyx_v_next_line); + if (__pyx_1) { + __pyx_2 = PyString_FromString(__pyx_v_message); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k4p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_chk_map_pyx.pyx":171 - * raise ValueError("Missing %s line\n" % message) - * - * value = strtol(cur[0], &next, 10) # <<<<<<<<<<<<<< - * if next != next_line: - * raise ValueError("%s line not a proper int\n" % message) - */ - __pyx_v_value = strtol((__pyx_v_cur[0]), (&__pyx_v_next), 10); - - /* "bzrlib/_chk_map_pyx.pyx":172 - * - * value = strtol(cur[0], &next, 10) - * if next != next_line: # <<<<<<<<<<<<<< - * raise ValueError("%s line not a proper int\n" % message) - * cur[0] = next_line + 1 - */ - __pyx_t_1 = (__pyx_v_next != __pyx_v_next_line); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":173 - * value = strtol(cur[0], &next, 10) - * if next != next_line: - * raise ValueError("%s line not a proper int\n" % message) # <<<<<<<<<<<<<< - * cur[0] = next_line + 1 - * return value - */ - __pyx_t_3 = PyBytes_FromString(__pyx_v_message); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "bzrlib/_chk_map_pyx.pyx":174 - * if next != next_line: - * raise ValueError("%s line not a proper int\n" % message) - * cur[0] = next_line + 1 # <<<<<<<<<<<<<< - * return value - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":174 */ (__pyx_v_cur[0]) = (__pyx_v_next_line + 1); - /* "bzrlib/_chk_map_pyx.pyx":175 - * raise ValueError("%s line not a proper int\n" % message) - * cur[0] = next_line + 1 - * return value # <<<<<<<<<<<<<< - * - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":175 */ __pyx_r = __pyx_v_value; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._chk_map_pyx._get_int_from_line"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "bzrlib/_chk_map_pyx.pyx":178 - * - * - * cdef _import_globals(): # <<<<<<<<<<<<<< - * """Set the global attributes. Done lazy to avoid recursive import loops.""" - * global _LeafNode, _InternalNode, _unknown - */ - -static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__import_globals(void) { +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__import_globals(void) { PyObject *__pyx_v_chk_map; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("_import_globals"); - __pyx_v_chk_map = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_chk_map_pyx.pyx":182 - * global _LeafNode, _InternalNode, _unknown - * - * from bzrlib import chk_map # <<<<<<<<<<<<<< - * _LeafNode = chk_map.LeafNode - * _InternalNode = chk_map.InternalNode - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__chk_map)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__chk_map)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chk_map)); - __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 = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__chk_map); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_chk_map); - __pyx_v_chk_map = __pyx_t_1; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":183 - * - * from bzrlib import chk_map - * _LeafNode = chk_map.LeafNode # <<<<<<<<<<<<<< - * _InternalNode = chk_map.InternalNode - * _unknown = chk_map._unknown - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_chk_map, __pyx_n_s__LeafNode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode); - __Pyx_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_v_6bzrlib_12_chk_map_pyx__LeafNode = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":184 - * from bzrlib import chk_map - * _LeafNode = chk_map.LeafNode - * _InternalNode = chk_map.InternalNode # <<<<<<<<<<<<<< - * _unknown = chk_map._unknown - * - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_chk_map, __pyx_n_s__InternalNode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode); - __Pyx_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_v_6bzrlib_12_chk_map_pyx__InternalNode = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":185 - * _LeafNode = chk_map.LeafNode - * _InternalNode = chk_map.InternalNode - * _unknown = chk_map._unknown # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_chk_map, __pyx_n_s___unknown); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_chk_map_pyx__unknown); - __Pyx_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__unknown); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_v_6bzrlib_12_chk_map_pyx__unknown = __pyx_t_2; - __pyx_t_2 = 0; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + __pyx_v_chk_map = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":182 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + Py_INCREF(__pyx_n_chk_map); + PyList_SET_ITEM(__pyx_1, 0, __pyx_n_chk_map); + __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_chk_map); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;} + Py_DECREF(__pyx_v_chk_map); + __pyx_v_chk_map = __pyx_1; + __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":183 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_chk_map, __pyx_n_LeafNode); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;} + Py_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode); + __pyx_v_6bzrlib_12_chk_map_pyx__LeafNode = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":184 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_chk_map, __pyx_n_InternalNode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; goto __pyx_L1;} + Py_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode); + __pyx_v_6bzrlib_12_chk_map_pyx__InternalNode = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":185 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_chk_map, __pyx_n__unknown); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} + Py_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__unknown); + __pyx_v_6bzrlib_12_chk_map_pyx__unknown = __pyx_2; + __pyx_2 = 0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._chk_map_pyx._import_globals"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_chk_map); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_chk_map); return __pyx_r; } -/* "bzrlib/_chk_map_pyx.pyx":188 - * - * - * def _deserialise_leaf_node(bytes, key, search_key_func=None): # <<<<<<<<<<<<<< - * """Deserialise bytes, with key key, into a LeafNode. - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_chk_map_pyx_2_deserialise_leaf_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_12_chk_map_pyx_2_deserialise_leaf_node[] = "Deserialise bytes, with key key, into a LeafNode.\n\n :param bytes: The bytes of the node.\n :param key: The key that the serialised node has.\n "; -static PyMethodDef __pyx_mdef_6bzrlib_12_chk_map_pyx_2_deserialise_leaf_node = {__Pyx_NAMESTR("_deserialise_leaf_node"), (PyCFunction)__pyx_pf_6bzrlib_12_chk_map_pyx_2_deserialise_leaf_node, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_12_chk_map_pyx_2_deserialise_leaf_node)}; -static PyObject *__pyx_pf_6bzrlib_12_chk_map_pyx_2_deserialise_leaf_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__deserialise_leaf_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_12_chk_map_pyx__deserialise_leaf_node[] = "Deserialise bytes, with key key, into a LeafNode.\n\n :param bytes: The bytes of the node.\n :param key: The key that the serialised node has.\n "; +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__deserialise_leaf_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bytes = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_search_key_func = 0; @@ -1559,1373 +677,613 @@ PyObject *__pyx_v_items; PyObject *__pyx_v_entry; PyObject *__pyx_v_value; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__bytes,&__pyx_n_s__key,&__pyx_n_s__search_key_func,0}; - __Pyx_RefNannySetupContext("_deserialise_leaf_node"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[3] = {0,0,0}; - values[2] = ((PyObject *)Py_None); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bytes); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("_deserialise_leaf_node", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__search_key_func); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_deserialise_leaf_node") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_bytes = values[0]; - __pyx_v_key = values[1]; - __pyx_v_search_key_func = values[2]; - } else { - __pyx_v_search_key_func = ((PyObject *)Py_None); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: - __pyx_v_search_key_func = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: - __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_bytes = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_deserialise_leaf_node", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._chk_map_pyx._deserialise_leaf_node"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_entry_bits = ((StaticTuple *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_result = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_prefix_bits = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_items = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_entry = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_value = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_chk_map_pyx.pyx":204 - * cdef StaticTuple entry_bits - * - * if _LeafNode is None: # <<<<<<<<<<<<<< - * _import_globals() - * - */ - __pyx_t_1 = (__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode == Py_None); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":205 - * - * if _LeafNode is None: - * _import_globals() # <<<<<<<<<<<<<< - * - * result = _LeafNode(search_key_func=search_key_func) - */ - __pyx_t_2 = __pyx_f_6bzrlib_12_chk_map_pyx__import_globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L6; - } - __pyx_L6:; - - /* "bzrlib/_chk_map_pyx.pyx":207 - * _import_globals() - * - * result = _LeafNode(search_key_func=search_key_func) # <<<<<<<<<<<<<< - * # Splitlines can split on '\r' so don't use it, split('\n') adds an - * # extra '' if the bytes ends in a final newline. - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__search_key_func), __pyx_v_search_key_func) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":210 - * # Splitlines can split on '\r' so don't use it, split('\n') adds an - * # extra '' if the bytes ends in a final newline. - * if not PyString_CheckExact(bytes): # <<<<<<<<<<<<<< - * raise TypeError('bytes must be a plain string not %s' % (type(bytes),)) - * - */ - __pyx_t_1 = (!PyString_CheckExact(__pyx_v_bytes)); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":211 - * # extra '' if the bytes ends in a final newline. - * if not PyString_CheckExact(bytes): - * raise TypeError('bytes must be a plain string not %s' % (type(bytes),)) # <<<<<<<<<<<<<< - * - * c_bytes = PyString_AS_STRING(bytes) - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_bytes))); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(__pyx_v_bytes))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_bytes))); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_ssize_t __pyx_5; + static char *__pyx_argnames[] = {"bytes","key","search_key_func",0}; + __pyx_v_search_key_func = __pyx_d1; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_bytes, &__pyx_v_key, &__pyx_v_search_key_func)) return 0; + Py_INCREF(__pyx_v_bytes); + Py_INCREF(__pyx_v_key); + Py_INCREF(__pyx_v_search_key_func); + __pyx_v_entry_bits = ((StaticTuple *)Py_None); Py_INCREF(Py_None); + __pyx_v_result = Py_None; Py_INCREF(Py_None); + __pyx_v_prefix_bits = Py_None; Py_INCREF(Py_None); + __pyx_v_items = Py_None; Py_INCREF(Py_None); + __pyx_v_entry = Py_None; Py_INCREF(Py_None); + __pyx_v_value = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":204 */ + __pyx_1 = __pyx_v_6bzrlib_12_chk_map_pyx__LeafNode == Py_None; + if (__pyx_1) { + __pyx_2 = __pyx_f_6bzrlib_12_chk_map_pyx__import_globals(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":207 */ + __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} + __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_3, __pyx_n_search_key_func, __pyx_v_search_key_func) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} + __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode, __pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_v_result); + __pyx_v_result = __pyx_4; + __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":210 */ + __pyx_1 = (!PyString_CheckExact(__pyx_v_bytes)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + Py_INCREF(__pyx_v_bytes); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_bytes); + __pyx_3 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k11p, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(PyExc_TypeError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + goto __pyx_L3; } - __pyx_L7:; + __pyx_L3:; - /* "bzrlib/_chk_map_pyx.pyx":213 - * raise TypeError('bytes must be a plain string not %s' % (type(bytes),)) - * - * c_bytes = PyString_AS_STRING(bytes) # <<<<<<<<<<<<<< - * c_bytes_len = PyString_GET_SIZE(bytes) - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":213 */ __pyx_v_c_bytes = PyString_AS_STRING(__pyx_v_bytes); - /* "bzrlib/_chk_map_pyx.pyx":214 - * - * c_bytes = PyString_AS_STRING(bytes) - * c_bytes_len = PyString_GET_SIZE(bytes) # <<<<<<<<<<<<<< - * - * if c_bytes_len < 9 or memcmp(c_bytes, "chkleaf:\n", 9) != 0: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":214 */ __pyx_v_c_bytes_len = PyString_GET_SIZE(__pyx_v_bytes); - /* "bzrlib/_chk_map_pyx.pyx":216 - * c_bytes_len = PyString_GET_SIZE(bytes) - * - * if c_bytes_len < 9 or memcmp(c_bytes, "chkleaf:\n", 9) != 0: # <<<<<<<<<<<<<< - * raise ValueError("not a serialised leaf node: %r" % bytes) - * if c_bytes[c_bytes_len - 1] != c'\n': - */ - __pyx_t_1 = (__pyx_v_c_bytes_len < 9); - if (!__pyx_t_1) { - __pyx_t_4 = (memcmp(__pyx_v_c_bytes, __pyx_k_6, 9) != 0); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_1; - } - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":217 - * - * if c_bytes_len < 9 or memcmp(c_bytes, "chkleaf:\n", 9) != 0: - * raise ValueError("not a serialised leaf node: %r" % bytes) # <<<<<<<<<<<<<< - * if c_bytes[c_bytes_len - 1] != c'\n': - * raise ValueError("bytes does not end in a newline") - */ - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_v_bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":216 */ + __pyx_1 = (__pyx_v_c_bytes_len < 9); + if (!__pyx_1) { + __pyx_1 = (memcmp(__pyx_v_c_bytes,__pyx_k12,9) != 0); + } + if (__pyx_1) { + __pyx_2 = PyNumber_Remainder(__pyx_k13p, __pyx_v_bytes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L8:; + __pyx_L4:; - /* "bzrlib/_chk_map_pyx.pyx":218 - * if c_bytes_len < 9 or memcmp(c_bytes, "chkleaf:\n", 9) != 0: - * raise ValueError("not a serialised leaf node: %r" % bytes) - * if c_bytes[c_bytes_len - 1] != c'\n': # <<<<<<<<<<<<<< - * raise ValueError("bytes does not end in a newline") - * - */ - __pyx_t_5 = ((__pyx_v_c_bytes[(__pyx_v_c_bytes_len - 1)]) != '\n'); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":219 - * raise ValueError("not a serialised leaf node: %r" % bytes) - * if c_bytes[c_bytes_len - 1] != c'\n': - * raise ValueError("bytes does not end in a newline") # <<<<<<<<<<<<<< - * - * end = c_bytes + c_bytes_len - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":218 */ + __pyx_1 = ((__pyx_v_c_bytes[(__pyx_v_c_bytes_len - 1)]) != '\n'); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + Py_INCREF(__pyx_k14p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k14p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + goto __pyx_L5; } - __pyx_L9:; + __pyx_L5:; - /* "bzrlib/_chk_map_pyx.pyx":221 - * raise ValueError("bytes does not end in a newline") - * - * end = c_bytes + c_bytes_len # <<<<<<<<<<<<<< - * cur = c_bytes + 9 - * maximum_size = _get_int_from_line(&cur, end, "maximum_size") - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":221 */ __pyx_v_end = (__pyx_v_c_bytes + __pyx_v_c_bytes_len); - /* "bzrlib/_chk_map_pyx.pyx":222 - * - * end = c_bytes + c_bytes_len - * cur = c_bytes + 9 # <<<<<<<<<<<<<< - * maximum_size = _get_int_from_line(&cur, end, "maximum_size") - * width = _get_int_from_line(&cur, end, "width") - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":222 */ __pyx_v_cur = (__pyx_v_c_bytes + 9); - /* "bzrlib/_chk_map_pyx.pyx":223 - * end = c_bytes + c_bytes_len - * cur = c_bytes + 9 - * maximum_size = _get_int_from_line(&cur, end, "maximum_size") # <<<<<<<<<<<<<< - * width = _get_int_from_line(&cur, end, "width") - * length = _get_int_from_line(&cur, end, "length") - */ - __pyx_t_6 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur), __pyx_v_end, __pyx_k__maximum_size); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_maximum_size = __pyx_t_6; - - /* "bzrlib/_chk_map_pyx.pyx":224 - * cur = c_bytes + 9 - * maximum_size = _get_int_from_line(&cur, end, "maximum_size") - * width = _get_int_from_line(&cur, end, "width") # <<<<<<<<<<<<<< - * length = _get_int_from_line(&cur, end, "length") - * - */ - __pyx_t_6 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur), __pyx_v_end, __pyx_k__width); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_width = __pyx_t_6; - - /* "bzrlib/_chk_map_pyx.pyx":225 - * maximum_size = _get_int_from_line(&cur, end, "maximum_size") - * width = _get_int_from_line(&cur, end, "width") - * length = _get_int_from_line(&cur, end, "length") # <<<<<<<<<<<<<< - * - * next_line = memchr(cur, c'\n', end - cur) - */ - __pyx_t_6 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur), __pyx_v_end, __pyx_k__length); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_length = __pyx_t_6; - - /* "bzrlib/_chk_map_pyx.pyx":227 - * length = _get_int_from_line(&cur, end, "length") - * - * next_line = memchr(cur, c'\n', end - cur) # <<<<<<<<<<<<<< - * if next_line == NULL: - * raise ValueError('Missing the prefix line\n') - */ - __pyx_v_next_line = ((char *)memchr(__pyx_v_cur, '\n', (__pyx_v_end - __pyx_v_cur))); - - /* "bzrlib/_chk_map_pyx.pyx":228 - * - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: # <<<<<<<<<<<<<< - * raise ValueError('Missing the prefix line\n') - * prefix = cur - */ - __pyx_t_5 = (__pyx_v_next_line == NULL); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":229 - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - * raise ValueError('Missing the prefix line\n') # <<<<<<<<<<<<<< - * prefix = cur - * prefix_length = next_line - cur - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":223 */ + __pyx_1 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur),__pyx_v_end,__pyx_k15); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; goto __pyx_L1;} + __pyx_v_maximum_size = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":224 */ + __pyx_1 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur),__pyx_v_end,__pyx_k16); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} + __pyx_v_width = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":225 */ + __pyx_1 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur),__pyx_v_end,__pyx_k17); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + __pyx_v_length = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":227 */ + __pyx_v_next_line = ((char *)memchr(__pyx_v_cur,'\n',(__pyx_v_end - __pyx_v_cur))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":228 */ + __pyx_1 = (__pyx_v_next_line == NULL); + if (__pyx_1) { + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + Py_INCREF(__pyx_k18p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k18p); + __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + goto __pyx_L6; } - __pyx_L10:; + __pyx_L6:; - /* "bzrlib/_chk_map_pyx.pyx":230 - * if next_line == NULL: - * raise ValueError('Missing the prefix line\n') - * prefix = cur # <<<<<<<<<<<<<< - * prefix_length = next_line - cur - * cur = next_line + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":230 */ __pyx_v_prefix = __pyx_v_cur; - /* "bzrlib/_chk_map_pyx.pyx":231 - * raise ValueError('Missing the prefix line\n') - * prefix = cur - * prefix_length = next_line - cur # <<<<<<<<<<<<<< - * cur = next_line + 1 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":231 */ __pyx_v_prefix_length = (__pyx_v_next_line - __pyx_v_cur); - /* "bzrlib/_chk_map_pyx.pyx":232 - * prefix = cur - * prefix_length = next_line - cur - * cur = next_line + 1 # <<<<<<<<<<<<<< - * - * prefix_bits = [] - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":232 */ __pyx_v_cur = (__pyx_v_next_line + 1); - /* "bzrlib/_chk_map_pyx.pyx":234 - * cur = next_line + 1 - * - * prefix_bits = [] # <<<<<<<<<<<<<< - * prefix_tail = prefix - * num_prefix_bits = 0 - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_v_prefix_bits)); - __pyx_v_prefix_bits = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":235 - * - * prefix_bits = [] - * prefix_tail = prefix # <<<<<<<<<<<<<< - * num_prefix_bits = 0 - * next_null = memchr(prefix, c'\0', prefix_length) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":234 */ + __pyx_3 = PyList_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} + Py_DECREF(__pyx_v_prefix_bits); + __pyx_v_prefix_bits = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":235 */ __pyx_v_prefix_tail = __pyx_v_prefix; - /* "bzrlib/_chk_map_pyx.pyx":236 - * prefix_bits = [] - * prefix_tail = prefix - * num_prefix_bits = 0 # <<<<<<<<<<<<<< - * next_null = memchr(prefix, c'\0', prefix_length) - * while next_null != NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":236 */ __pyx_v_num_prefix_bits = 0; - /* "bzrlib/_chk_map_pyx.pyx":237 - * prefix_tail = prefix - * num_prefix_bits = 0 - * next_null = memchr(prefix, c'\0', prefix_length) # <<<<<<<<<<<<<< - * while next_null != NULL: - * num_prefix_bits = num_prefix_bits + 1 - */ - __pyx_v_next_null = ((char *)memchr(__pyx_v_prefix, '\x00', __pyx_v_prefix_length)); - - /* "bzrlib/_chk_map_pyx.pyx":238 - * num_prefix_bits = 0 - * next_null = memchr(prefix, c'\0', prefix_length) - * while next_null != NULL: # <<<<<<<<<<<<<< - * num_prefix_bits = num_prefix_bits + 1 - * prefix_bits.append( - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":237 */ + __pyx_v_next_null = ((char *)memchr(__pyx_v_prefix,'\0',__pyx_v_prefix_length)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":238 */ while (1) { - __pyx_t_5 = (__pyx_v_next_null != NULL); - if (!__pyx_t_5) break; + __pyx_1 = (__pyx_v_next_null != NULL); + if (!__pyx_1) break; - /* "bzrlib/_chk_map_pyx.pyx":239 - * next_null = memchr(prefix, c'\0', prefix_length) - * while next_null != NULL: - * num_prefix_bits = num_prefix_bits + 1 # <<<<<<<<<<<<<< - * prefix_bits.append( - * PyString_FromStringAndSize(prefix_tail, next_null - prefix_tail)) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":239 */ __pyx_v_num_prefix_bits = (__pyx_v_num_prefix_bits + 1); - /* "bzrlib/_chk_map_pyx.pyx":240 - * while next_null != NULL: - * num_prefix_bits = num_prefix_bits + 1 - * prefix_bits.append( # <<<<<<<<<<<<<< - * PyString_FromStringAndSize(prefix_tail, next_null - prefix_tail)) - * prefix_tail = next_null + 1 - */ - if (unlikely(__pyx_v_prefix_bits == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":240 */ + __pyx_4 = PyObject_GetAttr(__pyx_v_prefix_bits, __pyx_n_append); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} + __pyx_2 = PyString_FromStringAndSize(__pyx_v_prefix_tail,(__pyx_v_next_null - __pyx_v_prefix_tail)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "bzrlib/_chk_map_pyx.pyx":241 - * num_prefix_bits = num_prefix_bits + 1 - * prefix_bits.append( - * PyString_FromStringAndSize(prefix_tail, next_null - prefix_tail)) # <<<<<<<<<<<<<< - * prefix_tail = next_null + 1 - * next_null = memchr(prefix_tail, c'\0', next_line - prefix_tail) - */ - __pyx_t_2 = PyString_FromStringAndSize(__pyx_v_prefix_tail, (__pyx_v_next_null - __pyx_v_prefix_tail)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyList_Append(__pyx_v_prefix_bits, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":242 - * prefix_bits.append( - * PyString_FromStringAndSize(prefix_tail, next_null - prefix_tail)) - * prefix_tail = next_null + 1 # <<<<<<<<<<<<<< - * next_null = memchr(prefix_tail, c'\0', next_line - prefix_tail) - * prefix_tail_len = next_line - prefix_tail - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":242 */ __pyx_v_prefix_tail = (__pyx_v_next_null + 1); - /* "bzrlib/_chk_map_pyx.pyx":243 - * PyString_FromStringAndSize(prefix_tail, next_null - prefix_tail)) - * prefix_tail = next_null + 1 - * next_null = memchr(prefix_tail, c'\0', next_line - prefix_tail) # <<<<<<<<<<<<<< - * prefix_tail_len = next_line - prefix_tail - * - */ - __pyx_v_next_null = ((char *)memchr(__pyx_v_prefix_tail, '\x00', (__pyx_v_next_line - __pyx_v_prefix_tail))); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":243 */ + __pyx_v_next_null = ((char *)memchr(__pyx_v_prefix_tail,'\0',(__pyx_v_next_line - __pyx_v_prefix_tail))); } - /* "bzrlib/_chk_map_pyx.pyx":244 - * prefix_tail = next_null + 1 - * next_null = memchr(prefix_tail, c'\0', next_line - prefix_tail) - * prefix_tail_len = next_line - prefix_tail # <<<<<<<<<<<<<< - * - * if num_prefix_bits >= width: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":244 */ __pyx_v_prefix_tail_len = (__pyx_v_next_line - __pyx_v_prefix_tail); - /* "bzrlib/_chk_map_pyx.pyx":246 - * prefix_tail_len = next_line - prefix_tail - * - * if num_prefix_bits >= width: # <<<<<<<<<<<<<< - * raise ValueError('Prefix has too many nulls versus width') - * - */ - __pyx_t_5 = (__pyx_v_num_prefix_bits >= __pyx_v_width); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":247 - * - * if num_prefix_bits >= width: - * raise ValueError('Prefix has too many nulls versus width') # <<<<<<<<<<<<<< - * - * items_length = end - cur - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L13; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":246 */ + __pyx_1 = (__pyx_v_num_prefix_bits >= __pyx_v_width); + if (__pyx_1) { + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;} + Py_INCREF(__pyx_k20p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k20p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;} + goto __pyx_L9; } - __pyx_L13:; + __pyx_L9:; - /* "bzrlib/_chk_map_pyx.pyx":249 - * raise ValueError('Prefix has too many nulls versus width') - * - * items_length = end - cur # <<<<<<<<<<<<<< - * items = {} - * while cur < end: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":249 */ __pyx_v_items_length = (__pyx_v_end - __pyx_v_cur); - /* "bzrlib/_chk_map_pyx.pyx":250 - * - * items_length = end - cur - * items = {} # <<<<<<<<<<<<<< - * while cur < end: - * line_start = cur - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_v_items)); - __pyx_v_items = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":251 - * items_length = end - cur - * items = {} - * while cur < end: # <<<<<<<<<<<<<< - * line_start = cur - * next_line = memchr(cur, c'\n', end - cur) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":250 */ + __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} + Py_DECREF(__pyx_v_items); + __pyx_v_items = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":251 */ while (1) { - __pyx_t_5 = (__pyx_v_cur < __pyx_v_end); - if (!__pyx_t_5) break; + __pyx_1 = (__pyx_v_cur < __pyx_v_end); + if (!__pyx_1) break; - /* "bzrlib/_chk_map_pyx.pyx":252 - * items = {} - * while cur < end: - * line_start = cur # <<<<<<<<<<<<<< - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":252 */ __pyx_v_line_start = __pyx_v_cur; - /* "bzrlib/_chk_map_pyx.pyx":253 - * while cur < end: - * line_start = cur - * next_line = memchr(cur, c'\n', end - cur) # <<<<<<<<<<<<<< - * if next_line == NULL: - * raise ValueError('null line\n') - */ - __pyx_v_next_line = ((char *)memchr(__pyx_v_cur, '\n', (__pyx_v_end - __pyx_v_cur))); - - /* "bzrlib/_chk_map_pyx.pyx":254 - * line_start = cur - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: # <<<<<<<<<<<<<< - * raise ValueError('null line\n') - * last_null = _my_memrchr(cur, c'\0', next_line - cur) - */ - __pyx_t_5 = (__pyx_v_next_line == NULL); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":255 - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - * raise ValueError('null line\n') # <<<<<<<<<<<<<< - * last_null = _my_memrchr(cur, c'\0', next_line - cur) - * if last_null == NULL: - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L16; - } - __pyx_L16:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":253 */ + __pyx_v_next_line = ((char *)memchr(__pyx_v_cur,'\n',(__pyx_v_end - __pyx_v_cur))); - /* "bzrlib/_chk_map_pyx.pyx":256 - * if next_line == NULL: - * raise ValueError('null line\n') - * last_null = _my_memrchr(cur, c'\0', next_line - cur) # <<<<<<<<<<<<<< - * if last_null == NULL: - * raise ValueError('fail to find the num value lines null') - */ - __pyx_v_last_null = ((char *)__pyx_f_6bzrlib_12_chk_map_pyx__my_memrchr(__pyx_v_cur, '\x00', (__pyx_v_next_line - __pyx_v_cur))); - - /* "bzrlib/_chk_map_pyx.pyx":257 - * raise ValueError('null line\n') - * last_null = _my_memrchr(cur, c'\0', next_line - cur) - * if last_null == NULL: # <<<<<<<<<<<<<< - * raise ValueError('fail to find the num value lines null') - * next_null = last_null + 1 # move past NULL - */ - __pyx_t_5 = (__pyx_v_last_null == NULL); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":258 - * last_null = _my_memrchr(cur, c'\0', next_line - cur) - * if last_null == NULL: - * raise ValueError('fail to find the num value lines null') # <<<<<<<<<<<<<< - * next_null = last_null + 1 # move past NULL - * num_value_lines = _get_int_from_line(&next_null, next_line + 1, - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L17; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":254 */ + __pyx_1 = (__pyx_v_next_line == NULL); + if (__pyx_1) { + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;} + Py_INCREF(__pyx_k21p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k21p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;} + goto __pyx_L12; + } + __pyx_L12:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":256 */ + __pyx_v_last_null = ((char *)__pyx_f_6bzrlib_12_chk_map_pyx__my_memrchr(__pyx_v_cur,'\0',(__pyx_v_next_line - __pyx_v_cur))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":257 */ + __pyx_1 = (__pyx_v_last_null == NULL); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;} + Py_INCREF(__pyx_k22p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k22p); + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;} + goto __pyx_L13; } - __pyx_L17:; + __pyx_L13:; - /* "bzrlib/_chk_map_pyx.pyx":259 - * if last_null == NULL: - * raise ValueError('fail to find the num value lines null') - * next_null = last_null + 1 # move past NULL # <<<<<<<<<<<<<< - * num_value_lines = _get_int_from_line(&next_null, next_line + 1, - * "num value lines") - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":259 */ __pyx_v_next_null = (__pyx_v_last_null + 1); - /* "bzrlib/_chk_map_pyx.pyx":260 - * raise ValueError('fail to find the num value lines null') - * next_null = last_null + 1 # move past NULL - * num_value_lines = _get_int_from_line(&next_null, next_line + 1, # <<<<<<<<<<<<<< - * "num value lines") - * cur = next_line + 1 - */ - __pyx_t_6 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_next_null), (__pyx_v_next_line + 1), __pyx_k_18); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_num_value_lines = __pyx_t_6; - - /* "bzrlib/_chk_map_pyx.pyx":262 - * num_value_lines = _get_int_from_line(&next_null, next_line + 1, - * "num value lines") - * cur = next_line + 1 # <<<<<<<<<<<<<< - * value_start = cur - * # Walk num_value_lines forward - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":260 */ + __pyx_1 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_next_null),(__pyx_v_next_line + 1),__pyx_k23); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; goto __pyx_L1;} + __pyx_v_num_value_lines = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":262 */ __pyx_v_cur = (__pyx_v_next_line + 1); - /* "bzrlib/_chk_map_pyx.pyx":263 - * "num value lines") - * cur = next_line + 1 - * value_start = cur # <<<<<<<<<<<<<< - * # Walk num_value_lines forward - * for i from 0 <= i < num_value_lines: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":263 */ __pyx_v_value_start = __pyx_v_cur; - /* "bzrlib/_chk_map_pyx.pyx":265 - * value_start = cur - * # Walk num_value_lines forward - * for i from 0 <= i < num_value_lines: # <<<<<<<<<<<<<< - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - */ - __pyx_t_6 = __pyx_v_num_value_lines; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - - /* "bzrlib/_chk_map_pyx.pyx":266 - * # Walk num_value_lines forward - * for i from 0 <= i < num_value_lines: - * next_line = memchr(cur, c'\n', end - cur) # <<<<<<<<<<<<<< - * if next_line == NULL: - * raise ValueError('missing trailing newline') - */ - __pyx_v_next_line = ((char *)memchr(__pyx_v_cur, '\n', (__pyx_v_end - __pyx_v_cur))); - - /* "bzrlib/_chk_map_pyx.pyx":267 - * for i from 0 <= i < num_value_lines: - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: # <<<<<<<<<<<<<< - * raise ValueError('missing trailing newline') - * cur = next_line + 1 - */ - __pyx_t_5 = (__pyx_v_next_line == NULL); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":268 - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - * raise ValueError('missing trailing newline') # <<<<<<<<<<<<<< - * cur = next_line + 1 - * entry_bits = StaticTuple_New(width) - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L20; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":265 */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_num_value_lines; ++__pyx_v_i) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":266 */ + __pyx_v_next_line = ((char *)memchr(__pyx_v_cur,'\n',(__pyx_v_end - __pyx_v_cur))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":267 */ + __pyx_1 = (__pyx_v_next_line == NULL); + if (__pyx_1) { + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;} + Py_INCREF(__pyx_k24p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k24p); + __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; goto __pyx_L1;} + goto __pyx_L16; } - __pyx_L20:; + __pyx_L16:; - /* "bzrlib/_chk_map_pyx.pyx":269 - * if next_line == NULL: - * raise ValueError('missing trailing newline') - * cur = next_line + 1 # <<<<<<<<<<<<<< - * entry_bits = StaticTuple_New(width) - * for i from 0 <= i < num_prefix_bits: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":269 */ __pyx_v_cur = (__pyx_v_next_line + 1); } - /* "bzrlib/_chk_map_pyx.pyx":270 - * raise ValueError('missing trailing newline') - * cur = next_line + 1 - * entry_bits = StaticTuple_New(width) # <<<<<<<<<<<<<< - * for i from 0 <= i < num_prefix_bits: - * # TODO: Use PyList_GetItem, or turn prefix_bits into a - */ - __pyx_t_2 = ((PyObject *)StaticTuple_New(__pyx_v_width)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_entry_bits)); - __pyx_v_entry_bits = ((StaticTuple *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":271 - * cur = next_line + 1 - * entry_bits = StaticTuple_New(width) - * for i from 0 <= i < num_prefix_bits: # <<<<<<<<<<<<<< - * # TODO: Use PyList_GetItem, or turn prefix_bits into a - * # tuple/StaticTuple - */ - __pyx_t_6 = __pyx_v_num_prefix_bits; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { - - /* "bzrlib/_chk_map_pyx.pyx":274 - * # TODO: Use PyList_GetItem, or turn prefix_bits into a - * # tuple/StaticTuple - * entry = prefix_bits[i] # <<<<<<<<<<<<<< - * # SET_ITEM 'steals' a reference - * Py_INCREF(entry) - */ - __pyx_t_2 = __Pyx_GetItemInt_List(((PyObject *)__pyx_v_prefix_bits), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_entry); - __pyx_v_entry = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":276 - * entry = prefix_bits[i] - * # SET_ITEM 'steals' a reference - * Py_INCREF(entry) # <<<<<<<<<<<<<< - * StaticTuple_SET_ITEM(entry_bits, i, entry) - * value = PyString_FromStringAndSize(value_start, next_line - value_start) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":270 */ + __pyx_4 = ((PyObject *)StaticTuple_New(__pyx_v_width)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_entry_bits)); + __pyx_v_entry_bits = ((StaticTuple *)__pyx_4); + __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":271 */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_num_prefix_bits; ++__pyx_v_i) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":274 */ + __pyx_3 = __Pyx_GetItemInt(__pyx_v_prefix_bits, __pyx_v_i); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;} + Py_DECREF(__pyx_v_entry); + __pyx_v_entry = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":276 */ Py_INCREF(__pyx_v_entry); - /* "bzrlib/_chk_map_pyx.pyx":277 - * # SET_ITEM 'steals' a reference - * Py_INCREF(entry) - * StaticTuple_SET_ITEM(entry_bits, i, entry) # <<<<<<<<<<<<<< - * value = PyString_FromStringAndSize(value_start, next_line - value_start) - * # The next entry bit needs the 'tail' from the prefix, and first part - */ - StaticTuple_SET_ITEM(__pyx_v_entry_bits, __pyx_v_i, __pyx_v_entry); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":277 */ + StaticTuple_SET_ITEM(__pyx_v_entry_bits,__pyx_v_i,__pyx_v_entry); } - /* "bzrlib/_chk_map_pyx.pyx":278 - * Py_INCREF(entry) - * StaticTuple_SET_ITEM(entry_bits, i, entry) - * value = PyString_FromStringAndSize(value_start, next_line - value_start) # <<<<<<<<<<<<<< - * # The next entry bit needs the 'tail' from the prefix, and first part - * # of the line - */ - __pyx_t_2 = PyString_FromStringAndSize(__pyx_v_value_start, (__pyx_v_next_line - __pyx_v_value_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_value); - __pyx_v_value = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":281 - * # The next entry bit needs the 'tail' from the prefix, and first part - * # of the line - * entry_start = line_start # <<<<<<<<<<<<<< - * next_null = memchr(entry_start, c'\0', - * last_null - entry_start + 1) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":278 */ + __pyx_2 = PyString_FromStringAndSize(__pyx_v_value_start,(__pyx_v_next_line - __pyx_v_value_start)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} + Py_DECREF(__pyx_v_value); + __pyx_v_value = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":281 */ __pyx_v_entry_start = __pyx_v_line_start; - /* "bzrlib/_chk_map_pyx.pyx":283 - * entry_start = line_start - * next_null = memchr(entry_start, c'\0', - * last_null - entry_start + 1) # <<<<<<<<<<<<<< - * if next_null == NULL: - * raise ValueError('bad no null, bad') - */ - __pyx_v_next_null = ((char *)memchr(__pyx_v_entry_start, '\x00', ((__pyx_v_last_null - __pyx_v_entry_start) + 1))); - - /* "bzrlib/_chk_map_pyx.pyx":284 - * next_null = memchr(entry_start, c'\0', - * last_null - entry_start + 1) - * if next_null == NULL: # <<<<<<<<<<<<<< - * raise ValueError('bad no null, bad') - * entry = PyString_FromStringAndSize(NULL, - */ - __pyx_t_5 = (__pyx_v_next_null == NULL); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":285 - * last_null - entry_start + 1) - * if next_null == NULL: - * raise ValueError('bad no null, bad') # <<<<<<<<<<<<<< - * entry = PyString_FromStringAndSize(NULL, - * prefix_tail_len + next_null - line_start) - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L23; - } - __pyx_L23:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":282 */ + __pyx_v_next_null = ((char *)memchr(__pyx_v_entry_start,'\0',((__pyx_v_last_null - __pyx_v_entry_start) + 1))); - /* "bzrlib/_chk_map_pyx.pyx":287 - * raise ValueError('bad no null, bad') - * entry = PyString_FromStringAndSize(NULL, - * prefix_tail_len + next_null - line_start) # <<<<<<<<<<<<<< - * c_entry = PyString_AS_STRING(entry) - * if prefix_tail_len > 0: - */ - __pyx_t_2 = PyString_FromStringAndSize(NULL, ((__pyx_v_prefix_tail_len + __pyx_v_next_null) - __pyx_v_line_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_entry); - __pyx_v_entry = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":288 - * entry = PyString_FromStringAndSize(NULL, - * prefix_tail_len + next_null - line_start) - * c_entry = PyString_AS_STRING(entry) # <<<<<<<<<<<<<< - * if prefix_tail_len > 0: - * memcpy(c_entry, prefix_tail, prefix_tail_len) - */ - __pyx_v_c_entry = PyString_AS_STRING(__pyx_v_entry); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":284 */ + __pyx_1 = (__pyx_v_next_null == NULL); + if (__pyx_1) { + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} + Py_INCREF(__pyx_k25p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k25p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} + goto __pyx_L19; + } + __pyx_L19:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":286 */ + __pyx_2 = PyString_FromStringAndSize(NULL,((__pyx_v_prefix_tail_len + __pyx_v_next_null) - __pyx_v_line_start)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; goto __pyx_L1;} + Py_DECREF(__pyx_v_entry); + __pyx_v_entry = __pyx_2; + __pyx_2 = 0; - /* "bzrlib/_chk_map_pyx.pyx":289 - * prefix_tail_len + next_null - line_start) - * c_entry = PyString_AS_STRING(entry) - * if prefix_tail_len > 0: # <<<<<<<<<<<<<< - * memcpy(c_entry, prefix_tail, prefix_tail_len) - * if next_null - line_start > 0: - */ - __pyx_t_5 = (__pyx_v_prefix_tail_len > 0); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":290 - * c_entry = PyString_AS_STRING(entry) - * if prefix_tail_len > 0: - * memcpy(c_entry, prefix_tail, prefix_tail_len) # <<<<<<<<<<<<<< - * if next_null - line_start > 0: - * memcpy(c_entry + prefix_tail_len, line_start, next_null - line_start) - */ - memcpy(__pyx_v_c_entry, __pyx_v_prefix_tail, __pyx_v_prefix_tail_len); - goto __pyx_L24; - } - __pyx_L24:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":288 */ + __pyx_v_c_entry = PyString_AS_STRING(__pyx_v_entry); - /* "bzrlib/_chk_map_pyx.pyx":291 - * if prefix_tail_len > 0: - * memcpy(c_entry, prefix_tail, prefix_tail_len) - * if next_null - line_start > 0: # <<<<<<<<<<<<<< - * memcpy(c_entry + prefix_tail_len, line_start, next_null - line_start) - * Py_INCREF(entry) - */ - __pyx_t_5 = ((__pyx_v_next_null - __pyx_v_line_start) > 0); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":292 - * memcpy(c_entry, prefix_tail, prefix_tail_len) - * if next_null - line_start > 0: - * memcpy(c_entry + prefix_tail_len, line_start, next_null - line_start) # <<<<<<<<<<<<<< - * Py_INCREF(entry) - * i = num_prefix_bits - */ - memcpy((__pyx_v_c_entry + __pyx_v_prefix_tail_len), __pyx_v_line_start, (__pyx_v_next_null - __pyx_v_line_start)); - goto __pyx_L25; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":289 */ + __pyx_1 = (__pyx_v_prefix_tail_len > 0); + if (__pyx_1) { + memcpy(__pyx_v_c_entry,__pyx_v_prefix_tail,__pyx_v_prefix_tail_len); + goto __pyx_L20; + } + __pyx_L20:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":291 */ + __pyx_1 = ((__pyx_v_next_null - __pyx_v_line_start) > 0); + if (__pyx_1) { + memcpy((__pyx_v_c_entry + __pyx_v_prefix_tail_len),__pyx_v_line_start,(__pyx_v_next_null - __pyx_v_line_start)); + goto __pyx_L21; } - __pyx_L25:; + __pyx_L21:; - /* "bzrlib/_chk_map_pyx.pyx":293 - * if next_null - line_start > 0: - * memcpy(c_entry + prefix_tail_len, line_start, next_null - line_start) - * Py_INCREF(entry) # <<<<<<<<<<<<<< - * i = num_prefix_bits - * StaticTuple_SET_ITEM(entry_bits, i, entry) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":293 */ Py_INCREF(__pyx_v_entry); - /* "bzrlib/_chk_map_pyx.pyx":294 - * memcpy(c_entry + prefix_tail_len, line_start, next_null - line_start) - * Py_INCREF(entry) - * i = num_prefix_bits # <<<<<<<<<<<<<< - * StaticTuple_SET_ITEM(entry_bits, i, entry) - * while next_null != last_null: # We have remaining bits - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":294 */ __pyx_v_i = __pyx_v_num_prefix_bits; - /* "bzrlib/_chk_map_pyx.pyx":295 - * Py_INCREF(entry) - * i = num_prefix_bits - * StaticTuple_SET_ITEM(entry_bits, i, entry) # <<<<<<<<<<<<<< - * while next_null != last_null: # We have remaining bits - * i = i + 1 - */ - StaticTuple_SET_ITEM(__pyx_v_entry_bits, __pyx_v_i, __pyx_v_entry); - - /* "bzrlib/_chk_map_pyx.pyx":296 - * i = num_prefix_bits - * StaticTuple_SET_ITEM(entry_bits, i, entry) - * while next_null != last_null: # We have remaining bits # <<<<<<<<<<<<<< - * i = i + 1 - * if i > width: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":295 */ + StaticTuple_SET_ITEM(__pyx_v_entry_bits,__pyx_v_i,__pyx_v_entry); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":296 */ while (1) { - __pyx_t_5 = (__pyx_v_next_null != __pyx_v_last_null); - if (!__pyx_t_5) break; + __pyx_1 = (__pyx_v_next_null != __pyx_v_last_null); + if (!__pyx_1) break; - /* "bzrlib/_chk_map_pyx.pyx":297 - * StaticTuple_SET_ITEM(entry_bits, i, entry) - * while next_null != last_null: # We have remaining bits - * i = i + 1 # <<<<<<<<<<<<<< - * if i > width: - * raise ValueError("Too many bits for entry") - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":297 */ __pyx_v_i = (__pyx_v_i + 1); - /* "bzrlib/_chk_map_pyx.pyx":298 - * while next_null != last_null: # We have remaining bits - * i = i + 1 - * if i > width: # <<<<<<<<<<<<<< - * raise ValueError("Too many bits for entry") - * entry_start = next_null + 1 - */ - __pyx_t_5 = (__pyx_v_i > __pyx_v_width); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":299 - * i = i + 1 - * if i > width: - * raise ValueError("Too many bits for entry") # <<<<<<<<<<<<<< - * entry_start = next_null + 1 - * next_null = memchr(entry_start, c'\0', - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L28; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":298 */ + __pyx_1 = (__pyx_v_i > __pyx_v_width); + if (__pyx_1) { + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; goto __pyx_L1;} + Py_INCREF(__pyx_k26p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k26p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; goto __pyx_L1;} + goto __pyx_L24; } - __pyx_L28:; + __pyx_L24:; - /* "bzrlib/_chk_map_pyx.pyx":300 - * if i > width: - * raise ValueError("Too many bits for entry") - * entry_start = next_null + 1 # <<<<<<<<<<<<<< - * next_null = memchr(entry_start, c'\0', - * last_null - entry_start + 1) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":300 */ __pyx_v_entry_start = (__pyx_v_next_null + 1); - /* "bzrlib/_chk_map_pyx.pyx":302 - * entry_start = next_null + 1 - * next_null = memchr(entry_start, c'\0', - * last_null - entry_start + 1) # <<<<<<<<<<<<<< - * if next_null == NULL: - * raise ValueError('bad no null') - */ - __pyx_v_next_null = ((char *)memchr(__pyx_v_entry_start, '\x00', ((__pyx_v_last_null - __pyx_v_entry_start) + 1))); - - /* "bzrlib/_chk_map_pyx.pyx":303 - * next_null = memchr(entry_start, c'\0', - * last_null - entry_start + 1) - * if next_null == NULL: # <<<<<<<<<<<<<< - * raise ValueError('bad no null') - * entry = PyString_FromStringAndSize(entry_start, - */ - __pyx_t_5 = (__pyx_v_next_null == NULL); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":304 - * last_null - entry_start + 1) - * if next_null == NULL: - * raise ValueError('bad no null') # <<<<<<<<<<<<<< - * entry = PyString_FromStringAndSize(entry_start, - * next_null - entry_start) - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L29; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":301 */ + __pyx_v_next_null = ((char *)memchr(__pyx_v_entry_start,'\0',((__pyx_v_last_null - __pyx_v_entry_start) + 1))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":303 */ + __pyx_1 = (__pyx_v_next_null == NULL); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;} + Py_INCREF(__pyx_k27p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k27p); + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;} + goto __pyx_L25; } - __pyx_L29:; + __pyx_L25:; - /* "bzrlib/_chk_map_pyx.pyx":306 - * raise ValueError('bad no null') - * entry = PyString_FromStringAndSize(entry_start, - * next_null - entry_start) # <<<<<<<<<<<<<< - * Py_INCREF(entry) - * StaticTuple_SET_ITEM(entry_bits, i, entry) - */ - __pyx_t_2 = PyString_FromStringAndSize(__pyx_v_entry_start, (__pyx_v_next_null - __pyx_v_entry_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_entry); - __pyx_v_entry = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":307 - * entry = PyString_FromStringAndSize(entry_start, - * next_null - entry_start) - * Py_INCREF(entry) # <<<<<<<<<<<<<< - * StaticTuple_SET_ITEM(entry_bits, i, entry) - * if StaticTuple_GET_SIZE(entry_bits) != width: - */ - Py_INCREF(__pyx_v_entry); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":305 */ + __pyx_3 = PyString_FromStringAndSize(__pyx_v_entry_start,(__pyx_v_next_null - __pyx_v_entry_start)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; goto __pyx_L1;} + Py_DECREF(__pyx_v_entry); + __pyx_v_entry = __pyx_3; + __pyx_3 = 0; - /* "bzrlib/_chk_map_pyx.pyx":308 - * next_null - entry_start) - * Py_INCREF(entry) - * StaticTuple_SET_ITEM(entry_bits, i, entry) # <<<<<<<<<<<<<< - * if StaticTuple_GET_SIZE(entry_bits) != width: - * raise AssertionError( - */ - StaticTuple_SET_ITEM(__pyx_v_entry_bits, __pyx_v_i, __pyx_v_entry); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":307 */ + Py_INCREF(__pyx_v_entry); - /* "bzrlib/_chk_map_pyx.pyx":309 - * Py_INCREF(entry) - * StaticTuple_SET_ITEM(entry_bits, i, entry) - * if StaticTuple_GET_SIZE(entry_bits) != width: # <<<<<<<<<<<<<< - * raise AssertionError( - * 'Incorrect number of elements (%d vs %d)' - */ - __pyx_t_5 = (StaticTuple_GET_SIZE(__pyx_v_entry_bits) != __pyx_v_width); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":312 - * raise AssertionError( - * 'Incorrect number of elements (%d vs %d)' - * % (len(entry_bits)+1, width + 1)) # <<<<<<<<<<<<<< - * entry_bits = StaticTuple_Intern(entry_bits) - * PyDict_SetItem(items, entry_bits, value) - */ - __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_entry_bits)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_7 + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong((__pyx_v_width + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L30; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":308 */ + StaticTuple_SET_ITEM(__pyx_v_entry_bits,__pyx_v_i,__pyx_v_entry); } - __pyx_L30:; - - /* "bzrlib/_chk_map_pyx.pyx":313 - * 'Incorrect number of elements (%d vs %d)' - * % (len(entry_bits)+1, width + 1)) - * entry_bits = StaticTuple_Intern(entry_bits) # <<<<<<<<<<<<<< - * PyDict_SetItem(items, entry_bits, value) - * if len(items) != length: - */ - __pyx_t_3 = ((PyObject *)StaticTuple_Intern(__pyx_v_entry_bits)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_v_entry_bits)); - __pyx_v_entry_bits = ((StaticTuple *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":314 - * % (len(entry_bits)+1, width + 1)) - * entry_bits = StaticTuple_Intern(entry_bits) - * PyDict_SetItem(items, entry_bits, value) # <<<<<<<<<<<<<< - * if len(items) != length: - * raise ValueError("item count (%d) mismatch for key %s," - */ - __pyx_t_6 = PyDict_SetItem(((PyObject *)__pyx_v_items), ((PyObject *)__pyx_v_entry_bits), __pyx_v_value); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - - /* "bzrlib/_chk_map_pyx.pyx":315 - * entry_bits = StaticTuple_Intern(entry_bits) - * PyDict_SetItem(items, entry_bits, value) - * if len(items) != length: # <<<<<<<<<<<<<< - * raise ValueError("item count (%d) mismatch for key %s," - * " bytes %r" % (length, entry_bits, bytes)) - */ - if (unlikely(__pyx_v_items == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_7 = PyDict_Size(((PyObject *)__pyx_v_items)); - __pyx_t_5 = (__pyx_t_7 != __pyx_v_length); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":317 - * if len(items) != length: - * raise ValueError("item count (%d) mismatch for key %s," - * " bytes %r" % (length, entry_bits, bytes)) # <<<<<<<<<<<<<< - * result._items = items - * result._len = length - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_INCREF(((PyObject *)__pyx_v_entry_bits)); - PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_entry_bits)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_entry_bits)); - __Pyx_INCREF(__pyx_v_bytes); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_bytes); - __Pyx_GIVEREF(__pyx_v_bytes); - __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_28), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L31; - } - __pyx_L31:; - /* "bzrlib/_chk_map_pyx.pyx":318 - * raise ValueError("item count (%d) mismatch for key %s," - * " bytes %r" % (length, entry_bits, bytes)) - * result._items = items # <<<<<<<<<<<<<< - * result._len = length - * result._maximum_size = maximum_size - */ - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___items, ((PyObject *)__pyx_v_items)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_chk_map_pyx.pyx":319 - * " bytes %r" % (length, entry_bits, bytes)) - * result._items = items - * result._len = length # <<<<<<<<<<<<<< - * result._maximum_size = maximum_size - * result._key = key - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___len, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":320 - * result._items = items - * result._len = length - * result._maximum_size = maximum_size # <<<<<<<<<<<<<< - * result._key = key - * result._key_width = width - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_maximum_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___maximum_size, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":321 - * result._len = length - * result._maximum_size = maximum_size - * result._key = key # <<<<<<<<<<<<<< - * result._key_width = width - * result._raw_size = items_length + length * prefix_length - */ - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___key, __pyx_v_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_chk_map_pyx.pyx":322 - * result._maximum_size = maximum_size - * result._key = key - * result._key_width = width # <<<<<<<<<<<<<< - * result._raw_size = items_length + length * prefix_length - * if length == 0: - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___key_width, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":323 - * result._key = key - * result._key_width = width - * result._raw_size = items_length + length * prefix_length # <<<<<<<<<<<<<< - * if length == 0: - * result._search_prefix = None - */ - __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_items_length + (__pyx_v_length * __pyx_v_prefix_length))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___raw_size, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":324 - * result._key_width = width - * result._raw_size = items_length + length * prefix_length - * if length == 0: # <<<<<<<<<<<<<< - * result._search_prefix = None - * result._common_serialised_prefix = None - */ - __pyx_t_5 = (__pyx_v_length == 0); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":325 - * result._raw_size = items_length + length * prefix_length - * if length == 0: - * result._search_prefix = None # <<<<<<<<<<<<<< - * result._common_serialised_prefix = None - * else: - */ - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___search_prefix, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_chk_map_pyx.pyx":326 - * if length == 0: - * result._search_prefix = None - * result._common_serialised_prefix = None # <<<<<<<<<<<<<< - * else: - * result._search_prefix = _unknown - */ - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s_29, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L32; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":309 */ + __pyx_1 = (StaticTuple_GET_SIZE(__pyx_v_entry_bits) != __pyx_v_width); + if (__pyx_1) { + __pyx_5 = PyObject_Length(((PyObject *)__pyx_v_entry_bits)); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;} + __pyx_2 = PyInt_FromSsize_t((__pyx_5 + 1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong((__pyx_v_width + 1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); + __pyx_2 = 0; + __pyx_4 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k28p, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); + __pyx_2 = 0; + __pyx_3 = PyObject_CallObject(PyExc_AssertionError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; goto __pyx_L1;} + goto __pyx_L26; + } + __pyx_L26:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":313 */ + __pyx_2 = ((PyObject *)StaticTuple_Intern(__pyx_v_entry_bits)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_entry_bits)); + __pyx_v_entry_bits = ((StaticTuple *)__pyx_2); + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":314 */ + __pyx_1 = PyDict_SetItem(__pyx_v_items,((PyObject *)__pyx_v_entry_bits),__pyx_v_value); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; goto __pyx_L1;} + } + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":315 */ + __pyx_5 = PyObject_Length(__pyx_v_items); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;} + __pyx_1 = (__pyx_5 != __pyx_v_length); + if (__pyx_1) { + __pyx_4 = PyInt_FromLong(__pyx_v_length); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;} + __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); + Py_INCREF(((PyObject *)__pyx_v_entry_bits)); + PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_entry_bits)); + Py_INCREF(__pyx_v_bytes); + PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_bytes); + __pyx_4 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k29p, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); + __pyx_2 = 0; + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} + goto __pyx_L27; + } + __pyx_L27:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":318 */ + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__items, __pyx_v_items) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":319 */ + __pyx_2 = PyInt_FromLong(__pyx_v_length); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__len, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":320 */ + __pyx_4 = PyInt_FromLong(__pyx_v_maximum_size); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__maximum_size, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":321 */ + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__key, __pyx_v_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":322 */ + __pyx_3 = PyInt_FromLong(__pyx_v_width); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__key_width, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":323 */ + __pyx_2 = PyInt_FromSsize_t((__pyx_v_items_length + (__pyx_v_length * __pyx_v_prefix_length))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__raw_size, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":324 */ + __pyx_1 = (__pyx_v_length == 0); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":325 */ + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__search_prefix, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":326 */ + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__common_serialised_prefix, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;} + goto __pyx_L28; } /*else*/ { - /* "bzrlib/_chk_map_pyx.pyx":328 - * result._common_serialised_prefix = None - * else: - * result._search_prefix = _unknown # <<<<<<<<<<<<<< - * result._common_serialised_prefix = PyString_FromStringAndSize(prefix, - * prefix_length) - */ - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___search_prefix, __pyx_v_6bzrlib_12_chk_map_pyx__unknown) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_chk_map_pyx.pyx":330 - * result._search_prefix = _unknown - * result._common_serialised_prefix = PyString_FromStringAndSize(prefix, - * prefix_length) # <<<<<<<<<<<<<< - * if c_bytes_len != result._current_size(): - * raise AssertionError('_current_size computed incorrectly %d != %d', - */ - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_prefix, __pyx_v_prefix_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - - /* "bzrlib/_chk_map_pyx.pyx":329 - * else: - * result._search_prefix = _unknown - * result._common_serialised_prefix = PyString_FromStringAndSize(prefix, # <<<<<<<<<<<<<< - * prefix_length) - * if c_bytes_len != result._current_size(): - */ - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s_29, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_L32:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":328 */ + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__search_prefix, __pyx_v_6bzrlib_12_chk_map_pyx__unknown) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; goto __pyx_L1;} - /* "bzrlib/_chk_map_pyx.pyx":331 - * result._common_serialised_prefix = PyString_FromStringAndSize(prefix, - * prefix_length) - * if c_bytes_len != result._current_size(): # <<<<<<<<<<<<<< - * raise AssertionError('_current_size computed incorrectly %d != %d', - * c_bytes_len, result._current_size()) - */ - __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_c_bytes_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_GetAttr(__pyx_v_result, __pyx_n_s___current_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":333 - * if c_bytes_len != result._current_size(): - * raise AssertionError('_current_size computed incorrectly %d != %d', - * c_bytes_len, result._current_size()) # <<<<<<<<<<<<<< - * return result - * - */ - __pyx_t_8 = PyInt_FromSsize_t(__pyx_v_c_bytes_len); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyObject_GetAttr(__pyx_v_result, __pyx_n_s___current_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_30)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_30)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_30)); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_8 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L33; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":329 */ + __pyx_4 = PyString_FromStringAndSize(__pyx_v_prefix,__pyx_v_prefix_length); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__common_serialised_prefix, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + __pyx_L28:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":331 */ + __pyx_3 = PyInt_FromSsize_t(__pyx_v_c_bytes_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_result, __pyx_n__current_size); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (PyObject_Cmp(__pyx_3, __pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;} + __pyx_1 = __pyx_1 != 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + if (__pyx_1) { + __pyx_2 = PyInt_FromSsize_t(__pyx_v_c_bytes_len); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_result, __pyx_n__current_size); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;} + Py_INCREF(__pyx_k39p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k39p); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); + PyTuple_SET_ITEM(__pyx_3, 2, __pyx_4); + __pyx_2 = 0; + __pyx_4 = 0; + __pyx_2 = PyObject_CallObject(PyExc_AssertionError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; goto __pyx_L1;} + goto __pyx_L29; } - __pyx_L33:; + __pyx_L29:; - /* "bzrlib/_chk_map_pyx.pyx":334 - * raise AssertionError('_current_size computed incorrectly %d != %d', - * c_bytes_len, result._current_size()) - * return result # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_result); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":334 */ + Py_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_8); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._chk_map_pyx._deserialise_leaf_node"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_entry_bits); - __Pyx_DECREF(__pyx_v_result); - __Pyx_DECREF(__pyx_v_prefix_bits); - __Pyx_DECREF(__pyx_v_items); - __Pyx_DECREF(__pyx_v_entry); - __Pyx_DECREF(__pyx_v_value); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_entry_bits); + Py_DECREF(__pyx_v_result); + Py_DECREF(__pyx_v_prefix_bits); + Py_DECREF(__pyx_v_items); + Py_DECREF(__pyx_v_entry); + Py_DECREF(__pyx_v_value); + Py_DECREF(__pyx_v_bytes); + Py_DECREF(__pyx_v_key); + Py_DECREF(__pyx_v_search_key_func); return __pyx_r; } -/* "bzrlib/_chk_map_pyx.pyx":337 - * - * - * def _deserialise_internal_node(bytes, key, search_key_func=None): # <<<<<<<<<<<<<< - * cdef char *c_bytes, *cur, *next, *end - * cdef char *next_line - */ - -static PyObject *__pyx_pf_6bzrlib_12_chk_map_pyx_3_deserialise_internal_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static PyMethodDef __pyx_mdef_6bzrlib_12_chk_map_pyx_3_deserialise_internal_node = {__Pyx_NAMESTR("_deserialise_internal_node"), (PyCFunction)__pyx_pf_6bzrlib_12_chk_map_pyx_3_deserialise_internal_node, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pf_6bzrlib_12_chk_map_pyx_3_deserialise_internal_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__deserialise_internal_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__deserialise_internal_node(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_bytes = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_search_key_func = 0; @@ -2945,741 +1303,339 @@ PyObject *__pyx_v_items; PyObject *__pyx_v_item_prefix; PyObject *__pyx_v_flat_key; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - Py_ssize_t __pyx_t_7; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__bytes,&__pyx_n_s__key,&__pyx_n_s__search_key_func,0}; - __Pyx_RefNannySetupContext("_deserialise_internal_node"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[3] = {0,0,0}; - values[2] = ((PyObject *)Py_None); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__bytes); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("_deserialise_internal_node", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - case 2: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__search_key_func); - if (value) { values[2] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_deserialise_internal_node") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_bytes = values[0]; - __pyx_v_key = values[1]; - __pyx_v_search_key_func = values[2]; - } else { - __pyx_v_search_key_func = ((PyObject *)Py_None); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 3: - __pyx_v_search_key_func = PyTuple_GET_ITEM(__pyx_args, 2); - case 2: - __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 1); - __pyx_v_bytes = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_deserialise_internal_node", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._chk_map_pyx._deserialise_internal_node"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_result = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_items = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_item_prefix = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_flat_key = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_chk_map_pyx.pyx":344 - * cdef char *prefix, *line_prefix, *next_null, *c_item_prefix - * - * if _InternalNode is None: # <<<<<<<<<<<<<< - * _import_globals() - * result = _InternalNode(search_key_func=search_key_func) - */ - __pyx_t_1 = (__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode == Py_None); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":345 - * - * if _InternalNode is None: - * _import_globals() # <<<<<<<<<<<<<< - * result = _InternalNode(search_key_func=search_key_func) - * - */ - __pyx_t_2 = __pyx_f_6bzrlib_12_chk_map_pyx__import_globals(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L6; - } - __pyx_L6:; - - /* "bzrlib/_chk_map_pyx.pyx":346 - * if _InternalNode is None: - * _import_globals() - * result = _InternalNode(search_key_func=search_key_func) # <<<<<<<<<<<<<< - * - * if not StaticTuple_CheckExact(key): - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__search_key_func), __pyx_v_search_key_func) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyEval_CallObjectWithKeywords(__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":348 - * result = _InternalNode(search_key_func=search_key_func) - * - * if not StaticTuple_CheckExact(key): # <<<<<<<<<<<<<< - * raise TypeError('key %r is not a StaticTuple' % (key,)) - * if not PyString_CheckExact(bytes): - */ - __pyx_t_1 = (!StaticTuple_CheckExact(__pyx_v_key)); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":349 - * - * if not StaticTuple_CheckExact(key): - * raise TypeError('key %r is not a StaticTuple' % (key,)) # <<<<<<<<<<<<<< - * if not PyString_CheckExact(bytes): - * raise TypeError('bytes must be a plain string not %s' % (type(bytes),)) - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_31), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_ssize_t __pyx_5; + static char *__pyx_argnames[] = {"bytes","key","search_key_func",0}; + __pyx_v_search_key_func = __pyx_d2; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_bytes, &__pyx_v_key, &__pyx_v_search_key_func)) return 0; + Py_INCREF(__pyx_v_bytes); + Py_INCREF(__pyx_v_key); + Py_INCREF(__pyx_v_search_key_func); + __pyx_v_result = Py_None; Py_INCREF(Py_None); + __pyx_v_items = Py_None; Py_INCREF(Py_None); + __pyx_v_item_prefix = Py_None; Py_INCREF(Py_None); + __pyx_v_flat_key = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":344 */ + __pyx_1 = __pyx_v_6bzrlib_12_chk_map_pyx__InternalNode == Py_None; + if (__pyx_1) { + __pyx_2 = __pyx_f_6bzrlib_12_chk_map_pyx__import_globals(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":346 */ + __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;} + __pyx_3 = PyDict_New(); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_3, __pyx_n_search_key_func, __pyx_v_search_key_func) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;} + __pyx_4 = PyEval_CallObjectWithKeywords(__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode, __pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_v_result); + __pyx_v_result = __pyx_4; + __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":348 */ + __pyx_1 = (!StaticTuple_CheckExact(__pyx_v_key)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;} + Py_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key); + __pyx_3 = PyNumber_Remainder(__pyx_k40p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_2 = PyObject_CallObject(PyExc_TypeError, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;} + goto __pyx_L3; } - __pyx_L7:; + __pyx_L3:; - /* "bzrlib/_chk_map_pyx.pyx":350 - * if not StaticTuple_CheckExact(key): - * raise TypeError('key %r is not a StaticTuple' % (key,)) - * if not PyString_CheckExact(bytes): # <<<<<<<<<<<<<< - * raise TypeError('bytes must be a plain string not %s' % (type(bytes),)) - * - */ - __pyx_t_1 = (!PyString_CheckExact(__pyx_v_bytes)); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":351 - * raise TypeError('key %r is not a StaticTuple' % (key,)) - * if not PyString_CheckExact(bytes): - * raise TypeError('bytes must be a plain string not %s' % (type(bytes),)) # <<<<<<<<<<<<<< - * - * c_bytes = PyString_AS_STRING(bytes) - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_bytes))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(__pyx_v_bytes))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_bytes))); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":350 */ + __pyx_1 = (!PyString_CheckExact(__pyx_v_bytes)); + if (__pyx_1) { + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} + Py_INCREF(__pyx_v_bytes); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_bytes); + __pyx_4 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_3 = PyNumber_Remainder(__pyx_k11p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_2 = PyObject_CallObject(PyExc_TypeError, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L8:; + __pyx_L4:; - /* "bzrlib/_chk_map_pyx.pyx":353 - * raise TypeError('bytes must be a plain string not %s' % (type(bytes),)) - * - * c_bytes = PyString_AS_STRING(bytes) # <<<<<<<<<<<<<< - * c_bytes_len = PyString_GET_SIZE(bytes) - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":353 */ __pyx_v_c_bytes = PyString_AS_STRING(__pyx_v_bytes); - /* "bzrlib/_chk_map_pyx.pyx":354 - * - * c_bytes = PyString_AS_STRING(bytes) - * c_bytes_len = PyString_GET_SIZE(bytes) # <<<<<<<<<<<<<< - * - * if c_bytes_len < 9 or memcmp(c_bytes, "chknode:\n", 9) != 0: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":354 */ __pyx_v_c_bytes_len = PyString_GET_SIZE(__pyx_v_bytes); - /* "bzrlib/_chk_map_pyx.pyx":356 - * c_bytes_len = PyString_GET_SIZE(bytes) - * - * if c_bytes_len < 9 or memcmp(c_bytes, "chknode:\n", 9) != 0: # <<<<<<<<<<<<<< - * raise ValueError("not a serialised internal node: %r" % bytes) - * if c_bytes[c_bytes_len - 1] != c'\n': - */ - __pyx_t_1 = (__pyx_v_c_bytes_len < 9); - if (!__pyx_t_1) { - __pyx_t_4 = (memcmp(__pyx_v_c_bytes, __pyx_k_32, 9) != 0); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_1; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":356 */ + __pyx_1 = (__pyx_v_c_bytes_len < 9); + if (!__pyx_1) { + __pyx_1 = (memcmp(__pyx_v_c_bytes,__pyx_k41,9) != 0); + } + if (__pyx_1) { + __pyx_3 = PyNumber_Remainder(__pyx_k42p, __pyx_v_bytes); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; goto __pyx_L1;} + goto __pyx_L5; } - if (__pyx_t_5) { + __pyx_L5:; - /* "bzrlib/_chk_map_pyx.pyx":357 - * - * if c_bytes_len < 9 or memcmp(c_bytes, "chknode:\n", 9) != 0: - * raise ValueError("not a serialised internal node: %r" % bytes) # <<<<<<<<<<<<<< - * if c_bytes[c_bytes_len - 1] != c'\n': - * raise ValueError("bytes does not end in a newline") - */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_33), __pyx_v_bytes); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":358 */ + __pyx_1 = ((__pyx_v_c_bytes[(__pyx_v_c_bytes_len - 1)]) != '\n'); + if (__pyx_1) { + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} + Py_INCREF(__pyx_k14p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k14p); + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; goto __pyx_L1;} + goto __pyx_L6; } - __pyx_L9:; + __pyx_L6:; - /* "bzrlib/_chk_map_pyx.pyx":358 - * if c_bytes_len < 9 or memcmp(c_bytes, "chknode:\n", 9) != 0: - * raise ValueError("not a serialised internal node: %r" % bytes) - * if c_bytes[c_bytes_len - 1] != c'\n': # <<<<<<<<<<<<<< - * raise ValueError("bytes does not end in a newline") - * - */ - __pyx_t_5 = ((__pyx_v_c_bytes[(__pyx_v_c_bytes_len - 1)]) != '\n'); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":359 - * raise ValueError("not a serialised internal node: %r" % bytes) - * if c_bytes[c_bytes_len - 1] != c'\n': - * raise ValueError("bytes does not end in a newline") # <<<<<<<<<<<<<< - * - * items = {} - */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_34), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; - } - __pyx_L10:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":361 */ + __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;} + Py_DECREF(__pyx_v_items); + __pyx_v_items = __pyx_2; + __pyx_2 = 0; - /* "bzrlib/_chk_map_pyx.pyx":361 - * raise ValueError("bytes does not end in a newline") - * - * items = {} # <<<<<<<<<<<<<< - * cur = c_bytes + 9 - * end = c_bytes + c_bytes_len - */ - __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_v_items)); - __pyx_v_items = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":362 - * - * items = {} - * cur = c_bytes + 9 # <<<<<<<<<<<<<< - * end = c_bytes + c_bytes_len - * maximum_size = _get_int_from_line(&cur, end, "maximum_size") - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":362 */ __pyx_v_cur = (__pyx_v_c_bytes + 9); - /* "bzrlib/_chk_map_pyx.pyx":363 - * items = {} - * cur = c_bytes + 9 - * end = c_bytes + c_bytes_len # <<<<<<<<<<<<<< - * maximum_size = _get_int_from_line(&cur, end, "maximum_size") - * width = _get_int_from_line(&cur, end, "width") - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":363 */ __pyx_v_end = (__pyx_v_c_bytes + __pyx_v_c_bytes_len); - /* "bzrlib/_chk_map_pyx.pyx":364 - * cur = c_bytes + 9 - * end = c_bytes + c_bytes_len - * maximum_size = _get_int_from_line(&cur, end, "maximum_size") # <<<<<<<<<<<<<< - * width = _get_int_from_line(&cur, end, "width") - * length = _get_int_from_line(&cur, end, "length") - */ - __pyx_t_6 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur), __pyx_v_end, __pyx_k__maximum_size); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_maximum_size = __pyx_t_6; - - /* "bzrlib/_chk_map_pyx.pyx":365 - * end = c_bytes + c_bytes_len - * maximum_size = _get_int_from_line(&cur, end, "maximum_size") - * width = _get_int_from_line(&cur, end, "width") # <<<<<<<<<<<<<< - * length = _get_int_from_line(&cur, end, "length") - * - */ - __pyx_t_6 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur), __pyx_v_end, __pyx_k__width); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_width = __pyx_t_6; - - /* "bzrlib/_chk_map_pyx.pyx":366 - * maximum_size = _get_int_from_line(&cur, end, "maximum_size") - * width = _get_int_from_line(&cur, end, "width") - * length = _get_int_from_line(&cur, end, "length") # <<<<<<<<<<<<<< - * - * next_line = memchr(cur, c'\n', end - cur) - */ - __pyx_t_6 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur), __pyx_v_end, __pyx_k__length); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_length = __pyx_t_6; - - /* "bzrlib/_chk_map_pyx.pyx":368 - * length = _get_int_from_line(&cur, end, "length") - * - * next_line = memchr(cur, c'\n', end - cur) # <<<<<<<<<<<<<< - * if next_line == NULL: - * raise ValueError('Missing the prefix line\n') - */ - __pyx_v_next_line = ((char *)memchr(__pyx_v_cur, '\n', (__pyx_v_end - __pyx_v_cur))); - - /* "bzrlib/_chk_map_pyx.pyx":369 - * - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: # <<<<<<<<<<<<<< - * raise ValueError('Missing the prefix line\n') - * prefix = cur - */ - __pyx_t_5 = (__pyx_v_next_line == NULL); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":370 - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - * raise ValueError('Missing the prefix line\n') # <<<<<<<<<<<<<< - * prefix = cur - * prefix_length = next_line - cur - */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L11; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":364 */ + __pyx_1 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur),__pyx_v_end,__pyx_k15); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} + __pyx_v_maximum_size = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":365 */ + __pyx_1 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur),__pyx_v_end,__pyx_k16); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;} + __pyx_v_width = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":366 */ + __pyx_1 = __pyx_f_6bzrlib_12_chk_map_pyx__get_int_from_line((&__pyx_v_cur),__pyx_v_end,__pyx_k17); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;} + __pyx_v_length = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":368 */ + __pyx_v_next_line = ((char *)memchr(__pyx_v_cur,'\n',(__pyx_v_end - __pyx_v_cur))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":369 */ + __pyx_1 = (__pyx_v_next_line == NULL); + if (__pyx_1) { + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; goto __pyx_L1;} + Py_INCREF(__pyx_k18p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k18p); + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; goto __pyx_L1;} + goto __pyx_L7; } - __pyx_L11:; + __pyx_L7:; - /* "bzrlib/_chk_map_pyx.pyx":371 - * if next_line == NULL: - * raise ValueError('Missing the prefix line\n') - * prefix = cur # <<<<<<<<<<<<<< - * prefix_length = next_line - cur - * cur = next_line + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":371 */ __pyx_v_prefix = __pyx_v_cur; - /* "bzrlib/_chk_map_pyx.pyx":372 - * raise ValueError('Missing the prefix line\n') - * prefix = cur - * prefix_length = next_line - cur # <<<<<<<<<<<<<< - * cur = next_line + 1 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":372 */ __pyx_v_prefix_length = (__pyx_v_next_line - __pyx_v_cur); - /* "bzrlib/_chk_map_pyx.pyx":373 - * prefix = cur - * prefix_length = next_line - cur - * cur = next_line + 1 # <<<<<<<<<<<<<< - * - * while cur < end: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":373 */ __pyx_v_cur = (__pyx_v_next_line + 1); - /* "bzrlib/_chk_map_pyx.pyx":375 - * cur = next_line + 1 - * - * while cur < end: # <<<<<<<<<<<<<< - * # Find the null separator - * next_line = memchr(cur, c'\n', end - cur) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":375 */ while (1) { - __pyx_t_5 = (__pyx_v_cur < __pyx_v_end); - if (!__pyx_t_5) break; + __pyx_1 = (__pyx_v_cur < __pyx_v_end); + if (!__pyx_1) break; - /* "bzrlib/_chk_map_pyx.pyx":377 - * while cur < end: - * # Find the null separator - * next_line = memchr(cur, c'\n', end - cur) # <<<<<<<<<<<<<< - * if next_line == NULL: - * raise ValueError('missing trailing newline') - */ - __pyx_v_next_line = ((char *)memchr(__pyx_v_cur, '\n', (__pyx_v_end - __pyx_v_cur))); - - /* "bzrlib/_chk_map_pyx.pyx":378 - * # Find the null separator - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: # <<<<<<<<<<<<<< - * raise ValueError('missing trailing newline') - * next_null = _my_memrchr(cur, c'\0', next_line - cur) - */ - __pyx_t_5 = (__pyx_v_next_line == NULL); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":379 - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - * raise ValueError('missing trailing newline') # <<<<<<<<<<<<<< - * next_null = _my_memrchr(cur, c'\0', next_line - cur) - * if next_null == NULL: - */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L14; - } - __pyx_L14:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":377 */ + __pyx_v_next_line = ((char *)memchr(__pyx_v_cur,'\n',(__pyx_v_end - __pyx_v_cur))); - /* "bzrlib/_chk_map_pyx.pyx":380 - * if next_line == NULL: - * raise ValueError('missing trailing newline') - * next_null = _my_memrchr(cur, c'\0', next_line - cur) # <<<<<<<<<<<<<< - * if next_null == NULL: - * raise ValueError('bad no null') - */ - __pyx_v_next_null = ((char *)__pyx_f_6bzrlib_12_chk_map_pyx__my_memrchr(__pyx_v_cur, '\x00', (__pyx_v_next_line - __pyx_v_cur))); - - /* "bzrlib/_chk_map_pyx.pyx":381 - * raise ValueError('missing trailing newline') - * next_null = _my_memrchr(cur, c'\0', next_line - cur) - * if next_null == NULL: # <<<<<<<<<<<<<< - * raise ValueError('bad no null') - * item_prefix = PyString_FromStringAndSize(NULL, - */ - __pyx_t_5 = (__pyx_v_next_null == NULL); - if (__pyx_t_5) { - - /* "bzrlib/_chk_map_pyx.pyx":382 - * next_null = _my_memrchr(cur, c'\0', next_line - cur) - * if next_null == NULL: - * raise ValueError('bad no null') # <<<<<<<<<<<<<< - * item_prefix = PyString_FromStringAndSize(NULL, - * prefix_length + next_null - cur) - */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L15; - } - __pyx_L15:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":378 */ + __pyx_1 = (__pyx_v_next_line == NULL); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;} + Py_INCREF(__pyx_k24p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k24p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;} + goto __pyx_L10; + } + __pyx_L10:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":380 */ + __pyx_v_next_null = ((char *)__pyx_f_6bzrlib_12_chk_map_pyx__my_memrchr(__pyx_v_cur,'\0',(__pyx_v_next_line - __pyx_v_cur))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":381 */ + __pyx_1 = (__pyx_v_next_null == NULL); + if (__pyx_1) { + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} + Py_INCREF(__pyx_k27p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k27p); + __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} + goto __pyx_L11; + } + __pyx_L11:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":383 */ + __pyx_3 = PyString_FromStringAndSize(NULL,((__pyx_v_prefix_length + __pyx_v_next_null) - __pyx_v_cur)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;} + Py_DECREF(__pyx_v_item_prefix); + __pyx_v_item_prefix = __pyx_3; + __pyx_3 = 0; - /* "bzrlib/_chk_map_pyx.pyx":384 - * raise ValueError('bad no null') - * item_prefix = PyString_FromStringAndSize(NULL, - * prefix_length + next_null - cur) # <<<<<<<<<<<<<< - * c_item_prefix = PyString_AS_STRING(item_prefix) - * if prefix_length: - */ - __pyx_t_3 = PyString_FromStringAndSize(NULL, ((__pyx_v_prefix_length + __pyx_v_next_null) - __pyx_v_cur)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_item_prefix); - __pyx_v_item_prefix = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":385 - * item_prefix = PyString_FromStringAndSize(NULL, - * prefix_length + next_null - cur) - * c_item_prefix = PyString_AS_STRING(item_prefix) # <<<<<<<<<<<<<< - * if prefix_length: - * memcpy(c_item_prefix, prefix, prefix_length) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":385 */ __pyx_v_c_item_prefix = PyString_AS_STRING(__pyx_v_item_prefix); - /* "bzrlib/_chk_map_pyx.pyx":386 - * prefix_length + next_null - cur) - * c_item_prefix = PyString_AS_STRING(item_prefix) - * if prefix_length: # <<<<<<<<<<<<<< - * memcpy(c_item_prefix, prefix, prefix_length) - * memcpy(c_item_prefix + prefix_length, cur, next_null - cur) - */ - if (__pyx_v_prefix_length) { - - /* "bzrlib/_chk_map_pyx.pyx":387 - * c_item_prefix = PyString_AS_STRING(item_prefix) - * if prefix_length: - * memcpy(c_item_prefix, prefix, prefix_length) # <<<<<<<<<<<<<< - * memcpy(c_item_prefix + prefix_length, cur, next_null - cur) - * flat_key = PyString_FromStringAndSize(next_null + 1, - */ - memcpy(__pyx_v_c_item_prefix, __pyx_v_prefix, __pyx_v_prefix_length); - goto __pyx_L16; - } - __pyx_L16:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":386 */ + __pyx_5 = __pyx_v_prefix_length; + if (__pyx_5) { + memcpy(__pyx_v_c_item_prefix,__pyx_v_prefix,__pyx_v_prefix_length); + goto __pyx_L12; + } + __pyx_L12:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":388 */ + memcpy((__pyx_v_c_item_prefix + __pyx_v_prefix_length),__pyx_v_cur,(__pyx_v_next_null - __pyx_v_cur)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":389 */ + __pyx_4 = PyString_FromStringAndSize((__pyx_v_next_null + 1),((__pyx_v_next_line - __pyx_v_next_null) - 1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; goto __pyx_L1;} + Py_DECREF(__pyx_v_flat_key); + __pyx_v_flat_key = __pyx_4; + __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":391 */ + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;} + Py_INCREF(__pyx_v_flat_key); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_flat_key); + __pyx_3 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_intern); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = PyObject_CallObject(__pyx_4, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_v_flat_key); + __pyx_v_flat_key = __pyx_2; + __pyx_2 = 0; - /* "bzrlib/_chk_map_pyx.pyx":388 - * if prefix_length: - * memcpy(c_item_prefix, prefix, prefix_length) - * memcpy(c_item_prefix + prefix_length, cur, next_null - cur) # <<<<<<<<<<<<<< - * flat_key = PyString_FromStringAndSize(next_null + 1, - * next_line - next_null - 1) - */ - memcpy((__pyx_v_c_item_prefix + __pyx_v_prefix_length), __pyx_v_cur, (__pyx_v_next_null - __pyx_v_cur)); - - /* "bzrlib/_chk_map_pyx.pyx":390 - * memcpy(c_item_prefix + prefix_length, cur, next_null - cur) - * flat_key = PyString_FromStringAndSize(next_null + 1, - * next_line - next_null - 1) # <<<<<<<<<<<<<< - * flat_key = StaticTuple(flat_key).intern() - * PyDict_SetItem(items, item_prefix, flat_key) - */ - __pyx_t_3 = PyString_FromStringAndSize((__pyx_v_next_null + 1), ((__pyx_v_next_line - __pyx_v_next_null) - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_flat_key); - __pyx_v_flat_key = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":391 - * flat_key = PyString_FromStringAndSize(next_null + 1, - * next_line - next_null - 1) - * flat_key = StaticTuple(flat_key).intern() # <<<<<<<<<<<<<< - * PyDict_SetItem(items, item_prefix, flat_key) - * cur = next_line + 1 - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_flat_key); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_flat_key); - __Pyx_GIVEREF(__pyx_v_flat_key); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__intern); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __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 = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_flat_key); - __pyx_v_flat_key = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":392 - * next_line - next_null - 1) - * flat_key = StaticTuple(flat_key).intern() - * PyDict_SetItem(items, item_prefix, flat_key) # <<<<<<<<<<<<<< - * cur = next_line + 1 - * assert len(items) > 0 - */ - __pyx_t_6 = PyDict_SetItem(((PyObject *)__pyx_v_items), __pyx_v_item_prefix, __pyx_v_flat_key); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_chk_map_pyx.pyx":393 - * flat_key = StaticTuple(flat_key).intern() - * PyDict_SetItem(items, item_prefix, flat_key) - * cur = next_line + 1 # <<<<<<<<<<<<<< - * assert len(items) > 0 - * result._items = items - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":392 */ + __pyx_1 = PyDict_SetItem(__pyx_v_items,__pyx_v_item_prefix,__pyx_v_flat_key); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":393 */ __pyx_v_cur = (__pyx_v_next_line + 1); } - /* "bzrlib/_chk_map_pyx.pyx":394 - * PyDict_SetItem(items, item_prefix, flat_key) - * cur = next_line + 1 - * assert len(items) > 0 # <<<<<<<<<<<<<< - * result._items = items - * result._len = length - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(__pyx_v_items == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_7 = PyDict_Size(((PyObject *)__pyx_v_items)); - if (unlikely(!(__pyx_t_7 > 0))) { + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":394 */ + #ifndef PYREX_WITHOUT_ASSERTIONS + __pyx_5 = PyObject_Length(__pyx_v_items); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;} + if (!(__pyx_5 > 0)) { PyErr_SetNone(PyExc_AssertionError); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;} } #endif - /* "bzrlib/_chk_map_pyx.pyx":395 - * cur = next_line + 1 - * assert len(items) > 0 - * result._items = items # <<<<<<<<<<<<<< - * result._len = length - * result._maximum_size = maximum_size - */ - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___items, ((PyObject *)__pyx_v_items)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_chk_map_pyx.pyx":396 - * assert len(items) > 0 - * result._items = items - * result._len = length # <<<<<<<<<<<<<< - * result._maximum_size = maximum_size - * result._key = key - */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___len, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":397 - * result._items = items - * result._len = length - * result._maximum_size = maximum_size # <<<<<<<<<<<<<< - * result._key = key - * result._key_width = width - */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_maximum_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___maximum_size, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":398 - * result._len = length - * result._maximum_size = maximum_size - * result._key = key # <<<<<<<<<<<<<< - * result._key_width = width - * # XXX: InternalNodes don't really care about their size, and this will - */ - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___key, __pyx_v_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_chk_map_pyx.pyx":399 - * result._maximum_size = maximum_size - * result._key = key - * result._key_width = width # <<<<<<<<<<<<<< - * # XXX: InternalNodes don't really care about their size, and this will - * # change if we add prefix compression - */ - __pyx_t_2 = PyInt_FromLong(__pyx_v_width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___key_width, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":402 - * # XXX: InternalNodes don't really care about their size, and this will - * # change if we add prefix compression - * result._raw_size = None # len(bytes) # <<<<<<<<<<<<<< - * result._node_width = len(item_prefix) - * result._search_prefix = PyString_FromStringAndSize(prefix, prefix_length) - */ - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___raw_size, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_chk_map_pyx.pyx":403 - * # change if we add prefix compression - * result._raw_size = None # len(bytes) - * result._node_width = len(item_prefix) # <<<<<<<<<<<<<< - * result._search_prefix = PyString_FromStringAndSize(prefix, prefix_length) - * return result - */ - __pyx_t_7 = PyObject_Length(__pyx_v_item_prefix); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___node_width, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":404 - * result._raw_size = None # len(bytes) - * result._node_width = len(item_prefix) - * result._search_prefix = PyString_FromStringAndSize(prefix, prefix_length) # <<<<<<<<<<<<<< - * return result - * - */ - __pyx_t_2 = PyString_FromStringAndSize(__pyx_v_prefix, __pyx_v_prefix_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_v_result, __pyx_n_s___search_prefix, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":405 - * result._node_width = len(item_prefix) - * result._search_prefix = PyString_FromStringAndSize(prefix, prefix_length) - * return result # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_result); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":395 */ + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__items, __pyx_v_items) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":396 */ + __pyx_3 = PyInt_FromLong(__pyx_v_length); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__len, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":397 */ + __pyx_4 = PyInt_FromLong(__pyx_v_maximum_size); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__maximum_size, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":398 */ + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__key, __pyx_v_key) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":399 */ + __pyx_2 = PyInt_FromLong(__pyx_v_width); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__key_width, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":402 */ + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__raw_size, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":403 */ + __pyx_5 = PyObject_Length(__pyx_v_item_prefix); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;} + __pyx_3 = PyInt_FromSsize_t(__pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__node_width, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":404 */ + __pyx_4 = PyString_FromStringAndSize(__pyx_v_prefix,__pyx_v_prefix_length); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_result, __pyx_n__search_prefix, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":405 */ + Py_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._chk_map_pyx._deserialise_internal_node"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_result); - __Pyx_DECREF(__pyx_v_items); - __Pyx_DECREF(__pyx_v_item_prefix); - __Pyx_DECREF(__pyx_v_flat_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_result); + Py_DECREF(__pyx_v_items); + Py_DECREF(__pyx_v_item_prefix); + Py_DECREF(__pyx_v_flat_key); + Py_DECREF(__pyx_v_bytes); + Py_DECREF(__pyx_v_key); + Py_DECREF(__pyx_v_search_key_func); return __pyx_r; } -/* "bzrlib/_chk_map_pyx.pyx":408 - * - * - * def _bytes_to_text_key(bytes): # <<<<<<<<<<<<<< - * """Take a CHKInventory value string and return a (file_id, rev_id) tuple""" - * cdef StaticTuple key - */ - -static PyObject *__pyx_pf_6bzrlib_12_chk_map_pyx_4_bytes_to_text_key(PyObject *__pyx_self, PyObject *__pyx_v_bytes); /*proto*/ -static char __pyx_doc_6bzrlib_12_chk_map_pyx_4_bytes_to_text_key[] = "Take a CHKInventory value string and return a (file_id, rev_id) tuple"; -static PyMethodDef __pyx_mdef_6bzrlib_12_chk_map_pyx_4_bytes_to_text_key = {__Pyx_NAMESTR("_bytes_to_text_key"), (PyCFunction)__pyx_pf_6bzrlib_12_chk_map_pyx_4_bytes_to_text_key, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_12_chk_map_pyx_4_bytes_to_text_key)}; -static PyObject *__pyx_pf_6bzrlib_12_chk_map_pyx_4_bytes_to_text_key(PyObject *__pyx_self, PyObject *__pyx_v_bytes) { +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__bytes_to_text_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_12_chk_map_pyx__bytes_to_text_key[] = "Take a CHKInventory value string and return a (file_id, rev_id) tuple"; +static PyObject *__pyx_f_6bzrlib_12_chk_map_pyx__bytes_to_text_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_bytes = 0; StaticTuple *__pyx_v_key; char *__pyx_v_byte_str; char *__pyx_v_cur_end; @@ -3689,1028 +1645,303 @@ Py_ssize_t __pyx_v_byte_size; PyObject *__pyx_v_file_id; PyObject *__pyx_v_revision; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("_bytes_to_text_key"); - __pyx_self = __pyx_self; - __pyx_v_key = ((StaticTuple *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_file_id = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_revision = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_chk_map_pyx.pyx":415 - * cdef Py_ssize_t byte_size, pos, file_id_len - * - * if not PyString_CheckExact(bytes): # <<<<<<<<<<<<<< - * raise TypeError('bytes must be a string, got %r' % (type(bytes),)) - * byte_str = PyString_AS_STRING(bytes) - */ - __pyx_t_1 = (!PyString_CheckExact(__pyx_v_bytes)); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":416 - * - * if not PyString_CheckExact(bytes): - * raise TypeError('bytes must be a string, got %r' % (type(bytes),)) # <<<<<<<<<<<<<< - * byte_str = PyString_AS_STRING(bytes) - * byte_size = PyString_GET_SIZE(bytes) - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_bytes))); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(__pyx_v_bytes))); - __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_bytes))); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_38), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + static char *__pyx_argnames[] = {"bytes",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_bytes)) return 0; + Py_INCREF(__pyx_v_bytes); + __pyx_v_key = ((StaticTuple *)Py_None); Py_INCREF(Py_None); + __pyx_v_file_id = Py_None; Py_INCREF(Py_None); + __pyx_v_revision = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":415 */ + __pyx_1 = (!PyString_CheckExact(__pyx_v_bytes)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;} + Py_INCREF(__pyx_v_bytes); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_bytes); + __pyx_3 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyNumber_Remainder(__pyx_k45p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_chk_map_pyx.pyx":417 - * if not PyString_CheckExact(bytes): - * raise TypeError('bytes must be a string, got %r' % (type(bytes),)) - * byte_str = PyString_AS_STRING(bytes) # <<<<<<<<<<<<<< - * byte_size = PyString_GET_SIZE(bytes) - * byte_end = byte_str + byte_size - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":417 */ __pyx_v_byte_str = PyString_AS_STRING(__pyx_v_bytes); - /* "bzrlib/_chk_map_pyx.pyx":418 - * raise TypeError('bytes must be a string, got %r' % (type(bytes),)) - * byte_str = PyString_AS_STRING(bytes) - * byte_size = PyString_GET_SIZE(bytes) # <<<<<<<<<<<<<< - * byte_end = byte_str + byte_size - * cur_end = memchr(byte_str, c':', byte_size) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":418 */ __pyx_v_byte_size = PyString_GET_SIZE(__pyx_v_bytes); - /* "bzrlib/_chk_map_pyx.pyx":419 - * byte_str = PyString_AS_STRING(bytes) - * byte_size = PyString_GET_SIZE(bytes) - * byte_end = byte_str + byte_size # <<<<<<<<<<<<<< - * cur_end = memchr(byte_str, c':', byte_size) - * if cur_end == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":419 */ __pyx_v_byte_end = (__pyx_v_byte_str + __pyx_v_byte_size); - /* "bzrlib/_chk_map_pyx.pyx":420 - * byte_size = PyString_GET_SIZE(bytes) - * byte_end = byte_str + byte_size - * cur_end = memchr(byte_str, c':', byte_size) # <<<<<<<<<<<<<< - * if cur_end == NULL: - * raise ValueError('No kind section found.') - */ - __pyx_v_cur_end = ((char *)memchr(__pyx_v_byte_str, ':', __pyx_v_byte_size)); - - /* "bzrlib/_chk_map_pyx.pyx":421 - * byte_end = byte_str + byte_size - * cur_end = memchr(byte_str, c':', byte_size) - * if cur_end == NULL: # <<<<<<<<<<<<<< - * raise ValueError('No kind section found.') - * if cur_end[1] != c' ': - */ - __pyx_t_1 = (__pyx_v_cur_end == NULL); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":422 - * cur_end = memchr(byte_str, c':', byte_size) - * if cur_end == NULL: - * raise ValueError('No kind section found.') # <<<<<<<<<<<<<< - * if cur_end[1] != c' ': - * raise ValueError( - */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":420 */ + __pyx_v_cur_end = ((char *)memchr(__pyx_v_byte_str,':',__pyx_v_byte_size)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":421 */ + __pyx_1 = (__pyx_v_cur_end == NULL); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;} + Py_INCREF(__pyx_k46p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k46p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;} + goto __pyx_L3; } - __pyx_L6:; + __pyx_L3:; - /* "bzrlib/_chk_map_pyx.pyx":423 - * if cur_end == NULL: - * raise ValueError('No kind section found.') - * if cur_end[1] != c' ': # <<<<<<<<<<<<<< - * raise ValueError( - * 'Kind section should end with ": ", got %r' % str(cur_end[:2],)) - */ - __pyx_t_1 = ((__pyx_v_cur_end[1]) != ' '); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":425 - * if cur_end[1] != c' ': - * raise ValueError( - * 'Kind section should end with ": ", got %r' % str(cur_end[:2],)) # <<<<<<<<<<<<<< - * file_id_str = cur_end + 2 - * # file_id is now the data up until the next newline - */ - __pyx_t_3 = PyBytes_FromStringAndSize(__pyx_v_cur_end + 0, 2 - 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_41), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":423 */ + __pyx_1 = ((__pyx_v_cur_end[1]) != ' '); + if (__pyx_1) { + __pyx_2 = PyString_FromString(__pyx_v_cur_end); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; goto __pyx_L1;} + __pyx_3 = PySequence_GetSlice(__pyx_2, 0, 2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(((PyObject *)(&PyString_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k47p, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L7:; + __pyx_L4:; - /* "bzrlib/_chk_map_pyx.pyx":426 - * raise ValueError( - * 'Kind section should end with ": ", got %r' % str(cur_end[:2],)) - * file_id_str = cur_end + 2 # <<<<<<<<<<<<<< - * # file_id is now the data up until the next newline - * cur_end = memchr(file_id_str, c'\n', byte_end - file_id_str) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":426 */ __pyx_v_file_id_str = (__pyx_v_cur_end + 2); - /* "bzrlib/_chk_map_pyx.pyx":428 - * file_id_str = cur_end + 2 - * # file_id is now the data up until the next newline - * cur_end = memchr(file_id_str, c'\n', byte_end - file_id_str) # <<<<<<<<<<<<<< - * if cur_end == NULL: - * raise ValueError('no newline after file-id') - */ - __pyx_v_cur_end = ((char *)memchr(__pyx_v_file_id_str, '\n', (__pyx_v_byte_end - __pyx_v_file_id_str))); - - /* "bzrlib/_chk_map_pyx.pyx":429 - * # file_id is now the data up until the next newline - * cur_end = memchr(file_id_str, c'\n', byte_end - file_id_str) - * if cur_end == NULL: # <<<<<<<<<<<<<< - * raise ValueError('no newline after file-id') - * file_id = safe_interned_string_from_size(file_id_str, - */ - __pyx_t_1 = (__pyx_v_cur_end == NULL); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":430 - * cur_end = memchr(file_id_str, c'\n', byte_end - file_id_str) - * if cur_end == NULL: - * raise ValueError('no newline after file-id') # <<<<<<<<<<<<<< - * file_id = safe_interned_string_from_size(file_id_str, - * cur_end - file_id_str) - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":428 */ + __pyx_v_cur_end = ((char *)memchr(__pyx_v_file_id_str,'\n',(__pyx_v_byte_end - __pyx_v_file_id_str))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":429 */ + __pyx_1 = (__pyx_v_cur_end == NULL); + if (__pyx_1) { + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;} + Py_INCREF(__pyx_k48p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k48p); + __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; goto __pyx_L1;} + goto __pyx_L5; } - __pyx_L8:; + __pyx_L5:; - /* "bzrlib/_chk_map_pyx.pyx":432 - * raise ValueError('no newline after file-id') - * file_id = safe_interned_string_from_size(file_id_str, - * cur_end - file_id_str) # <<<<<<<<<<<<<< - * # this is the end of the parent_str - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - */ - __pyx_t_2 = __pyx_f_6bzrlib_12_chk_map_pyx_safe_interned_string_from_size(__pyx_v_file_id_str, (__pyx_v_cur_end - __pyx_v_file_id_str)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_file_id); - __pyx_v_file_id = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":434 - * cur_end - file_id_str) - * # this is the end of the parent_str - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) # <<<<<<<<<<<<<< - * if cur_end == NULL: - * raise ValueError('no newline after parent_str') - */ - __pyx_v_cur_end = ((char *)memchr((__pyx_v_cur_end + 1), '\n', ((__pyx_v_byte_end - __pyx_v_cur_end) - 1))); - - /* "bzrlib/_chk_map_pyx.pyx":435 - * # this is the end of the parent_str - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - * if cur_end == NULL: # <<<<<<<<<<<<<< - * raise ValueError('no newline after parent_str') - * # end of the name str - */ - __pyx_t_1 = (__pyx_v_cur_end == NULL); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":436 - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - * if cur_end == NULL: - * raise ValueError('no newline after parent_str') # <<<<<<<<<<<<<< - * # end of the name str - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":431 */ + __pyx_3 = __pyx_f_6bzrlib_12_chk_map_pyx_safe_interned_string_from_size(__pyx_v_file_id_str,(__pyx_v_cur_end - __pyx_v_file_id_str)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;} + Py_DECREF(__pyx_v_file_id); + __pyx_v_file_id = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":434 */ + __pyx_v_cur_end = ((char *)memchr((__pyx_v_cur_end + 1),'\n',((__pyx_v_byte_end - __pyx_v_cur_end) - 1))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":435 */ + __pyx_1 = (__pyx_v_cur_end == NULL); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} + Py_INCREF(__pyx_k49p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k49p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; goto __pyx_L1;} + goto __pyx_L6; } - __pyx_L9:; + __pyx_L6:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":438 */ + __pyx_v_cur_end = ((char *)memchr((__pyx_v_cur_end + 1),'\n',((__pyx_v_byte_end - __pyx_v_cur_end) - 1))); - /* "bzrlib/_chk_map_pyx.pyx":438 - * raise ValueError('no newline after parent_str') - * # end of the name str - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) # <<<<<<<<<<<<<< - * if cur_end == NULL: - * raise ValueError('no newline after name str') - */ - __pyx_v_cur_end = ((char *)memchr((__pyx_v_cur_end + 1), '\n', ((__pyx_v_byte_end - __pyx_v_cur_end) - 1))); - - /* "bzrlib/_chk_map_pyx.pyx":439 - * # end of the name str - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - * if cur_end == NULL: # <<<<<<<<<<<<<< - * raise ValueError('no newline after name str') - * # the next section is the revision info - */ - __pyx_t_1 = (__pyx_v_cur_end == NULL); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":440 - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - * if cur_end == NULL: - * raise ValueError('no newline after name str') # <<<<<<<<<<<<<< - * # the next section is the revision info - * revision_str = cur_end + 1 - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":439 */ + __pyx_1 = (__pyx_v_cur_end == NULL); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;} + Py_INCREF(__pyx_k50p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k50p); + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;} + goto __pyx_L7; } - __pyx_L10:; + __pyx_L7:; - /* "bzrlib/_chk_map_pyx.pyx":442 - * raise ValueError('no newline after name str') - * # the next section is the revision info - * revision_str = cur_end + 1 # <<<<<<<<<<<<<< - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - * if cur_end == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":442 */ __pyx_v_revision_str = (__pyx_v_cur_end + 1); - /* "bzrlib/_chk_map_pyx.pyx":443 - * # the next section is the revision info - * revision_str = cur_end + 1 - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) # <<<<<<<<<<<<<< - * if cur_end == NULL: - * # This is probably a dir: entry, which has revision as the last item - */ - __pyx_v_cur_end = ((char *)memchr((__pyx_v_cur_end + 1), '\n', ((__pyx_v_byte_end - __pyx_v_cur_end) - 1))); - - /* "bzrlib/_chk_map_pyx.pyx":444 - * revision_str = cur_end + 1 - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - * if cur_end == NULL: # <<<<<<<<<<<<<< - * # This is probably a dir: entry, which has revision as the last item - * cur_end = byte_end - */ - __pyx_t_1 = (__pyx_v_cur_end == NULL); - if (__pyx_t_1) { - - /* "bzrlib/_chk_map_pyx.pyx":446 - * if cur_end == NULL: - * # This is probably a dir: entry, which has revision as the last item - * cur_end = byte_end # <<<<<<<<<<<<<< - * revision = safe_interned_string_from_size(revision_str, - * cur_end - revision_str) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":443 */ + __pyx_v_cur_end = ((char *)memchr((__pyx_v_cur_end + 1),'\n',((__pyx_v_byte_end - __pyx_v_cur_end) - 1))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":444 */ + __pyx_1 = (__pyx_v_cur_end == NULL); + if (__pyx_1) { __pyx_v_cur_end = __pyx_v_byte_end; - goto __pyx_L11; + goto __pyx_L8; } - __pyx_L11:; + __pyx_L8:; - /* "bzrlib/_chk_map_pyx.pyx":448 - * cur_end = byte_end - * revision = safe_interned_string_from_size(revision_str, - * cur_end - revision_str) # <<<<<<<<<<<<<< - * key = StaticTuple_New(2) - * Py_INCREF(file_id) - */ - __pyx_t_2 = __pyx_f_6bzrlib_12_chk_map_pyx_safe_interned_string_from_size(__pyx_v_revision_str, (__pyx_v_cur_end - __pyx_v_revision_str)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_revision); - __pyx_v_revision = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":449 - * revision = safe_interned_string_from_size(revision_str, - * cur_end - revision_str) - * key = StaticTuple_New(2) # <<<<<<<<<<<<<< - * Py_INCREF(file_id) - * StaticTuple_SET_ITEM(key, 0, file_id) - */ - __pyx_t_2 = ((PyObject *)StaticTuple_New(2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_key)); - __pyx_v_key = ((StaticTuple *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":450 - * cur_end - revision_str) - * key = StaticTuple_New(2) - * Py_INCREF(file_id) # <<<<<<<<<<<<<< - * StaticTuple_SET_ITEM(key, 0, file_id) - * Py_INCREF(revision) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":447 */ + __pyx_2 = __pyx_f_6bzrlib_12_chk_map_pyx_safe_interned_string_from_size(__pyx_v_revision_str,(__pyx_v_cur_end - __pyx_v_revision_str)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} + Py_DECREF(__pyx_v_revision); + __pyx_v_revision = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":449 */ + __pyx_3 = ((PyObject *)StaticTuple_New(2)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_key)); + __pyx_v_key = ((StaticTuple *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":450 */ Py_INCREF(__pyx_v_file_id); - /* "bzrlib/_chk_map_pyx.pyx":451 - * key = StaticTuple_New(2) - * Py_INCREF(file_id) - * StaticTuple_SET_ITEM(key, 0, file_id) # <<<<<<<<<<<<<< - * Py_INCREF(revision) - * StaticTuple_SET_ITEM(key, 1, revision) - */ - StaticTuple_SET_ITEM(__pyx_v_key, 0, __pyx_v_file_id); - - /* "bzrlib/_chk_map_pyx.pyx":452 - * Py_INCREF(file_id) - * StaticTuple_SET_ITEM(key, 0, file_id) - * Py_INCREF(revision) # <<<<<<<<<<<<<< - * StaticTuple_SET_ITEM(key, 1, revision) - * return StaticTuple_Intern(key) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":451 */ + StaticTuple_SET_ITEM(__pyx_v_key,0,__pyx_v_file_id); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":452 */ Py_INCREF(__pyx_v_revision); - /* "bzrlib/_chk_map_pyx.pyx":453 - * StaticTuple_SET_ITEM(key, 0, file_id) - * Py_INCREF(revision) - * StaticTuple_SET_ITEM(key, 1, revision) # <<<<<<<<<<<<<< - * return StaticTuple_Intern(key) - */ - StaticTuple_SET_ITEM(__pyx_v_key, 1, __pyx_v_revision); - - /* "bzrlib/_chk_map_pyx.pyx":454 - * Py_INCREF(revision) - * StaticTuple_SET_ITEM(key, 1, revision) - * return StaticTuple_Intern(key) # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((PyObject *)StaticTuple_Intern(__pyx_v_key)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":453 */ + StaticTuple_SET_ITEM(__pyx_v_key,1,__pyx_v_revision); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":454 */ + __pyx_2 = ((PyObject *)StaticTuple_Intern(__pyx_v_key)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._chk_map_pyx._bytes_to_text_key"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_key); - __Pyx_DECREF(__pyx_v_file_id); - __Pyx_DECREF(__pyx_v_revision); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_key); + Py_DECREF(__pyx_v_file_id); + Py_DECREF(__pyx_v_revision); + Py_DECREF(__pyx_v_bytes); return __pyx_r; } -static PyMethodDef __pyx_methods[] = { +static struct PyMethodDef __pyx_methods[] = { + {"_search_key_16", (PyCFunction)__pyx_f_6bzrlib_12_chk_map_pyx__search_key_16, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_chk_map_pyx__search_key_16}, + {"_search_key_255", (PyCFunction)__pyx_f_6bzrlib_12_chk_map_pyx__search_key_255, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_chk_map_pyx__search_key_255}, + {"_deserialise_leaf_node", (PyCFunction)__pyx_f_6bzrlib_12_chk_map_pyx__deserialise_leaf_node, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_chk_map_pyx__deserialise_leaf_node}, + {"_deserialise_internal_node", (PyCFunction)__pyx_f_6bzrlib_12_chk_map_pyx__deserialise_internal_node, METH_VARARGS|METH_KEYWORDS, 0}, + {"_bytes_to_text_key", (PyCFunction)__pyx_f_6bzrlib_12_chk_map_pyx__bytes_to_text_key, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_chk_map_pyx__bytes_to_text_key}, {0, 0, 0, 0} }; -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("_chk_map_pyx"), - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, - {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, - {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, - {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, - {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0}, - {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0}, - {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0}, - {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0}, - {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0}, - {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0}, - {&__pyx_n_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 1}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0}, - {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0}, - {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0}, - {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0}, - {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0}, - {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0}, - {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0}, - {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0}, - {&__pyx_n_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 1}, - {&__pyx_n_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 1}, - {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_n_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 1}, - {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, - {&__pyx_n_s__AssertionError, __pyx_k__AssertionError, sizeof(__pyx_k__AssertionError), 0, 0, 1, 1}, - {&__pyx_n_s__InternalNode, __pyx_k__InternalNode, sizeof(__pyx_k__InternalNode), 0, 0, 1, 1}, - {&__pyx_n_s__LeafNode, __pyx_k__LeafNode, sizeof(__pyx_k__LeafNode), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___bytes_to_text_key, __pyx_k___bytes_to_text_key, sizeof(__pyx_k___bytes_to_text_key), 0, 0, 1, 1}, - {&__pyx_n_s___current_size, __pyx_k___current_size, sizeof(__pyx_k___current_size), 0, 0, 1, 1}, - {&__pyx_n_s___items, __pyx_k___items, sizeof(__pyx_k___items), 0, 0, 1, 1}, - {&__pyx_n_s___key, __pyx_k___key, sizeof(__pyx_k___key), 0, 0, 1, 1}, - {&__pyx_n_s___key_width, __pyx_k___key_width, sizeof(__pyx_k___key_width), 0, 0, 1, 1}, - {&__pyx_n_s___len, __pyx_k___len, sizeof(__pyx_k___len), 0, 0, 1, 1}, - {&__pyx_n_s___maximum_size, __pyx_k___maximum_size, sizeof(__pyx_k___maximum_size), 0, 0, 1, 1}, - {&__pyx_n_s___node_width, __pyx_k___node_width, sizeof(__pyx_k___node_width), 0, 0, 1, 1}, - {&__pyx_n_s___raw_size, __pyx_k___raw_size, sizeof(__pyx_k___raw_size), 0, 0, 1, 1}, - {&__pyx_n_s___search_key_16, __pyx_k___search_key_16, sizeof(__pyx_k___search_key_16), 0, 0, 1, 1}, - {&__pyx_n_s___search_key_255, __pyx_k___search_key_255, sizeof(__pyx_k___search_key_255), 0, 0, 1, 1}, - {&__pyx_n_s___search_prefix, __pyx_k___search_prefix, sizeof(__pyx_k___search_prefix), 0, 0, 1, 1}, - {&__pyx_n_s___unknown, __pyx_k___unknown, sizeof(__pyx_k___unknown), 0, 0, 1, 1}, - {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, - {&__pyx_n_s__bytes, __pyx_k__bytes, sizeof(__pyx_k__bytes), 0, 0, 1, 1}, - {&__pyx_n_s__bzrlib, __pyx_k__bzrlib, sizeof(__pyx_k__bzrlib), 0, 0, 1, 1}, - {&__pyx_n_s__chk_map, __pyx_k__chk_map, sizeof(__pyx_k__chk_map), 0, 0, 1, 1}, - {&__pyx_n_s__crc32, __pyx_k__crc32, sizeof(__pyx_k__crc32), 0, 0, 1, 1}, - {&__pyx_n_s__intern, __pyx_k__intern, sizeof(__pyx_k__intern), 0, 0, 1, 1}, - {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1}, - {&__pyx_n_s__search_key_func, __pyx_k__search_key_func, sizeof(__pyx_k__search_key_func), 0, 0, 1, 1}, - {&__pyx_n_s__zlib, __pyx_k__zlib, sizeof(__pyx_k__zlib), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_AssertionError = __Pyx_GetName(__pyx_b, __pyx_n_s__AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); +static void __pyx_init_filenames(void); /*proto*/ - /* "bzrlib/_chk_map_pyx.pyx":219 - * raise ValueError("not a serialised leaf node: %r" % bytes) - * if c_bytes[c_bytes_len - 1] != c'\n': - * raise ValueError("bytes does not end in a newline") # <<<<<<<<<<<<<< - * - * end = c_bytes + c_bytes_len - */ - __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); - PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); - - /* "bzrlib/_chk_map_pyx.pyx":229 - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - * raise ValueError('Missing the prefix line\n') # <<<<<<<<<<<<<< - * prefix = cur - * prefix_length = next_line - cur - */ - __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); - PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - - /* "bzrlib/_chk_map_pyx.pyx":247 - * - * if num_prefix_bits >= width: - * raise ValueError('Prefix has too many nulls versus width') # <<<<<<<<<<<<<< - * - * items_length = end - cur - */ - __pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_13)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); - PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13)); - - /* "bzrlib/_chk_map_pyx.pyx":255 - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - * raise ValueError('null line\n') # <<<<<<<<<<<<<< - * last_null = _my_memrchr(cur, c'\0', next_line - cur) - * if last_null == NULL: - */ - __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_14)); - PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); - - /* "bzrlib/_chk_map_pyx.pyx":258 - * last_null = _my_memrchr(cur, c'\0', next_line - cur) - * if last_null == NULL: - * raise ValueError('fail to find the num value lines null') # <<<<<<<<<<<<<< - * next_null = last_null + 1 # move past NULL - * num_value_lines = _get_int_from_line(&next_null, next_line + 1, - */ - __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); - PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); - - /* "bzrlib/_chk_map_pyx.pyx":268 - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - * raise ValueError('missing trailing newline') # <<<<<<<<<<<<<< - * cur = next_line + 1 - * entry_bits = StaticTuple_New(width) - */ - __pyx_k_tuple_20 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_20)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); - PyTuple_SET_ITEM(__pyx_k_tuple_20, 0, ((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20)); - - /* "bzrlib/_chk_map_pyx.pyx":285 - * last_null - entry_start + 1) - * if next_null == NULL: - * raise ValueError('bad no null, bad') # <<<<<<<<<<<<<< - * entry = PyString_FromStringAndSize(NULL, - * prefix_tail_len + next_null - line_start) - */ - __pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_22)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_21)); - PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22)); - - /* "bzrlib/_chk_map_pyx.pyx":299 - * i = i + 1 - * if i > width: - * raise ValueError("Too many bits for entry") # <<<<<<<<<<<<<< - * entry_start = next_null + 1 - * next_null = memchr(entry_start, c'\0', - */ - __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_24)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_23)); - PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); - - /* "bzrlib/_chk_map_pyx.pyx":304 - * last_null - entry_start + 1) - * if next_null == NULL: - * raise ValueError('bad no null') # <<<<<<<<<<<<<< - * entry = PyString_FromStringAndSize(entry_start, - * next_null - entry_start) - */ - __pyx_k_tuple_26 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_26)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_25)); - PyTuple_SET_ITEM(__pyx_k_tuple_26, 0, ((PyObject *)__pyx_kp_s_25)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26)); - - /* "bzrlib/_chk_map_pyx.pyx":359 - * raise ValueError("not a serialised internal node: %r" % bytes) - * if c_bytes[c_bytes_len - 1] != c'\n': - * raise ValueError("bytes does not end in a newline") # <<<<<<<<<<<<<< - * - * items = {} - */ - __pyx_k_tuple_34 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_34)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); - PyTuple_SET_ITEM(__pyx_k_tuple_34, 0, ((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34)); - - /* "bzrlib/_chk_map_pyx.pyx":370 - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - * raise ValueError('Missing the prefix line\n') # <<<<<<<<<<<<<< - * prefix = cur - * prefix_length = next_line - cur - */ - __pyx_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_35)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); - PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35)); - - /* "bzrlib/_chk_map_pyx.pyx":379 - * next_line = memchr(cur, c'\n', end - cur) - * if next_line == NULL: - * raise ValueError('missing trailing newline') # <<<<<<<<<<<<<< - * next_null = _my_memrchr(cur, c'\0', next_line - cur) - * if next_null == NULL: - */ - __pyx_k_tuple_36 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_36)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); - PyTuple_SET_ITEM(__pyx_k_tuple_36, 0, ((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36)); - - /* "bzrlib/_chk_map_pyx.pyx":382 - * next_null = _my_memrchr(cur, c'\0', next_line - cur) - * if next_null == NULL: - * raise ValueError('bad no null') # <<<<<<<<<<<<<< - * item_prefix = PyString_FromStringAndSize(NULL, - * prefix_length + next_null - cur) - */ - __pyx_k_tuple_37 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_37)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_25)); - PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_kp_s_25)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37)); - - /* "bzrlib/_chk_map_pyx.pyx":422 - * cur_end = memchr(byte_str, c':', byte_size) - * if cur_end == NULL: - * raise ValueError('No kind section found.') # <<<<<<<<<<<<<< - * if cur_end[1] != c' ': - * raise ValueError( - */ - __pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_40)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_39)); - PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_s_39)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_39)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40)); - - /* "bzrlib/_chk_map_pyx.pyx":430 - * cur_end = memchr(file_id_str, c'\n', byte_end - file_id_str) - * if cur_end == NULL: - * raise ValueError('no newline after file-id') # <<<<<<<<<<<<<< - * file_id = safe_interned_string_from_size(file_id_str, - * cur_end - file_id_str) - */ - __pyx_k_tuple_43 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_43)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_42)); - PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, ((PyObject *)__pyx_kp_s_42)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43)); - - /* "bzrlib/_chk_map_pyx.pyx":436 - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - * if cur_end == NULL: - * raise ValueError('no newline after parent_str') # <<<<<<<<<<<<<< - * # end of the name str - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - */ - __pyx_k_tuple_45 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_45)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_44)); - PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, ((PyObject *)__pyx_kp_s_44)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_44)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45)); - - /* "bzrlib/_chk_map_pyx.pyx":440 - * cur_end = memchr(cur_end + 1, c'\n', byte_end - cur_end - 1) - * if cur_end == NULL: - * raise ValueError('no newline after name str') # <<<<<<<<<<<<<< - * # the next section is the revision info - * revision_str = cur_end + 1 - */ - __pyx_k_tuple_47 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_47)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_46)); - PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, ((PyObject *)__pyx_kp_s_46)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_46)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC init_chk_map_pyx(void); /*proto*/ -PyMODINIT_FUNC init_chk_map_pyx(void) -#else -PyMODINIT_FUNC PyInit__chk_map_pyx(void); /*proto*/ -PyMODINIT_FUNC PyInit__chk_map_pyx(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__chk_map_pyx(void)", __LINE__, __FILE__); - #endif - __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;} - __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;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_chk_map_pyx"), __pyx_methods, 0, 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_chk_map_pyx(void) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + int __pyx_3; + __pyx_init_filenames(); + __pyx_m = Py_InitModule4("_chk_map_pyx", __pyx_methods, 0, 0, PYTHON_API_VERSION); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}; Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_bzrlib___chk_map_pyx) { - 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;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ + __pyx_b = PyImport_AddModule("__builtin__"); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}; __pyx_v_6bzrlib_12_chk_map_pyx_crc32 = Py_None; Py_INCREF(Py_None); __pyx_v_6bzrlib_12_chk_map_pyx__LeafNode = Py_None; Py_INCREF(Py_None); __pyx_v_6bzrlib_12_chk_map_pyx__InternalNode = Py_None; Py_INCREF(Py_None); __pyx_v_6bzrlib_12_chk_map_pyx__unknown = Py_None; Py_INCREF(Py_None); - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple = __Pyx_ImportType("bzrlib._static_tuple_c", "StaticTuple", sizeof(StaticTuple), 0); if (unlikely(!__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "bzrlib/_chk_map_pyx.pyx":57 - * - * cdef object crc32 - * from zlib import crc32 # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__crc32)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__crc32)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__crc32)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__zlib), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__crc32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_chk_map_pyx_crc32); - __Pyx_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx_crc32); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6bzrlib_12_chk_map_pyx_crc32 = __pyx_t_1; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":61 - * - * # Set up the StaticTuple C_API functionality - * import_static_tuple_c() # <<<<<<<<<<<<<< - * - * cdef object _LeafNode - */ - __pyx_t_3 = import_static_tuple_c(); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_chk_map_pyx.pyx":64 - * - * cdef object _LeafNode - * _LeafNode = None # <<<<<<<<<<<<<< - * cdef object _InternalNode - * _InternalNode = None - */ - __Pyx_INCREF(Py_None); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode); - __Pyx_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode); - __Pyx_GIVEREF(Py_None); + __pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple = __Pyx_ImportType("bzrlib._static_tuple_c", "StaticTuple", sizeof(StaticTuple)); if (!__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":57 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + Py_INCREF(__pyx_n_crc32); + PyList_SET_ITEM(__pyx_1, 0, __pyx_n_crc32); + __pyx_2 = __Pyx_Import(__pyx_n_zlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_crc32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + Py_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx_crc32); + __pyx_v_6bzrlib_12_chk_map_pyx_crc32 = __pyx_1; + __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":61 */ + __pyx_3 = import_static_tuple_c(); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":64 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__LeafNode); __pyx_v_6bzrlib_12_chk_map_pyx__LeafNode = Py_None; - /* "bzrlib/_chk_map_pyx.pyx":66 - * _LeafNode = None - * cdef object _InternalNode - * _InternalNode = None # <<<<<<<<<<<<<< - * cdef object _unknown - * _unknown = None - */ - __Pyx_INCREF(Py_None); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode); - __Pyx_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode); - __Pyx_GIVEREF(Py_None); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":66 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__InternalNode); __pyx_v_6bzrlib_12_chk_map_pyx__InternalNode = Py_None; - /* "bzrlib/_chk_map_pyx.pyx":68 - * _InternalNode = None - * cdef object _unknown - * _unknown = None # <<<<<<<<<<<<<< - * - * # We shouldn't just copy this from _dirstate_helpers_pyx - */ - __Pyx_INCREF(Py_None); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_chk_map_pyx__unknown); - __Pyx_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__unknown); - __Pyx_GIVEREF(Py_None); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":68 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_6bzrlib_12_chk_map_pyx__unknown); __pyx_v_6bzrlib_12_chk_map_pyx__unknown = Py_None; - /* "bzrlib/_chk_map_pyx.pyx":100 - * - * - * def _search_key_16(key): # <<<<<<<<<<<<<< - * """See chk_map._search_key_16.""" - * cdef Py_ssize_t num_bits - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_12_chk_map_pyx__search_key_16, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___search_key_16, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":125 - * - * - * def _search_key_255(key): # <<<<<<<<<<<<<< - * """See chk_map._search_key_255.""" - * cdef Py_ssize_t num_bits - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_12_chk_map_pyx_1_search_key_255, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___search_key_255, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":188 - * - * - * def _deserialise_leaf_node(bytes, key, search_key_func=None): # <<<<<<<<<<<<<< - * """Deserialise bytes, with key key, into a LeafNode. - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_12_chk_map_pyx_2_deserialise_leaf_node, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_49, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":337 - * - * - * def _deserialise_internal_node(bytes, key, search_key_func=None): # <<<<<<<<<<<<<< - * cdef char *c_bytes, *cur, *next, *end - * cdef char *next_line - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_12_chk_map_pyx_3_deserialise_internal_node, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_50, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":408 - * - * - * def _bytes_to_text_key(bytes): # <<<<<<<<<<<<<< - * """Take a CHKInventory value string and return a (file_id, rev_id) tuple""" - * cdef StaticTuple key - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_12_chk_map_pyx_4_bytes_to_text_key, NULL, __pyx_n_s_48); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___bytes_to_text_key, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chk_map_pyx.pyx":1 - * # Copyright (C) 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<< - * # - * # This program is free software; you can redistribute it and/or modify - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - 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;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - __Pyx_AddTraceback("init bzrlib._chk_map_pyx"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init bzrlib._chk_map_pyx"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":188 */ + Py_INCREF(Py_None); + __pyx_d1 = Py_None; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":337 */ + Py_INCREF(Py_None); + __pyx_d2 = Py_None; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chk_map_pyx.pyx":408 */ return; - #else - return __pyx_m; - #endif + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("bzrlib._chk_map_pyx"); } -/* Runtime support code */ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} +static char *__pyx_filenames[] = { + "_chk_map_pyx.pyx", + "_static_tuple_c.pxd", +}; -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} +/* Runtime support code */ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } - -#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); @@ -4751,13 +1982,12 @@ Py_INCREF(type); } else { - type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else - type = (PyObject*) Py_TYPE(type); + type = (PyObject*) type->ob_type; Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, @@ -4766,8 +1996,7 @@ } #endif } - - __Pyx_ErrRestore(type, value, tb); + PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); @@ -4776,182 +2005,30 @@ return; } -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; -} -#endif - - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } +static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i) { + PyTypeObject *t = o->ob_type; + PyObject *r; + if (t->tp_as_sequence && t->tp_as_sequence->sq_item) + r = PySequence_GetItem(o, i); + else { + PyObject *j = PyInt_FromLong(i); + if (!j) + return 0; + r = PyObject_GetItem(o, j); + Py_DECREF(j); } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; + return r; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; + PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) + __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); + if (!__import__) goto bad; if (from_list) list = from_list; @@ -4967,467 +2044,55 @@ empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); + module = PyObject_CallFunction(__import__, "OOOO", + name, global_dict, empty_dict, list); bad: Py_XDECREF(empty_list); - Py_XDECREF(py_import); + Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + if (!*t->p) + return -1; + if (t->i) + PyString_InternInPlace(t->p); + ++t; } + return 0; } #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size, int strict) +static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, + long size) { PyObject *py_module = 0; PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - + py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; + result = PyObject_GetAttrString(py_module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, + PyErr_Format(PyExc_TypeError, "%s.%s is not a type object", module_name, class_name); goto bad; } - if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); - #else - PyErr_WarnEx(NULL, warning, 0); - #endif - } - else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s has the wrong size, try recompiling", + if (((PyTypeObject *)result)->tp_basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%s.%s does not appear to be the correct type object", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: - Py_XDECREF(py_module); Py_XDECREF(result); return 0; } @@ -5435,20 +2100,13 @@ #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { +static PyObject *__Pyx_ImportModule(char *name) { PyObject *py_name = 0; - PyObject *py_module = 0; - - #if PY_MAJOR_VERSION < 3 + py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif if (!py_name) goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; + return PyImport_Import(py_name); bad: Py_XDECREF(py_name); return 0; @@ -5459,58 +2117,44 @@ #include "frameobject.h" #include "traceback.h" -static void __Pyx_AddTraceback(const char *funcname) { +static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; + PyObject *empty_tuple = 0; + PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } + py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; + empty_tuple = PyTuple_New(0); + if (!empty_tuple) goto bad; + empty_string = PyString_FromString(""); + if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + empty_string, /*PyObject *code,*/ + empty_tuple, /*PyObject *consts,*/ + empty_tuple, /*PyObject *names,*/ + empty_tuple, /*PyObject *varnames,*/ + empty_tuple, /*PyObject *freevars,*/ + empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ + empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ + PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ @@ -5521,128 +2165,8 @@ bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); + Py_XDECREF(empty_tuple); + Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} - -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff -Nru bzr-2.5.0/bzrlib/chk_serializer.py bzr-2.6.0~beta1/bzrlib/chk_serializer.py --- bzr-2.5.0/bzrlib/chk_serializer.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/chk_serializer.py 2012-03-15 10:00:24.000000000 +0000 @@ -147,7 +147,7 @@ format_num = '9' revision_format_num = None support_altered_by_hack = False - supported_kinds = set(['file', 'directory', 'symlink']) + supported_kinds = set(['file', 'directory', 'symlink', 'tree-reference']) def __init__(self, node_size, search_key_name): self.maximum_size = node_size diff -Nru bzr-2.5.0/bzrlib/_chunks_to_lines_pyx.c bzr-2.6.0~beta1/bzrlib/_chunks_to_lines_pyx.c --- bzr-2.5.0/bzrlib/_chunks_to_lines_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_chunks_to_lines_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,434 +1,77 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:25 2012 */ +/* Generated by Pyrex 0.9.8.5 on Fri Oct 8 14:00:56 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif - -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif - -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif - +#include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include -#define __PYX_HAVE_API__bzrlib___chunks_to_lines_pyx #include "python-compat.h" #include "stdlib.h" #include "string.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif +typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ -/* inline attribute */ -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -/* unused attribute */ -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - -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*/ - - -/* Type Conversion Predeclarations */ - -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - static PyObject *__pyx_m; static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "_chunks_to_lines_pyx.pyx", -}; - -/* Type declarations */ +static char *__pyx_filename; +static char **__pyx_f; -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif - -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); - end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static char __pyx_mdoc[] = "Pyrex extensions for converting chunks to lines."; static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); +static void __Pyx_AddTraceback(char *funcname); /*proto*/ -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); +/* Declarations from bzrlib._chunks_to_lines_pyx */ -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); +/* Declarations from implementation of bzrlib._chunks_to_lines_pyx */ -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); +static char __pyx_k1[] = "chunk is not a string"; -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +static PyObject *__pyx_k1p; -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_k1p, 0, __pyx_k1, sizeof(__pyx_k1)}, + {0, 0, 0, 0} +}; -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from bzrlib._chunks_to_lines_pyx */ -#define __Pyx_MODULE_NAME "bzrlib._chunks_to_lines_pyx" -static int __pyx_module_is_main_bzrlib___chunks_to_lines_pyx = 0; /* Implementation of bzrlib._chunks_to_lines_pyx */ -static PyObject *__pyx_builtin_TypeError; -static char __pyx_k_1[] = "chunk is not a string"; -static char __pyx_k_4[] = "Pyrex extensions for converting chunks to lines."; -static char __pyx_k_5[] = "bzrlib._chunks_to_lines_pyx"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k__chunks_to_lines[] = "chunks_to_lines"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_n_s_5; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s__chunks_to_lines; -static PyObject *__pyx_k_tuple_2; -static PyObject *__pyx_k_tuple_3; - -/* "bzrlib/_chunks_to_lines_pyx.pyx":42 - * - * - * def chunks_to_lines(chunks): # <<<<<<<<<<<<<< - * """Re-split chunks into simple lines. - * - */ -static PyObject *__pyx_pf_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines(PyObject *__pyx_self, PyObject *__pyx_v_chunks); /*proto*/ +static PyObject *__pyx_f_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines[] = "Re-split chunks into simple lines.\n\n Each entry in the result should contain a single newline at the end. Except\n for the last entry which may not have a final newline. If chunks is already\n a simple list of lines, we return it directly.\n\n :param chunks: An list/tuple of strings. If chunks is already a list of\n lines, then we will return it as-is.\n :return: A list of strings.\n "; -static PyMethodDef __pyx_mdef_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines = {__Pyx_NAMESTR("chunks_to_lines"), (PyCFunction)__pyx_pf_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines)}; -static PyObject *__pyx_pf_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines(PyObject *__pyx_self, PyObject *__pyx_v_chunks) { +static PyObject *__pyx_f_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_chunks = 0; char *__pyx_v_c_str; char *__pyx_v_newline; char *__pyx_v_c_last; @@ -438,839 +81,309 @@ PyObject *__pyx_v_lines; PyObject *__pyx_v_tail; PyObject *__pyx_v_line; - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("chunks_to_lines"); - __pyx_self = __pyx_self; - __pyx_v_chunk = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_lines = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_tail = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_line = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_chunks_to_lines_pyx.pyx":60 - * - * # Check to see if the chunks are already lines - * last_no_newline = 0 # <<<<<<<<<<<<<< - * for chunk in chunks: - * if last_no_newline: - */ + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + int __pyx_3; + PyObject *__pyx_4 = 0; + static char *__pyx_argnames[] = {"chunks",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_chunks)) return 0; + Py_INCREF(__pyx_v_chunks); + __pyx_v_chunk = Py_None; Py_INCREF(Py_None); + __pyx_v_lines = Py_None; Py_INCREF(Py_None); + __pyx_v_tail = Py_None; Py_INCREF(Py_None); + __pyx_v_line = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":60 */ __pyx_v_last_no_newline = 0; - /* "bzrlib/_chunks_to_lines_pyx.pyx":61 - * # Check to see if the chunks are already lines - * last_no_newline = 0 - * for chunk in chunks: # <<<<<<<<<<<<<< - * if last_no_newline: - * # We have a chunk which followed a chunk without a newline, so this - */ - if (PyList_CheckExact(__pyx_v_chunks) || PyTuple_CheckExact(__pyx_v_chunks)) { - __pyx_t_1 = 0; __pyx_t_2 = __pyx_v_chunks; __Pyx_INCREF(__pyx_t_2); - } else { - __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_chunks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":61 */ + __pyx_1 = PyObject_GetIter(__pyx_v_chunks); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - } else if (likely(PyTuple_CheckExact(__pyx_t_2))) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - } else { - __pyx_t_3 = PyIter_Next(__pyx_t_2); - if (!__pyx_t_3) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_3); + __pyx_2 = PyIter_Next(__pyx_1); + if (!__pyx_2) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; goto __pyx_L1;} + break; + } + Py_DECREF(__pyx_v_chunk); + __pyx_v_chunk = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":62 */ + __pyx_3 = __pyx_v_last_no_newline; + if (__pyx_3) { + goto __pyx_L3; + goto __pyx_L4; + } + __pyx_L4:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":70 */ + __pyx_3 = (!PyString_CheckExact(__pyx_v_chunk)); + if (__pyx_3) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;} + Py_INCREF(__pyx_k1p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k1p); + __pyx_4 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;} + goto __pyx_L5; } - __Pyx_DECREF(__pyx_v_chunk); - __pyx_v_chunk = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_chunks_to_lines_pyx.pyx":62 - * last_no_newline = 0 - * for chunk in chunks: - * if last_no_newline: # <<<<<<<<<<<<<< - * # We have a chunk which followed a chunk without a newline, so this - * # is not a simple list of lines. - */ - if (__pyx_v_last_no_newline) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":65 - * # We have a chunk which followed a chunk without a newline, so this - * # is not a simple list of lines. - * break # <<<<<<<<<<<<<< - * # Switching from PyString_AsStringAndSize to PyString_CheckExact and - * # then the macros GET_SIZE and AS_STRING saved us 40us / 470us. - */ - goto __pyx_L6_break; - goto __pyx_L7; - } - __pyx_L7:; + __pyx_L5:; - /* "bzrlib/_chunks_to_lines_pyx.pyx":70 - * # It seems PyString_AsStringAndSize can actually trigger a conversion, - * # which we don't want anyway. - * if not PyString_CheckExact(chunk): # <<<<<<<<<<<<<< - * raise TypeError('chunk is not a string') - * the_len = PyString_GET_SIZE(chunk) - */ - __pyx_t_4 = (!PyString_CheckExact(__pyx_v_chunk)); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":71 - * # which we don't want anyway. - * if not PyString_CheckExact(chunk): - * raise TypeError('chunk is not a string') # <<<<<<<<<<<<<< - * the_len = PyString_GET_SIZE(chunk) - * if the_len == 0: - */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; - } - __pyx_L8:; - - /* "bzrlib/_chunks_to_lines_pyx.pyx":72 - * if not PyString_CheckExact(chunk): - * raise TypeError('chunk is not a string') - * the_len = PyString_GET_SIZE(chunk) # <<<<<<<<<<<<<< - * if the_len == 0: - * # An empty string is never a valid line - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":72 */ __pyx_v_the_len = PyString_GET_SIZE(__pyx_v_chunk); - /* "bzrlib/_chunks_to_lines_pyx.pyx":73 - * raise TypeError('chunk is not a string') - * the_len = PyString_GET_SIZE(chunk) - * if the_len == 0: # <<<<<<<<<<<<<< - * # An empty string is never a valid line - * break - */ - __pyx_t_4 = (__pyx_v_the_len == 0); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":75 - * if the_len == 0: - * # An empty string is never a valid line - * break # <<<<<<<<<<<<<< - * c_str = PyString_AS_STRING(chunk) - * c_last = c_str + the_len - 1 - */ - goto __pyx_L6_break; - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":73 */ + __pyx_3 = (__pyx_v_the_len == 0); + if (__pyx_3) { + goto __pyx_L3; + goto __pyx_L6; } - __pyx_L9:; + __pyx_L6:; - /* "bzrlib/_chunks_to_lines_pyx.pyx":76 - * # An empty string is never a valid line - * break - * c_str = PyString_AS_STRING(chunk) # <<<<<<<<<<<<<< - * c_last = c_str + the_len - 1 - * newline = memchr(c_str, c'\n', the_len) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":76 */ __pyx_v_c_str = PyString_AS_STRING(__pyx_v_chunk); - /* "bzrlib/_chunks_to_lines_pyx.pyx":77 - * break - * c_str = PyString_AS_STRING(chunk) - * c_last = c_str + the_len - 1 # <<<<<<<<<<<<<< - * newline = memchr(c_str, c'\n', the_len) - * if newline != c_last: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":77 */ __pyx_v_c_last = ((__pyx_v_c_str + __pyx_v_the_len) - 1); - /* "bzrlib/_chunks_to_lines_pyx.pyx":78 - * c_str = PyString_AS_STRING(chunk) - * c_last = c_str + the_len - 1 - * newline = memchr(c_str, c'\n', the_len) # <<<<<<<<<<<<<< - * if newline != c_last: - * if newline == NULL: - */ - __pyx_v_newline = ((char *)memchr(__pyx_v_c_str, '\n', __pyx_v_the_len)); - - /* "bzrlib/_chunks_to_lines_pyx.pyx":79 - * c_last = c_str + the_len - 1 - * newline = memchr(c_str, c'\n', the_len) - * if newline != c_last: # <<<<<<<<<<<<<< - * if newline == NULL: - * # Missing a newline. Only valid as the last line - */ - __pyx_t_4 = (__pyx_v_newline != __pyx_v_c_last); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":80 - * newline = memchr(c_str, c'\n', the_len) - * if newline != c_last: - * if newline == NULL: # <<<<<<<<<<<<<< - * # Missing a newline. Only valid as the last line - * last_no_newline = 1 - */ - __pyx_t_4 = (__pyx_v_newline == NULL); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":82 - * if newline == NULL: - * # Missing a newline. Only valid as the last line - * last_no_newline = 1 # <<<<<<<<<<<<<< - * else: - * # There is a newline in the middle, we must resplit - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":78 */ + __pyx_v_newline = ((char *)memchr(__pyx_v_c_str,'\n',__pyx_v_the_len)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":79 */ + __pyx_3 = (__pyx_v_newline != __pyx_v_c_last); + if (__pyx_3) { + __pyx_3 = (__pyx_v_newline == NULL); + if (__pyx_3) { __pyx_v_last_no_newline = 1; - goto __pyx_L11; + goto __pyx_L8; } /*else*/ { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":85 - * else: - * # There is a newline in the middle, we must resplit - * break # <<<<<<<<<<<<<< - * else: - * # Everything was already a list of lines - */ - goto __pyx_L6_break; + goto __pyx_L3; } - __pyx_L11:; - goto __pyx_L10; + __pyx_L8:; + goto __pyx_L7; } - __pyx_L10:; + __pyx_L7:; } /*else*/ { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":88 - * else: - * # Everything was already a list of lines - * return chunks # <<<<<<<<<<<<<< - * - * # We know we need to create a new list of lines - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_chunks); + Py_INCREF(__pyx_v_chunks); __pyx_r = __pyx_v_chunks; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L0; } - __pyx_L6_break:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L3:; + Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "bzrlib/_chunks_to_lines_pyx.pyx":91 - * - * # We know we need to create a new list of lines - * lines = [] # <<<<<<<<<<<<<< - * tail = None # Any remainder from the previous chunk - * for chunk in chunks: - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_v_lines)); - __pyx_v_lines = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_chunks_to_lines_pyx.pyx":92 - * # We know we need to create a new list of lines - * lines = [] - * tail = None # Any remainder from the previous chunk # <<<<<<<<<<<<<< - * for chunk in chunks: - * if tail is not None: - */ - __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_v_tail); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":91 */ + __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; goto __pyx_L1;} + Py_DECREF(__pyx_v_lines); + __pyx_v_lines = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":92 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_tail); __pyx_v_tail = Py_None; - /* "bzrlib/_chunks_to_lines_pyx.pyx":93 - * lines = [] - * tail = None # Any remainder from the previous chunk - * for chunk in chunks: # <<<<<<<<<<<<<< - * if tail is not None: - * chunk = tail + chunk - */ - if (PyList_CheckExact(__pyx_v_chunks) || PyTuple_CheckExact(__pyx_v_chunks)) { - __pyx_t_1 = 0; __pyx_t_2 = __pyx_v_chunks; __Pyx_INCREF(__pyx_t_2); - } else { - __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_chunks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":93 */ + __pyx_4 = PyObject_GetIter(__pyx_v_chunks); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - } else if (likely(PyTuple_CheckExact(__pyx_t_2))) { - if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; - } else { - __pyx_t_3 = PyIter_Next(__pyx_t_2); - if (!__pyx_t_3) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_DECREF(__pyx_v_chunk); - __pyx_v_chunk = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_chunks_to_lines_pyx.pyx":94 - * tail = None # Any remainder from the previous chunk - * for chunk in chunks: - * if tail is not None: # <<<<<<<<<<<<<< - * chunk = tail + chunk - * tail = None - */ - __pyx_t_4 = (__pyx_v_tail != Py_None); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":95 - * for chunk in chunks: - * if tail is not None: - * chunk = tail + chunk # <<<<<<<<<<<<<< - * tail = None - * if not PyString_CheckExact(chunk): - */ - __pyx_t_3 = PyNumber_Add(__pyx_v_tail, __pyx_v_chunk); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_chunk); - __pyx_v_chunk = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_chunks_to_lines_pyx.pyx":96 - * if tail is not None: - * chunk = tail + chunk - * tail = None # <<<<<<<<<<<<<< - * if not PyString_CheckExact(chunk): - * raise TypeError('chunk is not a string') - */ - __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_v_tail); + __pyx_1 = PyIter_Next(__pyx_4); + if (!__pyx_1) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;} + break; + } + Py_DECREF(__pyx_v_chunk); + __pyx_v_chunk = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":94 */ + __pyx_3 = __pyx_v_tail != Py_None; + if (__pyx_3) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":95 */ + __pyx_2 = PyNumber_Add(__pyx_v_tail, __pyx_v_chunk); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;} + Py_DECREF(__pyx_v_chunk); + __pyx_v_chunk = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":96 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_tail); __pyx_v_tail = Py_None; - goto __pyx_L15; + goto __pyx_L11; } - __pyx_L15:; + __pyx_L11:; - /* "bzrlib/_chunks_to_lines_pyx.pyx":97 - * chunk = tail + chunk - * tail = None - * if not PyString_CheckExact(chunk): # <<<<<<<<<<<<<< - * raise TypeError('chunk is not a string') - * the_len = PyString_GET_SIZE(chunk) - */ - __pyx_t_4 = (!PyString_CheckExact(__pyx_v_chunk)); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":98 - * tail = None - * if not PyString_CheckExact(chunk): - * raise TypeError('chunk is not a string') # <<<<<<<<<<<<<< - * the_len = PyString_GET_SIZE(chunk) - * if the_len == 0: - */ - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L16; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":97 */ + __pyx_3 = (!PyString_CheckExact(__pyx_v_chunk)); + if (__pyx_3) { + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;} + Py_INCREF(__pyx_k1p); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k1p); + __pyx_2 = PyObject_CallObject(PyExc_TypeError, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;} + goto __pyx_L12; } - __pyx_L16:; + __pyx_L12:; - /* "bzrlib/_chunks_to_lines_pyx.pyx":99 - * if not PyString_CheckExact(chunk): - * raise TypeError('chunk is not a string') - * the_len = PyString_GET_SIZE(chunk) # <<<<<<<<<<<<<< - * if the_len == 0: - * # An empty string is never a valid line, and we don't need to - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":99 */ __pyx_v_the_len = PyString_GET_SIZE(__pyx_v_chunk); - /* "bzrlib/_chunks_to_lines_pyx.pyx":100 - * raise TypeError('chunk is not a string') - * the_len = PyString_GET_SIZE(chunk) - * if the_len == 0: # <<<<<<<<<<<<<< - * # An empty string is never a valid line, and we don't need to - * # append anything - */ - __pyx_t_4 = (__pyx_v_the_len == 0); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":103 - * # An empty string is never a valid line, and we don't need to - * # append anything - * continue # <<<<<<<<<<<<<< - * c_str = PyString_AS_STRING(chunk) - * c_last = c_str + the_len - 1 - */ - goto __pyx_L13_continue; - goto __pyx_L17; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":100 */ + __pyx_3 = (__pyx_v_the_len == 0); + if (__pyx_3) { + goto __pyx_L9; + goto __pyx_L13; } - __pyx_L17:; + __pyx_L13:; - /* "bzrlib/_chunks_to_lines_pyx.pyx":104 - * # append anything - * continue - * c_str = PyString_AS_STRING(chunk) # <<<<<<<<<<<<<< - * c_last = c_str + the_len - 1 - * newline = memchr(c_str, c'\n', the_len) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":104 */ __pyx_v_c_str = PyString_AS_STRING(__pyx_v_chunk); - /* "bzrlib/_chunks_to_lines_pyx.pyx":105 - * continue - * c_str = PyString_AS_STRING(chunk) - * c_last = c_str + the_len - 1 # <<<<<<<<<<<<<< - * newline = memchr(c_str, c'\n', the_len) - * if newline == c_last: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":105 */ __pyx_v_c_last = ((__pyx_v_c_str + __pyx_v_the_len) - 1); - /* "bzrlib/_chunks_to_lines_pyx.pyx":106 - * c_str = PyString_AS_STRING(chunk) - * c_last = c_str + the_len - 1 - * newline = memchr(c_str, c'\n', the_len) # <<<<<<<<<<<<<< - * if newline == c_last: - * # A simple line - */ - __pyx_v_newline = ((char *)memchr(__pyx_v_c_str, '\n', __pyx_v_the_len)); - - /* "bzrlib/_chunks_to_lines_pyx.pyx":107 - * c_last = c_str + the_len - 1 - * newline = memchr(c_str, c'\n', the_len) - * if newline == c_last: # <<<<<<<<<<<<<< - * # A simple line - * PyList_Append(lines, chunk) - */ - __pyx_t_4 = (__pyx_v_newline == __pyx_v_c_last); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":109 - * if newline == c_last: - * # A simple line - * PyList_Append(lines, chunk) # <<<<<<<<<<<<<< - * elif newline == NULL: - * # A chunk without a newline, if this is the last entry, then we - */ - __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_lines), __pyx_v_chunk); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L18; - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":106 */ + __pyx_v_newline = ((char *)memchr(__pyx_v_c_str,'\n',__pyx_v_the_len)); - /* "bzrlib/_chunks_to_lines_pyx.pyx":110 - * # A simple line - * PyList_Append(lines, chunk) - * elif newline == NULL: # <<<<<<<<<<<<<< - * # A chunk without a newline, if this is the last entry, then we - * # allow it - */ - __pyx_t_4 = (__pyx_v_newline == NULL); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":113 - * # A chunk without a newline, if this is the last entry, then we - * # allow it - * tail = chunk # <<<<<<<<<<<<<< - * else: - * # We have a newline in the middle, loop until we've consumed all - */ - __Pyx_INCREF(__pyx_v_chunk); - __Pyx_DECREF(__pyx_v_tail); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":107 */ + __pyx_3 = (__pyx_v_newline == __pyx_v_c_last); + if (__pyx_3) { + __pyx_3 = PyList_Append(__pyx_v_lines,__pyx_v_chunk); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; goto __pyx_L1;} + goto __pyx_L14; + } + __pyx_3 = (__pyx_v_newline == NULL); + if (__pyx_3) { + Py_INCREF(__pyx_v_chunk); + Py_DECREF(__pyx_v_tail); __pyx_v_tail = __pyx_v_chunk; - goto __pyx_L18; + goto __pyx_L14; } /*else*/ { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":117 - * # We have a newline in the middle, loop until we've consumed all - * # lines - * while newline != NULL: # <<<<<<<<<<<<<< - * line = PyString_FromStringAndSize(c_str, newline - c_str + 1) - * PyList_Append(lines, line) - */ while (1) { - __pyx_t_4 = (__pyx_v_newline != NULL); - if (!__pyx_t_4) break; + __pyx_3 = (__pyx_v_newline != NULL); + if (!__pyx_3) break; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":118 */ + __pyx_1 = PyString_FromStringAndSize(__pyx_v_c_str,((__pyx_v_newline - __pyx_v_c_str) + 1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;} + Py_DECREF(__pyx_v_line); + __pyx_v_line = __pyx_1; + __pyx_1 = 0; - /* "bzrlib/_chunks_to_lines_pyx.pyx":118 - * # lines - * while newline != NULL: - * line = PyString_FromStringAndSize(c_str, newline - c_str + 1) # <<<<<<<<<<<<<< - * PyList_Append(lines, line) - * c_str = newline + 1 - */ - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_c_str, ((__pyx_v_newline - __pyx_v_c_str) + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_line); - __pyx_v_line = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_chunks_to_lines_pyx.pyx":119 - * while newline != NULL: - * line = PyString_FromStringAndSize(c_str, newline - c_str + 1) - * PyList_Append(lines, line) # <<<<<<<<<<<<<< - * c_str = newline + 1 - * if c_str > c_last: # We are done - */ - __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_lines), __pyx_v_line); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_chunks_to_lines_pyx.pyx":120 - * line = PyString_FromStringAndSize(c_str, newline - c_str + 1) - * PyList_Append(lines, line) - * c_str = newline + 1 # <<<<<<<<<<<<<< - * if c_str > c_last: # We are done - * break - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":119 */ + __pyx_3 = PyList_Append(__pyx_v_lines,__pyx_v_line); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":120 */ __pyx_v_c_str = (__pyx_v_newline + 1); - /* "bzrlib/_chunks_to_lines_pyx.pyx":121 - * PyList_Append(lines, line) - * c_str = newline + 1 - * if c_str > c_last: # We are done # <<<<<<<<<<<<<< - * break - * the_len = c_last - c_str + 1 - */ - __pyx_t_4 = (__pyx_v_c_str > __pyx_v_c_last); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":122 - * c_str = newline + 1 - * if c_str > c_last: # We are done - * break # <<<<<<<<<<<<<< - * the_len = c_last - c_str + 1 - * newline = memchr(c_str, c'\n', the_len) - */ - goto __pyx_L20_break; - goto __pyx_L21; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":121 */ + __pyx_3 = (__pyx_v_c_str > __pyx_v_c_last); + if (__pyx_3) { + goto __pyx_L16; + goto __pyx_L17; } - __pyx_L21:; + __pyx_L17:; - /* "bzrlib/_chunks_to_lines_pyx.pyx":123 - * if c_str > c_last: # We are done - * break - * the_len = c_last - c_str + 1 # <<<<<<<<<<<<<< - * newline = memchr(c_str, c'\n', the_len) - * if newline == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":123 */ __pyx_v_the_len = ((__pyx_v_c_last - __pyx_v_c_str) + 1); - /* "bzrlib/_chunks_to_lines_pyx.pyx":124 - * break - * the_len = c_last - c_str + 1 - * newline = memchr(c_str, c'\n', the_len) # <<<<<<<<<<<<<< - * if newline == NULL: - * tail = PyString_FromStringAndSize(c_str, the_len) - */ - __pyx_v_newline = ((char *)memchr(__pyx_v_c_str, '\n', __pyx_v_the_len)); - - /* "bzrlib/_chunks_to_lines_pyx.pyx":125 - * the_len = c_last - c_str + 1 - * newline = memchr(c_str, c'\n', the_len) - * if newline == NULL: # <<<<<<<<<<<<<< - * tail = PyString_FromStringAndSize(c_str, the_len) - * break - */ - __pyx_t_4 = (__pyx_v_newline == NULL); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":126 - * newline = memchr(c_str, c'\n', the_len) - * if newline == NULL: - * tail = PyString_FromStringAndSize(c_str, the_len) # <<<<<<<<<<<<<< - * break - * if tail is not None: - */ - __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_c_str, __pyx_v_the_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_tail); - __pyx_v_tail = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_chunks_to_lines_pyx.pyx":127 - * if newline == NULL: - * tail = PyString_FromStringAndSize(c_str, the_len) - * break # <<<<<<<<<<<<<< - * if tail is not None: - * PyList_Append(lines, tail) - */ - goto __pyx_L20_break; - goto __pyx_L22; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":124 */ + __pyx_v_newline = ((char *)memchr(__pyx_v_c_str,'\n',__pyx_v_the_len)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":125 */ + __pyx_3 = (__pyx_v_newline == NULL); + if (__pyx_3) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":126 */ + __pyx_2 = PyString_FromStringAndSize(__pyx_v_c_str,__pyx_v_the_len); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} + Py_DECREF(__pyx_v_tail); + __pyx_v_tail = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":127 */ + goto __pyx_L16; + goto __pyx_L18; } - __pyx_L22:; + __pyx_L18:; } - __pyx_L20_break:; + __pyx_L16:; } - __pyx_L18:; - __pyx_L13_continue:; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_chunks_to_lines_pyx.pyx":128 - * tail = PyString_FromStringAndSize(c_str, the_len) - * break - * if tail is not None: # <<<<<<<<<<<<<< - * PyList_Append(lines, tail) - * return lines - */ - __pyx_t_4 = (__pyx_v_tail != Py_None); - if (__pyx_t_4) { - - /* "bzrlib/_chunks_to_lines_pyx.pyx":129 - * break - * if tail is not None: - * PyList_Append(lines, tail) # <<<<<<<<<<<<<< - * return lines - */ - __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_lines), __pyx_v_tail); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L23; + __pyx_L14:; + __pyx_L9:; } - __pyx_L23:; + Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "bzrlib/_chunks_to_lines_pyx.pyx":130 - * if tail is not None: - * PyList_Append(lines, tail) - * return lines # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_lines)); - __pyx_r = ((PyObject *)__pyx_v_lines); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":128 */ + __pyx_3 = __pyx_v_tail != Py_None; + if (__pyx_3) { + __pyx_3 = PyList_Append(__pyx_v_lines,__pyx_v_tail); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} + goto __pyx_L19; + } + __pyx_L19:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":130 */ + Py_INCREF(__pyx_v_lines); + __pyx_r = __pyx_v_lines; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._chunks_to_lines_pyx.chunks_to_lines"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_chunk); - __Pyx_DECREF(__pyx_v_lines); - __Pyx_DECREF(__pyx_v_tail); - __Pyx_DECREF(__pyx_v_line); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_chunk); + Py_DECREF(__pyx_v_lines); + Py_DECREF(__pyx_v_tail); + Py_DECREF(__pyx_v_line); + Py_DECREF(__pyx_v_chunks); return __pyx_r; } -static PyMethodDef __pyx_methods[] = { +static struct PyMethodDef __pyx_methods[] = { + {"chunks_to_lines", (PyCFunction)__pyx_f_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines}, {0, 0, 0, 0} }; -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("_chunks_to_lines_pyx"), - __Pyx_DOCSTR(__pyx_k_4), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif +static void __pyx_init_filenames(void); /*proto*/ -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_n_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s__chunks_to_lines, __pyx_k__chunks_to_lines, sizeof(__pyx_k__chunks_to_lines), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "bzrlib/_chunks_to_lines_pyx.pyx":71 - * # which we don't want anyway. - * if not PyString_CheckExact(chunk): - * raise TypeError('chunk is not a string') # <<<<<<<<<<<<<< - * the_len = PyString_GET_SIZE(chunk) - * if the_len == 0: - */ - __pyx_k_tuple_2 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_2)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); - PyTuple_SET_ITEM(__pyx_k_tuple_2, 0, ((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2)); - - /* "bzrlib/_chunks_to_lines_pyx.pyx":98 - * tail = None - * if not PyString_CheckExact(chunk): - * raise TypeError('chunk is not a string') # <<<<<<<<<<<<<< - * the_len = PyString_GET_SIZE(chunk) - * if the_len == 0: - */ - __pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_3)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); - PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, ((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC init_chunks_to_lines_pyx(void); /*proto*/ -PyMODINIT_FUNC init_chunks_to_lines_pyx(void) -#else -PyMODINIT_FUNC PyInit__chunks_to_lines_pyx(void); /*proto*/ -PyMODINIT_FUNC PyInit__chunks_to_lines_pyx(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__chunks_to_lines_pyx(void)", __LINE__, __FILE__); - #endif - __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;} - __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;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_chunks_to_lines_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_4), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_chunks_to_lines_pyx(void) { + __pyx_init_filenames(); + __pyx_m = Py_InitModule4("_chunks_to_lines_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}; Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_bzrlib___chunks_to_lines_pyx) { - 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;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "bzrlib/_chunks_to_lines_pyx.pyx":42 - * - * - * def chunks_to_lines(chunks): # <<<<<<<<<<<<<< - * """Re-split chunks into simple lines. - * - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_20_chunks_to_lines_pyx_chunks_to_lines, NULL, __pyx_n_s_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__chunks_to_lines, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_chunks_to_lines_pyx.pyx":1 - * # Copyright (C) 2008 Canonical Ltd # <<<<<<<<<<<<<< - * # - * # This program is free software; you can redistribute it and/or modify - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - __Pyx_AddTraceback("init bzrlib._chunks_to_lines_pyx"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init bzrlib._chunks_to_lines_pyx"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 + __pyx_b = PyImport_AddModule("__builtin__"); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_chunks_to_lines_pyx.pyx":42 */ return; - #else - return __pyx_m; - #endif + __pyx_L1:; + __Pyx_AddTraceback("bzrlib._chunks_to_lines_pyx"); } -/* Runtime support code */ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} +static char *__pyx_filenames[] = { + "_chunks_to_lines_pyx.pyx", +}; -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} +/* Runtime support code */ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } - -#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); @@ -1311,13 +424,12 @@ Py_INCREF(type); } else { - type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else - type = (PyObject*) Py_TYPE(type); + type = (PyObject*) type->ob_type; Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, @@ -1326,8 +438,7 @@ } #endif } - - __Pyx_ErrRestore(type, value, tb); + PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); @@ -1336,506 +447,60 @@ return; } -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; -} -#endif - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + if (!*t->p) + return -1; + if (t->i) + PyString_InternInPlace(t->p); + ++t; } + return 0; } #include "compile.h" #include "frameobject.h" #include "traceback.h" -static void __Pyx_AddTraceback(const char *funcname) { +static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; + PyObject *empty_tuple = 0; + PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } + py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; + empty_tuple = PyTuple_New(0); + if (!empty_tuple) goto bad; + empty_string = PyString_FromString(""); + if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + empty_string, /*PyObject *code,*/ + empty_tuple, /*PyObject *consts,*/ + empty_tuple, /*PyObject *names,*/ + empty_tuple, /*PyObject *varnames,*/ + empty_tuple, /*PyObject *freevars,*/ + empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ + empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ + PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ @@ -1846,128 +511,8 @@ bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); + Py_XDECREF(empty_tuple); + Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} - -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff -Nru bzr-2.5.0/bzrlib/commands.py bzr-2.6.0~beta1/bzrlib/commands.py --- bzr-2.5.0/bzrlib/commands.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/commands.py 2012-03-15 10:00:24.000000000 +0000 @@ -690,11 +690,15 @@ """ class_run = self.run def run(*args, **kwargs): + for hook in Command.hooks['pre_command']: + hook(self) self._operation = cleanup.OperationWithCleanups(class_run) try: return self._operation.run_simple(*args, **kwargs) finally: del self._operation + for hook in Command.hooks['post_command']: + hook(self) self.run = run def run(self): @@ -788,6 +792,12 @@ " is safe to mutate - e.g. to remove a command. " "list_commands should return the updated set of command names.", (1, 17)) + self.add_hook('pre_command', + "Called prior to executing a command. Called with the command " + "object.", (2, 6)) + self.add_hook('post_command', + "Called after executing a command. Called with the command " + "object.", (2, 6)) Command.hooks = CommandHooks() diff -Nru bzr-2.5.0/bzrlib/commit.py bzr-2.6.0~beta1/bzrlib/commit.py --- bzr-2.5.0/bzrlib/commit.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/commit.py 2012-03-15 10:00:24.000000000 +0000 @@ -372,7 +372,7 @@ elif self.reporter is None: self.reporter = self._select_reporter() if self.config_stack is None: - self.config_stack = self.branch.get_config_stack() + self.config_stack = self.work_tree.get_config_stack() self._set_specific_file_ids() @@ -667,7 +667,7 @@ # entries and the order is preserved when doing this. if self.use_record_iter_changes: return - self.basis_inv = self.basis_tree.inventory + self.basis_inv = self.basis_tree.root_inventory self.parent_invs = [self.basis_inv] for revision in self.parents[1:]: if self.branch.repository.has_revision(revision): @@ -834,10 +834,9 @@ deleted_paths = {} # XXX: Note that entries may have the wrong kind because the entry does # not reflect the status on disk. - work_inv = self.work_tree.inventory # NB: entries will include entries within the excluded ids/paths # because iter_entries_by_dir has no 'exclude' facility today. - entries = work_inv.iter_entries_by_dir( + entries = self.work_tree.iter_entries_by_dir( specific_file_ids=self.specific_file_ids, yield_parents=True) for path, existing_ie in entries: file_id = existing_ie.file_id diff -Nru bzr-2.5.0/bzrlib/commit_signature_commands.py bzr-2.6.0~beta1/bzrlib/commit_signature_commands.py --- bzr-2.5.0/bzrlib/commit_signature_commands.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/commit_signature_commands.py 2012-03-15 10:00:24.000000000 +0000 @@ -19,19 +19,17 @@ from __future__ import absolute_import -from bzrlib.lazy_import import lazy_import -lazy_import(globals(), """ from bzrlib import ( controldir, errors, gpg, revision as _mod_revision, ) -""") from bzrlib.commands import Command from bzrlib.option import Option from bzrlib.i18n import gettext, ngettext + class cmd_sign_my_commits(Command): __doc__ = """Sign all commits by a given committer. @@ -59,11 +57,11 @@ bzrdir = controldir.ControlDir.open(location) branch = bzrdir.open_branch() repo = branch.repository - branch_config = branch.get_config() + branch_config = branch.get_config_stack() if committer is None: - committer = branch_config.username() - gpg_strategy = gpg.GPGStrategy(branch.get_config_stack()) + committer = branch_config.get('email') + gpg_strategy = gpg.GPGStrategy(branch_config) count = 0 repo.lock_write() @@ -85,7 +83,7 @@ continue # We have a revision without a signature who has a # matching committer, start signing - print rev_id + self.outf.write("%s\n" % rev_id) count += 1 if not dry_run: repo.sign_revision(rev_id, gpg_strategy) @@ -96,7 +94,9 @@ repo.commit_write_group() finally: repo.unlock() - print 'Signed %d revisions' % (count,) + self.outf.write( + ngettext('Signed %d revision.\n', 'Signed %d revisions.\n', count) % + count) class cmd_verify_signatures(Command): @@ -131,6 +131,7 @@ def write_verbose(string): self.outf.write(" " + string + "\n") + self.add_cleanup(repo.lock_read().unlock) #get our list of revisions revisions = [] if revision is not None: @@ -151,7 +152,6 @@ #all revisions by default including merges graph = repo.get_graph() revisions = [] - repo.lock_read() for rev_id, parents in graph.iter_ancestry( [branch.last_revision()]): if _mod_revision.is_null(rev_id): @@ -160,37 +160,32 @@ # Ignore ghosts continue revisions.append(rev_id) - repo.unlock() count, result, all_verifiable =\ - gpg_strategy.do_verifications(revisions, repo) + gpg.bulk_verify_signatures(repo, revisions, gpg_strategy) if all_verifiable: - write(gettext( - "All commits signed with verifiable keys")) + write(gettext("All commits signed with verifiable keys")) if verbose: - write(gpg_strategy.verbose_valid_message(result)) + write(gpg.verbose_valid_message(result)) return 0 else: - write(gpg_strategy.valid_commits_message(count)) + write(gpg.valid_commits_message(count)) if verbose: - for message in gpg_strategy.verbose_valid_message(result): + for message in gpg.verbose_valid_message(result): write_verbose(message) - write(gpg_strategy.expired_commit_message(count)) + write(gpg.expired_commit_message(count)) if verbose: - for message in gpg_strategy.verbose_expired_key_message(result, - repo): + for message in gpg.verbose_expired_key_message(result, repo): write_verbose(message) - write(gpg_strategy.unknown_key_message(count)) + write(gpg.unknown_key_message(count)) if verbose: - for message in gpg_strategy.verbose_missing_key_message(result): + for message in gpg.verbose_missing_key_message(result): write_verbose(message) - write(gpg_strategy.commit_not_valid_message(count)) + write(gpg.commit_not_valid_message(count)) if verbose: - for message in gpg_strategy.verbose_not_valid_message(result, - repo): + for message in gpg.verbose_not_valid_message(result, repo): write_verbose(message) - write(gpg_strategy.commit_not_signed_message(count)) + write(gpg.commit_not_signed_message(count)) if verbose: - for message in gpg_strategy.verbose_not_signed_message(result, - repo): + for message in gpg.verbose_not_signed_message(result, repo): write_verbose(message) return 1 diff -Nru bzr-2.5.0/bzrlib/config.py bzr-2.6.0~beta1/bzrlib/config.py --- bzr-2.5.0/bzrlib/config.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/config.py 2012-03-15 10:00:24.000000000 +0000 @@ -55,7 +55,7 @@ turns on create_signatures. create_signatures - this option controls whether bzr will always create gpg signatures or not on commits. There is an unused - option which in future is expected to work if + option which in future is expected to work if branch settings require signatures. log_format - this option sets the default log format. Possible values are long, short, line, or a plugin can register new formats. @@ -92,7 +92,6 @@ lazy_regex, library_state, lockdir, - mail_client, mergetools, osutils, symbol_versioning, @@ -196,27 +195,6 @@ return self[section][name] -# FIXME: Until we can guarantee that each config file is loaded once and -# only once for a given bzrlib session, we don't want to re-read the file every -# time we query for an option so we cache the value (bad ! watch out for tests -# needing to restore the proper value). -- vila 20110219 -_expand_default_value = None -def _get_expand_default_value(): - global _expand_default_value - if _expand_default_value is not None: - return _expand_default_value - conf = GlobalConfig() - # Note that we must not use None for the expand value below or we'll run - # into infinite recursion. Using False really would be quite silly ;) - expand = conf.get_user_option_as_bool('bzr.config.expand', expand=True) - if expand is None: - # This is an opt-in feature, you *really* need to clearly say you want - # to activate it ! - expand = False - _expand_default_value = expand - return expand - - class Config(object): """A configuration policy - what username, editor, gpg needs etc.""" @@ -227,11 +205,6 @@ """Returns a unique ID for the config.""" raise NotImplementedError(self.config_id) - @deprecated_method(deprecated_in((2, 4, 0))) - def get_editor(self): - """Get the users pop up editor.""" - raise NotImplementedError - def get_change_editor(self, old_tree, new_tree): from bzrlib import diff cmd = self._get_change_editor() @@ -240,16 +213,6 @@ return diff.DiffFromTool.from_string(cmd, old_tree, new_tree, sys.stdout) - def get_mail_client(self): - """Get a mail client to use""" - selected_client = self.get_user_option('mail_client') - _registry = mail_client.mail_client_registry - try: - mail_client_class = _registry.get(selected_client) - except KeyError: - raise errors.UnknownMailClient(selected_client) - return mail_client_class(self) - def _get_signature_checking(self): """Template method to override signature checking policy.""" @@ -384,7 +347,7 @@ """Template method to provide a user option.""" return None - def get_user_option(self, option_name, expand=None): + def get_user_option(self, option_name, expand=True): """Get a generic option - no special process, no default. :param option_name: The queried option. @@ -393,8 +356,6 @@ :returns: The value of the option. """ - if expand is None: - expand = _get_expand_default_value() value = self._get_user_option(option_name) if expand: if isinstance(value, list): @@ -648,7 +609,7 @@ for (oname, value, section, conf_id, parser) in self._get_options(): if oname.startswith('bzr.mergetool.'): tool_name = oname[len('bzr.mergetool.'):] - tools[tool_name] = self.get_user_option(oname) + tools[tool_name] = self.get_user_option(oname, False) trace.mutter('loaded merge tools: %r' % tools) return tools @@ -1090,10 +1051,6 @@ conf._create_from_string(str_or_unicode, save) return conf - @deprecated_method(deprecated_in((2, 4, 0))) - def get_editor(self): - return self._get_user_option('editor') - @needs_write_lock def set_user_option(self, option, value): """Save option and its value in the configuration.""" @@ -2185,8 +2142,8 @@ It may be set to a location, or None. - This policy affects all branches contained by this bzrdir, except for - those under repositories. + This policy affects all branches contained by this control dir, except + for those under repositories. """ if self._config is None: raise errors.BzrError("Cannot set configuration in %s" % self._bzrdir) @@ -2200,8 +2157,8 @@ This will either be a location, or None. - This policy affects all branches contained by this bzrdir, except for - those under repositories. + This policy affects all branches contained by this control dir, except + for those under repositories. """ if self._config is None: return None @@ -2384,13 +2341,17 @@ raise AssertionError('%r is not supported as a default value' % (default,)) self.default_from_env = default_from_env - self.help = help + self._help = help self.from_unicode = from_unicode self.unquote = unquote if invalid and invalid not in ('warning', 'error'): raise AssertionError("%s not supported for 'invalid'" % (invalid,)) self.invalid = invalid + @property + def help(self): + return self._help + def convert_from_unicode(self, store, unicode_value): if self.unquote and store is not None and unicode_value is not None: unicode_value = store.unquote(unicode_value) @@ -2442,6 +2403,9 @@ value = self.default return value + def get_help_topic(self): + return self.name + def get_help_text(self, additional_see_also=None, plain=True): result = self.help from bzrlib import help_topics @@ -2536,6 +2500,42 @@ return l +class RegistryOption(Option): + """Option for a choice from a registry.""" + + def __init__(self, name, registry, default_from_env=None, + help=None, invalid=None): + """A registry based Option definition. + + This overrides the base class so the conversion from a unicode string + can take quoting into account. + """ + super(RegistryOption, self).__init__( + name, default=lambda: unicode(registry.default_key), + default_from_env=default_from_env, + from_unicode=self.from_unicode, help=help, + invalid=invalid, unquote=False) + self.registry = registry + + def from_unicode(self, unicode_str): + if not isinstance(unicode_str, basestring): + raise TypeError + try: + return self.registry.get(unicode_str) + except KeyError: + raise ValueError( + "Invalid value %s for %s." + "See help for a list of possible values." % (unicode_str, + self.name)) + + @property + def help(self): + ret = [self._help, "\n\nThe following values are supported:\n"] + for key in self.registry.keys(): + ret.append(" %s - %s\n" % (key, self.registry.get_help(key))) + return "".join(ret) + + class OptionRegistry(registry.Registry): """Register config options by their name. @@ -2631,6 +2631,8 @@ help="""\ Whether revisions associated with tags should be fetched. """)) +option_registry.register_lazy( + 'bzr.transform.orphan_policy', 'bzrlib.transform', 'opt_transform_orphan') option_registry.register( Option('bzr.workingtree.worth_saving_limit', default=10, from_unicode=int_from_store, invalid='warning', @@ -2644,6 +2646,15 @@ a file has been touched. ''')) option_registry.register( + Option('bugtracker', default=None, + help='''\ +Default bug tracker to use. + +This bug tracker will be used for example when marking bugs +as fixed using ``bzr commit --fixes``, if no explicit +bug tracker was specified. +''')) +option_registry.register( Option('check_signatures', default=CHECK_IF_POSSIBLE, from_unicode=signature_policy_from_unicode, help='''\ @@ -2751,6 +2762,8 @@ Standard log formats are ``long``, ``short`` and ``line``. Additional formats may be provided by plugins. ''')) +option_registry.register_lazy('mail_client', 'bzrlib.mail_client', + 'opt_mail_client') option_registry.register( Option('output_encoding', help= 'Unicode encoding for output' @@ -2853,7 +2866,14 @@ option_registry.register( Option('submit_to', help='''Where submissions from this branch are mailed to.''')) - +option_registry.register( + ListOption('suppress_warnings', + default=[], + help="List of warning classes to suppress.")) +option_registry.register( + Option('validate_signatures_in_log', default=False, + from_unicode=bool_from_store, invalid='warning', + help='''Whether to validate signatures in bzr log.''')) option_registry.register_lazy('ssl.ca_certs', 'bzrlib.transport.http._urllib2_wrappers', 'opt_ssl_ca_certs') @@ -2861,7 +2881,6 @@ 'bzrlib.transport.http._urllib2_wrappers', 'opt_ssl_cert_reqs') - class Section(object): """A section defines a dict of option name => value. @@ -3370,20 +3389,6 @@ self.branch = branch self.id = 'branch' - def lock_write(self, token=None): - return self.branch.lock_write(token) - - def unlock(self): - return self.branch.unlock() - - @needs_write_lock - def save(self): - # We need to be able to override the undecorated implementation - self.save_without_locking() - - def save_without_locking(self): - super(BranchStore, self).save() - class ControlStore(LockableIniFileStore): @@ -3611,7 +3616,17 @@ self.store = store self.mutable_section_id = mutable_section_id - def get(self, name, expand=None): + def iter_sections(self): + """Iterate all the defined sections.""" + # Ensuring lazy loading is achieved by delaying section matching (which + # implies querying the persistent storage) until it can't be avoided + # anymore by using callables to describe (possibly empty) section + # lists. + for sections in self.sections_def: + for store, section in sections(): + yield store, section + + def get(self, name, expand=True, convert=True): """Return the *first* option value found in the sections. This is where we guarantee that sections coming from Store are loaded @@ -3624,11 +3639,12 @@ :param expand: Whether options references should be expanded. + :param convert: Whether the option value should be converted from + unicode (do nothing for non-registered options). + :returns: The value of the option. """ # FIXME: No caching of options nor sections yet -- vila 20110503 - if expand is None: - expand = _get_expand_default_value() value = None found_store = None # Where the option value has been found # If the option is registered, it may provide additional info about @@ -3652,7 +3668,7 @@ % (name, type(val))) if opt is None: val = found_store.unquote(val) - else: + elif convert: val = opt.convert_from_unicode(found_store, val) return val @@ -3662,17 +3678,10 @@ value = opt.get_override() value = expand_and_convert(value) if value is None: - # Ensuring lazy loading is achieved by delaying section matching - # (which implies querying the persistent storage) until it can't be - # avoided anymore by using callables to describe (possibly empty) - # section lists. - for sections in self.sections_def: - for store, section in sections(): - value = section.get(name) - if value is not None: - found_store = store - break + for store, section in self.iter_sections(): + value = section.get(name) if value is not None: + found_store = store break value = expand_and_convert(value) if opt is not None and value is None: @@ -3744,7 +3753,7 @@ # anything else value = env[name] else: - value = self.get(name, expand=False) + value = self.get(name, expand=False, convert=False) value = self._expand_options_in_string(value, env, _refs) return value @@ -3893,7 +3902,7 @@ lstore, mutable_section_id=location) -class BranchStack(_CompatibleStack): +class BranchStack(Stack): """Per-location options falling back to branch then global options stack. The following sections are queried: @@ -3924,6 +3933,24 @@ bstore) self.branch = branch + def lock_write(self, token=None): + return self.branch.lock_write(token) + + def unlock(self): + return self.branch.unlock() + + @needs_write_lock + def set(self, name, value): + super(BranchStack, self).set(name, value) + # Unlocking the branch will trigger a store.save_changes() so the last + # unlock saves all the changes. + + @needs_write_lock + def remove(self, name): + super(BranchStack, self).remove(name) + # Unlocking the branch will trigger a store.save_changes() so the last + # unlock saves all the changes. + class RemoteControlStack(_CompatibleStack): """Remote control-only options stack.""" @@ -3940,7 +3967,7 @@ self.bzrdir = bzrdir -class BranchOnlyStack(_CompatibleStack): +class BranchOnlyStack(Stack): """Branch-only options stack.""" # FIXME: _BranchOnlyStack only uses branch.conf and is used only for the @@ -3954,11 +3981,24 @@ bstore) self.branch = branch + def lock_write(self, token=None): + return self.branch.lock_write(token) + + def unlock(self): + return self.branch.unlock() + + @needs_write_lock + def set(self, name, value): + super(BranchOnlyStack, self).set(name, value) + # Force a write to persistent storage + self.store.save_changes() + + @needs_write_lock + def remove(self, name): + super(BranchOnlyStack, self).remove(name) + # Force a write to persistent storage + self.store.save_changes() -# Use a an empty dict to initialize an empty configobj avoiding all -# parsing and encoding checks -_quoting_config = configobj.ConfigObj( - {}, encoding='utf-8', interpolation=False, list_values=True) class cmd_config(commands.Command): __doc__ = """Display, set or remove a configuration option. @@ -4026,12 +4066,15 @@ # Set the option value self._set_config_option(name, value, directory, scope) - def _get_stack(self, directory, scope=None): + def _get_stack(self, directory, scope=None, write_access=False): """Get the configuration stack specified by ``directory`` and ``scope``. :param directory: Where the configurations are derived from. :param scope: A specific config to start from. + + :param write_access: Whether a write access to the stack will be + attempted. """ # FIXME: scope should allow access to plugin-specific stacks (even # reduced to the plugin-specific store), related to @@ -4045,6 +4088,8 @@ (_, br, _) = ( controldir.ControlDir.open_containing_tree_or_branch( directory)) + if write_access: + self.add_cleanup(br.lock_write().unlock) return br.get_config_stack() raise errors.NoSuchConfig(scope) else: @@ -4052,16 +4097,23 @@ (_, br, _) = ( controldir.ControlDir.open_containing_tree_or_branch( directory)) + if write_access: + self.add_cleanup(br.lock_write().unlock) return br.get_config_stack() except errors.NotBranchError: return LocationStack(directory) + def _quote_multiline(self, value): + if '\n' in value: + value = '"""' + value + '"""' + return value + def _show_value(self, name, directory, scope): conf = self._get_stack(directory, scope) - value = conf.get(name, expand=True) + value = conf.get(name, expand=True, convert=False) if value is not None: # Quote the value appropriately - value = _quoting_config._quote(value) + value = self._quote_multiline(value) self.outf.write('%s\n' % (value,)) else: raise errors.NoSuchConfigOption(name) @@ -4075,41 +4127,33 @@ cur_store_id = None cur_section = None conf = self._get_stack(directory, scope) - for sections in conf.sections_def: - for store, section in sections(): - for oname in section.iter_option_names(): - if name.search(oname): - if cur_store_id != store.id: - # Explain where the options are defined - self.outf.write('%s:\n' % (store.id,)) - cur_store_id = store.id - cur_section = None - if (section.id is not None - and cur_section != section.id): - # Display the section id as it appears in the store - # (None doesn't appear by definition) - self.outf.write(' [%s]\n' % (section.id,)) - cur_section = section.id - value = section.get(oname, expand=False) - # Since we don't use the stack, we need to restore a - # proper quoting. - try: - opt = option_registry.get(oname) - value = opt.convert_from_unicode(store, value) - except KeyError: - value = store.unquote(value) - value = _quoting_config._quote(value) - self.outf.write(' %s = %s\n' % (oname, value)) + for store, section in conf.iter_sections(): + for oname in section.iter_option_names(): + if name.search(oname): + if cur_store_id != store.id: + # Explain where the options are defined + self.outf.write('%s:\n' % (store.id,)) + cur_store_id = store.id + cur_section = None + if (section.id is not None and cur_section != section.id): + # Display the section id as it appears in the store + # (None doesn't appear by definition) + self.outf.write(' [%s]\n' % (section.id,)) + cur_section = section.id + value = section.get(oname, expand=False) + # Quote the value appropriately + value = self._quote_multiline(value) + self.outf.write(' %s = %s\n' % (oname, value)) def _set_config_option(self, name, value, directory, scope): - conf = self._get_stack(directory, scope) + conf = self._get_stack(directory, scope, write_access=True) conf.set(name, value) def _remove_config_option(self, name, directory, scope): if name is None: raise errors.BzrCommandError( '--remove expects an option to remove.') - conf = self._get_stack(directory, scope) + conf = self._get_stack(directory, scope, write_access=True) try: conf.remove(name) except KeyError: diff -Nru bzr-2.5.0/bzrlib/controldir.py bzr-2.6.0~beta1/bzrlib/controldir.py --- bzr-2.5.0/bzrlib/controldir.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/controldir.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2010, 2011 Canonical Ltd +# Copyright (C) 2010, 2011, 2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -406,6 +406,7 @@ repository_to.fetch(source.repository, revision_id=revision_id) br_to = source.clone(self, revision_id=revision_id) if source.get_push_location() is None or remember: + # FIXME: Should be done only if we succeed ? -- vila 2012-01-18 source.set_push_location(br_to.base) push_result.stacked_on = None push_result.branch_push_result = None @@ -417,6 +418,7 @@ else: # We have successfully opened the branch, remember if necessary: if source.get_push_location() is None or remember: + # FIXME: Should be done only if we succeed ? -- vila 2012-01-18 source.set_push_location(br_to.base) try: tree_to = self.open_workingtree() diff -Nru bzr-2.5.0/bzrlib/_dirstate_helpers_pyx.c bzr-2.6.0~beta1/bzrlib/_dirstate_helpers_pyx.c --- bzr-2.5.0/bzrlib/_dirstate_helpers_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_dirstate_helpers_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:29 2012 */ +/* Generated by Cython 0.13 on Thu Oct 6 10:22:35 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -126,20 +126,15 @@ #define PyBytes_Repr PyString_Repr #define PyBytes_Concat PyString_Concat #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif + #ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - #if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) @@ -156,7 +151,7 @@ #endif #if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject + #define PyBoolObject PyLongObject #endif @@ -168,25 +163,6 @@ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif @@ -227,11 +203,6 @@ #include "string.h" #include "_static_tuple_c.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - - /* inline attribute */ #ifndef CYTHON_INLINE #if defined(__GNUC__) @@ -241,7 +212,7 @@ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else - #define CYTHON_INLINE + #define CYTHON_INLINE #endif #endif @@ -249,14 +220,14 @@ #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) # else -# define CYTHON_UNUSED +# define CYTHON_UNUSED # endif #endif @@ -281,7 +252,7 @@ #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -310,7 +281,7 @@ /* Type declarations */ -/* "bzrlib/_dirstate_helpers_pyx.pyx":1020 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1020 * * * cdef class ProcessEntryC: # <<<<<<<<<<<<<< @@ -362,7 +333,7 @@ PyObject *sha_file; }; -/* "bzrlib/_dirstate_helpers_pyx.pyx":532 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":532 * * * cdef class Reader: # <<<<<<<<<<<<<< @@ -383,7 +354,7 @@ }; -/* "bzrlib/_dirstate_helpers_pyx.pyx":1020 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1020 * * * cdef class ProcessEntryC: # <<<<<<<<<<<<<< @@ -404,7 +375,7 @@ static struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_vtabptr_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC; -/* "bzrlib/_dirstate_helpers_pyx.pyx":532 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":532 * * * cdef class Reader: # <<<<<<<<<<<<<< @@ -468,18 +439,13 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ +static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */ @@ -729,6 +695,11 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); @@ -801,7 +772,7 @@ static PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_to_kind(char); /*proto*/ static int __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(char); /*proto*/ #define __Pyx_MODULE_NAME "bzrlib._dirstate_helpers_pyx" -static int __pyx_module_is_main_bzrlib___dirstate_helpers_pyx = 0; +int __pyx_module_is_main_bzrlib___dirstate_helpers_pyx = 0; /* Implementation of bzrlib._dirstate_helpers_pyx */ static PyObject *__pyx_builtin_AssertionError; @@ -822,48 +793,57 @@ static char __pyx_k_8[] = "you must pass a python list for 'dirblocks' not: %s %r"; static char __pyx_k_9[] = "you must pass a string for dirname not: %s %r"; static char __pyx_k_10[] = "get_next() called when cur_str is NULL"; -static char __pyx_k_12[] = "get_next() called when there are no chars left"; -static char __pyx_k_14[] = "failed to find trailing NULL (\\0). Trailing garbage: %r"; -static char __pyx_k_15[] = "First character should be null not: %s"; -static char __pyx_k_16[] = "Bad parse, we expected to end on \\n, not: %d %s: %s"; -static char __pyx_k_17[] = "_num_present_parents"; -static char __pyx_k_18[] = "We read the wrong number of entries. We expected to read %s, but read %s"; -static char __pyx_k_19[] = "_split_root_dirblock_into_contents"; -static char __pyx_k_20[] = "IN_MEMORY_UNMODIFIED"; -static char __pyx_k_21[] = "_get_block_entry_index"; +static char __pyx_k_11[] = "get_next() called when there are no chars left"; +static char __pyx_k_12[] = "failed to find trailing NULL (\\0). Trailing garbage: %r"; +static char __pyx_k_13[] = "First character should be null not: %s"; +static char __pyx_k_14[] = "Bad parse, we expected to end on \\n, not: %d %s: %s"; +static char __pyx_k_15[] = "_num_present_parents"; +static char __pyx_k_16[] = "We read the wrong number of entries. We expected to read %s, but read %s"; +static char __pyx_k_17[] = "_split_root_dirblock_into_contents"; +static char __pyx_k_18[] = "IN_MEMORY_UNMODIFIED"; +static char __pyx_k_19[] = "_get_block_entry_index"; +static char __pyx_k_20[] = "searched_specific_files"; +static char __pyx_k_21[] = "searched_exact_paths"; static char __pyx_k_22[] = "use_filesystem_for_exec"; static char __pyx_k_23[] = "search_specific_files"; static char __pyx_k_24[] = "doing_consistency_expansion"; static char __pyx_k_25[] = "old_dirname_to_file_id"; static char __pyx_k_26[] = "new_dirname_to_file_id"; -static char __pyx_k_27[] = "searched_specific_files"; -static char __pyx_k_28[] = "searched_exact_paths"; -static char __pyx_k_29[] = "search_specific_file_parents"; -static char __pyx_k_30[] = "current_root_unicode"; -static char __pyx_k_31[] = "_pending_consistent_entries"; -static char __pyx_k_32[] = "unsupported target index"; -static char __pyx_k_34[] = "Unsupported target index %d"; -static char __pyx_k_36[] = "entry '%s/%s' is considered renamed from %r but source does not exist\nentry: %s"; -static char __pyx_k_37[] = "tree-reference"; -static char __pyx_k_39[] = "Could not find target parent in wt: %s\nparent of: %s"; -static char __pyx_k_40[] = "We could not find the parent entry in index %d for the entry: %s"; -static char __pyx_k_42[] = "don't know how to compare source_minikind=%r, target_minikind=%r"; -static char __pyx_k_46[] = "_gather_result_for_consistency"; -static char __pyx_k_48[] = "file_kind_from_stat_mode"; -static char __pyx_k_49[] = "_directory_is_tree_reference"; -static char __pyx_k_52[] = ".bzr"; -static char __pyx_k_54[] = "_find_block_index_from_key"; -static char __pyx_k_55[] = "_update_current_block"; -static char __pyx_k_58[] = "_next_consistent_entries"; -static char __pyx_k_60[] = "result is not None: %r"; -static char __pyx_k_62[] = "Missing entry for specific path parent %r, %r"; -static char __pyx_k_64[] = "Got entry<->path mismatch for specific path %r entry %r path_info %r "; -static char __pyx_k_65[] = "/"; -static char __pyx_k_68[] = "Helper functions for DirState.\n\nThis is the python implementation for DirState functions.\n"; -static char __pyx_k_69[] = "bzrlib.dirstate"; -static char __pyx_k_70[] = "bzrlib.osutils"; -static char __pyx_k_71[] = "bzrlib._dirstate_helpers_pyx"; -static char __pyx_k_72[] = "_cmp_path_by_dirblock"; +static char __pyx_k_27[] = "search_specific_file_parents"; +static char __pyx_k_28[] = "current_root_unicode"; +static char __pyx_k_29[] = "_pending_consistent_entries"; +static char __pyx_k_30[] = "unsupported target index"; +static char __pyx_k_31[] = "Unsupported target index %d"; +static char __pyx_k_32[] = "entry '%s/%s' is considered renamed from %r but source does not exist\nentry: %s"; +static char __pyx_k_33[] = "tree-reference"; +static char __pyx_k_34[] = "Could not find target parent in wt: %s\nparent of: %s"; +static char __pyx_k_35[] = "We could not find the parent entry in index %d for the entry: %s"; +static char __pyx_k_36[] = "don't know how to compare source_minikind=%r, target_minikind=%r"; +static char __pyx_k_37[] = "_gather_result_for_consistency"; +static char __pyx_k_38[] = "file_kind_from_stat_mode"; +static char __pyx_k_39[] = "_directory_is_tree_reference"; +static char __pyx_k_40[] = ".bzr"; +static char __pyx_k_41[] = "_find_block_index_from_key"; +static char __pyx_k_42[] = "_update_current_block"; +static char __pyx_k_43[] = "_next_consistent_entries"; +static char __pyx_k_44[] = "result is not None: %r"; +static char __pyx_k_45[] = "Missing entry for specific path parent %r, %r"; +static char __pyx_k_46[] = "Got entry<->path mismatch for specific path %r entry %r path_info %r "; +static char __pyx_k_47[] = "/"; +static char __pyx_k_48[] = "Helper functions for DirState.\n\nThis is the python implementation for DirState functions.\n"; +static char __pyx_k_49[] = "bzrlib.dirstate"; +static char __pyx_k_50[] = "bzrlib.osutils"; +static char __pyx_k_51[] = "_py_memrchr (line 142)"; +static char __pyx_k_52[] = "cmp_by_dirs (line 246)"; +static char __pyx_k_53[] = "_cmp_path_by_dirblock (line 275)"; +static char __pyx_k_54[] = "_cmp_path_by_dirblock"; +static char __pyx_k_55[] = "_bisect_path_left (line 377)"; +static char __pyx_k_56[] = "_bisect_path_right (line 430)"; +static char __pyx_k_57[] = "bisect_dirblock (line 483)"; +static char __pyx_k_58[] = "Reader._parse_dirblocks (line 731)"; +static char __pyx_k_59[] = "_read_dirblocks (line 779)"; +static char __pyx_k_60[] = "pack_stat (line 835)"; +static char __pyx_k_61[] = "update_entry (line 840)"; static char __pyx_k__a[] = "a"; static char __pyx_k__c[] = "c"; static char __pyx_k__d[] = "d"; @@ -902,9 +882,9 @@ static char __pyx_k__win32[] = "win32"; static char __pyx_k__EINVAL[] = "EINVAL"; static char __pyx_k__ENOENT[] = "ENOENT"; +static char __pyx_k__Reader[] = "Reader"; static char __pyx_k____ne__[] = "__ne__"; static char __pyx_k__absent[] = "absent"; -static char __pyx_k__append[] = "append"; static char __pyx_k__bisect[] = "bisect"; static char __pyx_k__bzrlib[] = "bzrlib"; static char __pyx_k__decode[] = "decode"; @@ -1027,12 +1007,14 @@ static char __pyx_k__NULL_PARENT_DETAILS[] = "NULL_PARENT_DETAILS"; static PyObject *__pyx_kp_s_1; static PyObject *__pyx_kp_s_10; +static PyObject *__pyx_kp_s_11; static PyObject *__pyx_kp_s_12; +static PyObject *__pyx_kp_s_13; static PyObject *__pyx_kp_s_14; -static PyObject *__pyx_kp_s_15; +static PyObject *__pyx_n_s_15; static PyObject *__pyx_kp_s_16; static PyObject *__pyx_n_s_17; -static PyObject *__pyx_kp_s_18; +static PyObject *__pyx_n_s_18; static PyObject *__pyx_n_s_19; static PyObject *__pyx_kp_s_2; static PyObject *__pyx_n_s_20; @@ -1046,34 +1028,41 @@ static PyObject *__pyx_n_s_28; static PyObject *__pyx_n_s_29; static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_n_s_30; -static PyObject *__pyx_n_s_31; +static PyObject *__pyx_kp_s_30; +static PyObject *__pyx_kp_s_31; static PyObject *__pyx_kp_s_32; +static PyObject *__pyx_kp_s_33; static PyObject *__pyx_kp_s_34; +static PyObject *__pyx_kp_s_35; static PyObject *__pyx_kp_s_36; -static PyObject *__pyx_kp_s_37; -static PyObject *__pyx_kp_s_39; +static PyObject *__pyx_n_s_37; +static PyObject *__pyx_n_s_38; +static PyObject *__pyx_n_s_39; static PyObject *__pyx_kp_s_4; static PyObject *__pyx_kp_s_40; -static PyObject *__pyx_kp_s_42; -static PyObject *__pyx_n_s_46; -static PyObject *__pyx_n_s_48; +static PyObject *__pyx_n_s_41; +static PyObject *__pyx_n_s_42; +static PyObject *__pyx_n_s_43; +static PyObject *__pyx_kp_s_44; +static PyObject *__pyx_kp_s_45; +static PyObject *__pyx_kp_s_46; +static PyObject *__pyx_kp_s_47; static PyObject *__pyx_n_s_49; static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_52; +static PyObject *__pyx_n_s_50; +static PyObject *__pyx_kp_u_51; +static PyObject *__pyx_kp_u_52; +static PyObject *__pyx_kp_u_53; static PyObject *__pyx_n_s_54; -static PyObject *__pyx_n_s_55; -static PyObject *__pyx_n_s_58; +static PyObject *__pyx_kp_u_55; +static PyObject *__pyx_kp_u_56; +static PyObject *__pyx_kp_u_57; +static PyObject *__pyx_kp_u_58; +static PyObject *__pyx_kp_u_59; static PyObject *__pyx_kp_s_6; -static PyObject *__pyx_kp_s_60; -static PyObject *__pyx_kp_s_62; -static PyObject *__pyx_kp_s_64; -static PyObject *__pyx_kp_s_65; -static PyObject *__pyx_n_s_69; +static PyObject *__pyx_kp_u_60; +static PyObject *__pyx_kp_u_61; static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_n_s_70; -static PyObject *__pyx_n_s_71; -static PyObject *__pyx_n_s_72; static PyObject *__pyx_kp_s_8; static PyObject *__pyx_kp_s_9; static PyObject *__pyx_n_s__AssertionError; @@ -1091,6 +1080,7 @@ static PyObject *__pyx_n_s__NULLSTAT; static PyObject *__pyx_n_s__NULL_PARENT_DETAILS; static PyObject *__pyx_n_s__OSError; +static PyObject *__pyx_n_s__Reader; static PyObject *__pyx_n_s__S_IEXEC; static PyObject *__pyx_n_s__S_ISREG; static PyObject *__pyx_n_s__StopIteration; @@ -1135,7 +1125,6 @@ static PyObject *__pyx_n_s__absent; static PyObject *__pyx_n_s__abspath; static PyObject *__pyx_n_s__add; -static PyObject *__pyx_n_s__append; static PyObject *__pyx_n_s__ar; static PyObject *__pyx_n_s__b2a_base64; static PyObject *__pyx_n_s__binascii; @@ -1239,28 +1228,8 @@ static PyObject *__pyx_n_s__winerror; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; -static PyObject *__pyx_k_tuple_11; -static PyObject *__pyx_k_tuple_13; -static PyObject *__pyx_k_tuple_33; -static PyObject *__pyx_k_tuple_35; -static PyObject *__pyx_k_tuple_38; -static PyObject *__pyx_k_tuple_41; -static PyObject *__pyx_k_tuple_43; -static PyObject *__pyx_k_tuple_44; -static PyObject *__pyx_k_tuple_45; -static PyObject *__pyx_k_tuple_47; -static PyObject *__pyx_k_tuple_50; -static PyObject *__pyx_k_tuple_51; -static PyObject *__pyx_k_tuple_53; -static PyObject *__pyx_k_tuple_56; -static PyObject *__pyx_k_tuple_57; -static PyObject *__pyx_k_tuple_59; -static PyObject *__pyx_k_tuple_61; -static PyObject *__pyx_k_tuple_63; -static PyObject *__pyx_k_tuple_66; -static PyObject *__pyx_k_tuple_67; -/* "bzrlib/_dirstate_helpers_pyx.pyx":128 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":128 * import_static_tuple_c() * * cdef void* _my_memrchr(void *s, int c, size_t n): # cannot_raise # <<<<<<<<<<<<<< @@ -1275,7 +1244,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("_my_memrchr"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":133 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":133 * cdef char *start * * start = s # <<<<<<<<<<<<<< @@ -1284,7 +1253,7 @@ */ __pyx_v_start = ((char *)__pyx_v_s); - /* "bzrlib/_dirstate_helpers_pyx.pyx":134 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":134 * * start = s * pos = start + n - 1 # <<<<<<<<<<<<<< @@ -1293,7 +1262,7 @@ */ __pyx_v_pos = ((__pyx_v_start + __pyx_v_n) - 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":135 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":135 * start = s * pos = start + n - 1 * while pos >= start: # <<<<<<<<<<<<<< @@ -1304,7 +1273,7 @@ __pyx_t_1 = (__pyx_v_pos >= __pyx_v_start); if (!__pyx_t_1) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":136 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":136 * pos = start + n - 1 * while pos >= start: * if pos[0] == c: # <<<<<<<<<<<<<< @@ -1314,7 +1283,7 @@ __pyx_t_1 = ((__pyx_v_pos[0]) == __pyx_v_c); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":137 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":137 * while pos >= start: * if pos[0] == c: * return pos # <<<<<<<<<<<<<< @@ -1327,7 +1296,7 @@ } __pyx_L5:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":138 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":138 * if pos[0] == c: * return pos * pos = pos - 1 # <<<<<<<<<<<<<< @@ -1337,7 +1306,7 @@ __pyx_v_pos = (__pyx_v_pos - 1); } - /* "bzrlib/_dirstate_helpers_pyx.pyx":139 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":139 * return pos * pos = pos - 1 * return NULL # <<<<<<<<<<<<<< @@ -1353,7 +1322,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":142 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":142 * * * def _py_memrchr(s, c): # <<<<<<<<<<<<<< @@ -1363,7 +1332,6 @@ static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__py_memrchr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx__py_memrchr[] = "Just to expose _my_memrchr for testing.\n\n :param s: The Python string to search\n :param c: The character to search for\n :return: The offset to the last instance of 'c' in s\n "; -static PyMethodDef __pyx_mdef_6bzrlib_21_dirstate_helpers_pyx__py_memrchr = {__Pyx_NAMESTR("_py_memrchr"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__py_memrchr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx__py_memrchr)}; static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__py_memrchr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_s = 0; PyObject *__pyx_v_c = 0; @@ -1419,7 +1387,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":154 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":154 * cdef char *_c * * _s = PyString_AsString(s) # <<<<<<<<<<<<<< @@ -1428,7 +1396,7 @@ */ __pyx_v__s = PyString_AsString(__pyx_v_s); - /* "bzrlib/_dirstate_helpers_pyx.pyx":155 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":155 * * _s = PyString_AsString(s) * length = PyString_Size(s) # <<<<<<<<<<<<<< @@ -1437,7 +1405,7 @@ */ __pyx_v_length = PyString_Size(__pyx_v_s); - /* "bzrlib/_dirstate_helpers_pyx.pyx":157 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":157 * length = PyString_Size(s) * * _c = PyString_AsString(c) # <<<<<<<<<<<<<< @@ -1446,17 +1414,17 @@ */ __pyx_v__c = PyString_AsString(__pyx_v_c); - /* "bzrlib/_dirstate_helpers_pyx.pyx":158 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":158 * * _c = PyString_AsString(c) * assert PyString_Size(c) == 1,\ # <<<<<<<<<<<<<< * 'Must be a single character string, not %s' % (c,) * found = _my_memrchr(_s, _c[0], length) */ - #ifndef CYTHON_WITHOUT_ASSERTIONS + #ifndef PYREX_WITHOUT_ASSERTIONS if (unlikely(!(PyString_Size(__pyx_v_c) == 1))) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":159 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":159 * _c = PyString_AsString(c) * assert PyString_Size(c) == 1,\ * 'Must be a single character string, not %s' % (c,) # <<<<<<<<<<<<<< @@ -1464,20 +1432,20 @@ * if found == NULL: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_c); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_c); __Pyx_GIVEREF(__pyx_v_c); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_t_2)); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #endif - /* "bzrlib/_dirstate_helpers_pyx.pyx":160 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":160 * assert PyString_Size(c) == 1,\ * 'Must be a single character string, not %s' % (c,) * found = _my_memrchr(_s, _c[0], length) # <<<<<<<<<<<<<< @@ -1486,7 +1454,7 @@ */ __pyx_v_found = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__my_memrchr(__pyx_v__s, (__pyx_v__c[0]), __pyx_v_length); - /* "bzrlib/_dirstate_helpers_pyx.pyx":161 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":161 * 'Must be a single character string, not %s' % (c,) * found = _my_memrchr(_s, _c[0], length) * if found == NULL: # <<<<<<<<<<<<<< @@ -1496,7 +1464,7 @@ __pyx_t_3 = (__pyx_v_found == NULL); if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":162 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":162 * found = _my_memrchr(_s, _c[0], length) * if found == NULL: * return None # <<<<<<<<<<<<<< @@ -1511,7 +1479,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":163 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":163 * if found == NULL: * return None * return found - _s # <<<<<<<<<<<<<< @@ -1538,7 +1506,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":166 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":166 * * * cdef object safe_string_from_size(char *s, Py_ssize_t size): # <<<<<<<<<<<<<< @@ -1553,7 +1521,7 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("safe_string_from_size"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":167 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":167 * * cdef object safe_string_from_size(char *s, Py_ssize_t size): * if size < 0: # <<<<<<<<<<<<<< @@ -1563,7 +1531,7 @@ __pyx_t_1 = (__pyx_v_size < 0); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":170 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":170 * raise AssertionError( * 'tried to create a string with an invalid size: %d' * % (size)) # <<<<<<<<<<<<<< @@ -1576,13 +1544,13 @@ __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1590,7 +1558,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":171 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":171 * 'tried to create a string with an invalid size: %d' * % (size)) * return PyString_FromStringAndSize(s, size) # <<<<<<<<<<<<<< @@ -1617,7 +1585,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":174 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":174 * * * cdef int _is_aligned(void *ptr): # cannot_raise # <<<<<<<<<<<<<< @@ -1629,7 +1597,7 @@ int __pyx_r; __Pyx_RefNannySetupContext("_is_aligned"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":179 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":179 * :return: 1 if this pointer is aligned, 0 otherwise. * """ * return ((ptr) & ((sizeof(int))-1)) == 0 # <<<<<<<<<<<<<< @@ -1645,7 +1613,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":182 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":182 * * * cdef int _cmp_by_dirs(char *path1, int size1, char *path2, int size2): # cannot_raise # <<<<<<<<<<<<<< @@ -1671,7 +1639,7 @@ size_t __pyx_t_6; __Pyx_RefNannySetupContext("_cmp_by_dirs"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":192 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":192 * cdef int *end_int2 * * if path1 == path2 and size1 == size2: # <<<<<<<<<<<<<< @@ -1687,7 +1655,7 @@ } if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":193 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":193 * * if path1 == path2 and size1 == size2: * return 0 # <<<<<<<<<<<<<< @@ -1700,7 +1668,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":195 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":195 * return 0 * * end1 = path1+size1 # <<<<<<<<<<<<<< @@ -1709,7 +1677,7 @@ */ __pyx_v_end1 = (((unsigned char *)__pyx_v_path1) + __pyx_v_size1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":196 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":196 * * end1 = path1+size1 * end2 = path2+size2 # <<<<<<<<<<<<<< @@ -1718,7 +1686,7 @@ */ __pyx_v_end2 = (((unsigned char *)__pyx_v_path2) + __pyx_v_size2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":203 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":203 * # 99% of the time, these will be aligned, but in case they aren't just skip * # this loop * if _is_aligned(path1) and _is_aligned(path2): # <<<<<<<<<<<<<< @@ -1734,7 +1702,7 @@ } if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":204 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":204 * # this loop * if _is_aligned(path1) and _is_aligned(path2): * cur_int1 = path1 # <<<<<<<<<<<<<< @@ -1743,7 +1711,7 @@ */ __pyx_v_cur_int1 = ((int *)__pyx_v_path1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":205 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":205 * if _is_aligned(path1) and _is_aligned(path2): * cur_int1 = path1 * cur_int2 = path2 # <<<<<<<<<<<<<< @@ -1752,7 +1720,7 @@ */ __pyx_v_cur_int2 = ((int *)__pyx_v_path2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":206 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":206 * cur_int1 = path1 * cur_int2 = path2 * end_int1 = (path1 + size1 - (size1 % sizeof(int))) # <<<<<<<<<<<<<< @@ -1766,7 +1734,7 @@ } __pyx_v_end_int1 = ((int *)((__pyx_v_path1 + __pyx_v_size1) - (__pyx_v_size1 % __pyx_t_6))); - /* "bzrlib/_dirstate_helpers_pyx.pyx":207 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":207 * cur_int2 = path2 * end_int1 = (path1 + size1 - (size1 % sizeof(int))) * end_int2 = (path2 + size2 - (size2 % sizeof(int))) # <<<<<<<<<<<<<< @@ -1780,7 +1748,7 @@ } __pyx_v_end_int2 = ((int *)((__pyx_v_path2 + __pyx_v_size2) - (__pyx_v_size2 % __pyx_t_6))); - /* "bzrlib/_dirstate_helpers_pyx.pyx":209 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":209 * end_int2 = (path2 + size2 - (size2 % sizeof(int))) * * while cur_int1 < end_int1 and cur_int2 < end_int2: # <<<<<<<<<<<<<< @@ -1797,7 +1765,7 @@ } if (!__pyx_t_2) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":210 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":210 * * while cur_int1 < end_int1 and cur_int2 < end_int2: * if cur_int1[0] != cur_int2[0]: # <<<<<<<<<<<<<< @@ -1807,7 +1775,7 @@ __pyx_t_2 = ((__pyx_v_cur_int1[0]) != (__pyx_v_cur_int2[0])); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":211 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":211 * while cur_int1 < end_int1 and cur_int2 < end_int2: * if cur_int1[0] != cur_int2[0]: * break # <<<<<<<<<<<<<< @@ -1819,7 +1787,7 @@ } __pyx_L7:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":212 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":212 * if cur_int1[0] != cur_int2[0]: * break * cur_int1 = cur_int1 + 1 # <<<<<<<<<<<<<< @@ -1828,7 +1796,7 @@ */ __pyx_v_cur_int1 = (__pyx_v_cur_int1 + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":213 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":213 * break * cur_int1 = cur_int1 + 1 * cur_int2 = cur_int2 + 1 # <<<<<<<<<<<<<< @@ -1839,7 +1807,7 @@ } __pyx_L6_break:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":215 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":215 * cur_int2 = cur_int2 + 1 * * cur1 = cur_int1 # <<<<<<<<<<<<<< @@ -1848,7 +1816,7 @@ */ __pyx_v_cur1 = ((unsigned char *)__pyx_v_cur_int1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":216 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":216 * * cur1 = cur_int1 * cur2 = cur_int2 # <<<<<<<<<<<<<< @@ -1860,7 +1828,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":218 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":218 * cur2 = cur_int2 * else: * cur1 = path1 # <<<<<<<<<<<<<< @@ -1869,7 +1837,7 @@ */ __pyx_v_cur1 = ((unsigned char *)__pyx_v_path1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":219 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":219 * else: * cur1 = path1 * cur2 = path2 # <<<<<<<<<<<<<< @@ -1880,7 +1848,7 @@ } __pyx_L4:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":221 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":221 * cur2 = path2 * * while cur1 < end1 and cur2 < end2: # <<<<<<<<<<<<<< @@ -1897,7 +1865,7 @@ } if (!__pyx_t_1) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":222 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":222 * * while cur1 < end1 and cur2 < end2: * if cur1[0] == cur2[0]: # <<<<<<<<<<<<<< @@ -1907,7 +1875,7 @@ __pyx_t_1 = ((__pyx_v_cur1[0]) == (__pyx_v_cur2[0])); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":224 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":224 * if cur1[0] == cur2[0]: * # This character matches, just go to the next one * cur1 = cur1 + 1 # <<<<<<<<<<<<<< @@ -1916,7 +1884,7 @@ */ __pyx_v_cur1 = (__pyx_v_cur1 + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":225 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":225 * # This character matches, just go to the next one * cur1 = cur1 + 1 * cur2 = cur2 + 1 # <<<<<<<<<<<<<< @@ -1925,7 +1893,7 @@ */ __pyx_v_cur2 = (__pyx_v_cur2 + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":226 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":226 * cur1 = cur1 + 1 * cur2 = cur2 + 1 * continue # <<<<<<<<<<<<<< @@ -1937,7 +1905,7 @@ } __pyx_L10:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":228 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":228 * continue * # The current characters do not match * if cur1[0] == c'/': # <<<<<<<<<<<<<< @@ -1947,7 +1915,7 @@ __pyx_t_1 = ((__pyx_v_cur1[0]) == '/'); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":229 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":229 * # The current characters do not match * if cur1[0] == c'/': * return -1 # Reached the end of path1 segment first # <<<<<<<<<<<<<< @@ -1959,7 +1927,7 @@ goto __pyx_L11; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":230 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":230 * if cur1[0] == c'/': * return -1 # Reached the end of path1 segment first * elif cur2[0] == c'/': # <<<<<<<<<<<<<< @@ -1969,7 +1937,7 @@ __pyx_t_1 = ((__pyx_v_cur2[0]) == '/'); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":231 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":231 * return -1 # Reached the end of path1 segment first * elif cur2[0] == c'/': * return 1 # Reached the end of path2 segment first # <<<<<<<<<<<<<< @@ -1981,7 +1949,7 @@ goto __pyx_L11; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":232 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":232 * elif cur2[0] == c'/': * return 1 # Reached the end of path2 segment first * elif cur1[0] < cur2[0]: # <<<<<<<<<<<<<< @@ -1991,7 +1959,7 @@ __pyx_t_1 = ((__pyx_v_cur1[0]) < (__pyx_v_cur2[0])); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":233 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":233 * return 1 # Reached the end of path2 segment first * elif cur1[0] < cur2[0]: * return -1 # <<<<<<<<<<<<<< @@ -2004,7 +1972,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":235 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":235 * return -1 * else: * return 1 # <<<<<<<<<<<<<< @@ -2018,7 +1986,7 @@ __pyx_L8_continue:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":238 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":238 * * # We reached the end of at least one of the strings * if cur1 < end1: # <<<<<<<<<<<<<< @@ -2028,7 +1996,7 @@ __pyx_t_1 = (__pyx_v_cur1 < __pyx_v_end1); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":239 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":239 * # We reached the end of at least one of the strings * if cur1 < end1: * return 1 # Not at the end of cur1, must be at the end of cur2 # <<<<<<<<<<<<<< @@ -2041,7 +2009,7 @@ } __pyx_L12:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":240 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":240 * if cur1 < end1: * return 1 # Not at the end of cur1, must be at the end of cur2 * if cur2 < end2: # <<<<<<<<<<<<<< @@ -2051,7 +2019,7 @@ __pyx_t_1 = (__pyx_v_cur2 < __pyx_v_end2); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":241 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":241 * return 1 # Not at the end of cur1, must be at the end of cur2 * if cur2 < end2: * return -1 # At the end of cur1, but not at cur2 # <<<<<<<<<<<<<< @@ -2064,7 +2032,7 @@ } __pyx_L13:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":243 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":243 * return -1 # At the end of cur1, but not at cur2 * # We reached the end of both strings * return 0 # <<<<<<<<<<<<<< @@ -2084,7 +2052,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":246 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":246 * * * def cmp_by_dirs(path1, path2): # <<<<<<<<<<<<<< @@ -2092,10 +2060,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_1cmp_by_dirs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_1cmp_by_dirs[] = "Compare two paths directory by directory.\n\n This is equivalent to doing::\n\n cmp(path1.split('/'), path2.split('/'))\n\n The idea is that you should compare path components separately. This\n differs from plain ``cmp(path1, path2)`` for paths like ``'a-b'`` and\n ``a/b``. \"a-b\" comes after \"a\" but would come before \"a/b\" lexically.\n\n :param path1: first path\n :param path2: second path\n :return: negative number if ``path1`` comes first,\n 0 if paths are equal,\n and positive number if ``path2`` sorts first\n "; -static PyMethodDef __pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_1cmp_by_dirs = {__Pyx_NAMESTR("cmp_by_dirs"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_1cmp_by_dirs, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_1cmp_by_dirs)}; -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_1cmp_by_dirs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_cmp_by_dirs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_cmp_by_dirs[] = "Compare two paths directory by directory.\n\n This is equivalent to doing::\n\n cmp(path1.split('/'), path2.split('/'))\n\n The idea is that you should compare path components separately. This\n differs from plain ``cmp(path1, path2)`` for paths like ``'a-b'`` and\n ``a/b``. \"a-b\" comes after \"a\" but would come before \"a/b\" lexically.\n\n :param path1: first path\n :param path2: second path\n :return: negative number if ``path1`` comes first,\n 0 if paths are equal,\n and positive number if ``path2`` sorts first\n "; +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_cmp_by_dirs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_path1 = 0; PyObject *__pyx_v_path2 = 0; PyObject *__pyx_r = NULL; @@ -2146,7 +2113,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":263 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":263 * and positive number if ``path2`` sorts first * """ * if not PyString_CheckExact(path1): # <<<<<<<<<<<<<< @@ -2156,7 +2123,7 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path1)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":265 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":265 * if not PyString_CheckExact(path1): * raise TypeError("'path1' must be a plain string, not %s: %r" * % (type(path1), path1)) # <<<<<<<<<<<<<< @@ -2164,24 +2131,24 @@ * raise TypeError("'path2' must be a plain string, not %s: %r" */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_path1))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(__pyx_v_path1))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_path1))); __Pyx_INCREF(__pyx_v_path1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path1); __Pyx_GIVEREF(__pyx_v_path1); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2189,7 +2156,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":266 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":266 * raise TypeError("'path1' must be a plain string, not %s: %r" * % (type(path1), path1)) * if not PyString_CheckExact(path2): # <<<<<<<<<<<<<< @@ -2199,7 +2166,7 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path2)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":268 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":268 * if not PyString_CheckExact(path2): * raise TypeError("'path2' must be a plain string, not %s: %r" * % (type(path2), path2)) # <<<<<<<<<<<<<< @@ -2207,24 +2174,24 @@ * PyString_Size(path1), */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_path2))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(__pyx_v_path2))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_path2))); __Pyx_INCREF(__pyx_v_path2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path2); __Pyx_GIVEREF(__pyx_v_path2); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2232,7 +2199,7 @@ } __pyx_L7:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":269 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":269 * raise TypeError("'path2' must be a plain string, not %s: %r" * % (type(path2), path2)) * return _cmp_by_dirs(PyString_AsString(path1), # <<<<<<<<<<<<<< @@ -2241,7 +2208,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "bzrlib/_dirstate_helpers_pyx.pyx":272 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":272 * PyString_Size(path1), * PyString_AsString(path2), * PyString_Size(path2)) # <<<<<<<<<<<<<< @@ -2267,7 +2234,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":275 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":275 * * * def _cmp_path_by_dirblock(path1, path2): # <<<<<<<<<<<<<< @@ -2275,10 +2242,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_2_cmp_path_by_dirblock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_2_cmp_path_by_dirblock[] = "Compare two paths based on what directory they are in.\n\n This generates a sort order, such that all children of a directory are\n sorted together, and grandchildren are in the same order as the\n children appear. But all grandchildren come after all children.\n\n In other words, all entries in a directory are sorted together, and\n directorys are sorted in cmp_by_dirs order.\n\n :param path1: first path\n :param path2: the second path\n :return: negative number if ``path1`` comes first,\n 0 if paths are equal\n and a positive number if ``path2`` sorts first\n "; -static PyMethodDef __pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_2_cmp_path_by_dirblock = {__Pyx_NAMESTR("_cmp_path_by_dirblock"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_2_cmp_path_by_dirblock, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_2_cmp_path_by_dirblock)}; -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_2_cmp_path_by_dirblock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__cmp_path_by_dirblock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx__cmp_path_by_dirblock[] = "Compare two paths based on what directory they are in.\n\n This generates a sort order, such that all children of a directory are\n sorted together, and grandchildren are in the same order as the\n children appear. But all grandchildren come after all children.\n\n In other words, all entries in a directory are sorted together, and\n directorys are sorted in cmp_by_dirs order.\n\n :param path1: first path\n :param path2: the second path\n :return: negative number if ``path1`` comes first,\n 0 if paths are equal\n and a positive number if ``path2`` sorts first\n "; +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__cmp_path_by_dirblock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_path1 = 0; PyObject *__pyx_v_path2 = 0; PyObject *__pyx_r = NULL; @@ -2329,7 +2295,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":291 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":291 * and a positive number if ``path2`` sorts first * """ * if not PyString_CheckExact(path1): # <<<<<<<<<<<<<< @@ -2339,7 +2305,7 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path1)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":293 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":293 * if not PyString_CheckExact(path1): * raise TypeError("'path1' must be a plain string, not %s: %r" * % (type(path1), path1)) # <<<<<<<<<<<<<< @@ -2347,24 +2313,24 @@ * raise TypeError("'path2' must be a plain string, not %s: %r" */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_path1))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(__pyx_v_path1))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_path1))); __Pyx_INCREF(__pyx_v_path1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path1); __Pyx_GIVEREF(__pyx_v_path1); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2372,7 +2338,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":294 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":294 * raise TypeError("'path1' must be a plain string, not %s: %r" * % (type(path1), path1)) * if not PyString_CheckExact(path2): # <<<<<<<<<<<<<< @@ -2382,7 +2348,7 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path2)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":296 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":296 * if not PyString_CheckExact(path2): * raise TypeError("'path2' must be a plain string, not %s: %r" * % (type(path2), path2)) # <<<<<<<<<<<<<< @@ -2390,24 +2356,24 @@ * PyString_Size(path1), */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_path2))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(__pyx_v_path2))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_path2))); __Pyx_INCREF(__pyx_v_path2); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path2); __Pyx_GIVEREF(__pyx_v_path2); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -2415,7 +2381,7 @@ } __pyx_L7:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":297 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":297 * raise TypeError("'path2' must be a plain string, not %s: %r" * % (type(path2), path2)) * return _cmp_path_by_dirblock_intern(PyString_AsString(path1), # <<<<<<<<<<<<<< @@ -2424,7 +2390,7 @@ */ __Pyx_XDECREF(__pyx_r); - /* "bzrlib/_dirstate_helpers_pyx.pyx":300 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":300 * PyString_Size(path1), * PyString_AsString(path2), * PyString_Size(path2)) # <<<<<<<<<<<<<< @@ -2450,7 +2416,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":303 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":303 * * * cdef int _cmp_path_by_dirblock_intern(char *path1, int path1_len, # <<<<<<<<<<<<<< @@ -2475,7 +2441,7 @@ int __pyx_t_3; __Pyx_RefNannySetupContext("_cmp_path_by_dirblock_intern"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":320 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":320 * cdef int cmp_val * * if path1_len == 0 and path2_len == 0: # <<<<<<<<<<<<<< @@ -2491,7 +2457,7 @@ } if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":321 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":321 * * if path1_len == 0 and path2_len == 0: * return 0 # <<<<<<<<<<<<<< @@ -2504,7 +2470,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":323 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":323 * return 0 * * if path1 == path2 and path1_len == path2_len: # <<<<<<<<<<<<<< @@ -2520,7 +2486,7 @@ } if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":324 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":324 * * if path1 == path2 and path1_len == path2_len: * return 0 # <<<<<<<<<<<<<< @@ -2533,7 +2499,7 @@ } __pyx_L4:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":326 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":326 * return 0 * * if path1_len == 0: # <<<<<<<<<<<<<< @@ -2543,7 +2509,7 @@ __pyx_t_2 = (__pyx_v_path1_len == 0); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":327 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":327 * * if path1_len == 0: * return -1 # <<<<<<<<<<<<<< @@ -2556,7 +2522,7 @@ } __pyx_L5:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":329 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":329 * return -1 * * if path2_len == 0: # <<<<<<<<<<<<<< @@ -2566,7 +2532,7 @@ __pyx_t_2 = (__pyx_v_path2_len == 0); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":330 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":330 * * if path2_len == 0: * return 1 # <<<<<<<<<<<<<< @@ -2579,7 +2545,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":332 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":332 * return 1 * * basename1 = _my_memrchr(path1, c'/', path1_len) # <<<<<<<<<<<<<< @@ -2588,7 +2554,7 @@ */ __pyx_v_basename1 = ((char *)__pyx_f_6bzrlib_21_dirstate_helpers_pyx__my_memrchr(__pyx_v_path1, '/', __pyx_v_path1_len)); - /* "bzrlib/_dirstate_helpers_pyx.pyx":334 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":334 * basename1 = _my_memrchr(path1, c'/', path1_len) * * if basename1 == NULL: # <<<<<<<<<<<<<< @@ -2598,7 +2564,7 @@ __pyx_t_2 = (__pyx_v_basename1 == NULL); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":335 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":335 * * if basename1 == NULL: * basename1 = path1 # <<<<<<<<<<<<<< @@ -2607,7 +2573,7 @@ */ __pyx_v_basename1 = __pyx_v_path1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":336 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":336 * if basename1 == NULL: * basename1 = path1 * basename1_len = path1_len # <<<<<<<<<<<<<< @@ -2616,7 +2582,7 @@ */ __pyx_v_basename1_len = __pyx_v_path1_len; - /* "bzrlib/_dirstate_helpers_pyx.pyx":337 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":337 * basename1 = path1 * basename1_len = path1_len * dirname1 = '' # <<<<<<<<<<<<<< @@ -2625,7 +2591,7 @@ */ __pyx_v_dirname1 = __pyx_k_5; - /* "bzrlib/_dirstate_helpers_pyx.pyx":338 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":338 * basename1_len = path1_len * dirname1 = '' * dirname1_len = 0 # <<<<<<<<<<<<<< @@ -2637,7 +2603,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":340 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":340 * dirname1_len = 0 * else: * dirname1 = path1 # <<<<<<<<<<<<<< @@ -2646,7 +2612,7 @@ */ __pyx_v_dirname1 = __pyx_v_path1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":341 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":341 * else: * dirname1 = path1 * dirname1_len = basename1 - path1 # <<<<<<<<<<<<<< @@ -2655,7 +2621,7 @@ */ __pyx_v_dirname1_len = (__pyx_v_basename1 - __pyx_v_path1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":342 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":342 * dirname1 = path1 * dirname1_len = basename1 - path1 * basename1 = basename1 + 1 # <<<<<<<<<<<<<< @@ -2664,7 +2630,7 @@ */ __pyx_v_basename1 = (__pyx_v_basename1 + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":343 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":343 * dirname1_len = basename1 - path1 * basename1 = basename1 + 1 * basename1_len = path1_len - dirname1_len - 1 # <<<<<<<<<<<<<< @@ -2675,7 +2641,7 @@ } __pyx_L7:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":345 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":345 * basename1_len = path1_len - dirname1_len - 1 * * basename2 = _my_memrchr(path2, c'/', path2_len) # <<<<<<<<<<<<<< @@ -2684,7 +2650,7 @@ */ __pyx_v_basename2 = ((char *)__pyx_f_6bzrlib_21_dirstate_helpers_pyx__my_memrchr(__pyx_v_path2, '/', __pyx_v_path2_len)); - /* "bzrlib/_dirstate_helpers_pyx.pyx":347 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":347 * basename2 = _my_memrchr(path2, c'/', path2_len) * * if basename2 == NULL: # <<<<<<<<<<<<<< @@ -2694,7 +2660,7 @@ __pyx_t_2 = (__pyx_v_basename2 == NULL); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":348 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":348 * * if basename2 == NULL: * basename2 = path2 # <<<<<<<<<<<<<< @@ -2703,7 +2669,7 @@ */ __pyx_v_basename2 = __pyx_v_path2; - /* "bzrlib/_dirstate_helpers_pyx.pyx":349 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":349 * if basename2 == NULL: * basename2 = path2 * basename2_len = path2_len # <<<<<<<<<<<<<< @@ -2712,7 +2678,7 @@ */ __pyx_v_basename2_len = __pyx_v_path2_len; - /* "bzrlib/_dirstate_helpers_pyx.pyx":350 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":350 * basename2 = path2 * basename2_len = path2_len * dirname2 = '' # <<<<<<<<<<<<<< @@ -2721,7 +2687,7 @@ */ __pyx_v_dirname2 = __pyx_k_5; - /* "bzrlib/_dirstate_helpers_pyx.pyx":351 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":351 * basename2_len = path2_len * dirname2 = '' * dirname2_len = 0 # <<<<<<<<<<<<<< @@ -2733,7 +2699,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":353 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":353 * dirname2_len = 0 * else: * dirname2 = path2 # <<<<<<<<<<<<<< @@ -2742,7 +2708,7 @@ */ __pyx_v_dirname2 = __pyx_v_path2; - /* "bzrlib/_dirstate_helpers_pyx.pyx":354 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":354 * else: * dirname2 = path2 * dirname2_len = basename2 - path2 # <<<<<<<<<<<<<< @@ -2751,7 +2717,7 @@ */ __pyx_v_dirname2_len = (__pyx_v_basename2 - __pyx_v_path2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":355 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":355 * dirname2 = path2 * dirname2_len = basename2 - path2 * basename2 = basename2 + 1 # <<<<<<<<<<<<<< @@ -2760,7 +2726,7 @@ */ __pyx_v_basename2 = (__pyx_v_basename2 + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":356 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":356 * dirname2_len = basename2 - path2 * basename2 = basename2 + 1 * basename2_len = path2_len - dirname2_len - 1 # <<<<<<<<<<<<<< @@ -2771,7 +2737,7 @@ } __pyx_L8:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":359 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":359 * * cmp_val = _cmp_by_dirs(dirname1, dirname1_len, * dirname2, dirname2_len) # <<<<<<<<<<<<<< @@ -2780,7 +2746,7 @@ */ __pyx_v_cmp_val = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_by_dirs(__pyx_v_dirname1, __pyx_v_dirname1_len, __pyx_v_dirname2, __pyx_v_dirname2_len); - /* "bzrlib/_dirstate_helpers_pyx.pyx":360 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":360 * cmp_val = _cmp_by_dirs(dirname1, dirname1_len, * dirname2, dirname2_len) * if cmp_val != 0: # <<<<<<<<<<<<<< @@ -2790,7 +2756,7 @@ __pyx_t_2 = (__pyx_v_cmp_val != 0); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":361 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":361 * dirname2, dirname2_len) * if cmp_val != 0: * return cmp_val # <<<<<<<<<<<<<< @@ -2803,7 +2769,7 @@ } __pyx_L9:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":363 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":363 * return cmp_val * * cur_len = basename1_len # <<<<<<<<<<<<<< @@ -2812,7 +2778,7 @@ */ __pyx_v_cur_len = __pyx_v_basename1_len; - /* "bzrlib/_dirstate_helpers_pyx.pyx":364 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":364 * * cur_len = basename1_len * if basename2_len < basename1_len: # <<<<<<<<<<<<<< @@ -2822,7 +2788,7 @@ __pyx_t_2 = (__pyx_v_basename2_len < __pyx_v_basename1_len); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":365 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":365 * cur_len = basename1_len * if basename2_len < basename1_len: * cur_len = basename2_len # <<<<<<<<<<<<<< @@ -2834,7 +2800,7 @@ } __pyx_L10:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":367 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":367 * cur_len = basename2_len * * cmp_val = memcmp(basename1, basename2, cur_len) # <<<<<<<<<<<<<< @@ -2843,7 +2809,7 @@ */ __pyx_v_cmp_val = memcmp(__pyx_v_basename1, __pyx_v_basename2, __pyx_v_cur_len); - /* "bzrlib/_dirstate_helpers_pyx.pyx":368 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":368 * * cmp_val = memcmp(basename1, basename2, cur_len) * if cmp_val != 0: # <<<<<<<<<<<<<< @@ -2853,7 +2819,7 @@ __pyx_t_2 = (__pyx_v_cmp_val != 0); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":369 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":369 * cmp_val = memcmp(basename1, basename2, cur_len) * if cmp_val != 0: * return cmp_val # <<<<<<<<<<<<<< @@ -2866,7 +2832,7 @@ } __pyx_L11:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":370 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":370 * if cmp_val != 0: * return cmp_val * if basename1_len == basename2_len: # <<<<<<<<<<<<<< @@ -2876,7 +2842,7 @@ __pyx_t_2 = (__pyx_v_basename1_len == __pyx_v_basename2_len); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":371 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":371 * return cmp_val * if basename1_len == basename2_len: * return 0 # <<<<<<<<<<<<<< @@ -2889,7 +2855,7 @@ } __pyx_L12:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":372 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":372 * if basename1_len == basename2_len: * return 0 * if basename1_len < basename2_len: # <<<<<<<<<<<<<< @@ -2899,7 +2865,7 @@ __pyx_t_2 = (__pyx_v_basename1_len < __pyx_v_basename2_len); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":373 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":373 * return 0 * if basename1_len < basename2_len: * return -1 # <<<<<<<<<<<<<< @@ -2912,7 +2878,7 @@ } __pyx_L13:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":374 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":374 * if basename1_len < basename2_len: * return -1 * return 1 # <<<<<<<<<<<<<< @@ -2928,7 +2894,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":377 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":377 * * * def _bisect_path_left(paths, path): # <<<<<<<<<<<<<< @@ -2936,10 +2902,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_3_bisect_path_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_3_bisect_path_left[] = "Return the index where to insert path into paths.\n\n This uses a path-wise comparison so we get::\n a\n a-b\n a=b\n a/b\n Rather than::\n a\n a-b\n a/b\n a=b\n :param paths: A list of paths to search through\n :param path: A single path to insert\n :return: An offset where 'path' can be inserted.\n :seealso: bisect.bisect_left\n "; -static PyMethodDef __pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_3_bisect_path_left = {__Pyx_NAMESTR("_bisect_path_left"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_3_bisect_path_left, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_3_bisect_path_left)}; -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_3_bisect_path_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__bisect_path_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx__bisect_path_left[] = "Return the index where to insert path into paths.\n\n This uses a path-wise comparison so we get::\n a\n a-b\n a=b\n a/b\n Rather than::\n a\n a-b\n a/b\n a=b\n :param paths: A list of paths to search through\n :param path: A single path to insert\n :return: An offset where 'path' can be inserted.\n :seealso: bisect.bisect_left\n "; +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__bisect_path_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_paths = 0; PyObject *__pyx_v_path = 0; int __pyx_v__lo; @@ -2999,7 +2964,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":404 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":404 * cdef void *cur * * if not PyList_CheckExact(paths): # <<<<<<<<<<<<<< @@ -3009,7 +2974,7 @@ __pyx_t_1 = (!PyList_CheckExact(__pyx_v_paths)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":406 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":406 * if not PyList_CheckExact(paths): * raise TypeError("you must pass a python list for 'paths' not: %s %r" * % (type(paths), paths)) # <<<<<<<<<<<<<< @@ -3017,24 +2982,24 @@ * raise TypeError("you must pass a string for 'path' not: %s %r" */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_paths))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(__pyx_v_paths))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_paths))); __Pyx_INCREF(__pyx_v_paths); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_paths); __Pyx_GIVEREF(__pyx_v_paths); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3042,7 +3007,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":407 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":407 * raise TypeError("you must pass a python list for 'paths' not: %s %r" * % (type(paths), paths)) * if not PyString_CheckExact(path): # <<<<<<<<<<<<<< @@ -3052,7 +3017,7 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":409 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":409 * if not PyString_CheckExact(path): * raise TypeError("you must pass a string for 'path' not: %s %r" * % (type(path), path)) # <<<<<<<<<<<<<< @@ -3060,24 +3025,24 @@ * _hi = len(paths) */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_path))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(__pyx_v_path))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_path))); __Pyx_INCREF(__pyx_v_path); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3085,7 +3050,7 @@ } __pyx_L7:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":411 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":411 * % (type(path), path)) * * _hi = len(paths) # <<<<<<<<<<<<<< @@ -3095,7 +3060,7 @@ __pyx_t_4 = PyObject_Length(__pyx_v_paths); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__hi = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":412 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":412 * * _hi = len(paths) * _lo = 0 # <<<<<<<<<<<<<< @@ -3104,7 +3069,7 @@ */ __pyx_v__lo = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":414 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":414 * _lo = 0 * * path_cstr = PyString_AsString(path) # <<<<<<<<<<<<<< @@ -3113,7 +3078,7 @@ */ __pyx_v_path_cstr = PyString_AsString(__pyx_v_path); - /* "bzrlib/_dirstate_helpers_pyx.pyx":415 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":415 * * path_cstr = PyString_AsString(path) * path_size = PyString_Size(path) # <<<<<<<<<<<<<< @@ -3122,7 +3087,7 @@ */ __pyx_v_path_size = PyString_Size(__pyx_v_path); - /* "bzrlib/_dirstate_helpers_pyx.pyx":417 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":417 * path_size = PyString_Size(path) * * while _lo < _hi: # <<<<<<<<<<<<<< @@ -3133,7 +3098,7 @@ __pyx_t_1 = (__pyx_v__lo < __pyx_v__hi); if (!__pyx_t_1) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":418 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":418 * * while _lo < _hi: * _mid = (_lo + _hi) / 2 # <<<<<<<<<<<<<< @@ -3142,7 +3107,7 @@ */ __pyx_v__mid = __Pyx_div_long((__pyx_v__lo + __pyx_v__hi), 2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":419 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":419 * while _lo < _hi: * _mid = (_lo + _hi) / 2 * cur = PyList_GetItem_object_void(paths, _mid) # <<<<<<<<<<<<<< @@ -3151,7 +3116,7 @@ */ __pyx_v_cur = PyList_GET_ITEM(__pyx_v_paths, __pyx_v__mid); - /* "bzrlib/_dirstate_helpers_pyx.pyx":420 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":420 * _mid = (_lo + _hi) / 2 * cur = PyList_GetItem_object_void(paths, _mid) * cur_cstr = PyString_AS_STRING_void(cur) # <<<<<<<<<<<<<< @@ -3160,7 +3125,7 @@ */ __pyx_v_cur_cstr = PyString_AS_STRING(__pyx_v_cur); - /* "bzrlib/_dirstate_helpers_pyx.pyx":421 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":421 * cur = PyList_GetItem_object_void(paths, _mid) * cur_cstr = PyString_AS_STRING_void(cur) * cur_size = PyString_GET_SIZE_void(cur) # <<<<<<<<<<<<<< @@ -3169,7 +3134,7 @@ */ __pyx_v_cur_size = PyString_GET_SIZE(__pyx_v_cur); - /* "bzrlib/_dirstate_helpers_pyx.pyx":423 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":423 * cur_size = PyString_GET_SIZE_void(cur) * if _cmp_path_by_dirblock_intern(cur_cstr, cur_size, * path_cstr, path_size) < 0: # <<<<<<<<<<<<<< @@ -3179,7 +3144,7 @@ __pyx_t_1 = (__pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_path_by_dirblock_intern(__pyx_v_cur_cstr, __pyx_v_cur_size, __pyx_v_path_cstr, __pyx_v_path_size) < 0); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":424 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":424 * if _cmp_path_by_dirblock_intern(cur_cstr, cur_size, * path_cstr, path_size) < 0: * _lo = _mid + 1 # <<<<<<<<<<<<<< @@ -3191,7 +3156,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":426 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":426 * _lo = _mid + 1 * else: * _hi = _mid # <<<<<<<<<<<<<< @@ -3203,7 +3168,7 @@ __pyx_L10:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":427 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":427 * else: * _hi = _mid * return _lo # <<<<<<<<<<<<<< @@ -3230,7 +3195,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":430 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":430 * * * def _bisect_path_right(paths, path): # <<<<<<<<<<<<<< @@ -3238,10 +3203,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_4_bisect_path_right(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_4_bisect_path_right[] = "Return the index where to insert path into paths.\n\n This uses a path-wise comparison so we get::\n a\n a-b\n a=b\n a/b\n Rather than::\n a\n a-b\n a/b\n a=b\n :param paths: A list of paths to search through\n :param path: A single path to insert\n :return: An offset where 'path' can be inserted.\n :seealso: bisect.bisect_right\n "; -static PyMethodDef __pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_4_bisect_path_right = {__Pyx_NAMESTR("_bisect_path_right"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_4_bisect_path_right, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_4_bisect_path_right)}; -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_4_bisect_path_right(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__bisect_path_right(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx__bisect_path_right[] = "Return the index where to insert path into paths.\n\n This uses a path-wise comparison so we get::\n a\n a-b\n a=b\n a/b\n Rather than::\n a\n a-b\n a/b\n a=b\n :param paths: A list of paths to search through\n :param path: A single path to insert\n :return: An offset where 'path' can be inserted.\n :seealso: bisect.bisect_right\n "; +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__bisect_path_right(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_paths = 0; PyObject *__pyx_v_path = 0; int __pyx_v__lo; @@ -3301,7 +3265,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":457 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":457 * cdef void *cur * * if not PyList_CheckExact(paths): # <<<<<<<<<<<<<< @@ -3311,7 +3275,7 @@ __pyx_t_1 = (!PyList_CheckExact(__pyx_v_paths)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":459 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":459 * if not PyList_CheckExact(paths): * raise TypeError("you must pass a python list for 'paths' not: %s %r" * % (type(paths), paths)) # <<<<<<<<<<<<<< @@ -3319,24 +3283,24 @@ * raise TypeError("you must pass a string for 'path' not: %s %r" */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_paths))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(__pyx_v_paths))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_paths))); __Pyx_INCREF(__pyx_v_paths); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_paths); __Pyx_GIVEREF(__pyx_v_paths); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3344,7 +3308,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":460 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":460 * raise TypeError("you must pass a python list for 'paths' not: %s %r" * % (type(paths), paths)) * if not PyString_CheckExact(path): # <<<<<<<<<<<<<< @@ -3354,7 +3318,7 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":462 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":462 * if not PyString_CheckExact(path): * raise TypeError("you must pass a string for 'path' not: %s %r" * % (type(path), path)) # <<<<<<<<<<<<<< @@ -3362,24 +3326,24 @@ * _hi = len(paths) */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_path))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(__pyx_v_path))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_path))); __Pyx_INCREF(__pyx_v_path); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3387,7 +3351,7 @@ } __pyx_L7:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":464 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":464 * % (type(path), path)) * * _hi = len(paths) # <<<<<<<<<<<<<< @@ -3397,7 +3361,7 @@ __pyx_t_4 = PyObject_Length(__pyx_v_paths); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__hi = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":465 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":465 * * _hi = len(paths) * _lo = 0 # <<<<<<<<<<<<<< @@ -3406,7 +3370,7 @@ */ __pyx_v__lo = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":467 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":467 * _lo = 0 * * path_cstr = PyString_AsString(path) # <<<<<<<<<<<<<< @@ -3415,7 +3379,7 @@ */ __pyx_v_path_cstr = PyString_AsString(__pyx_v_path); - /* "bzrlib/_dirstate_helpers_pyx.pyx":468 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":468 * * path_cstr = PyString_AsString(path) * path_size = PyString_Size(path) # <<<<<<<<<<<<<< @@ -3424,7 +3388,7 @@ */ __pyx_v_path_size = PyString_Size(__pyx_v_path); - /* "bzrlib/_dirstate_helpers_pyx.pyx":470 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":470 * path_size = PyString_Size(path) * * while _lo < _hi: # <<<<<<<<<<<<<< @@ -3435,7 +3399,7 @@ __pyx_t_1 = (__pyx_v__lo < __pyx_v__hi); if (!__pyx_t_1) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":471 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":471 * * while _lo < _hi: * _mid = (_lo + _hi) / 2 # <<<<<<<<<<<<<< @@ -3444,7 +3408,7 @@ */ __pyx_v__mid = __Pyx_div_long((__pyx_v__lo + __pyx_v__hi), 2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":472 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":472 * while _lo < _hi: * _mid = (_lo + _hi) / 2 * cur = PyList_GetItem_object_void(paths, _mid) # <<<<<<<<<<<<<< @@ -3453,7 +3417,7 @@ */ __pyx_v_cur = PyList_GET_ITEM(__pyx_v_paths, __pyx_v__mid); - /* "bzrlib/_dirstate_helpers_pyx.pyx":473 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":473 * _mid = (_lo + _hi) / 2 * cur = PyList_GetItem_object_void(paths, _mid) * cur_cstr = PyString_AS_STRING_void(cur) # <<<<<<<<<<<<<< @@ -3462,7 +3426,7 @@ */ __pyx_v_cur_cstr = PyString_AS_STRING(__pyx_v_cur); - /* "bzrlib/_dirstate_helpers_pyx.pyx":474 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":474 * cur = PyList_GetItem_object_void(paths, _mid) * cur_cstr = PyString_AS_STRING_void(cur) * cur_size = PyString_GET_SIZE_void(cur) # <<<<<<<<<<<<<< @@ -3471,7 +3435,7 @@ */ __pyx_v_cur_size = PyString_GET_SIZE(__pyx_v_cur); - /* "bzrlib/_dirstate_helpers_pyx.pyx":476 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":476 * cur_size = PyString_GET_SIZE_void(cur) * if _cmp_path_by_dirblock_intern(path_cstr, path_size, * cur_cstr, cur_size) < 0: # <<<<<<<<<<<<<< @@ -3481,7 +3445,7 @@ __pyx_t_1 = (__pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_path_by_dirblock_intern(__pyx_v_path_cstr, __pyx_v_path_size, __pyx_v_cur_cstr, __pyx_v_cur_size) < 0); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":477 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":477 * if _cmp_path_by_dirblock_intern(path_cstr, path_size, * cur_cstr, cur_size) < 0: * _hi = _mid # <<<<<<<<<<<<<< @@ -3493,7 +3457,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":479 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":479 * _hi = _mid * else: * _lo = _mid + 1 # <<<<<<<<<<<<<< @@ -3505,7 +3469,7 @@ __pyx_L10:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":480 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":480 * else: * _lo = _mid + 1 * return _lo # <<<<<<<<<<<<<< @@ -3532,7 +3496,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":483 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":483 * * * def bisect_dirblock(dirblocks, dirname, lo=0, hi=None, cache=None): # <<<<<<<<<<<<<< @@ -3540,10 +3504,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_5bisect_dirblock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_5bisect_dirblock[] = "Return the index where to insert dirname into the dirblocks.\n\n The return value idx is such that all directories blocks in dirblock[:idx]\n have names < dirname, and all blocks in dirblock[idx:] have names >=\n dirname.\n\n Optional args lo (default 0) and hi (default len(dirblocks)) bound the\n slice of a to be searched.\n "; -static PyMethodDef __pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_5bisect_dirblock = {__Pyx_NAMESTR("bisect_dirblock"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_5bisect_dirblock, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_5bisect_dirblock)}; -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_5bisect_dirblock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_bisect_dirblock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_bisect_dirblock[] = "Return the index where to insert dirname into the dirblocks.\n\n The return value idx is such that all directories blocks in dirblock[:idx]\n have names < dirname, and all blocks in dirblock[idx:] have names >=\n dirname.\n\n Optional args lo (default 0) and hi (default len(dirblocks)) bound the\n slice of a to be searched.\n "; +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_bisect_dirblock(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dirblocks = 0; PyObject *__pyx_v_dirname = 0; PyObject *__pyx_v_lo = 0; @@ -3643,7 +3606,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":502 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":502 * cdef void *cur * * if not PyList_CheckExact(dirblocks): # <<<<<<<<<<<<<< @@ -3653,7 +3616,7 @@ __pyx_t_1 = (!PyList_CheckExact(__pyx_v_dirblocks)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":504 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":504 * if not PyList_CheckExact(dirblocks): * raise TypeError("you must pass a python list for 'dirblocks' not: %s %r" * % (type(dirblocks), dirblocks)) # <<<<<<<<<<<<<< @@ -3661,24 +3624,24 @@ * raise TypeError("you must pass a string for dirname not: %s %r" */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_dirblocks))); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(__pyx_v_dirblocks))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_dirblocks))); __Pyx_INCREF(__pyx_v_dirblocks); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_dirblocks); __Pyx_GIVEREF(__pyx_v_dirblocks); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3686,7 +3649,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":505 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":505 * raise TypeError("you must pass a python list for 'dirblocks' not: %s %r" * % (type(dirblocks), dirblocks)) * if not PyString_CheckExact(dirname): # <<<<<<<<<<<<<< @@ -3696,7 +3659,7 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_dirname)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":507 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":507 * if not PyString_CheckExact(dirname): * raise TypeError("you must pass a string for dirname not: %s %r" * % (type(dirname), dirname)) # <<<<<<<<<<<<<< @@ -3704,24 +3667,24 @@ * _hi = len(dirblocks) */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_dirname))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(__pyx_v_dirname))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(__pyx_v_dirname))); __Pyx_INCREF(__pyx_v_dirname); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_dirname); __Pyx_GIVEREF(__pyx_v_dirname); - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_9), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3729,7 +3692,7 @@ } __pyx_L7:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":508 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":508 * raise TypeError("you must pass a string for dirname not: %s %r" * % (type(dirname), dirname)) * if hi is None: # <<<<<<<<<<<<<< @@ -3739,7 +3702,7 @@ __pyx_t_1 = (__pyx_v_hi == Py_None); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":509 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":509 * % (type(dirname), dirname)) * if hi is None: * _hi = len(dirblocks) # <<<<<<<<<<<<<< @@ -3752,7 +3715,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":511 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":511 * _hi = len(dirblocks) * else: * _hi = hi # <<<<<<<<<<<<<< @@ -3764,7 +3727,7 @@ } __pyx_L8:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":513 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":513 * _hi = hi * * _lo = lo # <<<<<<<<<<<<<< @@ -3774,7 +3737,7 @@ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_lo); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v__lo = __pyx_t_5; - /* "bzrlib/_dirstate_helpers_pyx.pyx":514 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":514 * * _lo = lo * dirname_cstr = PyString_AsString(dirname) # <<<<<<<<<<<<<< @@ -3783,7 +3746,7 @@ */ __pyx_v_dirname_cstr = PyString_AsString(__pyx_v_dirname); - /* "bzrlib/_dirstate_helpers_pyx.pyx":515 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":515 * _lo = lo * dirname_cstr = PyString_AsString(dirname) * dirname_size = PyString_Size(dirname) # <<<<<<<<<<<<<< @@ -3792,7 +3755,7 @@ */ __pyx_v_dirname_size = PyString_Size(__pyx_v_dirname); - /* "bzrlib/_dirstate_helpers_pyx.pyx":517 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":517 * dirname_size = PyString_Size(dirname) * * while _lo < _hi: # <<<<<<<<<<<<<< @@ -3803,7 +3766,7 @@ __pyx_t_1 = (__pyx_v__lo < __pyx_v__hi); if (!__pyx_t_1) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":518 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":518 * * while _lo < _hi: * _mid = (_lo + _hi) / 2 # <<<<<<<<<<<<<< @@ -3812,7 +3775,7 @@ */ __pyx_v__mid = __Pyx_div_long((__pyx_v__lo + __pyx_v__hi), 2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":522 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":522 * # cur = dirblocks[_mid][0] * cur = PyTuple_GetItem_void_void( * PyList_GetItem_object_void(dirblocks, _mid), 0) # <<<<<<<<<<<<<< @@ -3821,7 +3784,7 @@ */ __pyx_v_cur = PyTuple_GET_ITEM(PyList_GET_ITEM(__pyx_v_dirblocks, __pyx_v__mid), 0); - /* "bzrlib/_dirstate_helpers_pyx.pyx":523 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":523 * cur = PyTuple_GetItem_void_void( * PyList_GetItem_object_void(dirblocks, _mid), 0) * cur_cstr = PyString_AS_STRING_void(cur) # <<<<<<<<<<<<<< @@ -3830,7 +3793,7 @@ */ __pyx_v_cur_cstr = PyString_AS_STRING(__pyx_v_cur); - /* "bzrlib/_dirstate_helpers_pyx.pyx":524 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":524 * PyList_GetItem_object_void(dirblocks, _mid), 0) * cur_cstr = PyString_AS_STRING_void(cur) * cur_size = PyString_GET_SIZE_void(cur) # <<<<<<<<<<<<<< @@ -3839,7 +3802,7 @@ */ __pyx_v_cur_size = PyString_GET_SIZE(__pyx_v_cur); - /* "bzrlib/_dirstate_helpers_pyx.pyx":525 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":525 * cur_cstr = PyString_AS_STRING_void(cur) * cur_size = PyString_GET_SIZE_void(cur) * if _cmp_by_dirs(cur_cstr, cur_size, dirname_cstr, dirname_size) < 0: # <<<<<<<<<<<<<< @@ -3849,7 +3812,7 @@ __pyx_t_1 = (__pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_by_dirs(__pyx_v_cur_cstr, __pyx_v_cur_size, __pyx_v_dirname_cstr, __pyx_v_dirname_size) < 0); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":526 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":526 * cur_size = PyString_GET_SIZE_void(cur) * if _cmp_by_dirs(cur_cstr, cur_size, dirname_cstr, dirname_size) < 0: * _lo = _mid + 1 # <<<<<<<<<<<<<< @@ -3861,7 +3824,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":528 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":528 * _lo = _mid + 1 * else: * _hi = _mid # <<<<<<<<<<<<<< @@ -3873,7 +3836,7 @@ __pyx_L11:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":529 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":529 * else: * _hi = _mid * return _lo # <<<<<<<<<<<<<< @@ -3900,7 +3863,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":544 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":544 * cdef char *next # Pointer to the end of this record * * def __init__(self, text, state): # <<<<<<<<<<<<<< @@ -3956,7 +3919,7 @@ return -1; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":545 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":545 * * def __init__(self, text, state): * self.state = state # <<<<<<<<<<<<<< @@ -3969,7 +3932,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state = __pyx_v_state; - /* "bzrlib/_dirstate_helpers_pyx.pyx":546 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":546 * def __init__(self, text, state): * self.state = state * self.text = text # <<<<<<<<<<<<<< @@ -3982,7 +3945,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->text); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->text = __pyx_v_text; - /* "bzrlib/_dirstate_helpers_pyx.pyx":547 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":547 * self.state = state * self.text = text * self.text_cstr = PyString_AsString(text) # <<<<<<<<<<<<<< @@ -3991,7 +3954,7 @@ */ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->text_cstr = PyString_AsString(__pyx_v_text); - /* "bzrlib/_dirstate_helpers_pyx.pyx":548 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":548 * self.text = text * self.text_cstr = PyString_AsString(text) * self.text_size = PyString_Size(text) # <<<<<<<<<<<<<< @@ -4000,7 +3963,7 @@ */ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->text_size = PyString_Size(__pyx_v_text); - /* "bzrlib/_dirstate_helpers_pyx.pyx":549 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":549 * self.text_cstr = PyString_AsString(text) * self.text_size = PyString_Size(text) * self.end_cstr = self.text_cstr + self.text_size # <<<<<<<<<<<<<< @@ -4009,7 +3972,7 @@ */ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->end_cstr = (((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->text_cstr + ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->text_size); - /* "bzrlib/_dirstate_helpers_pyx.pyx":550 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":550 * self.text_size = PyString_Size(text) * self.end_cstr = self.text_cstr + self.text_size * self.cur_cstr = self.text_cstr # <<<<<<<<<<<<<< @@ -4023,7 +3986,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":552 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":552 * self.cur_cstr = self.text_cstr * * cdef char *get_next(self, int *size) except NULL: # <<<<<<<<<<<<<< @@ -4041,7 +4004,7 @@ PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("get_next"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":557 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":557 * cdef Py_ssize_t extra_len * * if self.cur_cstr == NULL: # <<<<<<<<<<<<<< @@ -4051,22 +4014,28 @@ __pyx_t_1 = (__pyx_v_self->cur_cstr == NULL); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":558 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":558 * * if self.cur_cstr == NULL: * raise AssertionError('get_next() called when cur_str is NULL') # <<<<<<<<<<<<<< * elif self.cur_cstr >= self.end_cstr: * raise AssertionError('get_next() called when there are no chars' */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":559 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":559 * if self.cur_cstr == NULL: * raise AssertionError('get_next() called when cur_str is NULL') * elif self.cur_cstr >= self.end_cstr: # <<<<<<<<<<<<<< @@ -4076,15 +4045,21 @@ __pyx_t_1 = (__pyx_v_self->cur_cstr >= __pyx_v_self->end_cstr); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":560 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":560 * raise AssertionError('get_next() called when cur_str is NULL') * elif self.cur_cstr >= self.end_cstr: * raise AssertionError('get_next() called when there are no chars' # <<<<<<<<<<<<<< * ' left') * next = self.cur_cstr */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_11)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4092,7 +4067,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":562 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":562 * raise AssertionError('get_next() called when there are no chars' * ' left') * next = self.cur_cstr # <<<<<<<<<<<<<< @@ -4101,7 +4076,7 @@ */ __pyx_v_next = __pyx_v_self->cur_cstr; - /* "bzrlib/_dirstate_helpers_pyx.pyx":563 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":563 * ' left') * next = self.cur_cstr * self.cur_cstr = memchr(next, c'\0', self.end_cstr - next) # <<<<<<<<<<<<<< @@ -4110,7 +4085,7 @@ */ __pyx_v_self->cur_cstr = ((char *)memchr(__pyx_v_next, '\x00', (__pyx_v_self->end_cstr - __pyx_v_next))); - /* "bzrlib/_dirstate_helpers_pyx.pyx":564 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":564 * next = self.cur_cstr * self.cur_cstr = memchr(next, c'\0', self.end_cstr - next) * if self.cur_cstr == NULL: # <<<<<<<<<<<<<< @@ -4120,7 +4095,7 @@ __pyx_t_1 = (__pyx_v_self->cur_cstr == NULL); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":565 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":565 * self.cur_cstr = memchr(next, c'\0', self.end_cstr - next) * if self.cur_cstr == NULL: * extra_len = self.end_cstr - next # <<<<<<<<<<<<<< @@ -4129,7 +4104,7 @@ */ __pyx_v_extra_len = (__pyx_v_self->end_cstr - __pyx_v_next); - /* "bzrlib/_dirstate_helpers_pyx.pyx":566 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":566 * if self.cur_cstr == NULL: * extra_len = self.end_cstr - next * raise errors.DirstateCorrupt(self.state, # <<<<<<<<<<<<<< @@ -4142,7 +4117,7 @@ __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":569 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":569 * 'failed to find trailing NULL (\\0).' * ' Trailing garbage: %r' * % safe_string_from_size(next, extra_len)) # <<<<<<<<<<<<<< @@ -4151,21 +4126,21 @@ */ __pyx_t_2 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx_safe_string_from_size(__pyx_v_next, __pyx_v_extra_len); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_14), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_12), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_self->state); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->state); __Pyx_GIVEREF(__pyx_v_self->state); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4173,7 +4148,7 @@ } __pyx_L4:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":570 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":570 * ' Trailing garbage: %r' * % safe_string_from_size(next, extra_len)) * size[0] = self.cur_cstr - next # <<<<<<<<<<<<<< @@ -4182,7 +4157,7 @@ */ (__pyx_v_size[0]) = (__pyx_v_self->cur_cstr - __pyx_v_next); - /* "bzrlib/_dirstate_helpers_pyx.pyx":571 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":571 * % safe_string_from_size(next, extra_len)) * size[0] = self.cur_cstr - next * self.cur_cstr = self.cur_cstr + 1 # <<<<<<<<<<<<<< @@ -4191,7 +4166,7 @@ */ __pyx_v_self->cur_cstr = (__pyx_v_self->cur_cstr + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":572 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":572 * size[0] = self.cur_cstr - next * self.cur_cstr = self.cur_cstr + 1 * return next # <<<<<<<<<<<<<< @@ -4214,7 +4189,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":574 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":574 * return next * * cdef object get_next_str(self): # <<<<<<<<<<<<<< @@ -4230,7 +4205,7 @@ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_next_str"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":578 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":578 * cdef int size * cdef char *next * next = self.get_next(&size) # <<<<<<<<<<<<<< @@ -4240,7 +4215,7 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next(__pyx_v_self, (&__pyx_v_size)); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_next = __pyx_t_1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":579 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":579 * cdef char *next * next = self.get_next(&size) * return safe_string_from_size(next, size) # <<<<<<<<<<<<<< @@ -4266,7 +4241,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":581 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":581 * return safe_string_from_size(next, size) * * cdef int _init(self) except -1: # <<<<<<<<<<<<<< @@ -4286,7 +4261,7 @@ PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_init"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":592 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":592 * cdef int size * # The first field should be an empty string left over from the Header * first = self.get_next(&size) # <<<<<<<<<<<<<< @@ -4296,7 +4271,7 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next(__pyx_v_self, (&__pyx_v_size)); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_first = __pyx_t_1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":593 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":593 * # The first field should be an empty string left over from the Header * first = self.get_next(&size) * if first[0] != c'\0' and size == 0: # <<<<<<<<<<<<<< @@ -4312,7 +4287,7 @@ } if (__pyx_t_4) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":595 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":595 * if first[0] != c'\0' and size == 0: * raise AssertionError('First character should be null not: %s' * % (first,)) # <<<<<<<<<<<<<< @@ -4322,21 +4297,21 @@ __pyx_t_5 = PyBytes_FromString(__pyx_v_first); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5)); __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5)); __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4344,7 +4319,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":596 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":596 * raise AssertionError('First character should be null not: %s' * % (first,)) * return 0 # <<<<<<<<<<<<<< @@ -4366,7 +4341,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":598 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":598 * return 0 * * cdef object _get_entry(self, int num_trees, void **p_current_dirname, # <<<<<<<<<<<<<< @@ -4416,10 +4391,10 @@ __pyx_v_cur_dirname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_cur_basename = Py_None; __Pyx_INCREF(Py_None); __pyx_v_cur_file_id = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_trees = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_ret = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_trees = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_ret = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":634 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":634 * * # Read the 'key' information (dirname, name, file_id) * dirname_cstr = self.get_next(&cur_size) # <<<<<<<<<<<<<< @@ -4429,7 +4404,7 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next(__pyx_v_self, (&__pyx_v_cur_size)); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_dirname_cstr = __pyx_t_1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":642 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":642 * # Do the cheap 'length of string' check first. If the string is a * # different length, then we *have* to be a different directory. * if (cur_size != PyString_GET_SIZE_void(p_current_dirname[0]) # <<<<<<<<<<<<<< @@ -4439,7 +4414,7 @@ __pyx_t_2 = (__pyx_v_cur_size != PyString_GET_SIZE((__pyx_v_p_current_dirname[0]))); if (!__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":650 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":650 * # * PyString_AS_STRING_void(p_current_dirname[0]), * cur_size+1) != 0): # <<<<<<<<<<<<<< @@ -4453,7 +4428,7 @@ } if (__pyx_t_4) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":651 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":651 * PyString_AS_STRING_void(p_current_dirname[0]), * cur_size+1) != 0): * dirname = safe_string_from_size(dirname_cstr, cur_size) # <<<<<<<<<<<<<< @@ -4466,7 +4441,7 @@ __pyx_v_dirname = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":652 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":652 * cur_size+1) != 0): * dirname = safe_string_from_size(dirname_cstr, cur_size) * p_current_dirname[0] = dirname # <<<<<<<<<<<<<< @@ -4475,7 +4450,7 @@ */ (__pyx_v_p_current_dirname[0]) = ((void *)__pyx_v_dirname); - /* "bzrlib/_dirstate_helpers_pyx.pyx":653 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":653 * dirname = safe_string_from_size(dirname_cstr, cur_size) * p_current_dirname[0] = dirname * new_block[0] = 1 # <<<<<<<<<<<<<< @@ -4487,7 +4462,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":655 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":655 * new_block[0] = 1 * else: * new_block[0] = 0 # <<<<<<<<<<<<<< @@ -4498,7 +4473,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":660 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":660 * # By using (void *) Pyrex will automatically handle the * # Py_INCREF that we need. * cur_dirname = p_current_dirname[0] # <<<<<<<<<<<<<< @@ -4510,7 +4485,7 @@ __Pyx_DECREF(__pyx_v_cur_dirname); __pyx_v_cur_dirname = ((PyObject *)__pyx_t_6); - /* "bzrlib/_dirstate_helpers_pyx.pyx":667 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":667 * # self.get_next_str(), * # ) * tmp = StaticTuple_New(3) # <<<<<<<<<<<<<< @@ -4523,7 +4498,7 @@ __pyx_v_tmp = ((StaticTuple *)__pyx_t_5); __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":668 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":668 * # ) * tmp = StaticTuple_New(3) * Py_INCREF(cur_dirname); StaticTuple_SET_ITEM(tmp, 0, cur_dirname) # <<<<<<<<<<<<<< @@ -4533,7 +4508,7 @@ Py_INCREF(__pyx_v_cur_dirname); StaticTuple_SET_ITEM(__pyx_v_tmp, 0, __pyx_v_cur_dirname); - /* "bzrlib/_dirstate_helpers_pyx.pyx":669 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":669 * tmp = StaticTuple_New(3) * Py_INCREF(cur_dirname); StaticTuple_SET_ITEM(tmp, 0, cur_dirname) * cur_basename = self.get_next_str() # <<<<<<<<<<<<<< @@ -4546,7 +4521,7 @@ __pyx_v_cur_basename = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":670 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":670 * Py_INCREF(cur_dirname); StaticTuple_SET_ITEM(tmp, 0, cur_dirname) * cur_basename = self.get_next_str() * cur_file_id = self.get_next_str() # <<<<<<<<<<<<<< @@ -4559,7 +4534,7 @@ __pyx_v_cur_file_id = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":671 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":671 * cur_basename = self.get_next_str() * cur_file_id = self.get_next_str() * Py_INCREF(cur_basename); StaticTuple_SET_ITEM(tmp, 1, cur_basename) # <<<<<<<<<<<<<< @@ -4569,7 +4544,7 @@ Py_INCREF(__pyx_v_cur_basename); StaticTuple_SET_ITEM(__pyx_v_tmp, 1, __pyx_v_cur_basename); - /* "bzrlib/_dirstate_helpers_pyx.pyx":672 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":672 * cur_file_id = self.get_next_str() * Py_INCREF(cur_basename); StaticTuple_SET_ITEM(tmp, 1, cur_basename) * Py_INCREF(cur_file_id); StaticTuple_SET_ITEM(tmp, 2, cur_file_id) # <<<<<<<<<<<<<< @@ -4579,7 +4554,7 @@ Py_INCREF(__pyx_v_cur_file_id); StaticTuple_SET_ITEM(__pyx_v_tmp, 2, __pyx_v_cur_file_id); - /* "bzrlib/_dirstate_helpers_pyx.pyx":673 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":673 * Py_INCREF(cur_basename); StaticTuple_SET_ITEM(tmp, 1, cur_basename) * Py_INCREF(cur_file_id); StaticTuple_SET_ITEM(tmp, 2, cur_file_id) * path_name_file_id_key = tmp # <<<<<<<<<<<<<< @@ -4590,7 +4565,7 @@ __Pyx_DECREF(((PyObject *)__pyx_v_path_name_file_id_key)); __pyx_v_path_name_file_id_key = __pyx_v_tmp; - /* "bzrlib/_dirstate_helpers_pyx.pyx":688 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":688 * # Especially since this code is pretty much fixed at a max of * # 4GB. * trees = [] # <<<<<<<<<<<<<< @@ -4603,7 +4578,7 @@ __pyx_v_trees = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":689 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":689 * # 4GB. * trees = [] * for i from 0 <= i < num_trees: # <<<<<<<<<<<<<< @@ -4613,7 +4588,7 @@ __pyx_t_7 = __pyx_v_num_trees; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":690 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":690 * trees = [] * for i from 0 <= i < num_trees: * minikind = self.get_next_str() # <<<<<<<<<<<<<< @@ -4626,7 +4601,7 @@ __pyx_v_minikind = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":691 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":691 * for i from 0 <= i < num_trees: * minikind = self.get_next_str() * fingerprint = self.get_next_str() # <<<<<<<<<<<<<< @@ -4639,7 +4614,7 @@ __pyx_v_fingerprint = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":692 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":692 * minikind = self.get_next_str() * fingerprint = self.get_next_str() * entry_size_cstr = self.get_next(&cur_size) # <<<<<<<<<<<<<< @@ -4649,7 +4624,7 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next(__pyx_v_self, (&__pyx_v_cur_size)); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_entry_size_cstr = __pyx_t_1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":693 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":693 * fingerprint = self.get_next_str() * entry_size_cstr = self.get_next(&cur_size) * entry_size = strtoul(entry_size_cstr, NULL, 10) # <<<<<<<<<<<<<< @@ -4658,7 +4633,7 @@ */ __pyx_v_entry_size = strtoul(__pyx_v_entry_size_cstr, NULL, 10); - /* "bzrlib/_dirstate_helpers_pyx.pyx":694 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":694 * entry_size_cstr = self.get_next(&cur_size) * entry_size = strtoul(entry_size_cstr, NULL, 10) * executable_cstr = self.get_next(&cur_size) # <<<<<<<<<<<<<< @@ -4668,7 +4643,7 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next(__pyx_v_self, (&__pyx_v_cur_size)); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_executable_cstr = __pyx_t_1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":695 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":695 * entry_size = strtoul(entry_size_cstr, NULL, 10) * executable_cstr = self.get_next(&cur_size) * is_executable = (executable_cstr[0] == c'y') # <<<<<<<<<<<<<< @@ -4677,7 +4652,7 @@ */ __pyx_v_is_executable = ((__pyx_v_executable_cstr[0]) == 'y'); - /* "bzrlib/_dirstate_helpers_pyx.pyx":696 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":696 * executable_cstr = self.get_next(&cur_size) * is_executable = (executable_cstr[0] == c'y') * info = self.get_next_str() # <<<<<<<<<<<<<< @@ -4690,7 +4665,7 @@ __pyx_v_info = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":713 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":713 * minikind, # minikind * fingerprint, # fingerprint * entry_size, # size # <<<<<<<<<<<<<< @@ -4700,7 +4675,7 @@ __pyx_t_5 = PyLong_FromUnsignedLong(__pyx_v_entry_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - /* "bzrlib/_dirstate_helpers_pyx.pyx":714 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":714 * fingerprint, # fingerprint * entry_size, # size * is_executable,# executable # <<<<<<<<<<<<<< @@ -4710,7 +4685,7 @@ __pyx_t_8 = PyInt_FromLong(__pyx_v_is_executable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - /* "bzrlib/_dirstate_helpers_pyx.pyx":715 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":715 * entry_size, # size * is_executable,# executable * info, # packed_stat or revision_id # <<<<<<<<<<<<<< @@ -4718,7 +4693,7 @@ * */ __pyx_t_9 = PyTuple_New(5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_minikind); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_minikind); __Pyx_GIVEREF(__pyx_v_minikind); @@ -4734,14 +4709,14 @@ __Pyx_GIVEREF(__pyx_v_info); __pyx_t_5 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple)), __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = PyList_Append(((PyObject *)__pyx_v_trees), __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":719 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":719 * * # The returned tuple is (key, [trees]) * ret = (path_name_file_id_key, trees) # <<<<<<<<<<<<<< @@ -4749,18 +4724,19 @@ * # ensures that we always finish parsing a line on an end-of-entry */ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_v_path_name_file_id_key)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_path_name_file_id_key)); __Pyx_GIVEREF(((PyObject *)__pyx_v_path_name_file_id_key)); __Pyx_INCREF(((PyObject *)__pyx_v_trees)); PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_trees)); __Pyx_GIVEREF(((PyObject *)__pyx_v_trees)); + if (!(likely(PyTuple_CheckExact(__pyx_t_8))||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_8)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_ret)); - __pyx_v_ret = __pyx_t_8; + __pyx_v_ret = ((PyObject *)__pyx_t_8); __pyx_t_8 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":723 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":723 * # ensures that we always finish parsing a line on an end-of-entry * # marker. * trailing = self.get_next(&cur_size) # <<<<<<<<<<<<<< @@ -4770,7 +4746,7 @@ __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next(__pyx_v_self, (&__pyx_v_cur_size)); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_trailing = __pyx_t_1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":724 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":724 * # marker. * trailing = self.get_next(&cur_size) * if cur_size != 1 or trailing[0] != c'\n': # <<<<<<<<<<<<<< @@ -4786,7 +4762,7 @@ } if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":725 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":725 * trailing = self.get_next(&cur_size) * if cur_size != 1 or trailing[0] != c'\n': * raise errors.DirstateCorrupt(self.state, # <<<<<<<<<<<<<< @@ -4799,7 +4775,7 @@ __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":727 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":727 * raise errors.DirstateCorrupt(self.state, * 'Bad parse, we expected to end on \\n, not: %d %s: %s' * % (cur_size, safe_string_from_size(trailing, cur_size), # <<<<<<<<<<<<<< @@ -4811,7 +4787,7 @@ __pyx_t_5 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx_safe_string_from_size(__pyx_v_trailing, __pyx_v_cur_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - /* "bzrlib/_dirstate_helpers_pyx.pyx":728 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":728 * 'Bad parse, we expected to end on \\n, not: %d %s: %s' * % (cur_size, safe_string_from_size(trailing, cur_size), * ret)) # <<<<<<<<<<<<<< @@ -4819,7 +4795,7 @@ * */ __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); + __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_5); @@ -4829,21 +4805,21 @@ __Pyx_GIVEREF(((PyObject *)__pyx_v_ret)); __pyx_t_8 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_14), __pyx_t_11); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); + __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_self->state); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_self->state); __Pyx_GIVEREF(__pyx_v_self->state); PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_t_5)); __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4851,7 +4827,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":729 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":729 * % (cur_size, safe_string_from_size(trailing, cur_size), * ret)) * return ret # <<<<<<<<<<<<<< @@ -4889,7 +4865,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":731 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":731 * return ret * * def _parse_dirblocks(self): # <<<<<<<<<<<<<< @@ -4897,9 +4873,9 @@ * cdef int num_trees */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6Reader_1_parse_dirblocks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_6Reader_1_parse_dirblocks[] = "Parse all dirblocks in the state file."; -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6Reader_1_parse_dirblocks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6Reader__parse_dirblocks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_6Reader__parse_dirblocks[] = "Parse all dirblocks in the state file."; +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6Reader__parse_dirblocks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { int __pyx_v_num_trees; PyObject *__pyx_v_current_block; PyObject *__pyx_v_entry; @@ -4919,17 +4895,17 @@ __Pyx_RefNannySetupContext("_parse_dirblocks"); __pyx_v_current_block = Py_None; __Pyx_INCREF(Py_None); __pyx_v_entry = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_dirblocks = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_dirblocks = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_obj = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":741 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":741 * cdef int entry_count * * num_trees = self.state._num_present_parents() + 1 # <<<<<<<<<<<<<< * expected_entry_count = self.state._num_entries * */ - __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state, __pyx_n_s_17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state, __pyx_n_s_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); @@ -4941,7 +4917,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_num_trees = __pyx_t_3; - /* "bzrlib/_dirstate_helpers_pyx.pyx":742 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":742 * * num_trees = self.state._num_present_parents() + 1 * expected_entry_count = self.state._num_entries # <<<<<<<<<<<<<< @@ -4954,7 +4930,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_expected_entry_count = __pyx_t_3; - /* "bzrlib/_dirstate_helpers_pyx.pyx":745 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":745 * * # Ignore the first record * self._init() # <<<<<<<<<<<<<< @@ -4963,7 +4939,7 @@ */ __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->__pyx_vtab)->_init(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":747 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":747 * self._init() * * current_block = [] # <<<<<<<<<<<<<< @@ -4976,7 +4952,7 @@ __pyx_v_current_block = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":748 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":748 * * current_block = [] * dirblocks = [('', current_block), ('', [])] # <<<<<<<<<<<<<< @@ -4984,7 +4960,7 @@ * obj = '' */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); @@ -4994,7 +4970,7 @@ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); @@ -5003,17 +4979,17 @@ __pyx_t_2 = 0; __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); __pyx_t_1 = 0; __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_dirblocks)); __pyx_v_dirblocks = __pyx_t_2; __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":749 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":749 * current_block = [] * dirblocks = [('', current_block), ('', [])] * self.state._dirblocks = dirblocks # <<<<<<<<<<<<<< @@ -5022,7 +4998,7 @@ */ if (PyObject_SetAttr(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state, __pyx_n_s___dirblocks, ((PyObject *)__pyx_v_dirblocks)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":750 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":750 * dirblocks = [('', current_block), ('', [])] * self.state._dirblocks = dirblocks * obj = '' # <<<<<<<<<<<<<< @@ -5033,7 +5009,7 @@ __Pyx_DECREF(__pyx_v_obj); __pyx_v_obj = ((PyObject *)__pyx_kp_s_5); - /* "bzrlib/_dirstate_helpers_pyx.pyx":751 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":751 * self.state._dirblocks = dirblocks * obj = '' * current_dirname = obj # <<<<<<<<<<<<<< @@ -5042,7 +5018,7 @@ */ __pyx_v_current_dirname = ((void *)__pyx_v_obj); - /* "bzrlib/_dirstate_helpers_pyx.pyx":752 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":752 * obj = '' * current_dirname = obj * new_block = 0 # <<<<<<<<<<<<<< @@ -5051,7 +5027,7 @@ */ __pyx_v_new_block = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":753 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":753 * current_dirname = obj * new_block = 0 * entry_count = 0 # <<<<<<<<<<<<<< @@ -5060,7 +5036,7 @@ */ __pyx_v_entry_count = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":762 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":762 * # so), and then truncate. That would give us a malloc + realloc, * # rather than lots of reallocs. * while self.cur_cstr < self.end_cstr: # <<<<<<<<<<<<<< @@ -5071,7 +5047,7 @@ __pyx_t_5 = (((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->cur_cstr < ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->end_cstr); if (!__pyx_t_5) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":763 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":763 * # rather than lots of reallocs. * while self.cur_cstr < self.end_cstr: * entry = self._get_entry(num_trees, ¤t_dirname, &new_block) # <<<<<<<<<<<<<< @@ -5084,7 +5060,7 @@ __pyx_v_entry = __pyx_t_2; __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":764 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":764 * while self.cur_cstr < self.end_cstr: * entry = self._get_entry(num_trees, ¤t_dirname, &new_block) * if new_block: # <<<<<<<<<<<<<< @@ -5093,7 +5069,7 @@ */ if (__pyx_v_new_block) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":766 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":766 * if new_block: * # new block - different dirname * current_block = [] # <<<<<<<<<<<<<< @@ -5106,7 +5082,7 @@ __pyx_v_current_block = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":768 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":768 * current_block = [] * PyList_Append(dirblocks, * (current_dirname, current_block)) # <<<<<<<<<<<<<< @@ -5114,20 +5090,20 @@ * entry_count = entry_count + 1 */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_current_dirname)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_current_dirname)); __Pyx_GIVEREF(((PyObject *)__pyx_v_current_dirname)); __Pyx_INCREF(__pyx_v_current_block); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_current_block); __Pyx_GIVEREF(__pyx_v_current_block); - __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_dirblocks), ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_dirblocks), __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L7; } __pyx_L7:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":769 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":769 * PyList_Append(dirblocks, * (current_dirname, current_block)) * PyList_Append(current_block, entry) # <<<<<<<<<<<<<< @@ -5136,7 +5112,7 @@ */ __pyx_t_3 = PyList_Append(__pyx_v_current_block, __pyx_v_entry); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":770 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":770 * (current_dirname, current_block)) * PyList_Append(current_block, entry) * entry_count = entry_count + 1 # <<<<<<<<<<<<<< @@ -5146,7 +5122,7 @@ __pyx_v_entry_count = (__pyx_v_entry_count + 1); } - /* "bzrlib/_dirstate_helpers_pyx.pyx":771 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":771 * PyList_Append(current_block, entry) * entry_count = entry_count + 1 * if entry_count != expected_entry_count: # <<<<<<<<<<<<<< @@ -5156,7 +5132,7 @@ __pyx_t_5 = (__pyx_v_entry_count != __pyx_v_expected_entry_count); if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":772 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":772 * entry_count = entry_count + 1 * if entry_count != expected_entry_count: * raise errors.DirstateCorrupt(self.state, # <<<<<<<<<<<<<< @@ -5169,7 +5145,7 @@ __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":775 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":775 * 'We read the wrong number of entries.' * ' We expected to read %s, but read %s' * % (expected_entry_count, entry_count)) # <<<<<<<<<<<<<< @@ -5181,28 +5157,28 @@ __pyx_t_1 = PyInt_FromLong(__pyx_v_entry_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state); PyTuple_SET_ITEM(__pyx_t_6, 0, ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state); __Pyx_GIVEREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state); PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5210,14 +5186,14 @@ } __pyx_L8:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":776 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":776 * ' We expected to read %s, but read %s' * % (expected_entry_count, entry_count)) * self.state._split_root_dirblock_into_contents() # <<<<<<<<<<<<<< * * */ - __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state, __pyx_n_s_19); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state, __pyx_n_s_17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); @@ -5243,7 +5219,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":779 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":779 * * * def _read_dirblocks(state): # <<<<<<<<<<<<<< @@ -5251,10 +5227,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6_read_dirblocks(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/ -static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_6_read_dirblocks[] = "Read in the dirblocks for the given DirState object.\n\n This is tightly bound to the DirState internal representation. It should be\n thought of as a member function, which is only separated out so that we can\n re-write it in pyrex.\n\n :param state: A DirState object.\n :return: None\n :postcondition: The dirblocks will be loaded into the appropriate fields in\n the DirState object.\n "; -static PyMethodDef __pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_6_read_dirblocks = {__Pyx_NAMESTR("_read_dirblocks"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6_read_dirblocks, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_6_read_dirblocks)}; -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6_read_dirblocks(PyObject *__pyx_self, PyObject *__pyx_v_state) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__read_dirblocks(PyObject *__pyx_self, PyObject *__pyx_v_state); /*proto*/ +static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx__read_dirblocks[] = "Read in the dirblocks for the given DirState object.\n\n This is tightly bound to the DirState internal representation. It should be\n thought of as a member function, which is only separated out so that we can\n re-write it in pyrex.\n\n :param state: A DirState object.\n :return: None\n :postcondition: The dirblocks will be loaded into the appropriate fields in\n the DirState object.\n "; +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__read_dirblocks(PyObject *__pyx_self, PyObject *__pyx_v_state) { PyObject *__pyx_v_text; struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *__pyx_v_reader; PyObject *__pyx_r = NULL; @@ -5266,7 +5241,7 @@ __pyx_v_text = Py_None; __Pyx_INCREF(Py_None); __pyx_v_reader = ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)Py_None); __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":791 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":791 * the DirState object. * """ * state._state_file.seek(state._end_of_header) # <<<<<<<<<<<<<< @@ -5281,17 +5256,17 @@ __pyx_t_1 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s___end_of_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":792 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":792 * """ * state._state_file.seek(state._end_of_header) * text = state._state_file.read() # <<<<<<<<<<<<<< @@ -5310,7 +5285,7 @@ __pyx_v_text = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":795 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":795 * # TODO: check the crc checksums. crc_measured = zlib.crc32(text) * * reader = Reader(text, state) # <<<<<<<<<<<<<< @@ -5318,21 +5293,21 @@ * reader._parse_dirblocks() */ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_text); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_text); __Pyx_GIVEREF(__pyx_v_text); __Pyx_INCREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_21_dirstate_helpers_pyx_Reader)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_21_dirstate_helpers_pyx_Reader)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_reader)); __pyx_v_reader = ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":797 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":797 * reader = Reader(text, state) * * reader._parse_dirblocks() # <<<<<<<<<<<<<< @@ -5346,7 +5321,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":798 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":798 * * reader._parse_dirblocks() * state._dirblock_state = DirState.IN_MEMORY_UNMODIFIED # <<<<<<<<<<<<<< @@ -5355,7 +5330,7 @@ */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__DirState); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s_20); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s_18); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (PyObject_SetAttr(__pyx_v_state, __pyx_n_s___dirblock_state, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5377,7 +5352,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":801 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":801 * * * cdef int minikind_from_mode(int mode): # cannot_raise # <<<<<<<<<<<<<< @@ -5390,7 +5365,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("minikind_from_mode"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":803 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":803 * cdef int minikind_from_mode(int mode): # cannot_raise * # in order of frequency: * if S_ISREG(mode): # <<<<<<<<<<<<<< @@ -5400,7 +5375,7 @@ __pyx_t_1 = S_ISREG(__pyx_v_mode); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":804 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":804 * # in order of frequency: * if S_ISREG(mode): * return c"f" # <<<<<<<<<<<<<< @@ -5413,7 +5388,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":805 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":805 * if S_ISREG(mode): * return c"f" * if S_ISDIR(mode): # <<<<<<<<<<<<<< @@ -5423,7 +5398,7 @@ __pyx_t_1 = S_ISDIR(__pyx_v_mode); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":806 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":806 * return c"f" * if S_ISDIR(mode): * return c"d" # <<<<<<<<<<<<<< @@ -5436,7 +5411,7 @@ } __pyx_L4:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":807 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":807 * if S_ISDIR(mode): * return c"d" * if S_ISLNK(mode): # <<<<<<<<<<<<<< @@ -5446,7 +5421,7 @@ __pyx_t_1 = S_ISLNK(__pyx_v_mode); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":808 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":808 * return c"d" * if S_ISLNK(mode): * return c"l" # <<<<<<<<<<<<<< @@ -5459,7 +5434,7 @@ } __pyx_L5:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":809 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":809 * if S_ISLNK(mode): * return c"l" * return 0 # <<<<<<<<<<<<<< @@ -5475,7 +5450,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":815 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":815 * * * cdef _pack_stat(stat_value): # <<<<<<<<<<<<<< @@ -5495,7 +5470,7 @@ __Pyx_RefNannySetupContext("_pack_stat"); __pyx_v_packed = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":823 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":823 * cdef char result[6*4] # 6 long ints * cdef int *aliased * aliased = result # <<<<<<<<<<<<<< @@ -5504,7 +5479,7 @@ */ __pyx_v_aliased = ((int *)__pyx_v_result); - /* "bzrlib/_dirstate_helpers_pyx.pyx":824 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":824 * cdef int *aliased * aliased = result * aliased[0] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_size)) # <<<<<<<<<<<<<< @@ -5517,7 +5492,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_aliased[0]) = htonl(__pyx_t_2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":826 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":826 * aliased[0] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_size)) * # mtime and ctime will often be floats but get converted to PyInt within * aliased[1] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_mtime)) # <<<<<<<<<<<<<< @@ -5530,7 +5505,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_aliased[1]) = htonl(__pyx_t_2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":827 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":827 * # mtime and ctime will often be floats but get converted to PyInt within * aliased[1] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_mtime)) * aliased[2] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_ctime)) # <<<<<<<<<<<<<< @@ -5543,7 +5518,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_aliased[2]) = htonl(__pyx_t_2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":828 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":828 * aliased[1] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_mtime)) * aliased[2] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_ctime)) * aliased[3] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_dev)) # <<<<<<<<<<<<<< @@ -5556,7 +5531,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_aliased[3]) = htonl(__pyx_t_2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":829 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":829 * aliased[2] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_ctime)) * aliased[3] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_dev)) * aliased[4] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_ino)) # <<<<<<<<<<<<<< @@ -5569,7 +5544,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_aliased[4]) = htonl(__pyx_t_2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":830 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":830 * aliased[3] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_dev)) * aliased[4] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_ino)) * aliased[5] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_mode)) # <<<<<<<<<<<<<< @@ -5582,7 +5557,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_aliased[5]) = htonl(__pyx_t_2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":831 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":831 * aliased[4] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_ino)) * aliased[5] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_mode)) * packed = PyString_FromStringAndSize(result, 6*4) # <<<<<<<<<<<<<< @@ -5595,7 +5570,7 @@ __pyx_v_packed = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":832 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":832 * aliased[5] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_mode)) * packed = PyString_FromStringAndSize(result, 6*4) * return _encode(packed)[:-1] # <<<<<<<<<<<<<< @@ -5606,15 +5581,15 @@ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_packed); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_packed); __Pyx_GIVEREF(__pyx_v_packed); - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_t_4, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PySequence_GetSlice(__pyx_t_4, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; @@ -5636,7 +5611,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":835 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":835 * * * def pack_stat(stat_value): # <<<<<<<<<<<<<< @@ -5644,16 +5619,15 @@ * return _pack_stat(stat_value) */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_7pack_stat(PyObject *__pyx_self, PyObject *__pyx_v_stat_value); /*proto*/ -static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_7pack_stat[] = "Convert stat value into a packed representation quickly with pyrex"; -static PyMethodDef __pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_7pack_stat = {__Pyx_NAMESTR("pack_stat"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_7pack_stat, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_7pack_stat)}; -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_7pack_stat(PyObject *__pyx_self, PyObject *__pyx_v_stat_value) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_pack_stat(PyObject *__pyx_self, PyObject *__pyx_v_stat_value); /*proto*/ +static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_pack_stat[] = "Convert stat value into a packed representation quickly with pyrex"; +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_pack_stat(PyObject *__pyx_self, PyObject *__pyx_v_stat_value) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("pack_stat"); __pyx_self = __pyx_self; - /* "bzrlib/_dirstate_helpers_pyx.pyx":837 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":837 * def pack_stat(stat_value): * """Convert stat value into a packed representation quickly with pyrex""" * return _pack_stat(stat_value) # <<<<<<<<<<<<<< @@ -5679,7 +5653,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":840 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":840 * * * def update_entry(self, entry, abspath, stat_value): # <<<<<<<<<<<<<< @@ -5687,10 +5661,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_8update_entry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_8update_entry[] = "Update the entry based on what is actually on disk.\n\n This function only calculates the sha if it needs to - if the entry is\n uncachable, or clearly different to the first parent's entry, no sha\n is calculated, and None is returned.\n\n :param entry: This is the dirblock entry for the file in question.\n :param abspath: The path on disk for this file.\n :param stat_value: (optional) if we already have done a stat on the\n file, re-use it.\n :return: None, or The sha1 hexdigest of the file (40 bytes) or link\n target of a symlink.\n "; -static PyMethodDef __pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_8update_entry = {__Pyx_NAMESTR("update_entry"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_8update_entry, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_8update_entry)}; -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_8update_entry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_update_entry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_21_dirstate_helpers_pyx_update_entry[] = "Update the entry based on what is actually on disk.\n\n This function only calculates the sha if it needs to - if the entry is\n uncachable, or clearly different to the first parent's entry, no sha\n is calculated, and None is returned.\n\n :param entry: This is the dirblock entry for the file in question.\n :param abspath: The path on disk for this file.\n :param stat_value: (optional) if we already have done a stat on the\n file, re-use it.\n :return: None, or The sha1 hexdigest of the file (40 bytes) or link\n target of a symlink.\n "; +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_update_entry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_entry = 0; PyObject *__pyx_v_abspath = 0; @@ -5759,7 +5732,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":854 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":854 * target of a symlink. * """ * return _update_entry(self, entry, abspath, stat_value) # <<<<<<<<<<<<<< @@ -5785,7 +5758,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":857 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":857 * * * cdef _update_entry(self, entry, abspath, stat_value): # <<<<<<<<<<<<<< @@ -5836,7 +5809,7 @@ __pyx_v_dir_present = Py_None; __Pyx_INCREF(Py_None); __pyx_v_file_present = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":876 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":876 * cdef void * details * cdef int worth_saving * minikind = minikind_from_mode(stat_value.st_mode) # <<<<<<<<<<<<<< @@ -5849,7 +5822,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_minikind = __pyx_f_6bzrlib_21_dirstate_helpers_pyx_minikind_from_mode(__pyx_t_2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":877 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":877 * cdef int worth_saving * minikind = minikind_from_mode(stat_value.st_mode) * if 0 == minikind: # <<<<<<<<<<<<<< @@ -5859,7 +5832,7 @@ __pyx_t_3 = (0 == __pyx_v_minikind); if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":878 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":878 * minikind = minikind_from_mode(stat_value.st_mode) * if 0 == minikind: * return None # <<<<<<<<<<<<<< @@ -5874,7 +5847,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":879 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":879 * if 0 == minikind: * return None * packed_stat = _pack_stat(stat_value) # <<<<<<<<<<<<<< @@ -5887,7 +5860,7 @@ __pyx_v_packed_stat = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":880 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":880 * return None * packed_stat = _pack_stat(stat_value) * details = PyList_GetItem_void_void(PyTuple_GetItem_void_void(entry, 1), 0) # <<<<<<<<<<<<<< @@ -5896,7 +5869,7 @@ */ __pyx_v_details = PyList_GET_ITEM(PyTuple_GET_ITEM(((void *)__pyx_v_entry), 1), 0); - /* "bzrlib/_dirstate_helpers_pyx.pyx":881 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":881 * packed_stat = _pack_stat(stat_value) * details = PyList_GetItem_void_void(PyTuple_GetItem_void_void(entry, 1), 0) * saved_minikind = PyString_AsString_obj(PyTuple_GetItem_void_void(details, 0))[0] # <<<<<<<<<<<<<< @@ -5905,7 +5878,7 @@ */ __pyx_v_saved_minikind = (PyString_AsString(((PyObject *)PyTuple_GET_ITEM(__pyx_v_details, 0)))[0]); - /* "bzrlib/_dirstate_helpers_pyx.pyx":882 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":882 * details = PyList_GetItem_void_void(PyTuple_GetItem_void_void(entry, 1), 0) * saved_minikind = PyString_AsString_obj(PyTuple_GetItem_void_void(details, 0))[0] * if minikind == c'd' and saved_minikind == c't': # <<<<<<<<<<<<<< @@ -5921,7 +5894,7 @@ } if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":883 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":883 * saved_minikind = PyString_AsString_obj(PyTuple_GetItem_void_void(details, 0))[0] * if minikind == c'd' and saved_minikind == c't': * minikind = c't' # <<<<<<<<<<<<<< @@ -5933,7 +5906,7 @@ } __pyx_L4:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":884 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":884 * if minikind == c'd' and saved_minikind == c't': * minikind = c't' * saved_link_or_sha1 = PyTuple_GetItem_void_object(details, 1) # <<<<<<<<<<<<<< @@ -5946,7 +5919,7 @@ __pyx_v_saved_link_or_sha1 = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":885 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":885 * minikind = c't' * saved_link_or_sha1 = PyTuple_GetItem_void_object(details, 1) * saved_file_size = PyTuple_GetItem_void_object(details, 2) # <<<<<<<<<<<<<< @@ -5959,7 +5932,7 @@ __pyx_v_saved_file_size = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":886 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":886 * saved_link_or_sha1 = PyTuple_GetItem_void_object(details, 1) * saved_file_size = PyTuple_GetItem_void_object(details, 2) * saved_executable = PyTuple_GetItem_void_object(details, 3) # <<<<<<<<<<<<<< @@ -5972,7 +5945,7 @@ __pyx_v_saved_executable = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":887 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":887 * saved_file_size = PyTuple_GetItem_void_object(details, 2) * saved_executable = PyTuple_GetItem_void_object(details, 3) * saved_packed_stat = PyTuple_GetItem_void_object(details, 4) # <<<<<<<<<<<<<< @@ -5985,7 +5958,7 @@ __pyx_v_saved_packed_stat = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":889 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":889 * saved_packed_stat = PyTuple_GetItem_void_object(details, 4) * # Deal with pyrex decrefing the objects * Py_INCREF(saved_link_or_sha1) # <<<<<<<<<<<<<< @@ -5994,7 +5967,7 @@ */ Py_INCREF(__pyx_v_saved_link_or_sha1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":890 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":890 * # Deal with pyrex decrefing the objects * Py_INCREF(saved_link_or_sha1) * Py_INCREF(saved_file_size) # <<<<<<<<<<<<<< @@ -6003,7 +5976,7 @@ */ Py_INCREF(__pyx_v_saved_file_size); - /* "bzrlib/_dirstate_helpers_pyx.pyx":891 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":891 * Py_INCREF(saved_link_or_sha1) * Py_INCREF(saved_file_size) * Py_INCREF(saved_executable) # <<<<<<<<<<<<<< @@ -6012,7 +5985,7 @@ */ Py_INCREF(__pyx_v_saved_executable); - /* "bzrlib/_dirstate_helpers_pyx.pyx":892 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":892 * Py_INCREF(saved_file_size) * Py_INCREF(saved_executable) * Py_INCREF(saved_packed_stat) # <<<<<<<<<<<<<< @@ -6021,7 +5994,7 @@ */ Py_INCREF(__pyx_v_saved_packed_stat); - /* "bzrlib/_dirstate_helpers_pyx.pyx":897 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":897 * * if (minikind == saved_minikind * and packed_stat == saved_packed_stat): # <<<<<<<<<<<<<< @@ -6040,7 +6013,7 @@ } if (__pyx_t_4) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":900 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":900 * # The stat hasn't changed since we saved, so we can re-use the * # saved sha hash. * if minikind == c'd': # <<<<<<<<<<<<<< @@ -6050,7 +6023,7 @@ __pyx_t_4 = (__pyx_v_minikind == 'd'); if (__pyx_t_4) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":901 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":901 * # saved sha hash. * if minikind == c'd': * return None # <<<<<<<<<<<<<< @@ -6065,7 +6038,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":904 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":904 * * # size should also be in packed_stat * if saved_file_size == stat_value.st_size: # <<<<<<<<<<<<<< @@ -6081,7 +6054,7 @@ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":905 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":905 * # size should also be in packed_stat * if saved_file_size == stat_value.st_size: * return saved_link_or_sha1 # <<<<<<<<<<<<<< @@ -6099,7 +6072,7 @@ } __pyx_L5:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":909 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":909 * # If we have gotten this far, that means that we need to actually * # process this entry. * link_or_sha1 = None # <<<<<<<<<<<<<< @@ -6110,7 +6083,7 @@ __Pyx_DECREF(__pyx_v_link_or_sha1); __pyx_v_link_or_sha1 = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":910 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":910 * # process this entry. * link_or_sha1 = None * worth_saving = 1 # <<<<<<<<<<<<<< @@ -6119,25 +6092,17 @@ */ __pyx_v_worth_saving = 1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":949 - * # re-writing a dirstate for just this - * worth_saving = 0 - * elif minikind == c'l': # <<<<<<<<<<<<<< - * if saved_minikind == c'l': - * # If the object hasn't changed kind, it isn't worth saving the - */ - switch (__pyx_v_minikind) { - - /* "bzrlib/_dirstate_helpers_pyx.pyx":911 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":911 * link_or_sha1 = None * worth_saving = 1 * if minikind == c'f': # <<<<<<<<<<<<<< * executable = self._is_executable(stat_value.st_mode, * saved_executable) */ + switch (__pyx_v_minikind) { case 'f': - /* "bzrlib/_dirstate_helpers_pyx.pyx":912 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":912 * worth_saving = 1 * if minikind == c'f': * executable = self._is_executable(stat_value.st_mode, # <<<<<<<<<<<<<< @@ -6149,7 +6114,7 @@ __pyx_t_1 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":913 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":913 * if minikind == c'f': * executable = self._is_executable(stat_value.st_mode, * saved_executable) # <<<<<<<<<<<<<< @@ -6157,22 +6122,22 @@ * self._sha_cutoff_time() */ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_saved_executable); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_saved_executable); __Pyx_GIVEREF(__pyx_v_saved_executable); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_executable); __pyx_v_executable = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":914 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":914 * executable = self._is_executable(stat_value.st_mode, * saved_executable) * if self._cutoff_time is None: # <<<<<<<<<<<<<< @@ -6185,7 +6150,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":915 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":915 * saved_executable) * if self._cutoff_time is None: * self._sha_cutoff_time() # <<<<<<<<<<<<<< @@ -6202,7 +6167,7 @@ } __pyx_L8:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":916 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":916 * if self._cutoff_time is None: * self._sha_cutoff_time() * if (stat_value.st_mtime < self._cutoff_time # <<<<<<<<<<<<<< @@ -6221,7 +6186,7 @@ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_4) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":917 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":917 * self._sha_cutoff_time() * if (stat_value.st_mtime < self._cutoff_time * and stat_value.st_ctime < self._cutoff_time # <<<<<<<<<<<<<< @@ -6240,7 +6205,7 @@ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":918 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":918 * if (stat_value.st_mtime < self._cutoff_time * and stat_value.st_ctime < self._cutoff_time * and len(entry[1]) > 1 # <<<<<<<<<<<<<< @@ -6254,7 +6219,7 @@ __pyx_t_3 = (__pyx_t_8 > 1); if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":919 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":919 * and stat_value.st_ctime < self._cutoff_time * and len(entry[1]) > 1 * and entry[1][1][0] != 'a'): # <<<<<<<<<<<<<< @@ -6288,7 +6253,7 @@ } if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":923 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":923 * # avoidance of sha1's. However the most prominent case of * # over-shaing is during initial add, which this catches. * link_or_sha1 = self._sha1_file(abspath) # <<<<<<<<<<<<<< @@ -6298,19 +6263,19 @@ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___sha1_file); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_abspath); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_abspath); __Pyx_GIVEREF(__pyx_v_abspath); - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_link_or_sha1); __pyx_v_link_or_sha1 = __pyx_t_6; __pyx_t_6 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":924 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":924 * # over-shaing is during initial add, which this catches. * link_or_sha1 = self._sha1_file(abspath) * entry[1][0] = ('f', link_or_sha1, stat_value.st_size, # <<<<<<<<<<<<<< @@ -6320,7 +6285,7 @@ __pyx_t_6 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "bzrlib/_dirstate_helpers_pyx.pyx":925 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":925 * link_or_sha1 = self._sha1_file(abspath) * entry[1][0] = ('f', link_or_sha1, stat_value.st_size, * executable, packed_stat) # <<<<<<<<<<<<<< @@ -6328,7 +6293,7 @@ * # This file is not worth caching the sha1. Either it is too new, or */ __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_n_s__f)); PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__f)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f)); @@ -6345,7 +6310,7 @@ __Pyx_GIVEREF(__pyx_v_packed_stat); __pyx_t_6 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":924 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":924 * # over-shaing is during initial add, which this catches. * link_or_sha1 = self._sha1_file(abspath) * entry[1][0] = ('f', link_or_sha1, stat_value.st_size, # <<<<<<<<<<<<<< @@ -6354,14 +6319,14 @@ */ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetItemInt(__pyx_t_6, 0, ((PyObject *)__pyx_t_7), sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_7, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L9; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":932 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":932 * # *not* set the IN_MEMORY_MODIFIED flag. (But we'll save the * # updated values if there is *other* data worth saving.) * entry[1][0] = ('f', '', stat_value.st_size, executable, # <<<<<<<<<<<<<< @@ -6371,7 +6336,7 @@ __pyx_t_7 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - /* "bzrlib/_dirstate_helpers_pyx.pyx":933 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":933 * # updated values if there is *other* data worth saving.) * entry[1][0] = ('f', '', stat_value.st_size, executable, * DirState.NULLSTAT) # <<<<<<<<<<<<<< @@ -6384,7 +6349,7 @@ __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_n_s__f)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__f)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__f)); @@ -6401,7 +6366,7 @@ __pyx_t_7 = 0; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":932 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":932 * # *not* set the IN_MEMORY_MODIFIED flag. (But we'll save the * # updated values if there is *other* data worth saving.) * entry[1][0] = ('f', '', stat_value.st_size, executable, # <<<<<<<<<<<<<< @@ -6410,11 +6375,11 @@ */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_SetItemInt(__pyx_t_1, 0, ((PyObject *)__pyx_t_6), sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_1, 0, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":934 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":934 * entry[1][0] = ('f', '', stat_value.st_size, executable, * DirState.NULLSTAT) * worth_saving = 0 # <<<<<<<<<<<<<< @@ -6426,7 +6391,7 @@ __pyx_L9:; break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":935 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":935 * DirState.NULLSTAT) * worth_saving = 0 * elif minikind == c'd': # <<<<<<<<<<<<<< @@ -6435,7 +6400,7 @@ */ case 'd': - /* "bzrlib/_dirstate_helpers_pyx.pyx":936 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":936 * worth_saving = 0 * elif minikind == c'd': * entry[1][0] = ('d', '', 0, False, packed_stat) # <<<<<<<<<<<<<< @@ -6445,7 +6410,7 @@ __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_n_s__d)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__d)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__d)); @@ -6463,11 +6428,11 @@ __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_SetItemInt(__pyx_t_6, 0, ((PyObject *)__pyx_t_1), sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_1, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":937 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":937 * elif minikind == c'd': * entry[1][0] = ('d', '', 0, False, packed_stat) * if saved_minikind != c'd': # <<<<<<<<<<<<<< @@ -6477,14 +6442,14 @@ __pyx_t_5 = (__pyx_v_saved_minikind != 'd'); if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":942 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":942 * # often, so this doesn't have to be super fast. * block_index, entry_index, dir_present, file_present = \ * self._get_block_entry_index(entry[0][0], entry[0][1], 0) # <<<<<<<<<<<<<< * self._ensure_block(block_index, entry_index, * pathjoin(entry[0][0], entry[0][1])) */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_21); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_19); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); @@ -6497,7 +6462,7 @@ __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_11); @@ -6507,10 +6472,10 @@ __Pyx_GIVEREF(__pyx_int_0); __pyx_t_7 = 0; __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyTuple_CheckExact(__pyx_t_11) && likely(PyTuple_GET_SIZE(__pyx_t_11) == 4)) { PyObject* tuple = __pyx_t_11; __pyx_t_6 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_6); @@ -6518,7 +6483,7 @@ __pyx_t_7 = PyTuple_GET_ITEM(tuple, 2); __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = PyTuple_GET_ITEM(tuple, 3); __Pyx_INCREF(__pyx_t_12); - /* "bzrlib/_dirstate_helpers_pyx.pyx":941 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":941 * # have a directory block for it. This doesn't happen very * # often, so this doesn't have to be super fast. * block_index, entry_index, dir_present, file_present = \ # <<<<<<<<<<<<<< @@ -6566,7 +6531,7 @@ __pyx_t_12 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":943 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":943 * block_index, entry_index, dir_present, file_present = \ * self._get_block_entry_index(entry[0][0], entry[0][1], 0) * self._ensure_block(block_index, entry_index, # <<<<<<<<<<<<<< @@ -6576,7 +6541,7 @@ __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___ensure_block); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - /* "bzrlib/_dirstate_helpers_pyx.pyx":944 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":944 * self._get_block_entry_index(entry[0][0], entry[0][1], 0) * self._ensure_block(block_index, entry_index, * pathjoin(entry[0][0], entry[0][1])) # <<<<<<<<<<<<<< @@ -6596,19 +6561,19 @@ __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __Pyx_GOTREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_1 = 0; __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_12, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_block_index); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_block_index); __Pyx_GIVEREF(__pyx_v_block_index); @@ -6618,16 +6583,16 @@ PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_11, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L10; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":948 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":948 * # Any changes are derived trivially from the stat object, not worth * # re-writing a dirstate for just this * worth_saving = 0 # <<<<<<<<<<<<<< @@ -6639,7 +6604,7 @@ __pyx_L10:; break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":949 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":949 * # re-writing a dirstate for just this * worth_saving = 0 * elif minikind == c'l': # <<<<<<<<<<<<<< @@ -6648,7 +6613,7 @@ */ case 'l': - /* "bzrlib/_dirstate_helpers_pyx.pyx":950 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":950 * worth_saving = 0 * elif minikind == c'l': * if saved_minikind == c'l': # <<<<<<<<<<<<<< @@ -6658,7 +6623,7 @@ __pyx_t_5 = (__pyx_v_saved_minikind == 'l'); if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":955 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":955 * # save the target in the inode entry, rather than separately. So to * # stat, we've already read everything off disk. * worth_saving = 0 # <<<<<<<<<<<<<< @@ -6670,7 +6635,7 @@ } __pyx_L11:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":956 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":956 * # stat, we've already read everything off disk. * worth_saving = 0 * link_or_sha1 = self._read_link(abspath, saved_link_or_sha1) # <<<<<<<<<<<<<< @@ -6680,22 +6645,22 @@ __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___read_link); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_abspath); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_abspath); __Pyx_GIVEREF(__pyx_v_abspath); __Pyx_INCREF(__pyx_v_saved_link_or_sha1); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_saved_link_or_sha1); __Pyx_GIVEREF(__pyx_v_saved_link_or_sha1); - __pyx_t_11 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_link_or_sha1); __pyx_v_link_or_sha1 = __pyx_t_11; __pyx_t_11 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":957 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":957 * worth_saving = 0 * link_or_sha1 = self._read_link(abspath, saved_link_or_sha1) * if self._cutoff_time is None: # <<<<<<<<<<<<<< @@ -6708,7 +6673,7 @@ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":958 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":958 * link_or_sha1 = self._read_link(abspath, saved_link_or_sha1) * if self._cutoff_time is None: * self._sha_cutoff_time() # <<<<<<<<<<<<<< @@ -6725,7 +6690,7 @@ } __pyx_L12:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":959 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":959 * if self._cutoff_time is None: * self._sha_cutoff_time() * if (stat_value.st_mtime < self._cutoff_time # <<<<<<<<<<<<<< @@ -6744,7 +6709,7 @@ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":960 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":960 * self._sha_cutoff_time() * if (stat_value.st_mtime < self._cutoff_time * and stat_value.st_ctime < self._cutoff_time): # <<<<<<<<<<<<<< @@ -6767,7 +6732,7 @@ } if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":961 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":961 * if (stat_value.st_mtime < self._cutoff_time * and stat_value.st_ctime < self._cutoff_time): * entry[1][0] = ('l', link_or_sha1, stat_value.st_size, # <<<<<<<<<<<<<< @@ -6777,7 +6742,7 @@ __pyx_t_7 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - /* "bzrlib/_dirstate_helpers_pyx.pyx":962 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":962 * and stat_value.st_ctime < self._cutoff_time): * entry[1][0] = ('l', link_or_sha1, stat_value.st_size, * False, packed_stat) # <<<<<<<<<<<<<< @@ -6787,7 +6752,7 @@ __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_n_s__l)); PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_n_s__l)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__l)); @@ -6804,7 +6769,7 @@ __pyx_t_7 = 0; __pyx_t_11 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":961 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":961 * if (stat_value.st_mtime < self._cutoff_time * and stat_value.st_ctime < self._cutoff_time): * entry[1][0] = ('l', link_or_sha1, stat_value.st_size, # <<<<<<<<<<<<<< @@ -6813,14 +6778,14 @@ */ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_SetItemInt(__pyx_t_11, 0, ((PyObject *)__pyx_t_6), sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_11, 0, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L13; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":964 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":964 * False, packed_stat) * else: * entry[1][0] = ('l', '', stat_value.st_size, # <<<<<<<<<<<<<< @@ -6830,7 +6795,7 @@ __pyx_t_6 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "bzrlib/_dirstate_helpers_pyx.pyx":965 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":965 * else: * entry[1][0] = ('l', '', stat_value.st_size, * False, DirState.NULLSTAT) # <<<<<<<<<<<<<< @@ -6845,7 +6810,7 @@ __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(((PyObject *)__pyx_n_s__l)); PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__l)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__l)); @@ -6862,7 +6827,7 @@ __pyx_t_11 = 0; __pyx_t_12 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":964 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":964 * False, packed_stat) * else: * entry[1][0] = ('l', '', stat_value.st_size, # <<<<<<<<<<<<<< @@ -6871,15 +6836,15 @@ */ __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - if (__Pyx_SetItemInt(__pyx_t_12, 0, ((PyObject *)__pyx_t_7), sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__Pyx_SetItemInt(__pyx_t_12, 0, __pyx_t_7, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L13:; break; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":966 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":966 * entry[1][0] = ('l', '', stat_value.st_size, * False, DirState.NULLSTAT) * if worth_saving: # <<<<<<<<<<<<<< @@ -6888,7 +6853,7 @@ */ if (__pyx_v_worth_saving) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":969 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":969 * # Note, even though _mark_modified will only set * # IN_MEMORY_HASH_MODIFIED, it still isn't worth * self._mark_modified([entry]) # <<<<<<<<<<<<<< @@ -6903,20 +6868,20 @@ PyList_SET_ITEM(__pyx_t_12, 0, __pyx_v_entry); __Pyx_GIVEREF(__pyx_v_entry); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); + __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_t_12)); __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L14; } __pyx_L14:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":970 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":970 * # IN_MEMORY_HASH_MODIFIED, it still isn't worth * self._mark_modified([entry]) * return link_or_sha1 # <<<<<<<<<<<<<< @@ -6956,7 +6921,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":974 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":974 * * # TODO: Do we want to worry about exceptions here? * cdef char _minikind_from_string(object string) except? -1: # <<<<<<<<<<<<<< @@ -6968,7 +6933,7 @@ char __pyx_r; __Pyx_RefNannySetupContext("_minikind_from_string"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":976 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":976 * cdef char _minikind_from_string(object string) except? -1: * """Convert a python string to a char.""" * return PyString_AsString(string)[0] # <<<<<<<<<<<<<< @@ -6984,7 +6949,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":993 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":993 * * * cdef object _minikind_to_kind(char minikind): # <<<<<<<<<<<<<< @@ -6999,25 +6964,17 @@ PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("_minikind_to_kind"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1006 - * elif minikind == c'l': - * return _kind_symlink - * elif minikind == c't': # <<<<<<<<<<<<<< - * return _kind_tree_reference - * _minikind[0] = minikind - */ - switch (__pyx_v_minikind) { - - /* "bzrlib/_dirstate_helpers_pyx.pyx":996 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":996 * """Create a string kind for minikind.""" * cdef char _minikind[1] * if minikind == c'f': # <<<<<<<<<<<<<< * return _kind_file * elif minikind == c'd': */ + switch (__pyx_v_minikind) { case 'f': - /* "bzrlib/_dirstate_helpers_pyx.pyx":997 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":997 * cdef char _minikind[1] * if minikind == c'f': * return _kind_file # <<<<<<<<<<<<<< @@ -7030,7 +6987,7 @@ goto __pyx_L0; break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":998 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":998 * if minikind == c'f': * return _kind_file * elif minikind == c'd': # <<<<<<<<<<<<<< @@ -7039,7 +6996,7 @@ */ case 'd': - /* "bzrlib/_dirstate_helpers_pyx.pyx":999 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":999 * return _kind_file * elif minikind == c'd': * return _kind_directory # <<<<<<<<<<<<<< @@ -7052,7 +7009,7 @@ goto __pyx_L0; break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1000 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1000 * elif minikind == c'd': * return _kind_directory * elif minikind == c'a': # <<<<<<<<<<<<<< @@ -7061,7 +7018,7 @@ */ case 'a': - /* "bzrlib/_dirstate_helpers_pyx.pyx":1001 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1001 * return _kind_directory * elif minikind == c'a': * return _kind_absent # <<<<<<<<<<<<<< @@ -7074,7 +7031,7 @@ goto __pyx_L0; break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1002 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1002 * elif minikind == c'a': * return _kind_absent * elif minikind == c'r': # <<<<<<<<<<<<<< @@ -7083,7 +7040,7 @@ */ case 'r': - /* "bzrlib/_dirstate_helpers_pyx.pyx":1003 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1003 * return _kind_absent * elif minikind == c'r': * return _kind_relocated # <<<<<<<<<<<<<< @@ -7096,7 +7053,7 @@ goto __pyx_L0; break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1004 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1004 * elif minikind == c'r': * return _kind_relocated * elif minikind == c'l': # <<<<<<<<<<<<<< @@ -7105,7 +7062,7 @@ */ case 'l': - /* "bzrlib/_dirstate_helpers_pyx.pyx":1005 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1005 * return _kind_relocated * elif minikind == c'l': * return _kind_symlink # <<<<<<<<<<<<<< @@ -7118,7 +7075,7 @@ goto __pyx_L0; break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1006 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1006 * elif minikind == c'l': * return _kind_symlink * elif minikind == c't': # <<<<<<<<<<<<<< @@ -7127,7 +7084,7 @@ */ case 't': - /* "bzrlib/_dirstate_helpers_pyx.pyx":1007 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1007 * return _kind_symlink * elif minikind == c't': * return _kind_tree_reference # <<<<<<<<<<<<<< @@ -7141,7 +7098,7 @@ break; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1008 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1008 * elif minikind == c't': * return _kind_tree_reference * _minikind[0] = minikind # <<<<<<<<<<<<<< @@ -7150,7 +7107,7 @@ */ (__pyx_v__minikind[0]) = __pyx_v_minikind; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1009 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1009 * return _kind_tree_reference * _minikind[0] = minikind * raise KeyError(PyString_FromStringAndSize(_minikind, 1)) # <<<<<<<<<<<<<< @@ -7160,13 +7117,13 @@ __pyx_t_1 = PyString_FromStringAndSize(__pyx_v__minikind, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -7184,7 +7141,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1012 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1012 * * * cdef int _versioned_minikind(char minikind): # cannot_raise # <<<<<<<<<<<<<< @@ -7197,7 +7154,7 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("_versioned_minikind"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1014 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1014 * cdef int _versioned_minikind(char minikind): # cannot_raise * """Return non-zero if minikind is in fltd""" * return (minikind == c'f' or # <<<<<<<<<<<<<< @@ -7207,7 +7164,7 @@ switch (__pyx_v_minikind) { case 'f': - /* "bzrlib/_dirstate_helpers_pyx.pyx":1015 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1015 * """Return non-zero if minikind is in fltd""" * return (minikind == c'f' or * minikind == c'd' or # <<<<<<<<<<<<<< @@ -7216,7 +7173,7 @@ */ case 'd': - /* "bzrlib/_dirstate_helpers_pyx.pyx":1016 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1016 * return (minikind == c'f' or * minikind == c'd' or * minikind == c'l' or # <<<<<<<<<<<<<< @@ -7225,7 +7182,7 @@ */ case 'l': - /* "bzrlib/_dirstate_helpers_pyx.pyx":1017 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1017 * minikind == c'd' or * minikind == c'l' or * minikind == c't') # <<<<<<<<<<<<<< @@ -7234,7 +7191,7 @@ */ case 't': - /* "bzrlib/_dirstate_helpers_pyx.pyx":1014 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1014 * cdef int _versioned_minikind(char minikind): # cannot_raise * """Return non-zero if minikind is in fltd""" * return (minikind == c'f' or # <<<<<<<<<<<<<< @@ -7256,7 +7213,55 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1064 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1031 + * cdef object use_filesystem_for_exec + * cdef object utf8_decode + * cdef readonly object searched_specific_files # <<<<<<<<<<<<<< + * cdef readonly object searched_exact_paths + * cdef object search_specific_files + */ + +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_23searched_specific_files___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_23searched_specific_files___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_specific_files); + __pyx_r = ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_specific_files; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1032 + * cdef object utf8_decode + * cdef readonly object searched_specific_files + * cdef readonly object searched_exact_paths # <<<<<<<<<<<<<< + * cdef object search_specific_files + * # The parents up to the root of the paths we are searching. + */ + +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_20searched_exact_paths___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_20searched_exact_paths___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_exact_paths); + __pyx_r = ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_exact_paths; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1064 * cdef object sha_file * * def __init__(self, include_unchanged, use_filesystem_for_exec, # <<<<<<<<<<<<<< @@ -7377,7 +7382,7 @@ return -1; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1067 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1067 * search_specific_files, state, source_index, target_index, * want_unversioned, tree): * self.doing_consistency_expansion = 0 # <<<<<<<<<<<<<< @@ -7386,7 +7391,7 @@ */ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->doing_consistency_expansion = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1068 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1068 * want_unversioned, tree): * self.doing_consistency_expansion = 0 * self.old_dirname_to_file_id = {} # <<<<<<<<<<<<<< @@ -7401,7 +7406,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->old_dirname_to_file_id = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1069 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1069 * self.doing_consistency_expansion = 0 * self.old_dirname_to_file_id = {} * self.new_dirname_to_file_id = {} # <<<<<<<<<<<<<< @@ -7416,7 +7421,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->new_dirname_to_file_id = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1071 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1071 * self.new_dirname_to_file_id = {} * # Are we doing a partial iter_changes? * self.partial = set(['']).__ne__(search_specific_files) # <<<<<<<<<<<<<< @@ -7429,30 +7434,30 @@ PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PySet_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PySet_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____ne__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_search_specific_files); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_search_specific_files); __Pyx_GIVEREF(__pyx_v_search_specific_files); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->partial = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1074 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1074 * # Using a list so that we can access the values and change them in * # nested scope. Each one is [path, file_id, entry] * self.last_source_parent = [None, None] # <<<<<<<<<<<<<< @@ -7473,7 +7478,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->last_source_parent = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1075 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1075 * # nested scope. Each one is [path, file_id, entry] * self.last_source_parent = [None, None] * self.last_target_parent = [None, None] # <<<<<<<<<<<<<< @@ -7494,7 +7499,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->last_target_parent = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1076 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1076 * self.last_source_parent = [None, None] * self.last_target_parent = [None, None] * if include_unchanged is None: # <<<<<<<<<<<<<< @@ -7504,7 +7509,7 @@ __pyx_t_5 = (__pyx_v_include_unchanged == Py_None); if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1077 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1077 * self.last_target_parent = [None, None] * if include_unchanged is None: * self.include_unchanged = False # <<<<<<<<<<<<<< @@ -7516,7 +7521,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1079 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1079 * self.include_unchanged = False * else: * self.include_unchanged = int(include_unchanged) # <<<<<<<<<<<<<< @@ -7524,20 +7529,20 @@ * self.utf8_decode = cache_utf8._utf8_decode */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_include_unchanged); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_include_unchanged); __Pyx_GIVEREF(__pyx_v_include_unchanged); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->include_unchanged = __pyx_t_4; } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1080 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1080 * else: * self.include_unchanged = int(include_unchanged) * self.use_filesystem_for_exec = use_filesystem_for_exec # <<<<<<<<<<<<<< @@ -7550,7 +7555,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->use_filesystem_for_exec); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->use_filesystem_for_exec = __pyx_v_use_filesystem_for_exec; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1081 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1081 * self.include_unchanged = int(include_unchanged) * self.use_filesystem_for_exec = use_filesystem_for_exec * self.utf8_decode = cache_utf8._utf8_decode # <<<<<<<<<<<<<< @@ -7568,7 +7573,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->utf8_decode = __pyx_t_3; __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1086 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1086 * # add the relocated path as one to search if its not searched already. * # If the detail is not relocated, add the id. * self.searched_specific_files = set() # <<<<<<<<<<<<<< @@ -7583,7 +7588,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_specific_files = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1089 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1089 * # When we search exact paths without expanding downwards, we record * # that here. * self.searched_exact_paths = set() # <<<<<<<<<<<<<< @@ -7598,7 +7603,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_exact_paths = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1090 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1090 * # that here. * self.searched_exact_paths = set() * self.search_specific_files = search_specific_files # <<<<<<<<<<<<<< @@ -7611,7 +7616,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->search_specific_files); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->search_specific_files = __pyx_v_search_specific_files; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1093 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1093 * # The parents up to the root of the paths we are searching. * # After all normal paths are returned, these specific items are returned. * self.search_specific_file_parents = set() # <<<<<<<<<<<<<< @@ -7626,7 +7631,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->search_specific_file_parents = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1095 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1095 * self.search_specific_file_parents = set() * # The ids we've sent out in the delta. * self.seen_ids = set() # <<<<<<<<<<<<<< @@ -7641,7 +7646,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->seen_ids = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1096 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1096 * # The ids we've sent out in the delta. * self.seen_ids = set() * self.state = state # <<<<<<<<<<<<<< @@ -7654,7 +7659,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->state); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->state = __pyx_v_state; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1097 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1097 * self.seen_ids = set() * self.state = state * self.current_root = None # <<<<<<<<<<<<<< @@ -7667,7 +7672,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_root); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_root = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1098 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1098 * self.state = state * self.current_root = None * self.current_root_unicode = None # <<<<<<<<<<<<<< @@ -7680,7 +7685,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_root_unicode); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_root_unicode = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1099 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1099 * self.current_root = None * self.current_root_unicode = None * self.root_entries = None # <<<<<<<<<<<<<< @@ -7693,7 +7698,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_entries); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_entries = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1100 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1100 * self.current_root_unicode = None * self.root_entries = None * self.root_entries_pos = 0 # <<<<<<<<<<<<<< @@ -7702,7 +7707,7 @@ */ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_entries_pos = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1101 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1101 * self.root_entries = None * self.root_entries_pos = 0 * self.root_entries_len = 0 # <<<<<<<<<<<<<< @@ -7711,7 +7716,7 @@ */ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_entries_len = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1102 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1102 * self.root_entries_pos = 0 * self.root_entries_len = 0 * self.root_abspath = None # <<<<<<<<<<<<<< @@ -7724,7 +7729,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_abspath); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_abspath = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1103 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1103 * self.root_entries_len = 0 * self.root_abspath = None * if source_index is None: # <<<<<<<<<<<<<< @@ -7734,7 +7739,7 @@ __pyx_t_5 = (__pyx_v_source_index == Py_None); if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1104 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1104 * self.root_abspath = None * if source_index is None: * self.source_index = -1 # <<<<<<<<<<<<<< @@ -7746,7 +7751,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1106 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1106 * self.source_index = -1 * else: * self.source_index = source_index # <<<<<<<<<<<<<< @@ -7758,7 +7763,7 @@ } __pyx_L7:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1107 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1107 * else: * self.source_index = source_index * self.target_index = target_index # <<<<<<<<<<<<<< @@ -7768,7 +7773,7 @@ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_target_index); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->target_index = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1108 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1108 * self.source_index = source_index * self.target_index = target_index * self.want_unversioned = want_unversioned # <<<<<<<<<<<<<< @@ -7778,7 +7783,7 @@ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_want_unversioned); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->want_unversioned = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1109 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1109 * self.target_index = target_index * self.want_unversioned = want_unversioned * self.tree = tree # <<<<<<<<<<<<<< @@ -7791,7 +7796,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->tree); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->tree = __pyx_v_tree; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1110 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1110 * self.want_unversioned = want_unversioned * self.tree = tree * self.dir_iterator = None # <<<<<<<<<<<<<< @@ -7804,7 +7809,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->dir_iterator); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->dir_iterator = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1111 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1111 * self.tree = tree * self.dir_iterator = None * self.block_index = -1 # <<<<<<<<<<<<<< @@ -7813,7 +7818,7 @@ */ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->block_index = -1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1112 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1112 * self.dir_iterator = None * self.block_index = -1 * self.current_block = None # <<<<<<<<<<<<<< @@ -7826,7 +7831,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_block); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_block = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1113 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1113 * self.block_index = -1 * self.current_block = None * self.current_block_list = None # <<<<<<<<<<<<<< @@ -7839,7 +7844,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_block_list); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_block_list = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1114 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1114 * self.current_block = None * self.current_block_list = None * self.current_block_pos = -1 # <<<<<<<<<<<<<< @@ -7848,7 +7853,7 @@ */ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_block_pos = -1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1115 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1115 * self.current_block_list = None * self.current_block_pos = -1 * self.current_dir_info = None # <<<<<<<<<<<<<< @@ -7861,7 +7866,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_dir_info); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_dir_info = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1116 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1116 * self.current_block_pos = -1 * self.current_dir_info = None * self.current_dir_list = None # <<<<<<<<<<<<<< @@ -7874,7 +7879,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_dir_list); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_dir_list = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1117 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1117 * self.current_dir_info = None * self.current_dir_list = None * self._pending_consistent_entries = [] # <<<<<<<<<<<<<< @@ -7889,7 +7894,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->_pending_consistent_entries = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1118 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1118 * self.current_dir_list = None * self._pending_consistent_entries = [] * self.path_index = 0 # <<<<<<<<<<<<<< @@ -7898,7 +7903,7 @@ */ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->path_index = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1119 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1119 * self._pending_consistent_entries = [] * self.path_index = 0 * self.root_dir_info = None # <<<<<<<<<<<<<< @@ -7911,7 +7916,7 @@ __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_dir_info); ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_dir_info = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1120 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1120 * self.path_index = 0 * self.root_dir_info = None * self.bisect_left = bisect.bisect_left # <<<<<<<<<<<<<< @@ -7929,7 +7934,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->bisect_left = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1121 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1121 * self.root_dir_info = None * self.bisect_left = bisect.bisect_left * self.pathjoin = osutils.pathjoin # <<<<<<<<<<<<<< @@ -7947,7 +7952,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->pathjoin = __pyx_t_3; __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1122 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1122 * self.bisect_left = bisect.bisect_left * self.pathjoin = osutils.pathjoin * self.fstat = os.fstat # <<<<<<<<<<<<<< @@ -7965,7 +7970,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->fstat = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1123 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1123 * self.pathjoin = osutils.pathjoin * self.fstat = os.fstat * self.sha_file = osutils.sha_file # <<<<<<<<<<<<<< @@ -7983,7 +7988,7 @@ ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->sha_file = __pyx_t_3; __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1124 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1124 * self.fstat = os.fstat * self.sha_file = osutils.sha_file * if target_index != 0: # <<<<<<<<<<<<<< @@ -7996,7 +8001,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1126 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1126 * if target_index != 0: * # A lot of code in here depends on target_index == 0 * raise errors.BzrError('unsupported target index') # <<<<<<<<<<<<<< @@ -8008,11 +8013,17 @@ __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__BzrError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_33), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_30)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_30)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_30)); + __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } @@ -8031,7 +8042,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1128 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1128 * raise errors.BzrError('unsupported target index') * * cdef _process_entry(self, entry, path_info): # <<<<<<<<<<<<<< @@ -8076,8 +8087,8 @@ char __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; @@ -8112,7 +8123,7 @@ __pyx_v_parent_entry = Py_None; __Pyx_INCREF(Py_None); __pyx_v_parent_id = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1150 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1150 * cdef int content_change * cdef object details_list * file_id = None # <<<<<<<<<<<<<< @@ -8123,7 +8134,7 @@ __Pyx_DECREF(__pyx_v_file_id); __pyx_v_file_id = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1151 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1151 * cdef object details_list * file_id = None * details_list = entry[1] # <<<<<<<<<<<<<< @@ -8136,7 +8147,7 @@ __pyx_v_details_list = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1152 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1152 * file_id = None * details_list = entry[1] * if -1 == self.source_index: # <<<<<<<<<<<<<< @@ -8146,7 +8157,7 @@ __pyx_t_2 = (-1 == __pyx_v_self->source_index); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1153 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1153 * details_list = entry[1] * if -1 == self.source_index: * source_details = DirState.NULL_PARENT_DETAILS # <<<<<<<<<<<<<< @@ -8165,7 +8176,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1155 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1155 * source_details = DirState.NULL_PARENT_DETAILS * else: * source_details = details_list[self.source_index] # <<<<<<<<<<<<<< @@ -8180,7 +8191,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1156 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1156 * else: * source_details = details_list[self.source_index] * target_details = details_list[self.target_index] # <<<<<<<<<<<<<< @@ -8193,7 +8204,7 @@ __pyx_v_target_details = __pyx_t_3; __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1157 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1157 * source_details = details_list[self.source_index] * target_details = details_list[self.target_index] * target_minikind = _minikind_from_string(target_details[0]) # <<<<<<<<<<<<<< @@ -8206,7 +8217,7 @@ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_target_minikind = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1158 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1158 * target_details = details_list[self.target_index] * target_minikind = _minikind_from_string(target_details[0]) * if path_info is not None and _versioned_minikind(target_minikind): # <<<<<<<<<<<<<< @@ -8221,7 +8232,7 @@ } if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1159 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1159 * target_minikind = _minikind_from_string(target_details[0]) * if path_info is not None and _versioned_minikind(target_minikind): * if self.target_index != 0: # <<<<<<<<<<<<<< @@ -8231,7 +8242,7 @@ __pyx_t_5 = (__pyx_v_self->target_index != 0); if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1161 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1161 * if self.target_index != 0: * raise AssertionError("Unsupported target index %d" % * self.target_index) # <<<<<<<<<<<<<< @@ -8240,17 +8251,17 @@ */ __pyx_t_3 = PyInt_FromLong(__pyx_v_self->target_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_34), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_31), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -8258,58 +8269,55 @@ } __pyx_L5:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1162 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1162 * raise AssertionError("Unsupported target index %d" % * self.target_index) * link_or_sha1 = _update_entry(self.state, entry, path_info[4], path_info[3]) # <<<<<<<<<<<<<< * # The entry may have been modified by update_entry * target_details = details_list[self.target_index] */ - __pyx_t_1 = __pyx_v_self->state; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_path_info, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_path_info, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__update_entry(__pyx_v_self->state, __pyx_v_entry, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__update_entry(__pyx_t_1, __pyx_v_entry, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_link_or_sha1); - __pyx_v_link_or_sha1 = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_link_or_sha1 = __pyx_t_6; + __pyx_t_6 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1164 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1164 * link_or_sha1 = _update_entry(self.state, entry, path_info[4], path_info[3]) * # The entry may have been modified by update_entry * target_details = details_list[self.target_index] # <<<<<<<<<<<<<< * target_minikind = _minikind_from_string(target_details[0]) * else: */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_details_list, __pyx_v_self->target_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_details_list, __pyx_v_self->target_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_v_target_details); - __pyx_v_target_details = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_target_details = __pyx_t_6; + __pyx_t_6 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1165 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1165 * # The entry may have been modified by update_entry * target_details = details_list[self.target_index] * target_minikind = _minikind_from_string(target_details[0]) # <<<<<<<<<<<<<< * else: * link_or_sha1 = None */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_target_details, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_from_string(__pyx_t_7); if (unlikely(__pyx_t_4 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_target_details, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_from_string(__pyx_t_6); if (unlikely(__pyx_t_4 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_target_minikind = __pyx_t_4; goto __pyx_L4; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1167 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1167 * target_minikind = _minikind_from_string(target_details[0]) * else: * link_or_sha1 = None # <<<<<<<<<<<<<< @@ -8322,20 +8330,20 @@ } __pyx_L4:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1170 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1170 * # the rest of this function is 0.3 seconds on 50K paths, or * # 0.000006 seconds per call. * source_minikind = _minikind_from_string(source_details[0]) # <<<<<<<<<<<<<< * if ((_versioned_minikind(source_minikind) or source_minikind == c'r') * and _versioned_minikind(target_minikind)): */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_source_details, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_from_string(__pyx_t_7); if (unlikely(__pyx_t_4 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_source_details, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_4 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_from_string(__pyx_t_6); if (unlikely(__pyx_t_4 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_source_minikind = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1171 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1171 * # 0.000006 seconds per call. * source_minikind = _minikind_from_string(source_details[0]) * if ((_versioned_minikind(source_minikind) or source_minikind == c'r') # <<<<<<<<<<<<<< @@ -8350,7 +8358,7 @@ } if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1172 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1172 * source_minikind = _minikind_from_string(source_details[0]) * if ((_versioned_minikind(source_minikind) or source_minikind == c'r') * and _versioned_minikind(target_minikind)): # <<<<<<<<<<<<<< @@ -8363,7 +8371,7 @@ } if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1178 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1178 * # r | fdlt | a | dangling file that was present in the basis. * # | | | ??? * if source_minikind != c'r': # <<<<<<<<<<<<<< @@ -8373,39 +8381,39 @@ __pyx_t_5 = (__pyx_v_source_minikind != 'r'); if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1179 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1179 * # | | | ??? * if source_minikind != c'r': * old_dirname = entry[0][0] # <<<<<<<<<<<<<< * old_basename = entry[0][1] * old_path = path = None */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_old_dirname); - __pyx_v_old_dirname = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_old_dirname = __pyx_t_3; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1180 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1180 * if source_minikind != c'r': * old_dirname = entry[0][0] * old_basename = entry[0][1] # <<<<<<<<<<<<<< * old_path = path = None * else: */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_old_basename); - __pyx_v_old_basename = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_old_basename = __pyx_t_6; + __pyx_t_6 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1181 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1181 * old_dirname = entry[0][0] * old_basename = entry[0][1] * old_path = path = None # <<<<<<<<<<<<<< @@ -8422,7 +8430,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1185 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1185 * # add the source to the search path to find any children it * # has. TODO ? : only add if it is a container ? * if (not self.doing_consistency_expansion and # <<<<<<<<<<<<<< @@ -8432,282 +8440,291 @@ __pyx_t_5 = (!__pyx_v_self->doing_consistency_expansion); if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1186 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1186 * # has. TODO ? : only add if it is a container ? * if (not self.doing_consistency_expansion and * not osutils.is_inside_any(self.searched_specific_files, # <<<<<<<<<<<<<< * source_details[1])): * self.search_specific_files.add(source_details[1]) */ - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__is_inside_any); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__is_inside_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1187 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1187 * if (not self.doing_consistency_expansion and * not osutils.is_inside_any(self.searched_specific_files, * source_details[1])): # <<<<<<<<<<<<<< * self.search_specific_files.add(source_details[1]) * # expanding from a user requested path, parent expansion */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_source_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_source_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->searched_specific_files); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->searched_specific_files); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->searched_specific_files); __Pyx_GIVEREF(__pyx_v_self->searched_specific_files); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = (!__pyx_t_2); - __pyx_t_2 = __pyx_t_8; + __pyx_t_7 = (!__pyx_t_2); + __pyx_t_2 = __pyx_t_7; } else { __pyx_t_2 = __pyx_t_5; } if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1188 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1188 * not osutils.is_inside_any(self.searched_specific_files, * source_details[1])): * self.search_specific_files.add(source_details[1]) # <<<<<<<<<<<<<< * # expanding from a user requested path, parent expansion * # for delta consistency happens later. */ - __pyx_t_7 = PyObject_GetAttr(__pyx_v_self->search_specific_files, __pyx_n_s__add); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_source_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->search_specific_files, __pyx_n_s__add); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_source_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L8; } __pyx_L8:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1193 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1193 * # generate the old path; this is needed for stating later * # as well. * old_path = source_details[1] # <<<<<<<<<<<<<< * old_dirname, old_basename = os.path.split(old_path) * path = self.pathjoin(entry[0][0], entry[0][1]) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_source_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_source_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_old_path); - __pyx_v_old_path = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_old_path = __pyx_t_1; + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1194 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1194 * # as well. * old_path = source_details[1] * old_dirname, old_basename = os.path.split(old_path) # <<<<<<<<<<<<<< * path = self.pathjoin(entry[0][0], entry[0][1]) * old_entry = self.state._get_entry(self.source_index, */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_INCREF(__pyx_v_old_path); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_old_path); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_old_path); __Pyx_GIVEREF(__pyx_v_old_path); - __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - if (PyTuple_CheckExact(__pyx_t_7) && likely(PyTuple_GET_SIZE(__pyx_t_7) == 2)) { - PyObject* tuple = __pyx_t_7; - __pyx_t_6 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_6); - __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyTuple_CheckExact(__pyx_t_6) && likely(PyTuple_GET_SIZE(__pyx_t_6) == 2)) { + PyObject* tuple = __pyx_t_6; + __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_old_dirname); - __pyx_v_old_dirname = __pyx_t_6; - __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_v_old_basename); - __pyx_v_old_basename = __pyx_t_3; + __pyx_v_old_dirname = __pyx_t_3; __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_v_old_basename); + __pyx_v_old_basename = __pyx_t_1; + __pyx_t_1 = 0; } else { - __pyx_t_1 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_1, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_1, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_8, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_EndUnpack(__pyx_t_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_8, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_EndUnpack(__pyx_t_8, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_old_dirname); - __pyx_v_old_dirname = __pyx_t_6; - __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_v_old_basename); - __pyx_v_old_basename = __pyx_t_3; + __pyx_v_old_dirname = __pyx_t_3; __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_v_old_basename); + __pyx_v_old_basename = __pyx_t_1; + __pyx_t_1 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1195 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1195 * old_path = source_details[1] * old_dirname, old_basename = os.path.split(old_path) * path = self.pathjoin(entry[0][0], entry[0][1]) # <<<<<<<<<<<<<< * old_entry = self.state._get_entry(self.source_index, * path_utf8=old_path) */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_1 = 0; __pyx_t_3 = 0; - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_v_self->pathjoin, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __pyx_t_3 = PyObject_Call(__pyx_v_self->pathjoin, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_path); - __pyx_v_path = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_path = __pyx_t_3; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1196 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1196 * old_dirname, old_basename = os.path.split(old_path) * path = self.pathjoin(entry[0][0], entry[0][1]) * old_entry = self.state._get_entry(self.source_index, # <<<<<<<<<<<<<< * path_utf8=old_path) * # update the source details variable to be the real */ - __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___get_entry); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___get_entry); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyInt_FromLong(__pyx_v_self->source_index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyInt_FromLong(__pyx_v_self->source_index); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1197 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1197 * path = self.pathjoin(entry[0][0], entry[0][1]) * old_entry = self.state._get_entry(self.source_index, * path_utf8=old_path) # <<<<<<<<<<<<<< * # update the source details variable to be the real * # location. */ - if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__path_utf8), __pyx_v_old_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__path_utf8), __pyx_v_old_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_1, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_old_entry); - __pyx_v_old_entry = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_old_entry = __pyx_t_8; + __pyx_t_8 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1200 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1200 * # update the source details variable to be the real * # location. * if old_entry == (None, None): # <<<<<<<<<<<<<< * raise errors.CorruptDirstate(self.state._filename, * "entry '%s/%s' is considered renamed from %r" */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_old_entry, ((PyObject *)__pyx_k_tuple_35), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_6 = PyObject_RichCompare(__pyx_v_old_entry, __pyx_t_8, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1201 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1201 * # location. * if old_entry == (None, None): * raise errors.CorruptDirstate(self.state._filename, # <<<<<<<<<<<<<< * "entry '%s/%s' is considered renamed from %r" * " but source does not exist\n" */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__CorruptDirstate); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__CorruptDirstate); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___filename); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1204 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1204 * "entry '%s/%s' is considered renamed from %r" * " but source does not exist\n" * "entry: %s" % (entry[0][0], entry[0][1], old_path, entry)) # <<<<<<<<<<<<<< * source_details = old_entry[1][self.source_index] * source_minikind = _minikind_from_string(source_details[0]) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_old_path); - PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_old_path); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_old_path); __Pyx_GIVEREF(__pyx_v_old_path); __Pyx_INCREF(__pyx_v_entry); - PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_entry); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_entry); __Pyx_GIVEREF(__pyx_v_entry); - __pyx_t_6 = 0; + __pyx_t_3 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_36), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_32), __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_9)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_9)); __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); - __pyx_t_1 = 0; + __pyx_t_6 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_9, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -8715,7 +8732,7 @@ } __pyx_L9:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1205 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1205 * " but source does not exist\n" * "entry: %s" % (entry[0][0], entry[0][1], old_path, entry)) * source_details = old_entry[1][self.source_index] # <<<<<<<<<<<<<< @@ -8724,29 +8741,29 @@ */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_old_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, __pyx_v_self->source_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, __pyx_v_self->source_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_source_details); - __pyx_v_source_details = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_source_details = __pyx_t_1; + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1206 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1206 * "entry: %s" % (entry[0][0], entry[0][1], old_path, entry)) * source_details = old_entry[1][self.source_index] * source_minikind = _minikind_from_string(source_details[0]) # <<<<<<<<<<<<<< * if path_info is None: * # the file is missing on disk, show as removed. */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_source_details, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_from_string(__pyx_t_3); if (unlikely(__pyx_t_4 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_source_details, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_from_string(__pyx_t_1); if (unlikely(__pyx_t_4 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_source_minikind = __pyx_t_4; } __pyx_L7:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1207 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1207 * source_details = old_entry[1][self.source_index] * source_minikind = _minikind_from_string(source_details[0]) * if path_info is None: # <<<<<<<<<<<<<< @@ -8756,7 +8773,7 @@ __pyx_t_2 = (__pyx_v_path_info == Py_None); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1209 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1209 * if path_info is None: * # the file is missing on disk, show as removed. * content_change = 1 # <<<<<<<<<<<<<< @@ -8765,7 +8782,7 @@ */ __pyx_v_content_change = 1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1210 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1210 * # the file is missing on disk, show as removed. * content_change = 1 * target_kind = None # <<<<<<<<<<<<<< @@ -8776,49 +8793,49 @@ __Pyx_DECREF(__pyx_v_target_kind); __pyx_v_target_kind = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1211 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1211 * content_change = 1 * target_kind = None * target_exec = False # <<<<<<<<<<<<<< * else: * # source and target are both versioned and disk file is present. */ - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_target_exec); - __pyx_v_target_exec = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_target_exec = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L10; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1214 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1214 * else: * # source and target are both versioned and disk file is present. * target_kind = path_info[2] # <<<<<<<<<<<<<< * if target_kind == 'directory': * if path is None: */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_target_kind); - __pyx_v_target_kind = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_target_kind = __pyx_t_1; + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1215 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1215 * # source and target are both versioned and disk file is present. * target_kind = path_info[2] * if target_kind == 'directory': # <<<<<<<<<<<<<< * if path is None: * old_path = path = self.pathjoin(old_dirname, old_basename) */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_target_kind, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_target_kind, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1216 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1216 * target_kind = path_info[2] * if target_kind == 'directory': * if path is None: # <<<<<<<<<<<<<< @@ -8828,24 +8845,24 @@ __pyx_t_2 = (__pyx_v_path == Py_None); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1217 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1217 * if target_kind == 'directory': * if path is None: * old_path = path = self.pathjoin(old_dirname, old_basename) # <<<<<<<<<<<<<< * file_id = entry[0][2] * self.new_dirname_to_file_id[path] = file_id */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_old_dirname); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_old_dirname); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_old_dirname); __Pyx_GIVEREF(__pyx_v_old_dirname); __Pyx_INCREF(__pyx_v_old_basename); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_old_basename); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_old_basename); __Pyx_GIVEREF(__pyx_v_old_basename); - __pyx_t_9 = PyObject_Call(__pyx_v_self->pathjoin, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_v_self->pathjoin, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_INCREF(__pyx_t_9); __Pyx_DECREF(__pyx_v_old_path); __pyx_v_old_path = __pyx_t_9; @@ -8857,7 +8874,7 @@ } __pyx_L12:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1218 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1218 * if path is None: * old_path = path = self.pathjoin(old_dirname, old_basename) * file_id = entry[0][2] # <<<<<<<<<<<<<< @@ -8866,14 +8883,14 @@ */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_file_id); - __pyx_v_file_id = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_file_id = __pyx_t_1; + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1219 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1219 * old_path = path = self.pathjoin(old_dirname, old_basename) * file_id = entry[0][2] * self.new_dirname_to_file_id[path] = file_id # <<<<<<<<<<<<<< @@ -8882,7 +8899,7 @@ */ if (PyObject_SetItem(__pyx_v_self->new_dirname_to_file_id, __pyx_v_path, __pyx_v_file_id) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":1220 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1220 * file_id = entry[0][2] * self.new_dirname_to_file_id[path] = file_id * if source_minikind != c'd': # <<<<<<<<<<<<<< @@ -8892,7 +8909,7 @@ __pyx_t_2 = (__pyx_v_source_minikind != 'd'); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1221 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1221 * self.new_dirname_to_file_id[path] = file_id * if source_minikind != c'd': * content_change = 1 # <<<<<<<<<<<<<< @@ -8904,7 +8921,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1224 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1224 * else: * # directories have no fingerprint * content_change = 0 # <<<<<<<<<<<<<< @@ -8915,35 +8932,35 @@ } __pyx_L13:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1225 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1225 * # directories have no fingerprint * content_change = 0 * target_exec = False # <<<<<<<<<<<<<< * elif target_kind == 'file': * if source_minikind != c'f': */ - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_target_exec); - __pyx_v_target_exec = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_target_exec = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L11; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1226 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1226 * content_change = 0 * target_exec = False * elif target_kind == 'file': # <<<<<<<<<<<<<< * if source_minikind != c'f': * content_change = 1 */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_target_kind, ((PyObject *)__pyx_n_s__file), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_target_kind, ((PyObject *)__pyx_n_s__file), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1227 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1227 * target_exec = False * elif target_kind == 'file': * if source_minikind != c'f': # <<<<<<<<<<<<<< @@ -8953,7 +8970,7 @@ __pyx_t_2 = (__pyx_v_source_minikind != 'f'); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1228 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1228 * elif target_kind == 'file': * if source_minikind != c'f': * content_change = 1 # <<<<<<<<<<<<<< @@ -8965,7 +8982,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1233 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1233 * # content filtering may mean differ sizes actually * # map to the same content * if link_or_sha1 is None: # <<<<<<<<<<<<<< @@ -8975,85 +8992,85 @@ __pyx_t_2 = (__pyx_v_link_or_sha1 == Py_None); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1236 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1236 * # Stat cache miss: * statvalue, link_or_sha1 = \ * self.state._sha1_provider.stat_and_sha1( # <<<<<<<<<<<<<< * path_info[4]) * self.state._observed_sha1(entry, link_or_sha1, */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___sha1_provider); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__stat_and_sha1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___sha1_provider); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__stat_and_sha1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1237 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1237 * statvalue, link_or_sha1 = \ * self.state._sha1_provider.stat_and_sha1( * path_info[4]) # <<<<<<<<<<<<<< * self.state._observed_sha1(entry, link_or_sha1, * statvalue) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_path_info, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_path_info, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { - PyObject* tuple = __pyx_t_3; - __pyx_t_7 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) { + PyObject* tuple = __pyx_t_1; + __pyx_t_8 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_9); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1235 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1235 * if link_or_sha1 is None: * # Stat cache miss: * statvalue, link_or_sha1 = \ # <<<<<<<<<<<<<< * self.state._sha1_provider.stat_and_sha1( * path_info[4]) */ - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_statvalue); - __pyx_v_statvalue = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_statvalue = __pyx_t_8; + __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_link_or_sha1); __pyx_v_link_or_sha1 = __pyx_t_9; __pyx_t_9 = 0; } else { - __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_1, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_1, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_EndUnpack(__pyx_t_1, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_statvalue); - __pyx_v_statvalue = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_statvalue = __pyx_t_8; + __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_link_or_sha1); __pyx_v_link_or_sha1 = __pyx_t_9; __pyx_t_9 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1238 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1238 * self.state._sha1_provider.stat_and_sha1( * path_info[4]) * self.state._observed_sha1(entry, link_or_sha1, # <<<<<<<<<<<<<< * statvalue) * content_change = (link_or_sha1 != source_details[1]) */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___observed_sha1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___observed_sha1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1239 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1239 * path_info[4]) * self.state._observed_sha1(entry, link_or_sha1, * statvalue) # <<<<<<<<<<<<<< @@ -9061,7 +9078,7 @@ * # Target details is updated at update_entry time */ __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_entry); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_entry); __Pyx_GIVEREF(__pyx_v_entry); @@ -9071,34 +9088,34 @@ __Pyx_INCREF(__pyx_v_statvalue); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_statvalue); __Pyx_GIVEREF(__pyx_v_statvalue); - __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L15; } __pyx_L15:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1240 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1240 * self.state._observed_sha1(entry, link_or_sha1, * statvalue) * content_change = (link_or_sha1 != source_details[1]) # <<<<<<<<<<<<<< * # Target details is updated at update_entry time * if self.use_filesystem_for_exec: */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_source_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyObject_RichCompare(__pyx_v_link_or_sha1, __pyx_t_7, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_source_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_link_or_sha1, __pyx_t_8, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_content_change = __pyx_t_10; } __pyx_L14:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1242 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1242 * content_change = (link_or_sha1 != source_details[1]) * # Target details is updated at update_entry time * if self.use_filesystem_for_exec: # <<<<<<<<<<<<<< @@ -9108,7 +9125,7 @@ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->use_filesystem_for_exec); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1245 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1245 * # We don't need S_ISREG here, because we are sure * # we are dealing with a file. * target_exec = bool(S_IXUSR & path_info[3].st_mode) # <<<<<<<<<<<<<< @@ -9117,57 +9134,57 @@ */ __pyx_t_9 = PyInt_FromLong(S_IXUSR); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_And(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_And(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyBool_FromLong((!(!__pyx_t_2))); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_v_target_exec); - __pyx_v_target_exec = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_target_exec = __pyx_t_8; + __pyx_t_8 = 0; goto __pyx_L16; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1247 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1247 * target_exec = bool(S_IXUSR & path_info[3].st_mode) * else: * target_exec = target_details[3] # <<<<<<<<<<<<<< * elif target_kind == 'symlink': * if source_minikind != c'l': */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_target_details, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_target_details, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_v_target_exec); - __pyx_v_target_exec = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_target_exec = __pyx_t_8; + __pyx_t_8 = 0; } __pyx_L16:; goto __pyx_L11; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1248 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1248 * else: * target_exec = target_details[3] * elif target_kind == 'symlink': # <<<<<<<<<<<<<< * if source_minikind != c'l': * content_change = 1 */ - __pyx_t_7 = PyObject_RichCompare(__pyx_v_target_kind, ((PyObject *)__pyx_n_s__symlink), Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_v_target_kind, ((PyObject *)__pyx_n_s__symlink), Py_EQ); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1249 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1249 * target_exec = target_details[3] * elif target_kind == 'symlink': * if source_minikind != c'l': # <<<<<<<<<<<<<< @@ -9177,7 +9194,7 @@ __pyx_t_2 = (__pyx_v_source_minikind != 'l'); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1250 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1250 * elif target_kind == 'symlink': * if source_minikind != c'l': * content_change = 1 # <<<<<<<<<<<<<< @@ -9189,53 +9206,53 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1252 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1252 * content_change = 1 * else: * content_change = (link_or_sha1 != source_details[1]) # <<<<<<<<<<<<<< * target_exec = False * elif target_kind == 'tree-reference': */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_source_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_link_or_sha1, __pyx_t_7, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_source_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_or_sha1, __pyx_t_8, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_content_change = __pyx_t_10; } __pyx_L17:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1253 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1253 * else: * content_change = (link_or_sha1 != source_details[1]) * target_exec = False # <<<<<<<<<<<<<< * elif target_kind == 'tree-reference': * if source_minikind != c't': */ - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_target_exec); - __pyx_v_target_exec = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_target_exec = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L11; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1254 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1254 * content_change = (link_or_sha1 != source_details[1]) * target_exec = False * elif target_kind == 'tree-reference': # <<<<<<<<<<<<<< * if source_minikind != c't': * content_change = 1 */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_target_kind, ((PyObject *)__pyx_kp_s_37), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_target_kind, ((PyObject *)__pyx_kp_s_33), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1255 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1255 * target_exec = False * elif target_kind == 'tree-reference': * if source_minikind != c't': # <<<<<<<<<<<<<< @@ -9245,7 +9262,7 @@ __pyx_t_2 = (__pyx_v_source_minikind != 't'); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1256 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1256 * elif target_kind == 'tree-reference': * if source_minikind != c't': * content_change = 1 # <<<<<<<<<<<<<< @@ -9257,7 +9274,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1258 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1258 * content_change = 1 * else: * content_change = 0 # <<<<<<<<<<<<<< @@ -9268,23 +9285,23 @@ } __pyx_L18:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1259 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1259 * else: * content_change = 0 * target_exec = False # <<<<<<<<<<<<<< * else: * if path is None: */ - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_target_exec); - __pyx_v_target_exec = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_target_exec = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L11; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1261 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1261 * target_exec = False * else: * if path is None: # <<<<<<<<<<<<<< @@ -9294,66 +9311,66 @@ __pyx_t_2 = (__pyx_v_path == Py_None); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1262 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1262 * else: * if path is None: * path = self.pathjoin(old_dirname, old_basename) # <<<<<<<<<<<<<< * raise errors.BadFileKindError(path, path_info[2]) * if source_minikind == c'd': */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_old_dirname); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_old_dirname); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_old_dirname); __Pyx_GIVEREF(__pyx_v_old_dirname); __Pyx_INCREF(__pyx_v_old_basename); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_old_basename); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_old_basename); __Pyx_GIVEREF(__pyx_v_old_basename); - __pyx_t_7 = PyObject_Call(__pyx_v_self->pathjoin, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_8 = PyObject_Call(__pyx_v_self->pathjoin, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_path); - __pyx_v_path = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_path = __pyx_t_8; + __pyx_t_8 = 0; goto __pyx_L19; } __pyx_L19:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1263 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1263 * if path is None: * path = self.pathjoin(old_dirname, old_basename) * raise errors.BadFileKindError(path, path_info[2]) # <<<<<<<<<<<<<< * if source_minikind == c'd': * if path is None: */ - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__BadFileKindError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__BadFileKindError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_path); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_8, 0, 0); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L11:; } __pyx_L10:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1264 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1264 * path = self.pathjoin(old_dirname, old_basename) * raise errors.BadFileKindError(path, path_info[2]) * if source_minikind == c'd': # <<<<<<<<<<<<<< @@ -9363,7 +9380,7 @@ __pyx_t_2 = (__pyx_v_source_minikind == 'd'); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1265 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1265 * raise errors.BadFileKindError(path, path_info[2]) * if source_minikind == c'd': * if path is None: # <<<<<<<<<<<<<< @@ -9373,24 +9390,24 @@ __pyx_t_2 = (__pyx_v_path == Py_None); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1266 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1266 * if source_minikind == c'd': * if path is None: * old_path = path = self.pathjoin(old_dirname, old_basename) # <<<<<<<<<<<<<< * if file_id is None: * file_id = entry[0][2] */ - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_old_dirname); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_old_dirname); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_old_dirname); __Pyx_GIVEREF(__pyx_v_old_dirname); __Pyx_INCREF(__pyx_v_old_basename); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_old_basename); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_old_basename); __Pyx_GIVEREF(__pyx_v_old_basename); - __pyx_t_9 = PyObject_Call(__pyx_v_self->pathjoin, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_v_self->pathjoin, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_INCREF(__pyx_t_9); __Pyx_DECREF(__pyx_v_old_path); __pyx_v_old_path = __pyx_t_9; @@ -9402,7 +9419,7 @@ } __pyx_L21:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1267 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1267 * if path is None: * old_path = path = self.pathjoin(old_dirname, old_basename) * if file_id is None: # <<<<<<<<<<<<<< @@ -9412,7 +9429,7 @@ __pyx_t_2 = (__pyx_v_file_id == Py_None); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1268 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1268 * old_path = path = self.pathjoin(old_dirname, old_basename) * if file_id is None: * file_id = entry[0][2] # <<<<<<<<<<<<<< @@ -9421,17 +9438,17 @@ */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_file_id); - __pyx_v_file_id = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_file_id = __pyx_t_8; + __pyx_t_8 = 0; goto __pyx_L22; } __pyx_L22:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1269 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1269 * if file_id is None: * file_id = entry[0][2] * self.old_dirname_to_file_id[old_path] = file_id # <<<<<<<<<<<<<< @@ -9443,7 +9460,7 @@ } __pyx_L20:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1271 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1271 * self.old_dirname_to_file_id[old_path] = file_id * # parent id is the entry for the path in the target tree * if old_basename and old_dirname == self.last_source_parent[0]: # <<<<<<<<<<<<<< @@ -9452,20 +9469,20 @@ */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_old_basename); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_self->last_source_parent, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyObject_RichCompare(__pyx_v_old_dirname, __pyx_t_7, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_self->last_source_parent, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = PyObject_RichCompare(__pyx_v_old_dirname, __pyx_t_8, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_8 = __pyx_t_5; + __pyx_t_7 = __pyx_t_5; } else { - __pyx_t_8 = __pyx_t_2; + __pyx_t_7 = __pyx_t_2; } - if (__pyx_t_8) { + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1273 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1273 * if old_basename and old_dirname == self.last_source_parent[0]: * # use a cached hit for non-root source entries. * source_parent_id = self.last_source_parent[1] # <<<<<<<<<<<<<< @@ -9481,7 +9498,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1275 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1275 * source_parent_id = self.last_source_parent[1] * else: * try: # <<<<<<<<<<<<<< @@ -9496,7 +9513,7 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1276 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1276 * else: * try: * source_parent_id = self.old_dirname_to_file_id[old_dirname] # <<<<<<<<<<<<<< @@ -9514,13 +9531,13 @@ __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; goto __pyx_L31_try_end; __pyx_L24_error:; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1277 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1277 * try: * source_parent_id = self.old_dirname_to_file_id[old_dirname] * except KeyError, _: # <<<<<<<<<<<<<< @@ -9530,51 +9547,51 @@ __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_10) { __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._process_entry"); - if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_7, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} + if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_8, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_8); __Pyx_DECREF(__pyx_v__); - __pyx_v__ = __pyx_t_7; + __pyx_v__ = __pyx_t_8; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1278 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1278 * source_parent_id = self.old_dirname_to_file_id[old_dirname] * except KeyError, _: * source_parent_entry = self.state._get_entry(self.source_index, # <<<<<<<<<<<<<< * path_utf8=old_dirname) * source_parent_id = source_parent_entry[0][2] */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___get_entry); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyInt_FromLong(__pyx_v_self->source_index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} + __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___get_entry); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyInt_FromLong(__pyx_v_self->source_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1279 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1279 * except KeyError, _: * source_parent_entry = self.state._get_entry(self.source_index, * path_utf8=old_dirname) # <<<<<<<<<<<<<< * source_parent_id = source_parent_entry[0][2] * if source_parent_id == entry[0][2]: */ - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__path_utf8), __pyx_v_old_dirname) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} - __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} + if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__path_utf8), __pyx_v_old_dirname) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} + __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_6, __pyx_t_11, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_source_parent_entry); __pyx_v_source_parent_entry = __pyx_t_12; __pyx_t_12 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1280 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1280 * source_parent_entry = self.state._get_entry(self.source_index, * path_utf8=old_dirname) * source_parent_id = source_parent_entry[0][2] # <<<<<<<<<<<<<< @@ -9583,15 +9600,15 @@ */ __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_source_parent_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_12, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_12, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L26_except_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_v_source_parent_id); - __pyx_v_source_parent_id = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_source_parent_id = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L25_exception_handled; } __pyx_L26_except_error:; @@ -9608,26 +9625,26 @@ __pyx_L31_try_end:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1281 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1281 * path_utf8=old_dirname) * source_parent_id = source_parent_entry[0][2] * if source_parent_id == entry[0][2]: # <<<<<<<<<<<<<< * # This is the root, so the parent is None * source_parent_id = None */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_source_parent_id, __pyx_t_7, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_8) { + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_source_parent_id, __pyx_t_8, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1283 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1283 * if source_parent_id == entry[0][2]: * # This is the root, so the parent is None * source_parent_id = None # <<<<<<<<<<<<<< @@ -9641,7 +9658,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1285 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1285 * source_parent_id = None * else: * self.last_source_parent[0] = old_dirname # <<<<<<<<<<<<<< @@ -9650,7 +9667,7 @@ */ if (__Pyx_SetItemInt(__pyx_v_self->last_source_parent, 0, __pyx_v_old_dirname, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":1286 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1286 * else: * self.last_source_parent[0] = old_dirname * self.last_source_parent[1] = source_parent_id # <<<<<<<<<<<<<< @@ -9663,67 +9680,67 @@ } __pyx_L23:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1287 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1287 * self.last_source_parent[0] = old_dirname * self.last_source_parent[1] = source_parent_id * new_dirname = entry[0][0] # <<<<<<<<<<<<<< * if entry[0][1] and new_dirname == self.last_target_parent[0]: * # use a cached hit for non-root target entries. */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_new_dirname); - __pyx_v_new_dirname = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_new_dirname = __pyx_t_8; + __pyx_t_8 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1288 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1288 * self.last_source_parent[1] = source_parent_id * new_dirname = entry[0][0] * if entry[0][1] and new_dirname == self.last_target_parent[0]: # <<<<<<<<<<<<<< * # use a cached hit for non-root target entries. * target_parent_id = self.last_target_parent[1] */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_8) { - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->last_target_parent, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_new_dirname, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_7) { + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_self->last_target_parent, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = PyObject_RichCompare(__pyx_v_new_dirname, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_5 = __pyx_t_2; } else { - __pyx_t_5 = __pyx_t_8; + __pyx_t_5 = __pyx_t_7; } if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1290 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1290 * if entry[0][1] and new_dirname == self.last_target_parent[0]: * # use a cached hit for non-root target entries. * target_parent_id = self.last_target_parent[1] # <<<<<<<<<<<<<< * else: * try: */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_self->last_target_parent, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_self->last_target_parent, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_v_target_parent_id); - __pyx_v_target_parent_id = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_target_parent_id = __pyx_t_8; + __pyx_t_8 = 0; goto __pyx_L35; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1292 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1292 * target_parent_id = self.last_target_parent[1] * else: * try: # <<<<<<<<<<<<<< @@ -9738,33 +9755,33 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1293 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1293 * else: * try: * target_parent_id = self.new_dirname_to_file_id[new_dirname] # <<<<<<<<<<<<<< * except KeyError, _: * # TODO: We don't always need to do the lookup, because the */ - __pyx_t_7 = PyObject_GetItem(__pyx_v_self->new_dirname_to_file_id, __pyx_v_new_dirname); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L36_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyObject_GetItem(__pyx_v_self->new_dirname_to_file_id, __pyx_v_new_dirname); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; __pyx_clineno = __LINE__; goto __pyx_L36_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_v_target_parent_id); - __pyx_v_target_parent_id = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_target_parent_id = __pyx_t_8; + __pyx_t_8 = 0; } __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; goto __pyx_L43_try_end; __pyx_L36_error:; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1294 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1294 * try: * target_parent_id = self.new_dirname_to_file_id[new_dirname] * except KeyError, _: # <<<<<<<<<<<<<< @@ -9774,34 +9791,34 @@ __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_10) { __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._process_entry"); - if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_1, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_9); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_v__); - __pyx_v__ = __pyx_t_3; + __pyx_v__ = __pyx_t_1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1297 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1297 * # TODO: We don't always need to do the lookup, because the * # parent entry will be the same as the source entry. * target_parent_entry = self.state._get_entry(self.target_index, # <<<<<<<<<<<<<< * path_utf8=new_dirname) * if target_parent_entry == (None, None): */ - __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___get_entry); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___get_entry); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_12 = PyInt_FromLong(__pyx_v_self->target_index); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); + __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1298 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1298 * # parent entry will be the same as the source entry. * target_parent_entry = self.state._get_entry(self.target_index, * path_utf8=new_dirname) # <<<<<<<<<<<<<< @@ -9809,78 +9826,87 @@ * raise AssertionError( */ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__path_utf8), __pyx_v_new_dirname) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_t_11), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; + __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_11, ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_v_target_parent_entry); - __pyx_v_target_parent_entry = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_target_parent_entry = __pyx_t_6; + __pyx_t_6 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1299 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1299 * target_parent_entry = self.state._get_entry(self.target_index, * path_utf8=new_dirname) * if target_parent_entry == (None, None): # <<<<<<<<<<<<<< * raise AssertionError( * "Could not find target parent in wt: %s\nparent of: %s" */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_target_parent_entry, ((PyObject *)__pyx_k_tuple_38), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_t_12 = PyObject_RichCompare(__pyx_v_target_parent_entry, __pyx_t_6, Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1302 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1302 * raise AssertionError( * "Could not find target parent in wt: %s\nparent of: %s" * % (new_dirname, entry)) # <<<<<<<<<<<<<< * target_parent_id = target_parent_entry[0][2] * if target_parent_id == entry[0][2]: */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_new_dirname); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_new_dirname); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_new_dirname); __Pyx_GIVEREF(__pyx_v_new_dirname); __Pyx_INCREF(__pyx_v_entry); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_entry); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_entry); __Pyx_GIVEREF(__pyx_v_entry); - __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_39), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); - __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_34), __pyx_t_12); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_12, 0, 0); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + __pyx_t_6 = 0; + __pyx_t_6 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1300; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} goto __pyx_L46; } __pyx_L46:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1303 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1303 * "Could not find target parent in wt: %s\nparent of: %s" * % (new_dirname, entry)) * target_parent_id = target_parent_entry[0][2] # <<<<<<<<<<<<<< * if target_parent_id == entry[0][2]: * # This is the root, so the parent is None */ - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_target_parent_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_target_parent_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_12, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; __pyx_clineno = __LINE__; goto __pyx_L38_except_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_target_parent_id); - __pyx_v_target_parent_id = __pyx_t_1; - __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_target_parent_id = __pyx_t_12; + __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L37_exception_handled; } @@ -9898,7 +9924,7 @@ __pyx_L43_try_end:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1304 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1304 * % (new_dirname, entry)) * target_parent_id = target_parent_entry[0][2] * if target_parent_id == entry[0][2]: # <<<<<<<<<<<<<< @@ -9907,17 +9933,17 @@ */ __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_v_target_parent_id, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_RichCompare(__pyx_v_target_parent_id, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1306 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1306 * if target_parent_id == entry[0][2]: * # This is the root, so the parent is None * target_parent_id = None # <<<<<<<<<<<<<< @@ -9931,7 +9957,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1308 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1308 * target_parent_id = None * else: * self.last_target_parent[0] = new_dirname # <<<<<<<<<<<<<< @@ -9940,7 +9966,7 @@ */ if (__Pyx_SetItemInt(__pyx_v_self->last_target_parent, 0, __pyx_v_new_dirname, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":1309 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1309 * else: * self.last_target_parent[0] = new_dirname * self.last_target_parent[1] = target_parent_id # <<<<<<<<<<<<<< @@ -9953,7 +9979,7 @@ } __pyx_L35:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1311 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1311 * self.last_target_parent[1] = target_parent_id * * source_exec = source_details[3] # <<<<<<<<<<<<<< @@ -9966,7 +9992,7 @@ __pyx_v_source_exec = __pyx_t_9; __pyx_t_9 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1313 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1313 * source_exec = source_details[3] * changed = (content_change * or source_parent_id != target_parent_id # <<<<<<<<<<<<<< @@ -9979,70 +10005,70 @@ if (!__pyx_t_5) { __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1314 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1314 * changed = (content_change * or source_parent_id != target_parent_id * or old_basename != entry[0][1] # <<<<<<<<<<<<<< * or source_exec != target_exec * ) */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_source_parent_id, __pyx_v_target_parent_id, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_RichCompare(__pyx_v_source_parent_id, __pyx_v_target_parent_id, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_5) { - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1315 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1315 * or source_parent_id != target_parent_id * or old_basename != entry[0][1] * or source_exec != target_exec # <<<<<<<<<<<<<< * ) * if not changed and not self.include_unchanged: */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_v_old_basename, __pyx_t_1, Py_NE); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_v_old_basename, __pyx_t_12, Py_NE); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_5) { - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1316 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1316 * or old_basename != entry[0][1] * or source_exec != target_exec * ) # <<<<<<<<<<<<<< * if not changed and not self.include_unchanged: * return None, False */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_source_exec, __pyx_v_target_exec, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_12 = PyObject_RichCompare(__pyx_v_source_exec, __pyx_v_target_exec, Py_NE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_6 = __pyx_t_12; + __pyx_t_12 = 0; } else { - __pyx_t_12 = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_t_6 = __pyx_t_8; + __pyx_t_8 = 0; } - __pyx_t_7 = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_t_8 = __pyx_t_6; + __pyx_t_6 = 0; } else { - __pyx_t_7 = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_8 = __pyx_t_1; + __pyx_t_1 = 0; } - __pyx_t_3 = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_t_1 = __pyx_t_8; + __pyx_t_8 = 0; } else { - __pyx_t_3 = __pyx_t_9; + __pyx_t_1 = __pyx_t_9; __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_v_changed); - __pyx_v_changed = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_changed = __pyx_t_1; + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1317 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1317 * or source_exec != target_exec * ) * if not changed and not self.include_unchanged: # <<<<<<<<<<<<<< @@ -10050,16 +10076,16 @@ * else: */ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = (!__pyx_t_5); - if (__pyx_t_8) { + __pyx_t_7 = (!__pyx_t_5); + if (__pyx_t_7) { __pyx_t_5 = (!__pyx_v_self->include_unchanged); __pyx_t_2 = __pyx_t_5; } else { - __pyx_t_2 = __pyx_t_8; + __pyx_t_2 = __pyx_t_7; } if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1318 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1318 * ) * if not changed and not self.include_unchanged: * return None, False # <<<<<<<<<<<<<< @@ -10067,24 +10093,24 @@ * if old_path is None: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_9, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_r = ((PyObject *)__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L0; goto __pyx_L48; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1320 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1320 * return None, False * else: * if old_path is None: # <<<<<<<<<<<<<< @@ -10094,7 +10120,7 @@ __pyx_t_2 = (__pyx_v_old_path == Py_None); if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1321 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1321 * else: * if old_path is None: * path = self.pathjoin(old_dirname, old_basename) # <<<<<<<<<<<<<< @@ -10102,21 +10128,21 @@ * old_path_u = self.utf8_decode(old_path)[0] */ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_old_dirname); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_old_dirname); __Pyx_GIVEREF(__pyx_v_old_dirname); __Pyx_INCREF(__pyx_v_old_basename); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_old_basename); __Pyx_GIVEREF(__pyx_v_old_basename); - __pyx_t_3 = PyObject_Call(__pyx_v_self->pathjoin, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __pyx_t_1 = PyObject_Call(__pyx_v_self->pathjoin, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_path); - __pyx_v_path = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_path = __pyx_t_1; + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1322 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1322 * if old_path is None: * path = self.pathjoin(old_dirname, old_basename) * old_path = path # <<<<<<<<<<<<<< @@ -10127,29 +10153,29 @@ __Pyx_DECREF(__pyx_v_old_path); __pyx_v_old_path = __pyx_v_path; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1323 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1323 * path = self.pathjoin(old_dirname, old_basename) * old_path = path * old_path_u = self.utf8_decode(old_path)[0] # <<<<<<<<<<<<<< * path_u = old_path_u * else: */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_old_path); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_old_path); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_old_path); __Pyx_GIVEREF(__pyx_v_old_path); - __pyx_t_9 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_old_path_u); - __pyx_v_old_path_u = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_old_path_u = __pyx_t_1; + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1324 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1324 * old_path = path * old_path_u = self.utf8_decode(old_path)[0] * path_u = old_path_u # <<<<<<<<<<<<<< @@ -10163,42 +10189,42 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1326 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1326 * path_u = old_path_u * else: * old_path_u = self.utf8_decode(old_path)[0] # <<<<<<<<<<<<<< * if old_path == path: * path_u = old_path_u */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_old_path); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_old_path); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_old_path); __Pyx_GIVEREF(__pyx_v_old_path); - __pyx_t_9 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_old_path_u); - __pyx_v_old_path_u = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_old_path_u = __pyx_t_1; + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1327 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1327 * else: * old_path_u = self.utf8_decode(old_path)[0] * if old_path == path: # <<<<<<<<<<<<<< * path_u = old_path_u * else: */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_old_path, __pyx_v_path, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_v_old_path, __pyx_v_path, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1328 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1328 * old_path_u = self.utf8_decode(old_path)[0] * if old_path == path: * path_u = old_path_u # <<<<<<<<<<<<<< @@ -10212,46 +10238,46 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1330 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1330 * path_u = old_path_u * else: * path_u = self.utf8_decode(path)[0] # <<<<<<<<<<<<<< * source_kind = _minikind_to_kind(source_minikind) * return (entry[0][2], */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_path); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); - __pyx_t_9 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_path_u); - __pyx_v_path_u = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_path_u = __pyx_t_1; + __pyx_t_1 = 0; } __pyx_L50:; } __pyx_L49:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1331 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1331 * else: * path_u = self.utf8_decode(path)[0] * source_kind = _minikind_to_kind(source_minikind) # <<<<<<<<<<<<<< * return (entry[0][2], * (old_path_u, path_u), */ - __pyx_t_3 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_to_kind(__pyx_v_source_minikind); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_to_kind(__pyx_v_source_minikind); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_source_kind); - __pyx_v_source_kind = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_source_kind = __pyx_t_1; + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1332 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1332 * path_u = self.utf8_decode(path)[0] * source_kind = _minikind_to_kind(source_minikind) * return (entry[0][2], # <<<<<<<<<<<<<< @@ -10259,191 +10285,191 @@ * content_change, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1333 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1333 * source_kind = _minikind_to_kind(source_minikind) * return (entry[0][2], * (old_path_u, path_u), # <<<<<<<<<<<<<< * content_change, * (True, True), */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_old_path_u); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_old_path_u); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_old_path_u); __Pyx_GIVEREF(__pyx_v_old_path_u); __Pyx_INCREF(__pyx_v_path_u); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path_u); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_path_u); __Pyx_GIVEREF(__pyx_v_path_u); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1334 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1334 * return (entry[0][2], * (old_path_u, path_u), * content_change, # <<<<<<<<<<<<<< * (True, True), * (source_parent_id, target_parent_id), */ - __pyx_t_7 = PyInt_FromLong(__pyx_v_content_change); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyInt_FromLong(__pyx_v_content_change); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1335 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1335 * (old_path_u, path_u), * content_change, * (True, True), # <<<<<<<<<<<<<< * (source_parent_id, target_parent_id), * (self.utf8_decode(old_basename)[0], self.utf8_decode(entry[0][1])[0]), */ + __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __pyx_t_12 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_6 = 0; __pyx_t_12 = 0; - __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1336 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1336 * content_change, * (True, True), * (source_parent_id, target_parent_id), # <<<<<<<<<<<<<< * (self.utf8_decode(old_basename)[0], self.utf8_decode(entry[0][1])[0]), * (source_kind, target_kind), */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_source_parent_id); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_source_parent_id); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_source_parent_id); __Pyx_GIVEREF(__pyx_v_source_parent_id); __Pyx_INCREF(__pyx_v_target_parent_id); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_target_parent_id); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_target_parent_id); __Pyx_GIVEREF(__pyx_v_target_parent_id); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1337 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1337 * (True, True), * (source_parent_id, target_parent_id), * (self.utf8_decode(old_basename)[0], self.utf8_decode(entry[0][1])[0]), # <<<<<<<<<<<<<< * (source_kind, target_kind), * (source_exec, target_exec)), changed */ - __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_old_basename); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_old_basename); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_old_basename); __Pyx_GIVEREF(__pyx_v_old_basename); - __pyx_t_6 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_3 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_3, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_13, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_13, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_13)); - PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_6); + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_12 = 0; + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_6 = 0; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1338 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1338 * (source_parent_id, target_parent_id), * (self.utf8_decode(old_basename)[0], self.utf8_decode(entry[0][1])[0]), * (source_kind, target_kind), # <<<<<<<<<<<<<< * (source_exec, target_exec)), changed * elif source_minikind == c'a' and _versioned_minikind(target_minikind): */ - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_source_kind); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source_kind); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_source_kind); __Pyx_GIVEREF(__pyx_v_source_kind); __Pyx_INCREF(__pyx_v_target_kind); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_target_kind); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_target_kind); __Pyx_GIVEREF(__pyx_v_target_kind); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1339 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1339 * (self.utf8_decode(old_basename)[0], self.utf8_decode(entry[0][1])[0]), * (source_kind, target_kind), * (source_exec, target_exec)), changed # <<<<<<<<<<<<<< * elif source_minikind == c'a' and _versioned_minikind(target_minikind): * # looks like a new file */ - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_source_exec); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_source_exec); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_source_exec); __Pyx_GIVEREF(__pyx_v_source_exec); __Pyx_INCREF(__pyx_v_target_exec); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_target_exec); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_target_exec); __Pyx_GIVEREF(__pyx_v_target_exec); __pyx_t_14 = PyTuple_New(8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_14)); + __Pyx_GOTREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_14, 3, ((PyObject *)__pyx_t_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_11)); - PyTuple_SET_ITEM(__pyx_t_14, 4, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_14, 5, ((PyObject *)__pyx_t_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_13)); - PyTuple_SET_ITEM(__pyx_t_14, 6, ((PyObject *)__pyx_t_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_14, 7, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); __pyx_t_9 = 0; - __pyx_t_3 = 0; - __pyx_t_7 = 0; - __pyx_t_11 = 0; __pyx_t_1 = 0; + __pyx_t_8 = 0; + __pyx_t_11 = 0; + __pyx_t_12 = 0; __pyx_t_13 = 0; + __pyx_t_3 = 0; __pyx_t_6 = 0; - __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_t_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_14)); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_changed); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_changed); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_changed); __Pyx_GIVEREF(__pyx_v_changed); __pyx_t_14 = 0; - __pyx_r = ((PyObject *)__pyx_t_12); - __pyx_t_12 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; goto __pyx_L0; } __pyx_L48:; goto __pyx_L6; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1340 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1340 * (source_kind, target_kind), * (source_exec, target_exec)), changed * elif source_minikind == c'a' and _versioned_minikind(target_minikind): # <<<<<<<<<<<<<< @@ -10452,64 +10478,64 @@ */ __pyx_t_2 = (__pyx_v_source_minikind == 'a'); if (__pyx_t_2) { - __pyx_t_8 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_target_minikind); + __pyx_t_7 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_target_minikind); } else { - __pyx_t_8 = __pyx_t_2; + __pyx_t_7 = __pyx_t_2; } - if (__pyx_t_8) { + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1342 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1342 * elif source_minikind == c'a' and _versioned_minikind(target_minikind): * # looks like a new file * path = self.pathjoin(entry[0][0], entry[0][1]) # <<<<<<<<<<<<<< * # parent id is the entry for the path in the target tree * # TODO: these are the same for an entire directory: cache em. */ - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_12, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_14 = 0; - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_v_self->pathjoin, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_v_self->pathjoin, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_path); - __pyx_v_path = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_path = __pyx_t_3; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1345 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1345 * # parent id is the entry for the path in the target tree * # TODO: these are the same for an entire directory: cache em. * parent_entry = self.state._get_entry(self.target_index, # <<<<<<<<<<<<<< * path_utf8=entry[0][0]) * if parent_entry is None: */ - __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___get_entry); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___get_entry); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyInt_FromLong(__pyx_v_self->target_index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = PyInt_FromLong(__pyx_v_self->target_index); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_14)); - PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_6 = 0; + __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1346 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1346 * # TODO: these are the same for an entire directory: cache em. * parent_entry = self.state._get_entry(self.target_index, * path_utf8=entry[0][0]) # <<<<<<<<<<<<<< @@ -10518,77 +10544,77 @@ */ __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_13, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_13, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__path_utf8), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_t_14), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__path_utf8), __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_14, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_parent_entry); - __pyx_v_parent_entry = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_parent_entry = __pyx_t_12; + __pyx_t_12 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1347 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1347 * parent_entry = self.state._get_entry(self.target_index, * path_utf8=entry[0][0]) * if parent_entry is None: # <<<<<<<<<<<<<< * raise errors.DirstateCorrupt(self.state, * "We could not find the parent entry in index %d" */ - __pyx_t_8 = (__pyx_v_parent_entry == Py_None); - if (__pyx_t_8) { + __pyx_t_7 = (__pyx_v_parent_entry == Py_None); + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1348 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1348 * path_utf8=entry[0][0]) * if parent_entry is None: * raise errors.DirstateCorrupt(self.state, # <<<<<<<<<<<<<< * "We could not find the parent entry in index %d" * " for the entry: %s" */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__DirstateCorrupt); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__DirstateCorrupt); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1351 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1351 * "We could not find the parent entry in index %d" * " for the entry: %s" * % (self.target_index, entry[0])) # <<<<<<<<<<<<<< * parent_id = parent_entry[0][2] * if parent_id == entry[0][2]: */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_self->target_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = PyInt_FromLong(__pyx_v_self->target_index); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_14); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); - __pyx_t_1 = 0; + __pyx_t_12 = 0; __pyx_t_14 = 0; - __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_40), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_35), __pyx_t_3); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_14)); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->state); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self->state); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->state); __Pyx_GIVEREF(__pyx_v_self->state); - PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_14)); + PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_14)); __Pyx_GIVEREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __pyx_t_14 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_14, 0, 0); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -10596,7 +10622,7 @@ } __pyx_L51:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1352 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1352 * " for the entry: %s" * % (self.target_index, entry[0])) * parent_id = parent_entry[0][2] # <<<<<<<<<<<<<< @@ -10605,33 +10631,33 @@ */ __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_parent_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_14, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_14, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_v_parent_id); - __pyx_v_parent_id = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_parent_id = __pyx_t_3; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1353 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1353 * % (self.target_index, entry[0])) * parent_id = parent_entry[0][2] * if parent_id == entry[0][2]: # <<<<<<<<<<<<<< * parent_id = None * if path_info is not None: */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_v_parent_id, __pyx_t_14, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_parent_id, __pyx_t_14, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_8) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1354 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1354 * parent_id = parent_entry[0][2] * if parent_id == entry[0][2]: * parent_id = None # <<<<<<<<<<<<<< @@ -10645,47 +10671,47 @@ } __pyx_L52:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1355 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1355 * if parent_id == entry[0][2]: * parent_id = None * if path_info is not None: # <<<<<<<<<<<<<< * # Present on disk: * if self.use_filesystem_for_exec: */ - __pyx_t_8 = (__pyx_v_path_info != Py_None); - if (__pyx_t_8) { + __pyx_t_7 = (__pyx_v_path_info != Py_None); + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1357 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1357 * if path_info is not None: * # Present on disk: * if self.use_filesystem_for_exec: # <<<<<<<<<<<<<< * # We need S_ISREG here, because we aren't sure if this * # is a file or not. */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->use_filesystem_for_exec); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_8) { + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->use_filesystem_for_exec); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1361 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1361 * # is a file or not. * target_exec = bool( * S_ISREG(path_info[3].st_mode) # <<<<<<<<<<<<<< * and S_IXUSR & path_info[3].st_mode) * else: */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_14 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_14); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = PyInt_FromLong(S_ISREG(__pyx_t_10)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__pyx_t_8) { + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1362 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1362 * target_exec = bool( * S_ISREG(path_info[3].st_mode) * and S_IXUSR & path_info[3].st_mode) # <<<<<<<<<<<<<< @@ -10694,46 +10720,46 @@ */ __pyx_t_14 = PyInt_FromLong(S_IXUSR); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_And(__pyx_t_14, __pyx_t_12); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_And(__pyx_t_14, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_5 = __pyx_t_2; } else { - __pyx_t_5 = __pyx_t_8; + __pyx_t_5 = __pyx_t_7; } - __pyx_t_6 = __Pyx_PyBool_FromLong((!(!__pyx_t_5))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_target_exec); - __pyx_v_target_exec = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_target_exec = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L54; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1364 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1364 * and S_IXUSR & path_info[3].st_mode) * else: * target_exec = target_details[3] # <<<<<<<<<<<<<< * return (entry[0][2], * (None, self.utf8_decode(path)[0]), */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_target_details, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_target_details, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_target_exec); - __pyx_v_target_exec = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_target_exec = __pyx_t_3; + __pyx_t_3 = 0; } __pyx_L54:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1365 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1365 * else: * target_exec = target_details[3] * return (entry[0][2], # <<<<<<<<<<<<<< @@ -10741,70 +10767,70 @@ * True, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1366 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1366 * target_exec = target_details[3] * return (entry[0][2], * (None, self.utf8_decode(path)[0]), # <<<<<<<<<<<<<< * True, * (False, True), */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_path); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_path); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); - __pyx_t_14 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_14, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_14, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_14)); + __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_14, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1367 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1367 * return (entry[0][2], * (None, self.utf8_decode(path)[0]), * True, # <<<<<<<<<<<<<< * (False, True), * (None, parent_id), */ - __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1368 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1368 * (None, self.utf8_decode(path)[0]), * True, * (False, True), # <<<<<<<<<<<<<< * (None, parent_id), * (None, self.utf8_decode(entry[0][1])[0]), */ - __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); - __pyx_t_1 = 0; + __pyx_t_12 = 0; __pyx_t_13 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1369 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1369 * True, * (False, True), * (None, parent_id), # <<<<<<<<<<<<<< @@ -10812,7 +10838,7 @@ * (None, path_info[2]), */ __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_13)); + __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_13, 0, Py_None); __Pyx_GIVEREF(Py_None); @@ -10820,115 +10846,115 @@ PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_parent_id); __Pyx_GIVEREF(__pyx_v_parent_id); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1370 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1370 * (False, True), * (None, parent_id), * (None, self.utf8_decode(entry[0][1])[0]), # <<<<<<<<<<<<<< * (None, path_info[2]), * (None, target_exec)), True */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_12, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_7, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1371 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1371 * (None, parent_id), * (None, self.utf8_decode(entry[0][1])[0]), * (None, path_info[2]), # <<<<<<<<<<<<<< * (None, target_exec)), True * else: */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1372 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1372 * (None, self.utf8_decode(entry[0][1])[0]), * (None, path_info[2]), * (None, target_exec)), True # <<<<<<<<<<<<<< * else: * # Its a missing file, report it as such. */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 0, Py_None); __Pyx_GIVEREF(Py_None); __Pyx_INCREF(__pyx_v_target_exec); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_target_exec); + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_target_exec); __Pyx_GIVEREF(__pyx_v_target_exec); __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_t_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_14)); - PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_6); + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_9, 3, ((PyObject *)__pyx_t_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_11)); - PyTuple_SET_ITEM(__pyx_t_9, 4, ((PyObject *)__pyx_t_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_13)); - PyTuple_SET_ITEM(__pyx_t_9, 5, ((PyObject *)__pyx_t_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_9, 6, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_9, 7, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_12 = 0; - __pyx_t_14 = 0; + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); __pyx_t_6 = 0; + __pyx_t_14 = 0; + __pyx_t_3 = 0; __pyx_t_11 = 0; __pyx_t_13 = 0; - __pyx_t_7 = 0; - __pyx_t_3 = 0; + __pyx_t_8 = 0; __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); __pyx_t_9 = 0; + __pyx_t_12 = 0; + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; - __pyx_r = ((PyObject *)__pyx_t_3); - __pyx_t_3 = 0; goto __pyx_L0; goto __pyx_L53; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1375 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1375 * else: * # Its a missing file, report it as such. * return (entry[0][2], # <<<<<<<<<<<<<< @@ -10936,70 +10962,70 @@ * False, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1376 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1376 * # Its a missing file, report it as such. * return (entry[0][2], * (None, self.utf8_decode(path)[0]), # <<<<<<<<<<<<<< * False, * (False, True), */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_path); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path); __Pyx_GIVEREF(__pyx_v_path); - __pyx_t_9 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_9, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1377 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1377 * return (entry[0][2], * (None, self.utf8_decode(path)[0]), * False, # <<<<<<<<<<<<<< * (False, True), * (None, parent_id), */ - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1378 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1378 * (None, self.utf8_decode(path)[0]), * False, * (False, True), # <<<<<<<<<<<<<< * (None, parent_id), * (None, self.utf8_decode(entry[0][1])[0]), */ - __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __pyx_t_13 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); - __pyx_t_7 = 0; + __pyx_t_8 = 0; __pyx_t_13 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1379 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1379 * False, * (False, True), * (None, parent_id), # <<<<<<<<<<<<<< @@ -11007,7 +11033,7 @@ * (None, None), */ __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_13)); + __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_13, 0, Py_None); __Pyx_GIVEREF(Py_None); @@ -11015,100 +11041,116 @@ PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_parent_id); __Pyx_GIVEREF(__pyx_v_parent_id); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1380 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1380 * (False, True), * (None, parent_id), * (None, self.utf8_decode(entry[0][1])[0]), # <<<<<<<<<<<<<< * (None, None), * (None, False)), True */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_6, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1381 + * (None, parent_id), + * (None, self.utf8_decode(entry[0][1])[0]), + * (None, None), # <<<<<<<<<<<<<< + * (None, False)), True + * elif _versioned_minikind(source_minikind) and target_minikind == c'a': + */ + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_8, 1, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1382 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1382 * (None, self.utf8_decode(entry[0][1])[0]), * (None, None), * (None, False)), True # <<<<<<<<<<<<<< * elif _versioned_minikind(source_minikind) and target_minikind == c'a': * # unversioned, possibly, or possibly not deleted: we dont care. */ - __pyx_t_7 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_14)); + __pyx_t_14 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_14, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_t_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_t_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_11)); - PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_t_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_13)); - PyTuple_SET_ITEM(__pyx_t_7, 5, ((PyObject *)__pyx_t_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(((PyObject *)__pyx_k_tuple_41)); - PyTuple_SET_ITEM(__pyx_t_7, 6, ((PyObject *)__pyx_k_tuple_41)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41)); - PyTuple_SET_ITEM(__pyx_t_7, 7, ((PyObject *)__pyx_t_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_14)); - __pyx_t_1 = 0; + PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_12 = 0; __pyx_t_9 = 0; - __pyx_t_3 = 0; + __pyx_t_1 = 0; __pyx_t_11 = 0; __pyx_t_13 = 0; + __pyx_t_3 = 0; + __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_14); + __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); - __pyx_t_7 = 0; + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); __pyx_t_14 = 0; - __pyx_r = ((PyObject *)__pyx_t_6); __pyx_t_6 = 0; + __pyx_r = __pyx_t_8; + __pyx_t_8 = 0; goto __pyx_L0; } __pyx_L53:; goto __pyx_L6; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1383 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1383 * (None, None), * (None, False)), True * elif _versioned_minikind(source_minikind) and target_minikind == c'a': # <<<<<<<<<<<<<< @@ -11117,104 +11159,104 @@ */ if (__pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_source_minikind)) { __pyx_t_5 = (__pyx_v_target_minikind == 'a'); - __pyx_t_8 = __pyx_t_5; + __pyx_t_7 = __pyx_t_5; } else { - __pyx_t_8 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_source_minikind); + __pyx_t_7 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_source_minikind); } - if (__pyx_t_8) { + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1388 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1388 * # path [we dont know this in this routine at the moment - * # perhaps we should change this - then it would be an unknown. * old_path = self.pathjoin(entry[0][0], entry[0][1]) # <<<<<<<<<<<<<< * # parent id is the entry for the path in the target tree * parent_id = self.state._get_entry(self.source_index, path_utf8=entry[0][0])[0][2] */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_14); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_6 = 0; __pyx_t_14 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_v_self->pathjoin, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __pyx_t_14 = PyObject_Call(__pyx_v_self->pathjoin, __pyx_t_8, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_old_path); - __pyx_v_old_path = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_old_path = __pyx_t_14; + __pyx_t_14 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1390 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1390 * old_path = self.pathjoin(entry[0][0], entry[0][1]) * # parent id is the entry for the path in the target tree * parent_id = self.state._get_entry(self.source_index, path_utf8=entry[0][0])[0][2] # <<<<<<<<<<<<<< * if parent_id == entry[0][2]: * parent_id = None */ - __pyx_t_7 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___get_entry); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyInt_FromLong(__pyx_v_self->source_index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_14 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___get_entry); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_8 = PyInt_FromLong(__pyx_v_self->source_index); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_14)); - PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_8)); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_13); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_13, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_8, ((PyObject *)__pyx_n_s__path_utf8), __pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__path_utf8), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyEval_CallObjectWithKeywords(__pyx_t_7, ((PyObject *)__pyx_t_14), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_11, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = PyEval_CallObjectWithKeywords(__pyx_t_14, __pyx_t_6, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_13, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_parent_id); - __pyx_v_parent_id = __pyx_t_11; - __pyx_t_11 = 0; + __pyx_v_parent_id = __pyx_t_13; + __pyx_t_13 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1391 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1391 * # parent id is the entry for the path in the target tree * parent_id = self.state._get_entry(self.source_index, path_utf8=entry[0][0])[0][2] * if parent_id == entry[0][2]: # <<<<<<<<<<<<<< * parent_id = None * return (entry[0][2], */ - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_11, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_RichCompare(__pyx_v_parent_id, __pyx_t_6, Py_EQ); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__pyx_t_8) { + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_13, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyObject_RichCompare(__pyx_v_parent_id, __pyx_t_8, Py_EQ); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1392 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1392 * parent_id = self.state._get_entry(self.source_index, path_utf8=entry[0][0])[0][2] * if parent_id == entry[0][2]: * parent_id = None # <<<<<<<<<<<<<< @@ -11228,7 +11270,7 @@ } __pyx_L55:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1393 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1393 * if parent_id == entry[0][2]: * parent_id = None * return (entry[0][2], # <<<<<<<<<<<<<< @@ -11236,195 +11278,195 @@ * True, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_11, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_13, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1394 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1394 * parent_id = None * return (entry[0][2], * (self.utf8_decode(old_path)[0], None), # <<<<<<<<<<<<<< * True, * (True, False), */ - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); + __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_v_old_path); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_old_path); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_old_path); __Pyx_GIVEREF(__pyx_v_old_path); - __pyx_t_14 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_14, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_14)); - PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11); - __Pyx_GIVEREF(__pyx_t_11); + __pyx_t_6 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_14, 1, Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 1, Py_None); __Pyx_GIVEREF(Py_None); - __pyx_t_11 = 0; + __pyx_t_13 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1395 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1395 * return (entry[0][2], * (self.utf8_decode(old_path)[0], None), * True, # <<<<<<<<<<<<<< * (True, False), * (parent_id, None), */ - __pyx_t_11 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_13 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1396 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1396 * (self.utf8_decode(old_path)[0], None), * True, * (True, False), # <<<<<<<<<<<<<< * (parent_id, None), * (self.utf8_decode(entry[0][1])[0], None), */ - __pyx_t_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_13 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_13); - __Pyx_GIVEREF(__pyx_t_13); - __pyx_t_7 = 0; - __pyx_t_13 = 0; + __pyx_t_14 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_14 = 0; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1397 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1397 * True, * (True, False), * (parent_id, None), # <<<<<<<<<<<<<< * (self.utf8_decode(entry[0][1])[0], None), * (_minikind_to_kind(source_minikind), None), */ - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_13)); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_parent_id); - PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_parent_id); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_parent_id); __Pyx_GIVEREF(__pyx_v_parent_id); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_13, 1, Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None); __Pyx_GIVEREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1398 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1398 * (True, False), * (parent_id, None), * (self.utf8_decode(entry[0][1])[0], None), # <<<<<<<<<<<<<< * (_minikind_to_kind(source_minikind), None), * (source_details[3], None)), True */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_14, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_1 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_9, 1, Py_None); + PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None); __Pyx_GIVEREF(Py_None); - __pyx_t_7 = 0; + __pyx_t_14 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1399 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1399 * (parent_id, None), * (self.utf8_decode(entry[0][1])[0], None), * (_minikind_to_kind(source_minikind), None), # <<<<<<<<<<<<<< * (source_details[3], None)), True * elif _versioned_minikind(source_minikind) and target_minikind == c'r': */ - __pyx_t_7 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_to_kind(__pyx_v_source_minikind); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); + __pyx_t_14 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_to_kind(__pyx_v_source_minikind); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None); + PyTuple_SET_ITEM(__pyx_t_9, 1, Py_None); __Pyx_GIVEREF(Py_None); - __pyx_t_7 = 0; + __pyx_t_14 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1400 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1400 * (self.utf8_decode(entry[0][1])[0], None), * (_minikind_to_kind(source_minikind), None), * (source_details[3], None)), True # <<<<<<<<<<<<<< * elif _versioned_minikind(source_minikind) and target_minikind == c'r': * # a rename; could be a true rename, or a rename inherited from */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_source_details, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_source_details, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_12, 1, Py_None); __Pyx_GIVEREF(Py_None); - __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); + __pyx_t_14 = 0; + __pyx_t_14 = PyTuple_New(8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_t_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_14)); - PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); - PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_t_13)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_13)); - PyTuple_SET_ITEM(__pyx_t_7, 5, ((PyObject *)__pyx_t_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_7, 6, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_7, 7, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); + PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_14, 6, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_14 = 0; + __pyx_t_13 = 0; __pyx_t_11 = 0; __pyx_t_3 = 0; - __pyx_t_13 = 0; - __pyx_t_9 = 0; __pyx_t_1 = 0; + __pyx_t_9 = 0; __pyx_t_12 = 0; __pyx_t_12 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_12); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_7 = 0; + __pyx_t_14 = 0; __pyx_t_12 = 0; - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; goto __pyx_L0; goto __pyx_L6; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1401 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1401 * (_minikind_to_kind(source_minikind), None), * (source_details[3], None)), True * elif _versioned_minikind(source_minikind) and target_minikind == c'r': # <<<<<<<<<<<<<< @@ -11432,14 +11474,14 @@ * # a renamed parent. TODO: handle this efficiently. Its not */ if (__pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_source_minikind)) { - __pyx_t_8 = (__pyx_v_target_minikind == 'r'); - __pyx_t_5 = __pyx_t_8; + __pyx_t_7 = (__pyx_v_target_minikind == 'r'); + __pyx_t_5 = __pyx_t_7; } else { __pyx_t_5 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_source_minikind); } if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1406 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1406 * # common case to rename dirs though, so a correct but slow * # implementation will do. * if (not self.doing_consistency_expansion and # <<<<<<<<<<<<<< @@ -11449,77 +11491,77 @@ __pyx_t_5 = (!__pyx_v_self->doing_consistency_expansion); if (__pyx_t_5) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1407 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1407 * # implementation will do. * if (not self.doing_consistency_expansion and * not osutils.is_inside_any(self.searched_specific_files, # <<<<<<<<<<<<<< * target_details[1])): * self.search_specific_files.add(target_details[1]) */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__is_inside_any); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__is_inside_any); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1408 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1408 * if (not self.doing_consistency_expansion and * not osutils.is_inside_any(self.searched_specific_files, * target_details[1])): # <<<<<<<<<<<<<< * self.search_specific_files.add(target_details[1]) * # We don't expand the specific files parents list here as */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_target_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_target_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __Pyx_INCREF(__pyx_v_self->searched_specific_files); - PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_self->searched_specific_files); + PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_self->searched_specific_files); __Pyx_GIVEREF(__pyx_v_self->searched_specific_files); - PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = (!__pyx_t_8); - __pyx_t_8 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = (!__pyx_t_7); + __pyx_t_7 = __pyx_t_2; } else { - __pyx_t_8 = __pyx_t_5; + __pyx_t_7 = __pyx_t_5; } - if (__pyx_t_8) { + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1409 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1409 * not osutils.is_inside_any(self.searched_specific_files, * target_details[1])): * self.search_specific_files.add(target_details[1]) # <<<<<<<<<<<<<< * # We don't expand the specific files parents list here as * # the path is absent in target and won't create a delta with */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->search_specific_files, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_target_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyObject_GetAttr(__pyx_v_self->search_specific_files, __pyx_n_s__add); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_target_details, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_GOTREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + __pyx_t_14 = 0; + __pyx_t_14 = PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; goto __pyx_L56; } __pyx_L56:; goto __pyx_L6; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1413 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1413 * # the path is absent in target and won't create a delta with * # missing parent. * elif ((source_minikind == c'r' or source_minikind == c'a') and # <<<<<<<<<<<<<< @@ -11529,15 +11571,15 @@ switch (__pyx_v_source_minikind) { case 'r': case 'a': - __pyx_t_8 = 1; + __pyx_t_7 = 1; break; default: - __pyx_t_8 = 0; + __pyx_t_7 = 0; break; } - if (__pyx_t_8) { + if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1414 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1414 * # missing parent. * elif ((source_minikind == c'r' or source_minikind == c'a') and * (target_minikind == c'r' or target_minikind == c'a')): # <<<<<<<<<<<<<< @@ -11555,50 +11597,50 @@ } __pyx_t_2 = __pyx_t_5; } else { - __pyx_t_2 = __pyx_t_8; + __pyx_t_2 = __pyx_t_7; } if (__pyx_t_2) { goto __pyx_L6; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1422 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1422 * raise AssertionError("don't know how to compare " * "source_minikind=%r, target_minikind=%r" * % (source_minikind, target_minikind)) # <<<<<<<<<<<<<< * ## import pdb;pdb.set_trace() * return None, None */ - __pyx_t_7 = PyInt_FromLong(__pyx_v_source_minikind); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_14 = PyInt_FromLong(__pyx_v_source_minikind); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_14); __pyx_t_12 = PyInt_FromLong(__pyx_v_target_minikind); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_12); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_14); + __Pyx_GIVEREF(__pyx_t_14); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_7 = 0; + __pyx_t_14 = 0; __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_42), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_36), __pyx_t_9); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_12)); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_12)); __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_Raise(__pyx_t_12, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1424 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1424 * % (source_minikind, target_minikind)) * ## import pdb;pdb.set_trace() * return None, None # <<<<<<<<<<<<<< @@ -11606,9 +11648,17 @@ * def __iter__(self): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_k_tuple_43)); - __pyx_r = ((PyObject *)__pyx_k_tuple_43); - goto __pyx_L0; + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 1, Py_None); + __Pyx_GIVEREF(Py_None); + __pyx_r = __pyx_t_12; + __pyx_t_12 = 0; + goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; @@ -11616,7 +11666,7 @@ __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); @@ -11656,7 +11706,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1426 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1426 * return None, None * * def __iter__(self): # <<<<<<<<<<<<<< @@ -11664,12 +11714,12 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_1__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_1__iter__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC___iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC___iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannySetupContext("__iter__"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1427 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1427 * * def __iter__(self): * return self # <<<<<<<<<<<<<< @@ -11688,7 +11738,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1429 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1429 * return self * * def iter_changes(self): # <<<<<<<<<<<<<< @@ -11696,12 +11746,12 @@ * */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_2iter_changes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_2iter_changes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_iter_changes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_iter_changes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; __Pyx_RefNannySetupContext("iter_changes"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1430 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1430 * * def iter_changes(self): * return self # <<<<<<<<<<<<<< @@ -11720,7 +11770,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1432 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1432 * return self * * cdef int _gather_result_for_consistency(self, result) except -1: # <<<<<<<<<<<<<< @@ -11738,10 +11788,11 @@ PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("_gather_result_for_consistency"); __pyx_v_new_path = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1439 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1439 * :param result: A result tuple. * """ * if not self.partial or not result[0]: # <<<<<<<<<<<<<< @@ -11761,7 +11812,7 @@ } if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1440 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1440 * """ * if not self.partial or not result[0]: * return 0 # <<<<<<<<<<<<<< @@ -11774,7 +11825,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1441 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1441 * if not self.partial or not result[0]: * return 0 * self.seen_ids.add(result[0]) # <<<<<<<<<<<<<< @@ -11786,17 +11837,17 @@ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_result, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1442 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1442 * return 0 * self.seen_ids.add(result[0]) * new_path = result[1][1] # <<<<<<<<<<<<<< @@ -11812,7 +11863,7 @@ __pyx_v_new_path = __pyx_t_6; __pyx_t_6 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1443 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1443 * self.seen_ids.add(result[0]) * new_path = result[1][1] * if new_path: # <<<<<<<<<<<<<< @@ -11822,7 +11873,7 @@ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_new_path); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1445 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1445 * if new_path: * # Not the root and not a delete: queue up the parents of the path. * self.search_specific_file_parents.update( # <<<<<<<<<<<<<< @@ -11832,7 +11883,7 @@ __pyx_t_6 = PyObject_GetAttr(__pyx_v_self->search_specific_file_parents, __pyx_n_s__update); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1446 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1446 * # Not the root and not a delete: queue up the parents of the path. * self.search_specific_file_parents.update( * osutils.parent_directories(new_path.encode('utf8'))) # <<<<<<<<<<<<<< @@ -11846,47 +11897,59 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetAttr(__pyx_v_new_path, __pyx_n_s__encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(((PyObject *)__pyx_n_s__utf8)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_n_s__utf8)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8)); + __pyx_t_8 = PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8); + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1449 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1449 * # Add the root directory which parent_directories does not * # provide. * self.search_specific_file_parents.add('') # <<<<<<<<<<<<<< * return 0 * */ - __pyx_t_7 = PyObject_GetAttr(__pyx_v_self->search_specific_file_parents, __pyx_n_s__add); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_GetAttr(__pyx_v_self->search_specific_file_parents, __pyx_n_s__add); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); + PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); + __pyx_t_6 = PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L4; } __pyx_L4:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1450 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1450 * # provide. * self.search_specific_file_parents.add('') * return 0 # <<<<<<<<<<<<<< @@ -11903,6 +11966,7 @@ __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._gather_result_for_consistency"); __pyx_r = -1; __pyx_L0:; @@ -11911,7 +11975,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1452 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1452 * return 0 * * cdef int _update_current_block(self) except -1: # <<<<<<<<<<<<<< @@ -11930,7 +11994,7 @@ int __pyx_t_7; __Pyx_RefNannySetupContext("_update_current_block"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1453 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1453 * * cdef int _update_current_block(self) except -1: * if (self.block_index < len(self.state._dirblocks) and # <<<<<<<<<<<<<< @@ -11944,7 +12008,7 @@ __pyx_t_3 = (__pyx_v_self->block_index < __pyx_t_2); if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1454 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1454 * cdef int _update_current_block(self) except -1: * if (self.block_index < len(self.state._dirblocks) and * osutils.is_inside(self.current_root, self.state._dirblocks[self.block_index][0])): # <<<<<<<<<<<<<< @@ -11965,17 +12029,17 @@ __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_self->current_root); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->current_root); __Pyx_GIVEREF(__pyx_v_self->current_root); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_t_6; @@ -11984,7 +12048,7 @@ } if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1455 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1455 * if (self.block_index < len(self.state._dirblocks) and * osutils.is_inside(self.current_root, self.state._dirblocks[self.block_index][0])): * self.current_block = self.state._dirblocks[self.block_index] # <<<<<<<<<<<<<< @@ -12002,7 +12066,7 @@ __pyx_v_self->current_block = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1456 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1456 * osutils.is_inside(self.current_root, self.state._dirblocks[self.block_index][0])): * self.current_block = self.state._dirblocks[self.block_index] * self.current_block_list = self.current_block[1] # <<<<<<<<<<<<<< @@ -12017,7 +12081,7 @@ __pyx_v_self->current_block_list = __pyx_t_5; __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1457 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1457 * self.current_block = self.state._dirblocks[self.block_index] * self.current_block_list = self.current_block[1] * self.current_block_pos = 0 # <<<<<<<<<<<<<< @@ -12029,7 +12093,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1459 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1459 * self.current_block_pos = 0 * else: * self.current_block = None # <<<<<<<<<<<<<< @@ -12042,7 +12106,7 @@ __Pyx_DECREF(__pyx_v_self->current_block); __pyx_v_self->current_block = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1460 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1460 * else: * self.current_block = None * self.current_block_list = None # <<<<<<<<<<<<<< @@ -12057,7 +12121,7 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1461 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1461 * self.current_block = None * self.current_block_list = None * return 0 # <<<<<<<<<<<<<< @@ -12080,7 +12144,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1463 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1463 * return 0 * * def __next__(self): # <<<<<<<<<<<<<< @@ -12088,13 +12152,13 @@ * return self._iter_next() */ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_3__next__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_3__next__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC___next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC___next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__next__"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1465 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1465 * def __next__(self): * # Simple thunk to allow tail recursion without pyrex confusion * return self._iter_next() # <<<<<<<<<<<<<< @@ -12120,7 +12184,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1467 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1467 * return self._iter_next() * * cdef _iter_next(self): # <<<<<<<<<<<<<< @@ -12161,7 +12225,8 @@ PyObject *__pyx_t_10 = NULL; int __pyx_t_11; PyObject *__pyx_t_12 = NULL; - int __pyx_t_13; + PyObject *__pyx_t_13 = NULL; + int __pyx_t_14; __Pyx_RefNannySetupContext("_iter_next"); __pyx_v_current_dirname = Py_None; __Pyx_INCREF(Py_None); __pyx_v_current_blockname = Py_None; __Pyx_INCREF(Py_None); @@ -12174,13 +12239,13 @@ __pyx_v_e = Py_None; __Pyx_INCREF(Py_None); __pyx_v_new_executable = Py_None; __Pyx_INCREF(Py_None); __pyx_v_e_winerror = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_win_errors = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_win_errors = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_bzr_index = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_initial_key = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_initial_key = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_current_path_info = Py_None; __Pyx_INCREF(Py_None); __pyx_v_current_entry = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1519 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1519 * cdef int advance_entry, advance_path * cdef int path_handled * searched_specific_files = self.searched_specific_files # <<<<<<<<<<<<<< @@ -12191,7 +12256,7 @@ __Pyx_DECREF(__pyx_v_searched_specific_files); __pyx_v_searched_specific_files = __pyx_v_self->searched_specific_files; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1521 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1521 * searched_specific_files = self.searched_specific_files * # Are we walking a root? * while self.root_entries_pos < self.root_entries_len: # <<<<<<<<<<<<<< @@ -12202,7 +12267,7 @@ __pyx_t_1 = (__pyx_v_self->root_entries_pos < __pyx_v_self->root_entries_len); if (!__pyx_t_1) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1522 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1522 * # Are we walking a root? * while self.root_entries_pos < self.root_entries_len: * entry = self.root_entries[self.root_entries_pos] # <<<<<<<<<<<<<< @@ -12215,7 +12280,7 @@ __pyx_v_entry = __pyx_t_2; __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1523 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1523 * while self.root_entries_pos < self.root_entries_len: * entry = self.root_entries[self.root_entries_pos] * self.root_entries_pos = self.root_entries_pos + 1 # <<<<<<<<<<<<<< @@ -12224,48 +12289,45 @@ */ __pyx_v_self->root_entries_pos = (__pyx_v_self->root_entries_pos + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1524 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1524 * entry = self.root_entries[self.root_entries_pos] * self.root_entries_pos = self.root_entries_pos + 1 * result, changed = self._process_entry(entry, self.root_dir_info) # <<<<<<<<<<<<<< * if changed is not None: * if changed: */ - __pyx_t_2 = __pyx_v_self->root_dir_info; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_process_entry(__pyx_v_self, __pyx_v_entry, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { - PyObject* tuple = __pyx_t_3; - __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2); + __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_process_entry(__pyx_v_self, __pyx_v_entry, __pyx_v_self->root_dir_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) { + PyObject* tuple = __pyx_t_2; + __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_changed); __pyx_v_changed = __pyx_t_4; __pyx_t_4 = 0; } else { - __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_EndUnpack(__pyx_t_5, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_changed); __pyx_v_changed = __pyx_t_4; __pyx_t_4 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1525 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1525 * self.root_entries_pos = self.root_entries_pos + 1 * result, changed = self._process_entry(entry, self.root_dir_info) * if changed is not None: # <<<<<<<<<<<<<< @@ -12275,7 +12337,7 @@ __pyx_t_1 = (__pyx_v_changed != Py_None); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1526 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1526 * result, changed = self._process_entry(entry, self.root_dir_info) * if changed is not None: * if changed: # <<<<<<<<<<<<<< @@ -12285,7 +12347,7 @@ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1527 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1527 * if changed is not None: * if changed: * self._gather_result_for_consistency(result) # <<<<<<<<<<<<<< @@ -12297,7 +12359,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1528 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1528 * if changed: * self._gather_result_for_consistency(result) * if changed or self.include_unchanged: # <<<<<<<<<<<<<< @@ -12312,7 +12374,7 @@ } if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1529 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1529 * self._gather_result_for_consistency(result) * if changed or self.include_unchanged: * return result # <<<<<<<<<<<<<< @@ -12331,7 +12393,7 @@ __pyx_L5:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1531 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1531 * return result * # Have we finished the prior root, or never started one ? * if self.current_root is None: # <<<<<<<<<<<<<< @@ -12341,7 +12403,7 @@ __pyx_t_7 = (__pyx_v_self->current_root == Py_None); if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1534 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1534 * # TODO: the pending list should be lexically sorted? the * # interface doesn't require it. * try: # <<<<<<<<<<<<<< @@ -12356,20 +12418,20 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1535 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1535 * # interface doesn't require it. * try: * self.current_root = self.search_specific_files.pop() # <<<<<<<<<<<<<< * except KeyError, _: * raise StopIteration() */ - __pyx_t_3 = __Pyx_PyObject_Pop(__pyx_v_self->search_specific_files); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L9_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_self->search_specific_files); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; __pyx_clineno = __LINE__; goto __pyx_L9_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->current_root); __Pyx_DECREF(__pyx_v_self->current_root); - __pyx_v_self->current_root = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_self->current_root = __pyx_t_2; + __pyx_t_2 = 0; } __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; @@ -12377,11 +12439,11 @@ goto __pyx_L16_try_end; __pyx_L9_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1536 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1536 * try: * self.current_root = self.search_specific_files.pop() * except KeyError, _: # <<<<<<<<<<<<<< @@ -12391,15 +12453,15 @@ __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_KeyError); if (__pyx_t_6) { __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next"); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_v__); __pyx_v__ = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1537 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1537 * self.current_root = self.search_specific_files.pop() * except KeyError, _: * raise StopIteration() # <<<<<<<<<<<<<< @@ -12411,9 +12473,9 @@ __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L10_exception_handled; } __pyx_L11_except_error:; @@ -12430,106 +12492,109 @@ __pyx_L16_try_end:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1538 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1538 * except KeyError, _: * raise StopIteration() * self.searched_specific_files.add(self.current_root) # <<<<<<<<<<<<<< * # process the entries for this containing directory: the rest will be * # found by their parents recursively. */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->searched_specific_files, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->searched_specific_files, __pyx_n_s__add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self->current_root); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->current_root); __Pyx_GIVEREF(__pyx_v_self->current_root); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1541 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1541 * # process the entries for this containing directory: the rest will be * # found by their parents recursively. * self.root_entries = self.state._entries_for_path(self.current_root) # <<<<<<<<<<<<<< * self.root_entries_len = len(self.root_entries) * self.current_root_unicode = self.current_root.decode('utf8') */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___entries_for_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___entries_for_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self->current_root); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->current_root); __Pyx_GIVEREF(__pyx_v_self->current_root); - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root_entries); __Pyx_DECREF(__pyx_v_self->root_entries); - __pyx_v_self->root_entries = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_self->root_entries = __pyx_t_3; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1542 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1542 * # found by their parents recursively. * self.root_entries = self.state._entries_for_path(self.current_root) * self.root_entries_len = len(self.root_entries) # <<<<<<<<<<<<<< * self.current_root_unicode = self.current_root.decode('utf8') * self.root_abspath = self.tree.abspath(self.current_root_unicode) */ - __pyx_t_2 = __pyx_v_self->root_entries; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_8 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = PyObject_Length(__pyx_v_self->root_entries); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_self->root_entries_len = __pyx_t_8; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1543 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1543 * self.root_entries = self.state._entries_for_path(self.current_root) * self.root_entries_len = len(self.root_entries) * self.current_root_unicode = self.current_root.decode('utf8') # <<<<<<<<<<<<<< * self.root_abspath = self.tree.abspath(self.current_root_unicode) * try: */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->current_root, __pyx_n_s__decode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_47), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->current_root, __pyx_n_s__decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GIVEREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_n_s__utf8)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__utf8)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8)); + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->current_root_unicode); __Pyx_DECREF(__pyx_v_self->current_root_unicode); - __pyx_v_self->current_root_unicode = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_self->current_root_unicode = __pyx_t_2; + __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1544 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1544 * self.root_entries_len = len(self.root_entries) * self.current_root_unicode = self.current_root.decode('utf8') * self.root_abspath = self.tree.abspath(self.current_root_unicode) # <<<<<<<<<<<<<< * try: * root_stat = os.lstat(self.root_abspath) */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s__abspath); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s__abspath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_self->current_root_unicode); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->current_root_unicode); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->current_root_unicode); __Pyx_GIVEREF(__pyx_v_self->current_root_unicode); - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root_abspath); __Pyx_DECREF(__pyx_v_self->root_abspath); __pyx_v_self->root_abspath = __pyx_t_3; __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1545 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1545 * self.current_root_unicode = self.current_root.decode('utf8') * self.root_abspath = self.tree.abspath(self.current_root_unicode) * try: # <<<<<<<<<<<<<< @@ -12544,7 +12609,7 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1546 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1546 * self.root_abspath = self.tree.abspath(self.current_root_unicode) * try: * root_stat = os.lstat(self.root_abspath) # <<<<<<<<<<<<<< @@ -12553,171 +12618,177 @@ */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L19_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__lstat); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L19_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__lstat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L19_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->root_abspath); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->root_abspath); __Pyx_GIVEREF(__pyx_v_self->root_abspath); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L19_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L19_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_root_stat); - __pyx_v_root_stat = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_root_stat = __pyx_t_2; + __pyx_t_2 = 0; } /*else:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1556 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1556 * else: * self.root_dir_info = ('', self.current_root, * osutils.file_kind_from_stat_mode(root_stat.st_mode), root_stat, # <<<<<<<<<<<<<< * self.root_abspath) * if self.root_dir_info[2] == 'directory': */ - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s_48); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s_38); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_GetAttr(__pyx_v_root_stat, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_v_root_stat, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1556; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1557 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1557 * self.root_dir_info = ('', self.current_root, * osutils.file_kind_from_stat_mode(root_stat.st_mode), root_stat, * self.root_abspath) # <<<<<<<<<<<<<< * if self.root_dir_info[2] == 'directory': * if self.tree._directory_is_tree_reference( */ - __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); __Pyx_INCREF(__pyx_v_self->current_root); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->current_root); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->current_root); __Pyx_GIVEREF(__pyx_v_self->current_root); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_root_stat); - PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_root_stat); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_root_stat); __Pyx_GIVEREF(__pyx_v_root_stat); __Pyx_INCREF(__pyx_v_self->root_abspath); - PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_self->root_abspath); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_self->root_abspath); __Pyx_GIVEREF(__pyx_v_self->root_abspath); - __pyx_t_4 = 0; + __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1555 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1555 * raise * else: * self.root_dir_info = ('', self.current_root, # <<<<<<<<<<<<<< * osutils.file_kind_from_stat_mode(root_stat.st_mode), root_stat, * self.root_abspath) */ - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->root_dir_info); __Pyx_DECREF(__pyx_v_self->root_dir_info); - __pyx_v_self->root_dir_info = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_v_self->root_dir_info = __pyx_t_4; + __pyx_t_4 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1558 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1558 * osutils.file_kind_from_stat_mode(root_stat.st_mode), root_stat, * self.root_abspath) * if self.root_dir_info[2] == 'directory': # <<<<<<<<<<<<<< * if self.tree._directory_is_tree_reference( * self.current_root_unicode): */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->root_dir_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self->root_dir_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1559 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1559 * self.root_abspath) * if self.root_dir_info[2] == 'directory': * if self.tree._directory_is_tree_reference( # <<<<<<<<<<<<<< * self.current_root_unicode): * self.root_dir_info = self.root_dir_info[:2] + \ */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s_49); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s_39); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1560 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1560 * if self.root_dir_info[2] == 'directory': * if self.tree._directory_is_tree_reference( * self.current_root_unicode): # <<<<<<<<<<<<<< * self.root_dir_info = self.root_dir_info[:2] + \ * ('tree-reference',) + self.root_dir_info[3:] */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self->current_root_unicode); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->current_root_unicode); + PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->current_root_unicode); __Pyx_GIVEREF(__pyx_v_self->current_root_unicode); - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1559; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1561 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1561 * if self.tree._directory_is_tree_reference( * self.current_root_unicode): * self.root_dir_info = self.root_dir_info[:2] + \ # <<<<<<<<<<<<<< * ('tree-reference',) + self.root_dir_info[3:] * if not self.root_entries and not self.root_dir_info: */ - __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_self->root_dir_info, 0, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __pyx_t_3 = PySequence_GetSlice(__pyx_v_self->root_dir_info, 0, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} __Pyx_GOTREF(__pyx_t_3); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1562 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1562 * self.current_root_unicode): * self.root_dir_info = self.root_dir_info[:2] + \ * ('tree-reference',) + self.root_dir_info[3:] # <<<<<<<<<<<<<< * if not self.root_entries and not self.root_dir_info: * # this specified path is not present at all, skip it. */ - __pyx_t_2 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_k_tuple_50)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_33)); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_33)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_33)); + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_self->root_dir_info, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PySequence_GetSlice(__pyx_v_self->root_dir_info, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1561 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1561 * if self.tree._directory_is_tree_reference( * self.current_root_unicode): * self.root_dir_info = self.root_dir_info[:2] + \ # <<<<<<<<<<<<<< * ('tree-reference',) + self.root_dir_info[3:] * if not self.root_entries and not self.root_dir_info: */ - __Pyx_GIVEREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->root_dir_info); __Pyx_DECREF(__pyx_v_self->root_dir_info); - __pyx_v_self->root_dir_info = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_self->root_dir_info = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L28; } __pyx_L28:; @@ -12731,11 +12802,11 @@ goto __pyx_L26_try_end; __pyx_L19_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1547 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1547 * try: * root_stat = os.lstat(self.root_abspath) * except OSError, e: # <<<<<<<<<<<<<< @@ -12745,15 +12816,15 @@ __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_OSError); if (__pyx_t_6) { __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next"); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} - __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_e); - __pyx_v_e = __pyx_t_3; + __pyx_v_e = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1548 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1548 * root_stat = os.lstat(self.root_abspath) * except OSError, e: * if e.errno == errno.ENOENT: # <<<<<<<<<<<<<< @@ -12775,7 +12846,7 @@ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1550 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1550 * if e.errno == errno.ENOENT: * # the path does not exist: let _process_entry know that. * self.root_dir_info = None # <<<<<<<<<<<<<< @@ -12791,23 +12862,23 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1553 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1553 * else: * # some other random error: hand it up. * raise # <<<<<<<<<<<<<< * else: * self.root_dir_info = ('', self.current_root, */ - __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); - __Pyx_ErrRestore(__pyx_t_4, __pyx_t_3, __pyx_t_2); - __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; + __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_2); + __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;} } __pyx_L31:; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L20_exception_handled; } @@ -12825,7 +12896,7 @@ __pyx_L26_try_end:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1563 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1563 * self.root_dir_info = self.root_dir_info[:2] + \ * ('tree-reference',) + self.root_dir_info[3:] * if not self.root_entries and not self.root_dir_info: # <<<<<<<<<<<<<< @@ -12843,7 +12914,7 @@ } if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1567 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1567 * # (tail recursion, can do a loop once the full structure is * # known). * return self._iter_next() # <<<<<<<<<<<<<< @@ -12860,7 +12931,7 @@ } __pyx_L32:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1568 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1568 * # known). * return self._iter_next() * path_handled = 0 # <<<<<<<<<<<<<< @@ -12869,7 +12940,7 @@ */ __pyx_v_path_handled = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1569 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1569 * return self._iter_next() * path_handled = 0 * self.root_entries_pos = 0 # <<<<<<<<<<<<<< @@ -12878,7 +12949,7 @@ */ __pyx_v_self->root_entries_pos = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1574 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1574 * # (and the following if block cannot trigger because * # path_handled must be true, so the if block is not # duplicated. * while self.root_entries_pos < self.root_entries_len: # <<<<<<<<<<<<<< @@ -12889,7 +12960,7 @@ __pyx_t_7 = (__pyx_v_self->root_entries_pos < __pyx_v_self->root_entries_len); if (!__pyx_t_7) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1575 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1575 * # path_handled must be true, so the if block is not # duplicated. * while self.root_entries_pos < self.root_entries_len: * entry = self.root_entries[self.root_entries_pos] # <<<<<<<<<<<<<< @@ -12902,7 +12973,7 @@ __pyx_v_entry = __pyx_t_2; __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1576 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1576 * while self.root_entries_pos < self.root_entries_len: * entry = self.root_entries[self.root_entries_pos] * self.root_entries_pos = self.root_entries_pos + 1 # <<<<<<<<<<<<<< @@ -12911,48 +12982,45 @@ */ __pyx_v_self->root_entries_pos = (__pyx_v_self->root_entries_pos + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1577 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1577 * entry = self.root_entries[self.root_entries_pos] * self.root_entries_pos = self.root_entries_pos + 1 * result, changed = self._process_entry(entry, self.root_dir_info) # <<<<<<<<<<<<<< * if changed is not None: * path_handled = -1 */ - __pyx_t_2 = __pyx_v_self->root_dir_info; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_process_entry(__pyx_v_self, __pyx_v_entry, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { - PyObject* tuple = __pyx_t_3; - __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2); - __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_process_entry(__pyx_v_self, __pyx_v_entry, __pyx_v_self->root_dir_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) { + PyObject* tuple = __pyx_t_2; + __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_changed); - __pyx_v_changed = __pyx_t_4; + __pyx_v_result = __pyx_t_4; __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_v_changed); + __pyx_v_changed = __pyx_t_3; + __pyx_t_3 = 0; } else { - __pyx_t_9 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_9, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_9, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_9, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_9, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); if (__Pyx_EndUnpack(__pyx_t_9, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_v_changed); - __pyx_v_changed = __pyx_t_4; + __pyx_v_result = __pyx_t_4; __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_v_changed); + __pyx_v_changed = __pyx_t_3; + __pyx_t_3 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1578 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1578 * self.root_entries_pos = self.root_entries_pos + 1 * result, changed = self._process_entry(entry, self.root_dir_info) * if changed is not None: # <<<<<<<<<<<<<< @@ -12962,7 +13030,7 @@ __pyx_t_7 = (__pyx_v_changed != Py_None); if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1579 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1579 * result, changed = self._process_entry(entry, self.root_dir_info) * if changed is not None: * path_handled = -1 # <<<<<<<<<<<<<< @@ -12971,7 +13039,7 @@ */ __pyx_v_path_handled = -1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1580 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1580 * if changed is not None: * path_handled = -1 * if changed: # <<<<<<<<<<<<<< @@ -12981,7 +13049,7 @@ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1581 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1581 * path_handled = -1 * if changed: * self._gather_result_for_consistency(result) # <<<<<<<<<<<<<< @@ -12993,7 +13061,7 @@ } __pyx_L36:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1582 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1582 * if changed: * self._gather_result_for_consistency(result) * if changed or self.include_unchanged: # <<<<<<<<<<<<<< @@ -13008,7 +13076,7 @@ } if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1583 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1583 * self._gather_result_for_consistency(result) * if changed or self.include_unchanged: * return result # <<<<<<<<<<<<<< @@ -13027,7 +13095,7 @@ __pyx_L35:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1585 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1585 * return result * # handle unversioned specified paths: * if self.want_unversioned and not path_handled and self.root_dir_info: # <<<<<<<<<<<<<< @@ -13048,70 +13116,70 @@ } if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1587 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1587 * if self.want_unversioned and not path_handled and self.root_dir_info: * new_executable = bool( * stat.S_ISREG(self.root_dir_info[3].st_mode) # <<<<<<<<<<<<<< * and stat.S_IEXEC & self.root_dir_info[3].st_mode) * return (None, */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__S_ISREG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__S_ISREG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->root_dir_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->root_dir_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1588 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1588 * new_executable = bool( * stat.S_ISREG(self.root_dir_info[3].st_mode) * and stat.S_IEXEC & self.root_dir_info[3].st_mode) # <<<<<<<<<<<<<< * return (None, * (None, self.current_root_unicode), */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__S_IEXEC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__S_IEXEC); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self->root_dir_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->root_dir_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_And(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_And(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = __pyx_t_11; } else { __pyx_t_7 = __pyx_t_1; } - __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_7))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_new_executable); - __pyx_v_new_executable = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_new_executable = __pyx_t_4; + __pyx_t_4 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1589 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1589 * stat.S_ISREG(self.root_dir_info[3].st_mode) * and stat.S_IEXEC & self.root_dir_info[3].st_mode) * return (None, # <<<<<<<<<<<<<< @@ -13120,143 +13188,159 @@ */ __Pyx_XDECREF(__pyx_r); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1590 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1590 * and stat.S_IEXEC & self.root_dir_info[3].st_mode) * return (None, * (None, self.current_root_unicode), # <<<<<<<<<<<<<< * True, * (False, False), */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_4, 0, Py_None); __Pyx_GIVEREF(Py_None); __Pyx_INCREF(__pyx_v_self->current_root_unicode); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->current_root_unicode); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->current_root_unicode); __Pyx_GIVEREF(__pyx_v_self->current_root_unicode); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1591 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1591 * return (None, * (None, self.current_root_unicode), * True, # <<<<<<<<<<<<<< * (False, False), * (None, None), */ - __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1592 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1592 * (None, self.current_root_unicode), * True, * (False, False), # <<<<<<<<<<<<<< * (None, None), * (None, splitpath(self.current_root_unicode)[-1]), */ - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_3 = 0; + __pyx_t_2 = 0; __pyx_t_9 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1594 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1593 + * True, + * (False, False), + * (None, None), # <<<<<<<<<<<<<< + * (None, splitpath(self.current_root_unicode)[-1]), + * (None, self.root_dir_info[2]), + */ + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_9, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_9, 1, Py_None); + __Pyx_GIVEREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1594 * (False, False), * (None, None), * (None, splitpath(self.current_root_unicode)[-1]), # <<<<<<<<<<<<<< * (None, self.root_dir_info[2]), * (None, new_executable) */ - __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__splitpath); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__splitpath); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_self->current_root_unicode); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->current_root_unicode); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->current_root_unicode); __Pyx_GIVEREF(__pyx_v_self->current_root_unicode); - __pyx_t_5 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_12, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_5, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1595 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1595 * (None, None), * (None, splitpath(self.current_root_unicode)[-1]), * (None, self.root_dir_info[2]), # <<<<<<<<<<<<<< * (None, new_executable) * ) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->root_dir_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_9, 0, Py_None); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->root_dir_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1596 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1596 * (None, splitpath(self.current_root_unicode)[-1]), * (None, self.root_dir_info[2]), * (None, new_executable) # <<<<<<<<<<<<<< * ) * # If we reach here, the outer flow continues, which enters into the */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_5, 0, Py_None); __Pyx_GIVEREF(Py_None); __Pyx_INCREF(__pyx_v_new_executable); - PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_new_executable); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_new_executable); __Pyx_GIVEREF(__pyx_v_new_executable); - __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); + __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_12, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_13, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_t_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_12, 3, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); - __Pyx_INCREF(((PyObject *)__pyx_k_tuple_51)); - PyTuple_SET_ITEM(__pyx_t_12, 4, ((PyObject *)__pyx_k_tuple_51)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51)); - PyTuple_SET_ITEM(__pyx_t_12, 5, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_12, 6, ((PyObject *)__pyx_t_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_12, 7, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_2 = 0; + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); __pyx_t_4 = 0; + __pyx_t_3 = 0; __pyx_t_10 = 0; - __pyx_t_5 = 0; __pyx_t_9 = 0; - __pyx_t_3 = 0; - __pyx_r = ((PyObject *)__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_2 = 0; + __pyx_t_5 = 0; + __pyx_r = __pyx_t_13; + __pyx_t_13 = 0; goto __pyx_L0; goto __pyx_L38; } @@ -13265,7 +13349,7 @@ } __pyx_L8:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1600 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1600 * # If we reach here, the outer flow continues, which enters into the * # per-root setup logic. * if (self.current_dir_info is None and self.current_block is None and not # <<<<<<<<<<<<<< @@ -13277,7 +13361,7 @@ __pyx_t_1 = (__pyx_v_self->current_block == Py_None); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1601 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1601 * # per-root setup logic. * if (self.current_dir_info is None and self.current_block is None and not * self.doing_consistency_expansion): # <<<<<<<<<<<<<< @@ -13285,17 +13369,17 @@ * self.current_dir_list = None */ __pyx_t_11 = (!__pyx_v_self->doing_consistency_expansion); - __pyx_t_13 = __pyx_t_11; + __pyx_t_14 = __pyx_t_11; } else { - __pyx_t_13 = __pyx_t_1; + __pyx_t_14 = __pyx_t_1; } - __pyx_t_1 = __pyx_t_13; + __pyx_t_1 = __pyx_t_14; } else { __pyx_t_1 = __pyx_t_7; } if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1603 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1603 * self.doing_consistency_expansion): * # setup iteration of this root: * self.current_dir_list = None # <<<<<<<<<<<<<< @@ -13308,7 +13392,7 @@ __Pyx_DECREF(__pyx_v_self->current_dir_list); __pyx_v_self->current_dir_list = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1604 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1604 * # setup iteration of this root: * self.current_dir_list = None * if self.root_dir_info and self.root_dir_info[2] == 'tree-reference': # <<<<<<<<<<<<<< @@ -13317,20 +13401,20 @@ */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->root_dir_info); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_self->root_dir_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_12, ((PyObject *)__pyx_kp_s_37), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_13 = __pyx_t_7; + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_self->root_dir_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_5 = PyObject_RichCompare(__pyx_t_13, ((PyObject *)__pyx_kp_s_33), Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_14 = __pyx_t_7; } else { - __pyx_t_13 = __pyx_t_1; + __pyx_t_14 = __pyx_t_1; } - if (__pyx_t_13) { + if (__pyx_t_14) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1605 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1605 * self.current_dir_list = None * if self.root_dir_info and self.root_dir_info[2] == 'tree-reference': * self.current_dir_info = None # <<<<<<<<<<<<<< @@ -13346,54 +13430,54 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1607 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1607 * self.current_dir_info = None * else: * self.dir_iterator = osutils._walkdirs_utf8(self.root_abspath, # <<<<<<<<<<<<<< * prefix=self.current_root) * self.path_index = 0 */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s___walkdirs_utf8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s___walkdirs_utf8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_self->root_abspath); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->root_abspath); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->root_abspath); __Pyx_GIVEREF(__pyx_v_self->root_abspath); - __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1608 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1608 * else: * self.dir_iterator = osutils._walkdirs_utf8(self.root_abspath, * prefix=self.current_root) # <<<<<<<<<<<<<< * self.path_index = 0 * try: */ - if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__prefix), __pyx_v_self->current_root) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_12, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__prefix), __pyx_v_self->current_root) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyEval_CallObjectWithKeywords(__pyx_t_13, __pyx_t_5, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1607 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1607 * self.current_dir_info = None * else: * self.dir_iterator = osutils._walkdirs_utf8(self.root_abspath, # <<<<<<<<<<<<<< * prefix=self.current_root) * self.path_index = 0 */ - __Pyx_GIVEREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_12); __Pyx_GOTREF(__pyx_v_self->dir_iterator); __Pyx_DECREF(__pyx_v_self->dir_iterator); - __pyx_v_self->dir_iterator = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_self->dir_iterator = __pyx_t_12; + __pyx_t_12 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1609 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1609 * self.dir_iterator = osutils._walkdirs_utf8(self.root_abspath, * prefix=self.current_root) * self.path_index = 0 # <<<<<<<<<<<<<< @@ -13402,7 +13486,7 @@ */ __pyx_v_self->path_index = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1610 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1610 * prefix=self.current_root) * self.path_index = 0 * try: # <<<<<<<<<<<<<< @@ -13417,118 +13501,123 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1611 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1611 * self.path_index = 0 * try: * self.current_dir_info = self.dir_iterator.next() # <<<<<<<<<<<<<< * self.current_dir_list = self.current_dir_info[1] * except OSError, e: */ - __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->dir_iterator, __pyx_n_s__next); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L41_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L41_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_12 = PyObject_GetAttr(__pyx_v_self->dir_iterator, __pyx_n_s__next); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L41_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1611; __pyx_clineno = __LINE__; goto __pyx_L41_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->current_dir_info); __Pyx_DECREF(__pyx_v_self->current_dir_info); - __pyx_v_self->current_dir_info = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_self->current_dir_info = __pyx_t_2; + __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1612 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1612 * try: * self.current_dir_info = self.dir_iterator.next() * self.current_dir_list = self.current_dir_info[1] # <<<<<<<<<<<<<< * except OSError, e: * # there may be directories in the inventory even though */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L41_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; __pyx_clineno = __LINE__; goto __pyx_L41_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->current_dir_list); __Pyx_DECREF(__pyx_v_self->current_dir_list); - __pyx_v_self->current_dir_list = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_self->current_dir_list = __pyx_t_2; + __pyx_t_2 = 0; } /*else:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1636 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1636 * raise * else: * if self.current_dir_info[0][0] == '': # <<<<<<<<<<<<<< * # remove .bzr from iteration * bzr_index = self.bisect_left(self.current_dir_list, ('.bzr',)) */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, ((PyObject *)__pyx_kp_s_5), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__pyx_t_13) { + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_12, ((PyObject *)__pyx_kp_s_5), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_14) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1638 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1638 * if self.current_dir_info[0][0] == '': * # remove .bzr from iteration * bzr_index = self.bisect_left(self.current_dir_list, ('.bzr',)) # <<<<<<<<<<<<<< * if self.current_dir_list[bzr_index][0] != '.bzr': * raise AssertionError() */ - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_40)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_40)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40)); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_self->current_dir_list); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_self->current_dir_list); + PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_self->current_dir_list); __Pyx_GIVEREF(__pyx_v_self->current_dir_list); - __Pyx_INCREF(((PyObject *)__pyx_k_tuple_53)); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_k_tuple_53)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53)); - __pyx_t_5 = PyObject_Call(__pyx_v_self->bisect_left, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_v_self->bisect_left, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_v_bzr_index); - __pyx_v_bzr_index = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_bzr_index = __pyx_t_2; + __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1639 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1639 * # remove .bzr from iteration * bzr_index = self.bisect_left(self.current_dir_list, ('.bzr',)) * if self.current_dir_list[bzr_index][0] != '.bzr': # <<<<<<<<<<<<<< * raise AssertionError() * del self.current_dir_list[bzr_index] */ - __pyx_t_5 = PyObject_GetItem(__pyx_v_self->current_dir_list, __pyx_v_bzr_index); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_9, ((PyObject *)__pyx_kp_s_52), Py_NE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_13) { + __pyx_t_2 = PyObject_GetItem(__pyx_v_self->current_dir_list, __pyx_v_bzr_index); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_12, ((PyObject *)__pyx_kp_s_40), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_14) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1640 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1640 * bzr_index = self.bisect_left(self.current_dir_list, ('.bzr',)) * if self.current_dir_list[bzr_index][0] != '.bzr': * raise AssertionError() # <<<<<<<<<<<<<< * del self.current_dir_list[bzr_index] * initial_key = (self.current_root, '', '') */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1640; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} goto __pyx_L50; } __pyx_L50:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1641 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1641 * if self.current_dir_list[bzr_index][0] != '.bzr': * raise AssertionError() * del self.current_dir_list[bzr_index] # <<<<<<<<<<<<<< @@ -13545,15 +13634,16 @@ __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; goto __pyx_L48_try_end; __pyx_L41_error:; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1613 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1613 * self.current_dir_info = self.dir_iterator.next() * self.current_dir_list = self.current_dir_info[1] * except OSError, e: # <<<<<<<<<<<<<< @@ -13563,71 +13653,71 @@ __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_OSError); if (__pyx_t_6) { __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next"); - if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_9, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_12, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1613; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_12); __Pyx_GOTREF(__pyx_t_5); - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_12); __Pyx_DECREF(__pyx_v_e); - __pyx_v_e = __pyx_t_9; + __pyx_v_e = __pyx_t_12; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1617 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1617 * # this path is not a file on disk: so mark it as end of * # iterator * if e.errno in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL): # <<<<<<<<<<<<<< * self.current_dir_info = None * elif sys.platform == 'win32': */ - __pyx_t_12 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__errno); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__errno); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__ENOENT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_t_12, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __pyx_t_13 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__errno); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__errno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__ENOENT); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_t_13, __pyx_t_10, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_1 = __pyx_t_13; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_1 = __pyx_t_14; if (!__pyx_t_1) { - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__errno); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__ENOTDIR); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_t_12, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__errno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__ENOTDIR); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_t_13, __pyx_t_10, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_7 = __pyx_t_13; - __pyx_t_13 = __pyx_t_7; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_7 = __pyx_t_14; + __pyx_t_14 = __pyx_t_7; } else { - __pyx_t_13 = __pyx_t_1; + __pyx_t_14 = __pyx_t_1; } - if (!__pyx_t_13) { - __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__errno); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__EINVAL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_RichCompare(__pyx_t_12, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + if (!__pyx_t_14) { + __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__errno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__EINVAL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_t_13, __pyx_t_10, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_7 = __pyx_t_1; __pyx_t_1 = __pyx_t_7; } else { - __pyx_t_1 = __pyx_t_13; + __pyx_t_1 = __pyx_t_14; } - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_13 = __pyx_t_1; - if (__pyx_t_13) { + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_14 = __pyx_t_1; + if (__pyx_t_14) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1618 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1618 * # iterator * if e.errno in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL): * self.current_dir_info = None # <<<<<<<<<<<<<< @@ -13642,26 +13732,26 @@ goto __pyx_L53; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1619 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1619 * if e.errno in (errno.ENOENT, errno.ENOTDIR, errno.EINVAL): * self.current_dir_info = None * elif sys.platform == 'win32': # <<<<<<<<<<<<<< * # on win32, python2.4 has e.errno == ERROR_DIRECTORY, but * # python 2.5 has e.errno == EINVAL, */ - __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__platform); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_n_s__win32), Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__pyx_t_13) { + __pyx_t_13 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = PyObject_GetAttr(__pyx_t_13, __pyx_n_s__platform); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyObject_RichCompare(__pyx_t_9, ((PyObject *)__pyx_n_s__win32), Py_EQ); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1619; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_14) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1623 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1623 * # python 2.5 has e.errno == EINVAL, * # and e.winerror == ERROR_DIRECTORY * try: # <<<<<<<<<<<<<< @@ -13676,30 +13766,31 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1624 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1624 * # and e.winerror == ERROR_DIRECTORY * try: * e_winerror = e.winerror # <<<<<<<<<<<<<< * except AttributeError, _: * e_winerror = None */ - __pyx_t_12 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__winerror); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L54_error;} - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__winerror); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1624; __pyx_clineno = __LINE__; goto __pyx_L54_error;} + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_v_e_winerror); - __pyx_v_e_winerror = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_v_e_winerror = __pyx_t_13; + __pyx_t_13 = 0; } __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; goto __pyx_L61_try_end; __pyx_L54_error:; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1625 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1625 * try: * e_winerror = e.winerror * except AttributeError, _: # <<<<<<<<<<<<<< @@ -13709,15 +13800,15 @@ __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_6) { __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next"); - if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_10, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;} - __Pyx_GOTREF(__pyx_t_12); + if (__Pyx_GetException(&__pyx_t_13, &__pyx_t_9, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L56_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GOTREF(__pyx_t_9); __Pyx_GOTREF(__pyx_t_10); - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(__pyx_t_9); __Pyx_DECREF(__pyx_v__); - __pyx_v__ = __pyx_t_10; + __pyx_v__ = __pyx_t_9; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1626 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1626 * e_winerror = e.winerror * except AttributeError, _: * e_winerror = None # <<<<<<<<<<<<<< @@ -13727,9 +13818,9 @@ __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_v_e_winerror); __pyx_v_e_winerror = Py_None; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L55_exception_handled; } __pyx_L56_except_error:; @@ -13746,49 +13837,50 @@ __pyx_L61_try_end:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1627 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1627 * except AttributeError, _: * e_winerror = None * win_errors = (ERROR_DIRECTORY, ERROR_PATH_NOT_FOUND) # <<<<<<<<<<<<<< * if (e.errno in win_errors or e_winerror in win_errors): * self.current_dir_info = None */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_6bzrlib_21_dirstate_helpers_pyx_ERROR_DIRECTORY); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyInt_FromLong(__pyx_v_6bzrlib_21_dirstate_helpers_pyx_ERROR_PATH_NOT_FOUND); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_6bzrlib_21_dirstate_helpers_pyx_ERROR_DIRECTORY); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); - PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10); + __pyx_t_9 = PyInt_FromLong(__pyx_v_6bzrlib_21_dirstate_helpers_pyx_ERROR_PATH_NOT_FOUND); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_4 = 0; + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); __pyx_t_10 = 0; + __pyx_t_9 = 0; + if (!(likely(PyTuple_CheckExact(__pyx_t_13))||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_13)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __Pyx_DECREF(((PyObject *)__pyx_v_win_errors)); - __pyx_v_win_errors = __pyx_t_12; - __pyx_t_12 = 0; + __pyx_v_win_errors = ((PyObject *)__pyx_t_13); + __pyx_t_13 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1628 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1628 * e_winerror = None * win_errors = (ERROR_DIRECTORY, ERROR_PATH_NOT_FOUND) * if (e.errno in win_errors or e_winerror in win_errors): # <<<<<<<<<<<<<< * self.current_dir_info = None * else: */ - __pyx_t_12 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__errno); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = ((PySequence_Contains(((PyObject *)__pyx_v_win_errors), __pyx_t_12))); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (!__pyx_t_13) { + __pyx_t_13 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__errno); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_14 = ((PySequence_Contains(((PyObject *)__pyx_v_win_errors), __pyx_t_13))); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (!__pyx_t_14) { __pyx_t_1 = ((PySequence_Contains(((PyObject *)__pyx_v_win_errors), __pyx_v_e_winerror))); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1628; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} __pyx_t_7 = __pyx_t_1; } else { - __pyx_t_7 = __pyx_t_13; + __pyx_t_7 = __pyx_t_14; } if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1629 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1629 * win_errors = (ERROR_DIRECTORY, ERROR_PATH_NOT_FOUND) * if (e.errno in win_errors or e_winerror in win_errors): * self.current_dir_info = None # <<<<<<<<<<<<<< @@ -13804,18 +13896,18 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1632 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1632 * else: * # Will this really raise the right exception ? * raise # <<<<<<<<<<<<<< * else: * raise */ + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_ErrRestore(__pyx_t_5, __pyx_t_9, __pyx_t_3); - __pyx_t_5 = 0; __pyx_t_9 = 0; __pyx_t_3 = 0; + __Pyx_ErrRestore(__pyx_t_2, __pyx_t_12, __pyx_t_5); + __pyx_t_2 = 0; __pyx_t_12 = 0; __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} } __pyx_L64:; @@ -13823,24 +13915,24 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1634 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1634 * raise * else: * raise # <<<<<<<<<<<<<< * else: * if self.current_dir_info[0][0] == '': */ + __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_3); - __Pyx_ErrRestore(__pyx_t_5, __pyx_t_9, __pyx_t_3); - __pyx_t_5 = 0; __pyx_t_9 = 0; __pyx_t_3 = 0; + __Pyx_ErrRestore(__pyx_t_2, __pyx_t_12, __pyx_t_5); + __pyx_t_2 = 0; __pyx_t_12 = 0; __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;} } __pyx_L53:; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L42_exception_handled; } __pyx_L43_except_error:; @@ -13859,76 +13951,77 @@ } __pyx_L40:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1642 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1642 * raise AssertionError() * del self.current_dir_list[bzr_index] * initial_key = (self.current_root, '', '') # <<<<<<<<<<<<<< * self.block_index, _ = self.state._find_block_index_from_key(initial_key) * if self.block_index == 0: */ - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_self->current_root); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->current_root); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->current_root); __Pyx_GIVEREF(__pyx_v_self->current_root); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_kp_s_5)); + PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_kp_s_5)); + PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); + if (!(likely(PyTuple_CheckExact(__pyx_t_5))||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_initial_key)); - __pyx_v_initial_key = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_initial_key = ((PyObject *)__pyx_t_5); + __pyx_t_5 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1643 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1643 * del self.current_dir_list[bzr_index] * initial_key = (self.current_root, '', '') * self.block_index, _ = self.state._find_block_index_from_key(initial_key) # <<<<<<<<<<<<<< * if self.block_index == 0: * # we have processed the total root already, but because the */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s_54); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __pyx_t_5 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s_41); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(((PyObject *)__pyx_v_initial_key)); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_v_initial_key)); + PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)__pyx_v_initial_key)); __Pyx_GIVEREF(((PyObject *)__pyx_v_initial_key)); - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 2)) { - PyObject* tuple = __pyx_t_5; - __pyx_t_9 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_9); - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_2 = PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) { + PyObject* tuple = __pyx_t_2; + __pyx_t_12 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_12); + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_12); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_5 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_self->block_index = __pyx_t_6; __Pyx_DECREF(__pyx_v__); - __pyx_v__ = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v__ = __pyx_t_5; + __pyx_t_5 = 0; } else { - __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_13 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_UnpackItem(__pyx_t_13, 0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_12, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_12, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_EndUnpack(__pyx_t_12, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_12); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_13, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_EndUnpack(__pyx_t_13, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_v_self->block_index = __pyx_t_6; __Pyx_DECREF(__pyx_v__); - __pyx_v__ = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v__ = __pyx_t_5; + __pyx_t_5 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1644 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1644 * initial_key = (self.current_root, '', '') * self.block_index, _ = self.state._find_block_index_from_key(initial_key) * if self.block_index == 0: # <<<<<<<<<<<<<< @@ -13938,7 +14031,7 @@ __pyx_t_7 = (__pyx_v_self->block_index == 0); if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1647 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1647 * # we have processed the total root already, but because the * # initial key matched it we should skip it here. * self.block_index = self.block_index + 1 # <<<<<<<<<<<<<< @@ -13950,7 +14043,7 @@ } __pyx_L65:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1648 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1648 * # initial key matched it we should skip it here. * self.block_index = self.block_index + 1 * self._update_current_block() # <<<<<<<<<<<<<< @@ -13962,7 +14055,7 @@ } __pyx_L39:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1651 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1651 * # walk until both the directory listing and the versioned metadata * # are exhausted. * while (self.current_dir_info is not None # <<<<<<<<<<<<<< @@ -13971,7 +14064,7 @@ */ while (1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1652 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1652 * # are exhausted. * while (self.current_dir_info is not None * or self.current_block is not None): # <<<<<<<<<<<<<< @@ -13980,14 +14073,14 @@ */ __pyx_t_7 = (__pyx_v_self->current_dir_info != Py_None); if (!__pyx_t_7) { - __pyx_t_13 = (__pyx_v_self->current_block != Py_None); - __pyx_t_1 = __pyx_t_13; + __pyx_t_14 = (__pyx_v_self->current_block != Py_None); + __pyx_t_1 = __pyx_t_14; } else { __pyx_t_1 = __pyx_t_7; } if (!__pyx_t_1) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1654 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1654 * or self.current_block is not None): * # Uncommon case - a missing directory or an unversioned directory: * if (self.current_dir_info and self.current_block # <<<<<<<<<<<<<< @@ -13997,7 +14090,7 @@ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->current_dir_info); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1655 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1655 * # Uncommon case - a missing directory or an unversioned directory: * if (self.current_dir_info and self.current_block * and self.current_dir_info[0][0] != self.current_block[0]): # <<<<<<<<<<<<<< @@ -14006,20 +14099,20 @@ */ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->current_block); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_7) { - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->current_block, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_NE); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->current_block, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_11 = __pyx_t_13; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_11 = __pyx_t_14; } else { __pyx_t_11 = __pyx_t_7; } @@ -14029,23 +14122,23 @@ } if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1658 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1658 * # Work around pyrex broken heuristic - current_dirname has * # the same scope as current_dirname_c * current_dirname = self.current_dir_info[0][0] # <<<<<<<<<<<<<< * current_dirname_c = PyString_AS_STRING_void( * current_dirname) */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_v_current_dirname); - __pyx_v_current_dirname = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_current_dirname = __pyx_t_2; + __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1660 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1660 * current_dirname = self.current_dir_info[0][0] * current_dirname_c = PyString_AS_STRING_void( * current_dirname) # <<<<<<<<<<<<<< @@ -14054,20 +14147,20 @@ */ __pyx_v_current_dirname_c = PyString_AS_STRING(((void *)__pyx_v_current_dirname)); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1661 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1661 * current_dirname_c = PyString_AS_STRING_void( * current_dirname) * current_blockname = self.current_block[0] # <<<<<<<<<<<<<< * current_blockname_c = PyString_AS_STRING_void( * current_blockname) */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->current_block, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->current_block, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_current_blockname); - __pyx_v_current_blockname = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_current_blockname = __pyx_t_2; + __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1663 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1663 * current_blockname = self.current_block[0] * current_blockname_c = PyString_AS_STRING_void( * current_blockname) # <<<<<<<<<<<<<< @@ -14076,7 +14169,7 @@ */ __pyx_v_current_blockname_c = PyString_AS_STRING(((void *)__pyx_v_current_blockname)); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1671 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1671 * PyString_Size(current_dirname), * current_blockname_c, * PyString_Size(current_blockname)) < 0: # <<<<<<<<<<<<<< @@ -14086,7 +14179,7 @@ __pyx_t_7 = (__pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_by_dirs(__pyx_v_current_dirname_c, PyString_Size(__pyx_v_current_dirname), __pyx_v_current_blockname_c, PyString_Size(__pyx_v_current_blockname)) < 0); if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1682 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1682 * # recurse into unknown directories. * # We are doing a loop * while self.path_index < len(self.current_dir_list): # <<<<<<<<<<<<<< @@ -14094,55 +14187,52 @@ * # dont descend into this unversioned path if it is */ while (1) { - __pyx_t_5 = __pyx_v_self->current_dir_list; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_8 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_8 = PyObject_Length(__pyx_v_self->current_dir_list); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = (__pyx_v_self->path_index < __pyx_t_8); if (!__pyx_t_7) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1683 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1683 * # We are doing a loop * while self.path_index < len(self.current_dir_list): * current_path_info = self.current_dir_list[self.path_index] # <<<<<<<<<<<<<< * # dont descend into this unversioned path if it is * # a dir */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->current_dir_list, __pyx_v_self->path_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->current_dir_list, __pyx_v_self->path_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_current_path_info); - __pyx_v_current_path_info = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_current_path_info = __pyx_t_2; + __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1686 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1686 * # dont descend into this unversioned path if it is * # a dir * if current_path_info[2] in ('directory', # <<<<<<<<<<<<<< * 'tree-reference'): * del self.current_dir_list[self.path_index] */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_1 = __pyx_t_7; if (!__pyx_t_1) { - __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, ((PyObject *)__pyx_kp_s_37), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_12 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_kp_s_33), Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_11 = __pyx_t_7; __pyx_t_7 = __pyx_t_11; } else { __pyx_t_7 = __pyx_t_1; } - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_7; if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1688 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1688 * if current_path_info[2] in ('directory', * 'tree-reference'): * del self.current_dir_list[self.path_index] # <<<<<<<<<<<<<< @@ -14151,7 +14241,7 @@ */ if (__Pyx_DelItemInt(__pyx_v_self->current_dir_list, __pyx_v_self->path_index, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":1689 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1689 * 'tree-reference'): * del self.current_dir_list[self.path_index] * self.path_index = self.path_index - 1 # <<<<<<<<<<<<<< @@ -14163,7 +14253,7 @@ } __pyx_L72:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1690 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1690 * del self.current_dir_list[self.path_index] * self.path_index = self.path_index - 1 * self.path_index = self.path_index + 1 # <<<<<<<<<<<<<< @@ -14172,7 +14262,7 @@ */ __pyx_v_self->path_index = (__pyx_v_self->path_index + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1691 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1691 * self.path_index = self.path_index - 1 * self.path_index = self.path_index + 1 * if self.want_unversioned: # <<<<<<<<<<<<<< @@ -14181,94 +14271,100 @@ */ if (__pyx_v_self->want_unversioned) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1692 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1692 * self.path_index = self.path_index + 1 * if self.want_unversioned: * if current_path_info[2] == 'directory': # <<<<<<<<<<<<<< * if self.tree._directory_is_tree_reference( * self.utf8_decode(current_path_info[0])[0]): */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1693 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1693 * if self.want_unversioned: * if current_path_info[2] == 'directory': * if self.tree._directory_is_tree_reference( # <<<<<<<<<<<<<< * self.utf8_decode(current_path_info[0])[0]): * current_path_info = current_path_info[:2] + \ */ - __pyx_t_9 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s_49); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_12 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s_39); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1694 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1694 * if current_path_info[2] == 'directory': * if self.tree._directory_is_tree_reference( * self.utf8_decode(current_path_info[0])[0]): # <<<<<<<<<<<<<< * current_path_info = current_path_info[:2] + \ * ('tree-reference',) + current_path_info[3:] */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_current_path_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_current_path_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_t_12, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1695 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1695 * if self.tree._directory_is_tree_reference( * self.utf8_decode(current_path_info[0])[0]): * current_path_info = current_path_info[:2] + \ # <<<<<<<<<<<<<< * ('tree-reference',) + current_path_info[3:] * new_executable = bool( */ - __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_current_path_info, 0, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = PySequence_GetSlice(__pyx_v_current_path_info, 0, 2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1696 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1696 * self.utf8_decode(current_path_info[0])[0]): * current_path_info = current_path_info[:2] + \ * ('tree-reference',) + current_path_info[3:] # <<<<<<<<<<<<<< * new_executable = bool( * stat.S_ISREG(current_path_info[3].st_mode) */ - __pyx_t_5 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_k_tuple_56)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_current_path_info, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_33)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_33)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_33)); + __pyx_t_12 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_GetSlice(__pyx_v_current_path_info, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyNumber_Add(__pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_current_path_info); - __pyx_v_current_path_info = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_current_path_info = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L75; } __pyx_L75:; @@ -14276,70 +14372,70 @@ } __pyx_L74:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1698 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1698 * ('tree-reference',) + current_path_info[3:] * new_executable = bool( * stat.S_ISREG(current_path_info[3].st_mode) # <<<<<<<<<<<<<< * and stat.S_IEXEC & current_path_info[3].st_mode) * return (None, */ - __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__S_ISREG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_current_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__S_ISREG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_current_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1699 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1699 * new_executable = bool( * stat.S_ISREG(current_path_info[3].st_mode) * and stat.S_IEXEC & current_path_info[3].st_mode) # <<<<<<<<<<<<<< * return (None, * (None, self.utf8_decode(current_path_info[0])[0]), */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__S_IEXEC); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_current_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_And(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__S_IEXEC); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_current_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyObject_GetAttr(__pyx_t_12, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_And(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_11 = __pyx_t_7; } else { __pyx_t_11 = __pyx_t_1; } - __pyx_t_5 = __Pyx_PyBool_FromLong((!(!__pyx_t_11))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_v_new_executable); - __pyx_v_new_executable = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_new_executable = __pyx_t_12; + __pyx_t_12 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1700 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1700 * stat.S_ISREG(current_path_info[3].st_mode) * and stat.S_IEXEC & current_path_info[3].st_mode) * return (None, # <<<<<<<<<<<<<< @@ -14348,162 +14444,178 @@ */ __Pyx_XDECREF(__pyx_r); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1701 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1701 * and stat.S_IEXEC & current_path_info[3].st_mode) * return (None, * (None, self.utf8_decode(current_path_info[0])[0]), # <<<<<<<<<<<<<< * True, * (False, False), */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_current_path_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_current_path_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + __pyx_t_12 = 0; + __pyx_t_12 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_2, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_5, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; + PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1702 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1702 * return (None, * (None, self.utf8_decode(current_path_info[0])[0]), * True, # <<<<<<<<<<<<<< * (False, False), * (None, None), */ - __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1703 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1703 * (None, self.utf8_decode(current_path_info[0])[0]), * True, * (False, False), # <<<<<<<<<<<<<< * (None, None), * (None, self.utf8_decode(current_path_info[1])[0]), */ - __pyx_t_9 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_9 = 0; - __pyx_t_12 = 0; + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + __pyx_t_5 = 0; + __pyx_t_13 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1704 + * True, + * (False, False), + * (None, None), # <<<<<<<<<<<<<< + * (None, self.utf8_decode(current_path_info[1])[0]), + * (None, current_path_info[2]), + */ + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_13, 0, Py_None); + __Pyx_GIVEREF(Py_None); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_13, 1, Py_None); + __Pyx_GIVEREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1705 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1705 * (False, False), * (None, None), * (None, self.utf8_decode(current_path_info[1])[0]), # <<<<<<<<<<<<<< * (None, current_path_info[2]), * (None, new_executable)) */ - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_current_path_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_current_path_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + __pyx_t_5 = 0; + __pyx_t_5 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_12, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_5, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1706 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1706 * (None, None), * (None, self.utf8_decode(current_path_info[1])[0]), * (None, current_path_info[2]), # <<<<<<<<<<<<<< * (None, new_executable)) * # This dir info has been handled, go to the next */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_4, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - __pyx_t_9 = 0; + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1707 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1707 * (None, self.utf8_decode(current_path_info[1])[0]), * (None, current_path_info[2]), * (None, new_executable)) # <<<<<<<<<<<<<< * # This dir info has been handled, go to the next * self.path_index = 0 */ - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_9, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_10, 0, Py_None); __Pyx_GIVEREF(Py_None); __Pyx_INCREF(__pyx_v_new_executable); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_new_executable); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_new_executable); __Pyx_GIVEREF(__pyx_v_new_executable); - __pyx_t_2 = PyTuple_New(8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __pyx_t_4 = PyTuple_New(8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_4, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_13); + __Pyx_GIVEREF(__pyx_t_13); + PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_4, 6, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); - __Pyx_INCREF(((PyObject *)__pyx_k_tuple_57)); - PyTuple_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_k_tuple_57)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57)); - PyTuple_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); - PyTuple_SET_ITEM(__pyx_t_2, 6, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_2, 7, ((PyObject *)__pyx_t_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); + PyTuple_SET_ITEM(__pyx_t_4, 7, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_12 = 0; + __pyx_t_2 = 0; + __pyx_t_9 = 0; + __pyx_t_13 = 0; __pyx_t_5 = 0; __pyx_t_3 = 0; __pyx_t_10 = 0; - __pyx_t_12 = 0; + __pyx_r = __pyx_t_4; __pyx_t_4 = 0; - __pyx_t_9 = 0; - __pyx_r = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; goto __pyx_L0; goto __pyx_L73; } __pyx_L73:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1709 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1709 * (None, new_executable)) * # This dir info has been handled, go to the next * self.path_index = 0 # <<<<<<<<<<<<<< @@ -14512,7 +14624,7 @@ */ __pyx_v_self->path_index = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1710 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1710 * # This dir info has been handled, go to the next * self.path_index = 0 * self.current_dir_list = None # <<<<<<<<<<<<<< @@ -14525,7 +14637,7 @@ __Pyx_DECREF(__pyx_v_self->current_dir_list); __pyx_v_self->current_dir_list = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1711 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1711 * self.path_index = 0 * self.current_dir_list = None * try: # <<<<<<<<<<<<<< @@ -14540,53 +14652,54 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1712 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1712 * self.current_dir_list = None * try: * self.current_dir_info = self.dir_iterator.next() # <<<<<<<<<<<<<< * self.current_dir_list = self.current_dir_info[1] * except StopIteration, _: */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->dir_iterator, __pyx_n_s__next); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L76_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L76_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->dir_iterator, __pyx_n_s__next); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L76_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L76_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->current_dir_info); __Pyx_DECREF(__pyx_v_self->current_dir_info); - __pyx_v_self->current_dir_info = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_self->current_dir_info = __pyx_t_10; + __pyx_t_10 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1713 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1713 * try: * self.current_dir_info = self.dir_iterator.next() * self.current_dir_list = self.current_dir_info[1] # <<<<<<<<<<<<<< * except StopIteration, _: * self.current_dir_info = None */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L76_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L76_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->current_dir_list); __Pyx_DECREF(__pyx_v_self->current_dir_list); - __pyx_v_self->current_dir_list = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_self->current_dir_list = __pyx_t_10; + __pyx_t_10 = 0; } __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; goto __pyx_L83_try_end; __pyx_L76_error:; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1714 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1714 * self.current_dir_info = self.dir_iterator.next() * self.current_dir_list = self.current_dir_info[1] * except StopIteration, _: # <<<<<<<<<<<<<< @@ -14596,15 +14709,15 @@ __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_6) { __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next"); - if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L78_except_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_4, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L78_except_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_v__); - __pyx_v__ = __pyx_t_2; + __pyx_v__ = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1715 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1715 * self.current_dir_list = self.current_dir_info[1] * except StopIteration, _: * self.current_dir_info = None # <<<<<<<<<<<<<< @@ -14616,9 +14729,9 @@ __Pyx_GOTREF(__pyx_v_self->current_dir_info); __Pyx_DECREF(__pyx_v_self->current_dir_info); __pyx_v_self->current_dir_info = Py_None; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L77_exception_handled; } __pyx_L78_except_error:; @@ -14638,7 +14751,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1724 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1724 * # need to handle all of the files that are contained * # within. * while self.current_block_pos < len(self.current_block_list): # <<<<<<<<<<<<<< @@ -14646,27 +14759,24 @@ * self.current_block_pos = self.current_block_pos + 1 */ while (1) { - __pyx_t_4 = __pyx_v_self->current_block_list; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyObject_Length(__pyx_v_self->current_block_list); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_11 = (__pyx_v_self->current_block_pos < __pyx_t_8); if (!__pyx_t_11) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1725 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1725 * # within. * while self.current_block_pos < len(self.current_block_list): * current_entry = self.current_block_list[self.current_block_pos] # <<<<<<<<<<<<<< * self.current_block_pos = self.current_block_pos + 1 * # entry referring to file not present on disk. */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self->current_block_list, __pyx_v_self->current_block_pos, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_self->current_block_list, __pyx_v_self->current_block_pos, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_current_entry); - __pyx_v_current_entry = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_current_entry = __pyx_t_3; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1726 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1726 * while self.current_block_pos < len(self.current_block_list): * current_entry = self.current_block_list[self.current_block_pos] * self.current_block_pos = self.current_block_pos + 1 # <<<<<<<<<<<<<< @@ -14675,45 +14785,45 @@ */ __pyx_v_self->current_block_pos = (__pyx_v_self->current_block_pos + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1729 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1729 * # entry referring to file not present on disk. * # advance the entry only, after processing. * result, changed = self._process_entry(current_entry, None) # <<<<<<<<<<<<<< * if changed is not None: * if changed: */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_process_entry(__pyx_v_self, __pyx_v_current_entry, Py_None); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) { - PyObject* tuple = __pyx_t_4; - __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2); - __pyx_t_9 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_process_entry(__pyx_v_self, __pyx_v_current_entry, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { + PyObject* tuple = __pyx_t_3; + __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4); + __pyx_t_10 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_changed); - __pyx_v_changed = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_changed = __pyx_t_10; + __pyx_t_10 = 0; } else { - __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_12, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_12, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_EndUnpack(__pyx_t_12, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_10 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_EndUnpack(__pyx_t_5, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_changed); - __pyx_v_changed = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_changed = __pyx_t_10; + __pyx_t_10 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1730 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1730 * # advance the entry only, after processing. * result, changed = self._process_entry(current_entry, None) * if changed is not None: # <<<<<<<<<<<<<< @@ -14723,7 +14833,7 @@ __pyx_t_11 = (__pyx_v_changed != Py_None); if (__pyx_t_11) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1731 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1731 * result, changed = self._process_entry(current_entry, None) * if changed is not None: * if changed: # <<<<<<<<<<<<<< @@ -14733,7 +14843,7 @@ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_11) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1732 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1732 * if changed is not None: * if changed: * self._gather_result_for_consistency(result) # <<<<<<<<<<<<<< @@ -14745,7 +14855,7 @@ } __pyx_L89:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1733 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1733 * if changed: * self._gather_result_for_consistency(result) * if changed or self.include_unchanged: # <<<<<<<<<<<<<< @@ -14760,7 +14870,7 @@ } if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1734 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1734 * self._gather_result_for_consistency(result) * if changed or self.include_unchanged: * return result # <<<<<<<<<<<<<< @@ -14779,7 +14889,7 @@ __pyx_L88:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1735 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1735 * if changed or self.include_unchanged: * return result * self.block_index = self.block_index + 1 # <<<<<<<<<<<<<< @@ -14788,7 +14898,7 @@ */ __pyx_v_self->block_index = (__pyx_v_self->block_index + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1736 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1736 * return result * self.block_index = self.block_index + 1 * self._update_current_block() # <<<<<<<<<<<<<< @@ -14799,7 +14909,7 @@ } __pyx_L69:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1737 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1737 * self.block_index = self.block_index + 1 * self._update_current_block() * continue # next loop-on-block/dir # <<<<<<<<<<<<<< @@ -14811,20 +14921,20 @@ } __pyx_L68:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1738 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1738 * self._update_current_block() * continue # next loop-on-block/dir * result = self._loop_one_block() # <<<<<<<<<<<<<< * if result is not None: * return result */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_loop_one_block(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_loop_one_block(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_result = __pyx_t_3; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1739 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1739 * continue # next loop-on-block/dir * result = self._loop_one_block() * if result is not None: # <<<<<<<<<<<<<< @@ -14834,7 +14944,7 @@ __pyx_t_1 = (__pyx_v_result != Py_None); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1740 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1740 * result = self._loop_one_block() * if result is not None: * return result # <<<<<<<<<<<<<< @@ -14851,20 +14961,17 @@ __pyx_L66_continue:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1741 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1741 * if result is not None: * return result * if len(self.search_specific_files): # <<<<<<<<<<<<<< * # More supplied paths to process * self.current_root = None */ - __pyx_t_4 = __pyx_v_self->search_specific_files; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyObject_Length(__pyx_v_self->search_specific_files); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1743 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1743 * if len(self.search_specific_files): * # More supplied paths to process * self.current_root = None # <<<<<<<<<<<<<< @@ -14877,7 +14984,7 @@ __Pyx_DECREF(__pyx_v_self->current_root); __pyx_v_self->current_root = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1744 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1744 * # More supplied paths to process * self.current_root = None * return self._iter_next() # <<<<<<<<<<<<<< @@ -14885,16 +14992,16 @@ * # have intended but required for consistent deltas. */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_iter_next(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_iter_next(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; goto __pyx_L92; } __pyx_L92:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1747 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1747 * # Start expanding more conservatively, adding paths the user may not * # have intended but required for consistent deltas. * self.doing_consistency_expansion = 1 # <<<<<<<<<<<<<< @@ -14903,7 +15010,7 @@ */ __pyx_v_self->doing_consistency_expansion = 1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1748 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1748 * # have intended but required for consistent deltas. * self.doing_consistency_expansion = 1 * if not self._pending_consistent_entries: # <<<<<<<<<<<<<< @@ -14914,25 +15021,25 @@ __pyx_t_11 = (!__pyx_t_1); if (__pyx_t_11) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1749 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1749 * self.doing_consistency_expansion = 1 * if not self._pending_consistent_entries: * self._pending_consistent_entries = self._next_consistent_entries() # <<<<<<<<<<<<<< * while self._pending_consistent_entries: * result, changed = self._pending_consistent_entries.pop() */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_next_consistent_entries(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_next_consistent_entries(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->_pending_consistent_entries); __Pyx_DECREF(__pyx_v_self->_pending_consistent_entries); - __pyx_v_self->_pending_consistent_entries = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_self->_pending_consistent_entries = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L93; } __pyx_L93:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1750 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1750 * if not self._pending_consistent_entries: * self._pending_consistent_entries = self._next_consistent_entries() * while self._pending_consistent_entries: # <<<<<<<<<<<<<< @@ -14943,45 +15050,45 @@ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_self->_pending_consistent_entries); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_11) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1751 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1751 * self._pending_consistent_entries = self._next_consistent_entries() * while self._pending_consistent_entries: * result, changed = self._pending_consistent_entries.pop() # <<<<<<<<<<<<<< * if changed is not None: * return result */ - __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_self->_pending_consistent_entries); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) { - PyObject* tuple = __pyx_t_4; - __pyx_t_9 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_9); - __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_PyObject_Pop(__pyx_v_self->_pending_consistent_entries); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { + PyObject* tuple = __pyx_t_3; + __pyx_t_10 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_10); + __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_result = __pyx_t_10; + __pyx_t_10 = 0; __Pyx_DECREF(__pyx_v_changed); - __pyx_v_changed = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_changed = __pyx_t_4; + __pyx_t_4 = 0; } else { - __pyx_t_12 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_12, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_12, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_EndUnpack(__pyx_t_12, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_EndUnpack(__pyx_t_5, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_result = __pyx_t_10; + __pyx_t_10 = 0; __Pyx_DECREF(__pyx_v_changed); - __pyx_v_changed = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_changed = __pyx_t_4; + __pyx_t_4 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1752 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1752 * while self._pending_consistent_entries: * result, changed = self._pending_consistent_entries.pop() * if changed is not None: # <<<<<<<<<<<<<< @@ -14991,7 +15098,7 @@ __pyx_t_11 = (__pyx_v_changed != Py_None); if (__pyx_t_11) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1753 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1753 * result, changed = self._pending_consistent_entries.pop() * if changed is not None: * return result # <<<<<<<<<<<<<< @@ -15007,17 +15114,17 @@ __pyx_L96:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1754 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1754 * if changed is not None: * return result * raise StopIteration() # <<<<<<<<<<<<<< * * cdef object _maybe_tree_ref(self, current_path_info): */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -15030,6 +15137,7 @@ __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next"); __pyx_r = 0; __pyx_L0:; @@ -15054,7 +15162,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1756 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1756 * raise StopIteration() * * cdef object _maybe_tree_ref(self, current_path_info): # <<<<<<<<<<<<<< @@ -15070,17 +15178,17 @@ int __pyx_t_4; __Pyx_RefNannySetupContext("_maybe_tree_ref"); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1757 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1757 * * cdef object _maybe_tree_ref(self, current_path_info): * if self.tree._directory_is_tree_reference( # <<<<<<<<<<<<<< * self.utf8_decode(current_path_info[0])[0]): * return current_path_info[:2] + \ */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s_49); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s_39); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1758 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1758 * cdef object _maybe_tree_ref(self, current_path_info): * if self.tree._directory_is_tree_reference( * self.utf8_decode(current_path_info[0])[0]): # <<<<<<<<<<<<<< @@ -15090,30 +15198,30 @@ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_current_path_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1759 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1759 * if self.tree._directory_is_tree_reference( * self.utf8_decode(current_path_info[0])[0]): * return current_path_info[:2] + \ # <<<<<<<<<<<<<< @@ -15122,32 +15230,38 @@ */ __Pyx_XDECREF(__pyx_r); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1760 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1760 * self.utf8_decode(current_path_info[0])[0]): * return current_path_info[:2] + \ * ('tree-reference',) + current_path_info[3:] # <<<<<<<<<<<<<< * else: * return current_path_info */ - __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_current_path_info, 0, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PySequence_GetSlice(__pyx_v_current_path_info, 0, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_k_tuple_59)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_33)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_33)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_33)); + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_current_path_info, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_GetSlice(__pyx_v_current_path_info, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; goto __pyx_L3; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1762 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1762 * ('tree-reference',) + current_path_info[3:] * else: * return current_path_info # <<<<<<<<<<<<<< @@ -15175,7 +15289,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1764 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1764 * return current_path_info * * cdef object _loop_one_block(self): # <<<<<<<<<<<<<< @@ -15199,9 +15313,9 @@ PyObject *__pyx_v__; PyObject *__pyx_r = NULL; int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; + int __pyx_t_2; int __pyx_t_3; - int __pyx_t_4; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; @@ -15210,7 +15324,8 @@ PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; - Py_ssize_t __pyx_t_13; + PyObject *__pyx_t_13 = NULL; + Py_ssize_t __pyx_t_14; __Pyx_RefNannySetupContext("_loop_one_block"); __pyx_v_current_entry = Py_None; __Pyx_INCREF(Py_None); __pyx_v_current_path_info = Py_None; __Pyx_INCREF(Py_None); @@ -15221,7 +15336,7 @@ __pyx_v_relpath_unicode = Py_None; __Pyx_INCREF(Py_None); __pyx_v__ = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1777 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1777 * # PyString_AsStringAndSize(disk_kind, &temp_str, &temp_str_length) * # if not strncmp(temp_str, "directory", temp_str_length): * if (self.current_block is not None and # <<<<<<<<<<<<<< @@ -15231,48 +15346,34 @@ __pyx_t_1 = (__pyx_v_self->current_block != Py_None); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1778 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1778 * # if not strncmp(temp_str, "directory", temp_str_length): * if (self.current_block is not None and * self.current_block_pos < PyList_GET_SIZE(self.current_block_list)): # <<<<<<<<<<<<<< * current_entry = PyList_GET_ITEM(self.current_block_list, * self.current_block_pos) */ - __pyx_t_2 = __pyx_v_self->current_block_list; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = (__pyx_v_self->current_block_pos < PyList_GET_SIZE(__pyx_t_2)); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __pyx_t_3; + __pyx_t_2 = (__pyx_v_self->current_block_pos < PyList_GET_SIZE(__pyx_v_self->current_block_list)); + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_4 = __pyx_t_1; + __pyx_t_3 = __pyx_t_1; } - if (__pyx_t_4) { - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1779 - * if (self.current_block is not None and - * self.current_block_pos < PyList_GET_SIZE(self.current_block_list)): - * current_entry = PyList_GET_ITEM(self.current_block_list, # <<<<<<<<<<<<<< - * self.current_block_pos) - * # accomodate pyrex - */ - __pyx_t_2 = __pyx_v_self->current_block_list; - __Pyx_INCREF(__pyx_t_2); + if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1780 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1780 * self.current_block_pos < PyList_GET_SIZE(self.current_block_list)): * current_entry = PyList_GET_ITEM(self.current_block_list, * self.current_block_pos) # <<<<<<<<<<<<<< * # accomodate pyrex * Py_INCREF(current_entry) */ - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_v_self->current_block_pos); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = PyList_GET_ITEM(__pyx_v_self->current_block_list, __pyx_v_self->current_block_pos); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_current_entry); - __pyx_v_current_entry = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_current_entry = __pyx_t_4; + __pyx_t_4 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1782 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1782 * self.current_block_pos) * # accomodate pyrex * Py_INCREF(current_entry) # <<<<<<<<<<<<<< @@ -15284,7 +15385,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1784 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1784 * Py_INCREF(current_entry) * else: * current_entry = None # <<<<<<<<<<<<<< @@ -15297,58 +15398,44 @@ } __pyx_L3:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1785 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1785 * else: * current_entry = None * if (self.current_dir_info is not None and # <<<<<<<<<<<<<< * self.path_index < PyList_GET_SIZE(self.current_dir_list)): * current_path_info = PyList_GET_ITEM(self.current_dir_list, */ - __pyx_t_4 = (__pyx_v_self->current_dir_info != Py_None); - if (__pyx_t_4) { + __pyx_t_3 = (__pyx_v_self->current_dir_info != Py_None); + if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1786 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1786 * current_entry = None * if (self.current_dir_info is not None and * self.path_index < PyList_GET_SIZE(self.current_dir_list)): # <<<<<<<<<<<<<< * current_path_info = PyList_GET_ITEM(self.current_dir_list, * self.path_index) */ - __pyx_t_5 = __pyx_v_self->current_dir_list; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = (__pyx_v_self->path_index < PyList_GET_SIZE(__pyx_t_5)); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = __pyx_t_1; + __pyx_t_1 = (__pyx_v_self->path_index < PyList_GET_SIZE(__pyx_v_self->current_dir_list)); + __pyx_t_2 = __pyx_t_1; } else { - __pyx_t_3 = __pyx_t_4; + __pyx_t_2 = __pyx_t_3; } - if (__pyx_t_3) { - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1787 - * if (self.current_dir_info is not None and - * self.path_index < PyList_GET_SIZE(self.current_dir_list)): - * current_path_info = PyList_GET_ITEM(self.current_dir_list, # <<<<<<<<<<<<<< - * self.path_index) - * # accomodate pyrex - */ - __pyx_t_5 = __pyx_v_self->current_dir_list; - __Pyx_INCREF(__pyx_t_5); + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1788 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1788 * self.path_index < PyList_GET_SIZE(self.current_dir_list)): * current_path_info = PyList_GET_ITEM(self.current_dir_list, * self.path_index) # <<<<<<<<<<<<<< * # accomodate pyrex * Py_INCREF(current_path_info) */ - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_v_self->path_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_4 = PyList_GET_ITEM(__pyx_v_self->current_dir_list, __pyx_v_self->path_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_current_path_info); - __pyx_v_current_path_info = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_current_path_info = __pyx_t_4; + __pyx_t_4 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1790 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1790 * self.path_index) * # accomodate pyrex * Py_INCREF(current_path_info) # <<<<<<<<<<<<<< @@ -15357,20 +15444,20 @@ */ Py_INCREF(__pyx_v_current_path_info); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1791 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1791 * # accomodate pyrex * Py_INCREF(current_path_info) * disk_kind = PyTuple_GET_ITEM(current_path_info, 2) # <<<<<<<<<<<<<< * # accomodate pyrex * Py_INCREF(disk_kind) */ - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_current_path_info, 2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_current_path_info, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_disk_kind); - __pyx_v_disk_kind = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_disk_kind = __pyx_t_4; + __pyx_t_4 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1793 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1793 * disk_kind = PyTuple_GET_ITEM(current_path_info, 2) * # accomodate pyrex * Py_INCREF(disk_kind) # <<<<<<<<<<<<<< @@ -15379,31 +15466,31 @@ */ Py_INCREF(__pyx_v_disk_kind); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1794 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1794 * # accomodate pyrex * Py_INCREF(disk_kind) * if disk_kind == "directory": # <<<<<<<<<<<<<< * current_path_info = self._maybe_tree_ref(current_path_info) * else: */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_disk_kind, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { + __pyx_t_4 = PyObject_RichCompare(__pyx_v_disk_kind, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1795 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1795 * Py_INCREF(disk_kind) * if disk_kind == "directory": * current_path_info = self._maybe_tree_ref(current_path_info) # <<<<<<<<<<<<<< * else: * current_path_info = None */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_maybe_tree_ref(__pyx_v_self, __pyx_v_current_path_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_maybe_tree_ref(__pyx_v_self, __pyx_v_current_path_info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_current_path_info); - __pyx_v_current_path_info = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_current_path_info = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L5; } __pyx_L5:; @@ -15411,7 +15498,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1797 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1797 * current_path_info = self._maybe_tree_ref(current_path_info) * else: * current_path_info = None # <<<<<<<<<<<<<< @@ -15424,7 +15511,7 @@ } __pyx_L4:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1798 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1798 * else: * current_path_info = None * while (current_entry is not None or current_path_info is not None): # <<<<<<<<<<<<<< @@ -15432,16 +15519,16 @@ * advance_path = -1 */ while (1) { - __pyx_t_3 = (__pyx_v_current_entry != Py_None); - if (!__pyx_t_3) { - __pyx_t_4 = (__pyx_v_current_path_info != Py_None); - __pyx_t_1 = __pyx_t_4; - } else { + __pyx_t_2 = (__pyx_v_current_entry != Py_None); + if (!__pyx_t_2) { + __pyx_t_3 = (__pyx_v_current_path_info != Py_None); __pyx_t_1 = __pyx_t_3; + } else { + __pyx_t_1 = __pyx_t_2; } if (!__pyx_t_1) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1799 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1799 * current_path_info = None * while (current_entry is not None or current_path_info is not None): * advance_entry = -1 # <<<<<<<<<<<<<< @@ -15450,7 +15537,7 @@ */ __pyx_v_advance_entry = -1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1800 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1800 * while (current_entry is not None or current_path_info is not None): * advance_entry = -1 * advance_path = -1 # <<<<<<<<<<<<<< @@ -15459,7 +15546,7 @@ */ __pyx_v_advance_path = -1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1801 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1801 * advance_entry = -1 * advance_path = -1 * result = None # <<<<<<<<<<<<<< @@ -15470,7 +15557,7 @@ __Pyx_DECREF(__pyx_v_result); __pyx_v_result = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1802 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1802 * advance_path = -1 * result = None * changed = None # <<<<<<<<<<<<<< @@ -15481,7 +15568,7 @@ __Pyx_DECREF(__pyx_v_changed); __pyx_v_changed = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1803 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1803 * result = None * changed = None * path_handled = 0 # <<<<<<<<<<<<<< @@ -15490,7 +15577,7 @@ */ __pyx_v_path_handled = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1804 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1804 * changed = None * path_handled = 0 * if current_entry is None: # <<<<<<<<<<<<<< @@ -15502,7 +15589,7 @@ goto __pyx_L8; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1808 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1808 * # is advanced will yield this path if needed. * pass * elif current_path_info is None: # <<<<<<<<<<<<<< @@ -15512,28 +15599,28 @@ __pyx_t_1 = (__pyx_v_current_path_info == Py_None); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1811 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1811 * # no path is fine: the per entry code will handle it. * result, changed = self._process_entry(current_entry, * current_path_info) # <<<<<<<<<<<<<< * else: * minikind = _minikind_from_string( */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_process_entry(__pyx_v_self, __pyx_v_current_entry, __pyx_v_current_path_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) { - PyObject* tuple = __pyx_t_2; + __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_process_entry(__pyx_v_self, __pyx_v_current_entry, __pyx_v_current_path_info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + if (PyTuple_CheckExact(__pyx_t_4) && likely(PyTuple_GET_SIZE(__pyx_t_4) == 2)) { + PyObject* tuple = __pyx_t_4; __pyx_t_5 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1810 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1810 * elif current_path_info is None: * # no path is fine: the per entry code will handle it. * result, changed = self._process_entry(current_entry, # <<<<<<<<<<<<<< * current_path_info) * else: */ - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_result); __pyx_v_result = __pyx_t_5; __pyx_t_5 = 0; @@ -15541,9 +15628,9 @@ __pyx_v_changed = __pyx_t_6; __pyx_t_6 = 0; } else { - __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -15561,55 +15648,55 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1814 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1814 * else: * minikind = _minikind_from_string( * current_entry[1][self.target_index][0]) # <<<<<<<<<<<<<< * cmp_result = cmp(current_path_info[1], current_entry[0][1]) * if (cmp_result or minikind == c'a' or minikind == c'r'): */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_current_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_self->target_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_current_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_self->target_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_8 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_from_string(__pyx_t_2); if (unlikely(__pyx_t_8 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_from_string(__pyx_t_4); if (unlikely(__pyx_t_8 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_minikind = __pyx_t_8; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1815 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1815 * minikind = _minikind_from_string( * current_entry[1][self.target_index][0]) * cmp_result = cmp(current_path_info[1], current_entry[0][1]) # <<<<<<<<<<<<<< * if (cmp_result or minikind == c'a' or minikind == c'r'): * # The current path on disk doesn't match the dirblock */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_current_path_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_current_path_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_current_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); - __pyx_t_2 = 0; + __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_cmp, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_cmp_result = __pyx_t_9; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1816 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1816 * current_entry[1][self.target_index][0]) * cmp_result = cmp(current_path_info[1], current_entry[0][1]) * if (cmp_result or minikind == c'a' or minikind == c'r'): # <<<<<<<<<<<<<< @@ -15626,23 +15713,23 @@ __pyx_t_1 = 0; break; } - __pyx_t_3 = __pyx_t_1; + __pyx_t_2 = __pyx_t_1; } else { - __pyx_t_3 = __pyx_v_cmp_result; + __pyx_t_2 = __pyx_v_cmp_result; } - if (__pyx_t_3) { + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1825 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1825 * # Compare the basename for these files to determine * # which comes first * if cmp_result < 0: # <<<<<<<<<<<<<< * # extra file on disk: pass for now, but only * # increment the path, not the entry */ - __pyx_t_3 = (__pyx_v_cmp_result < 0); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_cmp_result < 0); + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1828 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1828 * # extra file on disk: pass for now, but only * # increment the path, not the entry * advance_entry = 0 # <<<<<<<<<<<<<< @@ -15654,7 +15741,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1833 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1833 * # advance the entry only, after processing. * result, changed = self._process_entry(current_entry, * None) # <<<<<<<<<<<<<< @@ -15666,9 +15753,9 @@ if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 2)) { PyObject* tuple = __pyx_t_5; __pyx_t_6 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_6); - __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2); + __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1832 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1832 * # entry referring to file not present on disk. * # advance the entry only, after processing. * result, changed = self._process_entry(current_entry, # <<<<<<<<<<<<<< @@ -15680,27 +15767,27 @@ __pyx_v_result = __pyx_t_6; __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_changed); - __pyx_v_changed = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_changed = __pyx_t_4; + __pyx_t_4 = 0; } else { __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); if (__Pyx_EndUnpack(__pyx_t_7, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_result); __pyx_v_result = __pyx_t_6; __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_changed); - __pyx_v_changed = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_changed = __pyx_t_4; + __pyx_t_4 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1834 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1834 * result, changed = self._process_entry(current_entry, * None) * advance_path = 0 # <<<<<<<<<<<<<< @@ -15714,7 +15801,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1839 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1839 * # absent or renamed. * result, changed = self._process_entry(current_entry, * current_path_info) # <<<<<<<<<<<<<< @@ -15725,10 +15812,10 @@ __Pyx_GOTREF(__pyx_t_5); if (PyTuple_CheckExact(__pyx_t_5) && likely(PyTuple_GET_SIZE(__pyx_t_5) == 2)) { PyObject* tuple = __pyx_t_5; - __pyx_t_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_2); + __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1838 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1838 * # paths are the same,and the dirstate entry is not * # absent or renamed. * result, changed = self._process_entry(current_entry, # <<<<<<<<<<<<<< @@ -15737,8 +15824,8 @@ */ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_changed); __pyx_v_changed = __pyx_t_6; __pyx_t_6 = 0; @@ -15746,31 +15833,31 @@ __pyx_t_7 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_7, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_7, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); if (__Pyx_EndUnpack(__pyx_t_7, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_changed); __pyx_v_changed = __pyx_t_6; __pyx_t_6 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1840 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1840 * result, changed = self._process_entry(current_entry, * current_path_info) * if changed is not None: # <<<<<<<<<<<<<< * path_handled = -1 * if not changed and not self.include_unchanged: */ - __pyx_t_3 = (__pyx_v_changed != Py_None); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_changed != Py_None); + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1841 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1841 * current_path_info) * if changed is not None: * path_handled = -1 # <<<<<<<<<<<<<< @@ -15779,24 +15866,24 @@ */ __pyx_v_path_handled = -1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1842 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1842 * if changed is not None: * path_handled = -1 * if not changed and not self.include_unchanged: # <<<<<<<<<<<<<< * changed = None * # >- loop control starts here: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = (!__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (!__pyx_t_2); if (__pyx_t_1) { - __pyx_t_3 = (!__pyx_v_self->include_unchanged); - __pyx_t_4 = __pyx_t_3; + __pyx_t_2 = (!__pyx_v_self->include_unchanged); + __pyx_t_3 = __pyx_t_2; } else { - __pyx_t_4 = __pyx_t_1; + __pyx_t_3 = __pyx_t_1; } - if (__pyx_t_4) { + if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1843 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1843 * path_handled = -1 * if not changed and not self.include_unchanged: * changed = None # <<<<<<<<<<<<<< @@ -15817,7 +15904,7 @@ } __pyx_L8:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1846 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1846 * # >- loop control starts here: * # >- entry * if advance_entry and current_entry is not None: # <<<<<<<<<<<<<< @@ -15825,14 +15912,14 @@ * if self.current_block_pos < PyList_GET_SIZE(self.current_block_list): */ if (__pyx_v_advance_entry) { - __pyx_t_4 = (__pyx_v_current_entry != Py_None); - __pyx_t_1 = __pyx_t_4; + __pyx_t_3 = (__pyx_v_current_entry != Py_None); + __pyx_t_1 = __pyx_t_3; } else { __pyx_t_1 = __pyx_v_advance_entry; } if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1847 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1847 * # >- entry * if advance_entry and current_entry is not None: * self.current_block_pos = self.current_block_pos + 1 # <<<<<<<<<<<<<< @@ -15841,20 +15928,17 @@ */ __pyx_v_self->current_block_pos = (__pyx_v_self->current_block_pos + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1848 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1848 * if advance_entry and current_entry is not None: * self.current_block_pos = self.current_block_pos + 1 * if self.current_block_pos < PyList_GET_SIZE(self.current_block_list): # <<<<<<<<<<<<<< * current_entry = self.current_block_list[self.current_block_pos] * else: */ - __pyx_t_5 = __pyx_v_self->current_block_list; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_1 = (__pyx_v_self->current_block_pos < PyList_GET_SIZE(__pyx_t_5)); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_1 = (__pyx_v_self->current_block_pos < PyList_GET_SIZE(__pyx_v_self->current_block_list)); if (__pyx_t_1) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1849 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1849 * self.current_block_pos = self.current_block_pos + 1 * if self.current_block_pos < PyList_GET_SIZE(self.current_block_list): * current_entry = self.current_block_list[self.current_block_pos] # <<<<<<<<<<<<<< @@ -15870,7 +15954,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1851 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1851 * current_entry = self.current_block_list[self.current_block_pos] * else: * current_entry = None # <<<<<<<<<<<<<< @@ -15886,7 +15970,7 @@ } __pyx_L13:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1853 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1853 * current_entry = None * # >- path * if advance_path and current_path_info is not None: # <<<<<<<<<<<<<< @@ -15895,23 +15979,23 @@ */ if (__pyx_v_advance_path) { __pyx_t_1 = (__pyx_v_current_path_info != Py_None); - __pyx_t_4 = __pyx_t_1; + __pyx_t_3 = __pyx_t_1; } else { - __pyx_t_4 = __pyx_v_advance_path; + __pyx_t_3 = __pyx_v_advance_path; } - if (__pyx_t_4) { + if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1854 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1854 * # >- path * if advance_path and current_path_info is not None: * if not path_handled: # <<<<<<<<<<<<<< * # unversioned in all regards * if self.want_unversioned: */ - __pyx_t_4 = (!__pyx_v_path_handled); - if (__pyx_t_4) { + __pyx_t_3 = (!__pyx_v_path_handled); + if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1856 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1856 * if not path_handled: * # unversioned in all regards * if self.want_unversioned: # <<<<<<<<<<<<<< @@ -15920,7 +16004,7 @@ */ if (__pyx_v_self->want_unversioned) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1858 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1858 * if self.want_unversioned: * new_executable = bool( * stat.S_ISREG(current_path_info[3].st_mode) # <<<<<<<<<<<<<< @@ -15934,56 +16018,56 @@ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_current_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_4) { + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1859 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1859 * new_executable = bool( * stat.S_ISREG(current_path_info[3].st_mode) * and stat.S_IEXEC & current_path_info[3].st_mode) # <<<<<<<<<<<<<< * try: * relpath_unicode = self.utf8_decode(current_path_info[0])[0] */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__S_IEXEC); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__S_IEXEC); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_current_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_current_path_info, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_And(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_And(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __pyx_t_1; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __pyx_t_1; } else { - __pyx_t_3 = __pyx_t_4; + __pyx_t_2 = __pyx_t_3; } - __pyx_t_2 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_new_executable); - __pyx_v_new_executable = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_new_executable = __pyx_t_4; + __pyx_t_4 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1860 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1860 * stat.S_ISREG(current_path_info[3].st_mode) * and stat.S_IEXEC & current_path_info[3].st_mode) * try: # <<<<<<<<<<<<<< @@ -15998,26 +16082,26 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1861 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1861 * and stat.S_IEXEC & current_path_info[3].st_mode) * try: * relpath_unicode = self.utf8_decode(current_path_info[0])[0] # <<<<<<<<<<<<<< * except UnicodeDecodeError, _: * raise errors.BadFilenameEncoding( */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_current_path_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L18_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_current_path_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L18_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L18_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L18_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L18_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_relpath_unicode); __pyx_v_relpath_unicode = __pyx_t_6; __pyx_t_6 = 0; @@ -16029,10 +16113,10 @@ __pyx_L18_error:; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1862 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1862 * try: * relpath_unicode = self.utf8_decode(current_path_info[0])[0] * except UnicodeDecodeError, _: # <<<<<<<<<<<<<< @@ -16042,15 +16126,15 @@ __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError); if (__pyx_t_9) { __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._loop_one_block"); - if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_4); __Pyx_DECREF(__pyx_v__); - __pyx_v__ = __pyx_t_2; + __pyx_v__ = __pyx_t_4; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1863 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1863 * relpath_unicode = self.utf8_decode(current_path_info[0])[0] * except UnicodeDecodeError, _: * raise errors.BadFilenameEncoding( # <<<<<<<<<<<<<< @@ -16063,7 +16147,7 @@ __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1864 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1864 * except UnicodeDecodeError, _: * raise errors.BadFilenameEncoding( * current_path_info[0], osutils._fs_enc) # <<<<<<<<<<<<<< @@ -16078,22 +16162,22 @@ __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); + __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_7 = 0; __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} + __pyx_t_12 = PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_Raise(__pyx_t_12, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L19_exception_handled; } @@ -16111,33 +16195,33 @@ __pyx_L25_try_end:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1865 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1865 * raise errors.BadFilenameEncoding( * current_path_info[0], osutils._fs_enc) * if changed is not None: # <<<<<<<<<<<<<< * raise AssertionError( * "result is not None: %r" % result) */ - __pyx_t_3 = (__pyx_v_changed != Py_None); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_changed != Py_None); + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1867 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1867 * if changed is not None: * raise AssertionError( * "result is not None: %r" % result) # <<<<<<<<<<<<<< * result = (None, * (None, relpath_unicode), */ - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_60), __pyx_v_result); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_44), __pyx_v_result); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_5)); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5)); __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_5, 0, 0); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1866; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -16145,7 +16229,7 @@ } __pyx_L28:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1869 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1869 * "result is not None: %r" % result) * result = (None, * (None, relpath_unicode), # <<<<<<<<<<<<<< @@ -16153,7 +16237,7 @@ * (False, False), */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_5, 0, Py_None); __Pyx_GIVEREF(Py_None); @@ -16161,17 +16245,17 @@ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_relpath_unicode); __Pyx_GIVEREF(__pyx_v_relpath_unicode); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1870 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1870 * result = (None, * (None, relpath_unicode), * True, # <<<<<<<<<<<<<< * (False, False), * (None, None), */ - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1871 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1871 * (None, relpath_unicode), * True, * (False, False), # <<<<<<<<<<<<<< @@ -16183,7 +16267,7 @@ __pyx_t_12 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); + __Pyx_GOTREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12); @@ -16191,128 +16275,144 @@ __pyx_t_6 = 0; __pyx_t_12 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1873 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1872 + * True, * (False, False), - * (None, None), - * (None, self.utf8_decode(current_path_info[1])[0]), # <<<<<<<<<<<<<< + * (None, None), # <<<<<<<<<<<<<< + * (None, self.utf8_decode(current_path_info[1])[0]), * (None, current_path_info[2]), - * (None, new_executable)) */ - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_current_path_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12); - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = PyObject_Call(__pyx_v_self->utf8_decode, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_12)); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_12, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_6); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_12, 1, Py_None); + __Pyx_GIVEREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1873 + * (False, False), + * (None, None), + * (None, self.utf8_decode(current_path_info[1])[0]), # <<<<<<<<<<<<<< + * (None, current_path_info[2]), + * (None, new_executable)) + */ + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_current_path_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyObject_Call(__pyx_v_self->utf8_decode, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 0, Py_None); + __Pyx_GIVEREF(Py_None); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1874 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1874 * (None, None), * (None, self.utf8_decode(current_path_info[1])[0]), * (None, current_path_info[2]), # <<<<<<<<<<<<<< * (None, new_executable)) * changed = True */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_10, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_7, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __pyx_t_6 = 0; + PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1875 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1875 * (None, self.utf8_decode(current_path_info[1])[0]), * (None, current_path_info[2]), * (None, new_executable)) # <<<<<<<<<<<<<< * changed = True * # dont descend into this unversioned path if it is */ - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_6, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_10, 0, Py_None); __Pyx_GIVEREF(Py_None); __Pyx_INCREF(__pyx_v_new_executable); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_new_executable); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_new_executable); __Pyx_GIVEREF(__pyx_v_new_executable); - __pyx_t_7 = PyTuple_New(8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); + __pyx_t_13 = PyTuple_New(8); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_7, 0, Py_None); + PyTuple_SET_ITEM(__pyx_t_13, 0, Py_None); __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_t_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_11)); - __Pyx_INCREF(((PyObject *)__pyx_k_tuple_61)); - PyTuple_SET_ITEM(__pyx_t_7, 4, ((PyObject *)__pyx_k_tuple_61)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61)); - PyTuple_SET_ITEM(__pyx_t_7, 5, ((PyObject *)__pyx_t_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_12)); - PyTuple_SET_ITEM(__pyx_t_7, 6, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); - PyTuple_SET_ITEM(__pyx_t_7, 7, ((PyObject *)__pyx_t_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); + PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_t_11); + __Pyx_GIVEREF(__pyx_t_11); + PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_6); + __Pyx_GIVEREF(__pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_13, 6, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_13, 7, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __pyx_t_5 = 0; - __pyx_t_2 = 0; + __pyx_t_4 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; - __pyx_t_10 = 0; __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = ((PyObject *)__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_v_result); + __pyx_v_result = __pyx_t_13; + __pyx_t_13 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1876 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1876 * (None, current_path_info[2]), * (None, new_executable)) * changed = True # <<<<<<<<<<<<<< * # dont descend into this unversioned path if it is * # a dir */ - __pyx_t_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_v_changed); - __pyx_v_changed = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_changed = __pyx_t_13; + __pyx_t_13 = 0; goto __pyx_L17; } __pyx_L17:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1879 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1879 * # dont descend into this unversioned path if it is * # a dir * if current_path_info[2] in ('directory'): # <<<<<<<<<<<<<< * del self.current_dir_list[self.path_index] * self.path_index = self.path_index - 1 */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = ((PySequence_Contains(((PyObject *)__pyx_n_s__directory), __pyx_t_7))); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_3) { + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_2 = ((PySequence_Contains(((PyObject *)__pyx_n_s__directory), __pyx_t_13))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1880 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1880 * # a dir * if current_path_info[2] in ('directory'): * del self.current_dir_list[self.path_index] # <<<<<<<<<<<<<< @@ -16321,7 +16421,7 @@ */ if (__Pyx_DelItemInt(__pyx_v_self->current_dir_list, __pyx_v_self->path_index, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":1881 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1881 * if current_path_info[2] in ('directory'): * del self.current_dir_list[self.path_index] * self.path_index = self.path_index - 1 # <<<<<<<<<<<<<< @@ -16336,23 +16436,23 @@ } __pyx_L16:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1884 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1884 * # dont descend the disk iterator into any tree * # paths. * if current_path_info[2] == 'tree-reference': # <<<<<<<<<<<<<< * del self.current_dir_list[self.path_index] * self.path_index = self.path_index - 1 */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, ((PyObject *)__pyx_kp_s_37), Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_3) { + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = PyObject_RichCompare(__pyx_t_13, ((PyObject *)__pyx_kp_s_33), Py_EQ); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1885 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1885 * # paths. * if current_path_info[2] == 'tree-reference': * del self.current_dir_list[self.path_index] # <<<<<<<<<<<<<< @@ -16361,7 +16461,7 @@ */ if (__Pyx_DelItemInt(__pyx_v_self->current_dir_list, __pyx_v_self->path_index, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1885; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":1886 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1886 * if current_path_info[2] == 'tree-reference': * del self.current_dir_list[self.path_index] * self.path_index = self.path_index - 1 # <<<<<<<<<<<<<< @@ -16373,7 +16473,7 @@ } __pyx_L30:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1887 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1887 * del self.current_dir_list[self.path_index] * self.path_index = self.path_index - 1 * self.path_index = self.path_index + 1 # <<<<<<<<<<<<<< @@ -16382,61 +16482,58 @@ */ __pyx_v_self->path_index = (__pyx_v_self->path_index + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1888 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1888 * self.path_index = self.path_index - 1 * self.path_index = self.path_index + 1 * if self.path_index < len(self.current_dir_list): # <<<<<<<<<<<<<< * current_path_info = self.current_dir_list[self.path_index] * if current_path_info[2] == 'directory': */ - __pyx_t_6 = __pyx_v_self->current_dir_list; - __Pyx_INCREF(__pyx_t_6); - __pyx_t_13 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = (__pyx_v_self->path_index < __pyx_t_13); - if (__pyx_t_3) { + __pyx_t_14 = PyObject_Length(__pyx_v_self->current_dir_list); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_v_self->path_index < __pyx_t_14); + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1889 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1889 * self.path_index = self.path_index + 1 * if self.path_index < len(self.current_dir_list): * current_path_info = self.current_dir_list[self.path_index] # <<<<<<<<<<<<<< * if current_path_info[2] == 'directory': * current_path_info = self._maybe_tree_ref( */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_self->current_dir_list, __pyx_v_self->path_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_self->current_dir_list, __pyx_v_self->path_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_v_current_path_info); - __pyx_v_current_path_info = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_current_path_info = __pyx_t_10; + __pyx_t_10 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1890 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1890 * if self.path_index < len(self.current_dir_list): * current_path_info = self.current_dir_list[self.path_index] * if current_path_info[2] == 'directory': # <<<<<<<<<<<<<< * current_path_info = self._maybe_tree_ref( * current_path_info) */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_3) { - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1892 - * if current_path_info[2] == 'directory': - * current_path_info = self._maybe_tree_ref( - * current_path_info) # <<<<<<<<<<<<<< + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_current_path_info, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_13 = PyObject_RichCompare(__pyx_t_10, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1892 + * if current_path_info[2] == 'directory': + * current_path_info = self._maybe_tree_ref( + * current_path_info) # <<<<<<<<<<<<<< * else: * current_path_info = None */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_maybe_tree_ref(__pyx_v_self, __pyx_v_current_path_info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_13 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_maybe_tree_ref(__pyx_v_self, __pyx_v_current_path_info); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_v_current_path_info); - __pyx_v_current_path_info = __pyx_t_7; - __pyx_t_7 = 0; + __pyx_v_current_path_info = __pyx_t_13; + __pyx_t_13 = 0; goto __pyx_L32; } __pyx_L32:; @@ -16444,7 +16541,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1894 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1894 * current_path_info) * else: * current_path_info = None # <<<<<<<<<<<<<< @@ -16460,27 +16557,27 @@ } __pyx_L15:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1895 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1895 * else: * current_path_info = None * if changed is not None: # <<<<<<<<<<<<<< * # Found a result on this pass, yield it * if changed: */ - __pyx_t_3 = (__pyx_v_changed != Py_None); - if (__pyx_t_3) { + __pyx_t_2 = (__pyx_v_changed != Py_None); + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1897 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1897 * if changed is not None: * # Found a result on this pass, yield it * if changed: # <<<<<<<<<<<<<< * self._gather_result_for_consistency(result) * if changed or self.include_unchanged: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_3) { + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1898 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1898 * # Found a result on this pass, yield it * if changed: * self._gather_result_for_consistency(result) # <<<<<<<<<<<<<< @@ -16492,22 +16589,22 @@ } __pyx_L34:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1899 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1899 * if changed: * self._gather_result_for_consistency(result) * if changed or self.include_unchanged: # <<<<<<<<<<<<<< * return result * if self.current_block is not None: */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!__pyx_t_3) { - __pyx_t_4 = __pyx_v_self->include_unchanged; + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__pyx_t_2) { + __pyx_t_3 = __pyx_v_self->include_unchanged; } else { - __pyx_t_4 = __pyx_t_3; + __pyx_t_3 = __pyx_t_2; } - if (__pyx_t_4) { + if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1900 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1900 * self._gather_result_for_consistency(result) * if changed or self.include_unchanged: * return result # <<<<<<<<<<<<<< @@ -16526,17 +16623,17 @@ __pyx_L33:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1901 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1901 * if changed or self.include_unchanged: * return result * if self.current_block is not None: # <<<<<<<<<<<<<< * self.block_index = self.block_index + 1 * self._update_current_block() */ - __pyx_t_4 = (__pyx_v_self->current_block != Py_None); - if (__pyx_t_4) { + __pyx_t_3 = (__pyx_v_self->current_block != Py_None); + if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1902 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1902 * return result * if self.current_block is not None: * self.block_index = self.block_index + 1 # <<<<<<<<<<<<<< @@ -16545,7 +16642,7 @@ */ __pyx_v_self->block_index = (__pyx_v_self->block_index + 1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1903 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1903 * if self.current_block is not None: * self.block_index = self.block_index + 1 * self._update_current_block() # <<<<<<<<<<<<<< @@ -16557,17 +16654,17 @@ } __pyx_L36:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1904 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1904 * self.block_index = self.block_index + 1 * self._update_current_block() * if self.current_dir_info is not None: # <<<<<<<<<<<<<< * self.path_index = 0 * self.current_dir_list = None */ - __pyx_t_4 = (__pyx_v_self->current_dir_info != Py_None); - if (__pyx_t_4) { + __pyx_t_3 = (__pyx_v_self->current_dir_info != Py_None); + if (__pyx_t_3) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1905 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1905 * self._update_current_block() * if self.current_dir_info is not None: * self.path_index = 0 # <<<<<<<<<<<<<< @@ -16576,7 +16673,7 @@ */ __pyx_v_self->path_index = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1906 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1906 * if self.current_dir_info is not None: * self.path_index = 0 * self.current_dir_list = None # <<<<<<<<<<<<<< @@ -16589,7 +16686,7 @@ __Pyx_DECREF(__pyx_v_self->current_dir_list); __pyx_v_self->current_dir_list = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1907 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1907 * self.path_index = 0 * self.current_dir_list = None * try: # <<<<<<<<<<<<<< @@ -16604,38 +16701,38 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1908 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1908 * self.current_dir_list = None * try: * self.current_dir_info = self.dir_iterator.next() # <<<<<<<<<<<<<< * self.current_dir_list = self.current_dir_info[1] * except StopIteration, _: */ - __pyx_t_7 = PyObject_GetAttr(__pyx_v_self->dir_iterator, __pyx_n_s__next); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L38_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L38_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_13 = PyObject_GetAttr(__pyx_v_self->dir_iterator, __pyx_n_s__next); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L38_error;} + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_10 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L38_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->current_dir_info); __Pyx_DECREF(__pyx_v_self->current_dir_info); - __pyx_v_self->current_dir_info = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_self->current_dir_info = __pyx_t_10; + __pyx_t_10 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1909 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1909 * try: * self.current_dir_info = self.dir_iterator.next() * self.current_dir_list = self.current_dir_info[1] # <<<<<<<<<<<<<< * except StopIteration, _: * self.current_dir_info = None */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L38_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_self->current_dir_info, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1909; __pyx_clineno = __LINE__; goto __pyx_L38_error;} + __Pyx_GOTREF(__pyx_t_10); + __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->current_dir_list); __Pyx_DECREF(__pyx_v_self->current_dir_list); - __pyx_v_self->current_dir_list = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_v_self->current_dir_list = __pyx_t_10; + __pyx_t_10 = 0; } __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; @@ -16643,14 +16740,15 @@ goto __pyx_L45_try_end; __pyx_L38_error:; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1910 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1910 * self.current_dir_info = self.dir_iterator.next() * self.current_dir_list = self.current_dir_info[1] * except StopIteration, _: # <<<<<<<<<<<<<< @@ -16660,15 +16758,15 @@ __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_9) { __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._loop_one_block"); - if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L40_except_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_13, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L40_except_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_INCREF(__pyx_t_7); + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GOTREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_13); __Pyx_DECREF(__pyx_v__); - __pyx_v__ = __pyx_t_7; + __pyx_v__ = __pyx_t_13; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1911 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1911 * self.current_dir_list = self.current_dir_info[1] * except StopIteration, _: * self.current_dir_info = None # <<<<<<<<<<<<<< @@ -16680,9 +16778,9 @@ __Pyx_GOTREF(__pyx_v_self->current_dir_info); __Pyx_DECREF(__pyx_v_self->current_dir_info); __pyx_v_self->current_dir_info = Py_None; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L39_exception_handled; } __pyx_L40_except_error:; @@ -16705,13 +16803,14 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); + __Pyx_XDECREF(__pyx_t_13); __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._loop_one_block"); __pyx_r = 0; __pyx_L0:; @@ -16728,7 +16827,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":1913 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1913 * self.current_dir_info = None * * cdef object _next_consistent_entries(self): # <<<<<<<<<<<<<< @@ -16765,22 +16864,22 @@ PyObject *__pyx_t_10 = NULL; Py_ssize_t __pyx_t_11; __Pyx_RefNannySetupContext("_next_consistent_entries"); - __pyx_v_results = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_results = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_path_utf8 = Py_None; __Pyx_INCREF(Py_None); __pyx_v_path_entries = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_selected_entries = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_selected_entries = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_candidate_entry = Py_None; __Pyx_INCREF(Py_None); __pyx_v_path_info = Py_None; __Pyx_INCREF(Py_None); __pyx_v_entry = Py_None; __Pyx_INCREF(Py_None); __pyx_v_result = Py_None; __Pyx_INCREF(Py_None); __pyx_v_changed = Py_None; __Pyx_INCREF(Py_None); __pyx_v_entry_path_utf8 = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_initial_key = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_initial_key = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_block_index = Py_None; __Pyx_INCREF(Py_None); __pyx_v__ = Py_None; __Pyx_INCREF(Py_None); __pyx_v_current_block = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1918 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1918 * :return: A list of the results, each of which is as for _process_entry. * """ * results = [] # <<<<<<<<<<<<<< @@ -16793,7 +16892,7 @@ __pyx_v_results = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1919 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1919 * """ * results = [] * while self.search_specific_file_parents: # <<<<<<<<<<<<<< @@ -16804,7 +16903,7 @@ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->search_specific_file_parents); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1919; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) break; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1923 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1923 * # Even in extremely large trees this should be modest, so currently * # no attempt is made to optimise. * path_utf8 = self.search_specific_file_parents.pop() # <<<<<<<<<<<<<< @@ -16817,7 +16916,7 @@ __pyx_v_path_utf8 = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1924 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1924 * # no attempt is made to optimise. * path_utf8 = self.search_specific_file_parents.pop() * if path_utf8 in self.searched_exact_paths: # <<<<<<<<<<<<<< @@ -16827,7 +16926,7 @@ __pyx_t_2 = ((PySequence_Contains(__pyx_v_self->searched_exact_paths, __pyx_v_path_utf8))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1924; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1926 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1926 * if path_utf8 in self.searched_exact_paths: * # We've examined this path. * continue # <<<<<<<<<<<<<< @@ -16839,7 +16938,7 @@ } __pyx_L5:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1927 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1927 * # We've examined this path. * continue * if osutils.is_inside_any(self.searched_specific_files, path_utf8): # <<<<<<<<<<<<<< @@ -16852,22 +16951,22 @@ __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->searched_specific_files); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->searched_specific_files); __Pyx_GIVEREF(__pyx_v_self->searched_specific_files); __Pyx_INCREF(__pyx_v_path_utf8); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_path_utf8); __Pyx_GIVEREF(__pyx_v_path_utf8); - __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1929 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1929 * if osutils.is_inside_any(self.searched_specific_files, path_utf8): * # We've examined this path. * continue # <<<<<<<<<<<<<< @@ -16879,7 +16978,7 @@ } __pyx_L6:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1930 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1930 * # We've examined this path. * continue * path_entries = self.state._entries_for_path(path_utf8) # <<<<<<<<<<<<<< @@ -16889,19 +16988,19 @@ __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___entries_for_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_path_utf8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path_utf8); __Pyx_GIVEREF(__pyx_v_path_utf8); - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_path_entries); __pyx_v_path_entries = __pyx_t_3; __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1935 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1935 * # 'ar') then we need to also look for the entry for this path in * # self.source_index, to output the appropriate delete-or-rename. * selected_entries = [] # <<<<<<<<<<<<<< @@ -16914,7 +17013,7 @@ __pyx_v_selected_entries = __pyx_t_3; __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1936 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1936 * # self.source_index, to output the appropriate delete-or-rename. * selected_entries = [] * found_item = False # <<<<<<<<<<<<<< @@ -16923,7 +17022,7 @@ */ __pyx_v_found_item = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1937 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1937 * selected_entries = [] * found_item = False * for candidate_entry in path_entries: # <<<<<<<<<<<<<< @@ -16955,7 +17054,7 @@ __pyx_v_candidate_entry = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1939 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1939 * for candidate_entry in path_entries: * # Find entries present in target at this path: * if candidate_entry[1][self.target_index][0] not in 'ar': # <<<<<<<<<<<<<< @@ -16974,7 +17073,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1940 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1940 * # Find entries present in target at this path: * if candidate_entry[1][self.target_index][0] not in 'ar': * found_item = True # <<<<<<<<<<<<<< @@ -16983,7 +17082,7 @@ */ __pyx_v_found_item = 1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1941 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1941 * if candidate_entry[1][self.target_index][0] not in 'ar': * found_item = True * selected_entries.append(candidate_entry) # <<<<<<<<<<<<<< @@ -16993,11 +17092,11 @@ if (unlikely(__pyx_v_selected_entries == Py_None)) { PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_6 = PyList_Append(__pyx_v_selected_entries, __pyx_v_candidate_entry); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_selected_entries), __pyx_v_candidate_entry); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1941; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L9; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1943 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1943 * selected_entries.append(candidate_entry) * # Find entries present in source at this path: * elif (self.source_index is not None and # <<<<<<<<<<<<<< @@ -17010,7 +17109,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1944 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1944 * # Find entries present in source at this path: * elif (self.source_index is not None and * candidate_entry[1][self.source_index][0] not in 'ar'): # <<<<<<<<<<<<<< @@ -17033,7 +17132,7 @@ } if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1945 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1945 * elif (self.source_index is not None and * candidate_entry[1][self.source_index][0] not in 'ar'): * found_item = True # <<<<<<<<<<<<<< @@ -17042,7 +17141,7 @@ */ __pyx_v_found_item = 1; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1946 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1946 * candidate_entry[1][self.source_index][0] not in 'ar'): * found_item = True * if candidate_entry[1][self.target_index][0] == 'a': # <<<<<<<<<<<<<< @@ -17064,7 +17163,7 @@ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1948 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1948 * if candidate_entry[1][self.target_index][0] == 'a': * # Deleted, emit it here. * selected_entries.append(candidate_entry) # <<<<<<<<<<<<<< @@ -17074,12 +17173,12 @@ if (unlikely(__pyx_v_selected_entries == Py_None)) { PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_6 = PyList_Append(__pyx_v_selected_entries, __pyx_v_candidate_entry); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_selected_entries), __pyx_v_candidate_entry); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L10; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1952 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1952 * # renamed, emit it when we process the directory it * # ended up at. * self.search_specific_file_parents.add( # <<<<<<<<<<<<<< @@ -17089,7 +17188,7 @@ __pyx_t_4 = PyObject_GetAttr(__pyx_v_self->search_specific_file_parents, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1953 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1953 * # ended up at. * self.search_specific_file_parents.add( * candidate_entry[1][self.target_index][1]) # <<<<<<<<<<<<<< @@ -17105,14 +17204,14 @@ __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_GOTREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L10:; @@ -17122,7 +17221,7 @@ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1954 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1954 * self.search_specific_file_parents.add( * candidate_entry[1][self.target_index][1]) * if not found_item: # <<<<<<<<<<<<<< @@ -17132,7 +17231,7 @@ __pyx_t_8 = (!__pyx_v_found_item); if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1957 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1957 * raise AssertionError( * "Missing entry for specific path parent %r, %r" % ( * path_utf8, path_entries)) # <<<<<<<<<<<<<< @@ -17140,24 +17239,24 @@ * for entry in selected_entries: */ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_path_utf8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_path_utf8); __Pyx_GIVEREF(__pyx_v_path_utf8); __Pyx_INCREF(__pyx_v_path_entries); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_path_entries); __Pyx_GIVEREF(__pyx_v_path_entries); - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_45), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -17165,7 +17264,7 @@ } __pyx_L11:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1958 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1958 * "Missing entry for specific path parent %r, %r" % ( * path_utf8, path_entries)) * path_info = self._path_info(path_utf8, path_utf8.decode('utf8')) # <<<<<<<<<<<<<< @@ -17174,51 +17273,58 @@ */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_path_utf8, __pyx_n_s__decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_63), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_n_s__utf8)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__utf8)); + __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8)); + __pyx_t_9 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path_utf8, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_path_info(__pyx_v_self, __pyx_v_path_utf8, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_path_info); - __pyx_v_path_info = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_path_info = __pyx_t_3; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1959 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1959 * path_utf8, path_entries)) * path_info = self._path_info(path_utf8, path_utf8.decode('utf8')) * for entry in selected_entries: # <<<<<<<<<<<<<< * if entry[0][2] in self.seen_ids: * continue */ - if (unlikely(__pyx_v_selected_entries == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (likely(((PyObject *)__pyx_v_selected_entries) != Py_None)) { + __pyx_t_5 = 0; __pyx_t_3 = ((PyObject *)__pyx_v_selected_entries); __Pyx_INCREF(__pyx_t_3); + } else { + PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_5 = 0; __pyx_t_1 = ((PyObject *)__pyx_v_selected_entries); __Pyx_INCREF(__pyx_t_1); for (;;) { - if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; + if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; __Pyx_DECREF(__pyx_v_entry); - __pyx_v_entry = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_entry = __pyx_t_9; + __pyx_t_9 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1960 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1960 * path_info = self._path_info(path_utf8, path_utf8.decode('utf8')) * for entry in selected_entries: * if entry[0][2] in self.seen_ids: # <<<<<<<<<<<<<< * continue * result, changed = self._process_entry(entry, path_info) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_8 = ((PySequence_Contains(__pyx_v_self->seen_ids, __pyx_t_9))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = ((PySequence_Contains(__pyx_v_self->seen_ids, __pyx_t_1))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1961 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1961 * for entry in selected_entries: * if entry[0][2] in self.seen_ids: * continue # <<<<<<<<<<<<<< @@ -17230,45 +17336,45 @@ } __pyx_L14:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1962 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1962 * if entry[0][2] in self.seen_ids: * continue * result, changed = self._process_entry(entry, path_info) # <<<<<<<<<<<<<< * if changed is None: * raise AssertionError( */ - __pyx_t_9 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_process_entry(__pyx_v_self, __pyx_v_entry, __pyx_v_path_info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - if (PyTuple_CheckExact(__pyx_t_9) && likely(PyTuple_GET_SIZE(__pyx_t_9) == 2)) { - PyObject* tuple = __pyx_t_9; - __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_process_entry(__pyx_v_self, __pyx_v_entry, __pyx_v_path_info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) { + PyObject* tuple = __pyx_t_1; + __pyx_t_9 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_9); __pyx_t_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_9; + __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_changed); __pyx_v_changed = __pyx_t_4; __pyx_t_4 = 0; } else { - __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_10, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_10, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_10, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (__Pyx_EndUnpack(__pyx_t_10, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_result = __pyx_t_9; + __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_changed); __pyx_v_changed = __pyx_t_4; __pyx_t_4 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1963 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1963 * continue * result, changed = self._process_entry(entry, path_info) * if changed is None: # <<<<<<<<<<<<<< @@ -17278,35 +17384,35 @@ __pyx_t_8 = (__pyx_v_changed == Py_None); if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1967 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1967 * "Got entry<->path mismatch for specific path " * "%r entry %r path_info %r " % ( * path_utf8, entry, path_info)) # <<<<<<<<<<<<<< * # Only include changes - we're outside the users requested * # expansion. */ - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_path_utf8); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_path_utf8); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_path_utf8); __Pyx_GIVEREF(__pyx_v_path_utf8); __Pyx_INCREF(__pyx_v_entry); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_entry); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_entry); __Pyx_GIVEREF(__pyx_v_entry); __Pyx_INCREF(__pyx_v_path_info); - PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_path_info); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_path_info); __Pyx_GIVEREF(__pyx_v_path_info); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_64), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_46), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_4)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4)); __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_4, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -17314,7 +17420,7 @@ } __pyx_L15:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1970 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1970 * # Only include changes - we're outside the users requested * # expansion. * if changed: # <<<<<<<<<<<<<< @@ -17324,7 +17430,7 @@ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1971 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1971 * # expansion. * if changed: * self._gather_result_for_consistency(result) # <<<<<<<<<<<<<< @@ -17333,7 +17439,7 @@ */ __pyx_t_6 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_gather_result_for_consistency(__pyx_v_self, __pyx_v_result); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":1972 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1972 * if changed: * self._gather_result_for_consistency(result) * if (result[6][0] == 'directory' and # <<<<<<<<<<<<<< @@ -17342,17 +17448,17 @@ */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_result, 6, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1973 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1973 * self._gather_result_for_consistency(result) * if (result[6][0] == 'directory' and * result[6][1] != 'directory'): # <<<<<<<<<<<<<< @@ -17361,12 +17467,12 @@ */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_result, 6, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, ((PyObject *)__pyx_n_s__directory), Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__directory), Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_7 = __pyx_t_2; @@ -17375,7 +17481,7 @@ } if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1976 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1976 * # This stopped being a directory, the old children have * # to be included. * if entry[1][self.source_index][0] == 'r': # <<<<<<<<<<<<<< @@ -17384,42 +17490,42 @@ */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_self->source_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, __pyx_v_self->source_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_n_s__r), Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, ((PyObject *)__pyx_n_s__r), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1978 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1978 * if entry[1][self.source_index][0] == 'r': * # renamed, take the source path * entry_path_utf8 = entry[1][self.source_index][1] # <<<<<<<<<<<<<< * else: * entry_path_utf8 = path_utf8 */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_9, __pyx_v_self->source_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->source_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_entry_path_utf8); - __pyx_v_entry_path_utf8 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_entry_path_utf8 = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L18; } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1980 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1980 * entry_path_utf8 = entry[1][self.source_index][1] * else: * entry_path_utf8 = path_utf8 # <<<<<<<<<<<<<< @@ -17432,39 +17538,40 @@ } __pyx_L18:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1981 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1981 * else: * entry_path_utf8 = path_utf8 * initial_key = (entry_path_utf8, '', '') # <<<<<<<<<<<<<< * block_index, _ = self.state._find_block_index_from_key( * initial_key) */ - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_entry_path_utf8); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_entry_path_utf8); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_entry_path_utf8); __Pyx_GIVEREF(__pyx_v_entry_path_utf8); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_kp_s_5)); + PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_t_9, 2, ((PyObject *)__pyx_kp_s_5)); + PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); + if (!(likely(PyTuple_CheckExact(__pyx_t_1))||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_initial_key)); - __pyx_v_initial_key = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v_initial_key = ((PyObject *)__pyx_t_1); + __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1982 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1982 * entry_path_utf8 = path_utf8 * initial_key = (entry_path_utf8, '', '') * block_index, _ = self.state._find_block_index_from_key( # <<<<<<<<<<<<<< * initial_key) * if block_index == 0: */ - __pyx_t_9 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s_54); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s_41); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1983 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1983 * initial_key = (entry_path_utf8, '', '') * block_index, _ = self.state._find_block_index_from_key( * initial_key) # <<<<<<<<<<<<<< @@ -17472,81 +17579,81 @@ * # The children of the root are in block index 1. */ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(((PyObject *)__pyx_v_initial_key)); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_initial_key)); __Pyx_GIVEREF(((PyObject *)__pyx_v_initial_key)); - __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - if (PyTuple_CheckExact(__pyx_t_3) && likely(PyTuple_GET_SIZE(__pyx_t_3) == 2)) { - PyObject* tuple = __pyx_t_3; + __pyx_t_9 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyTuple_CheckExact(__pyx_t_9) && likely(PyTuple_GET_SIZE(__pyx_t_9) == 2)) { + PyObject* tuple = __pyx_t_9; __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4); - __pyx_t_9 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_9); + __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1982 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1982 * entry_path_utf8 = path_utf8 * initial_key = (entry_path_utf8, '', '') * block_index, _ = self.state._find_block_index_from_key( # <<<<<<<<<<<<<< * initial_key) * if block_index == 0: */ - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_v_block_index); __pyx_v_block_index = __pyx_t_4; __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v__); - __pyx_v__ = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v__ = __pyx_t_1; + __pyx_t_1 = 0; } else { - __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_10, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_10, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_10, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); if (__Pyx_EndUnpack(__pyx_t_10, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_v_block_index); __pyx_v_block_index = __pyx_t_4; __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v__); - __pyx_v__ = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_v__ = __pyx_t_1; + __pyx_t_1 = 0; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":1984 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1984 * block_index, _ = self.state._find_block_index_from_key( * initial_key) * if block_index == 0: # <<<<<<<<<<<<<< * # The children of the root are in block index 1. * block_index = block_index + 1 */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_block_index, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_9 = PyObject_RichCompare(__pyx_v_block_index, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1986 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1986 * if block_index == 0: * # The children of the root are in block index 1. * block_index = block_index + 1 # <<<<<<<<<<<<<< * current_block = None * if block_index < len(self.state._dirblocks): */ - __pyx_t_3 = PyNumber_Add(__pyx_v_block_index, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyNumber_Add(__pyx_v_block_index, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_v_block_index); - __pyx_v_block_index = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_block_index = __pyx_t_9; + __pyx_t_9 = 0; goto __pyx_L19; } __pyx_L19:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1987 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1987 * # The children of the root are in block index 1. * block_index = block_index + 1 * current_block = None # <<<<<<<<<<<<<< @@ -17557,82 +17664,82 @@ __Pyx_DECREF(__pyx_v_current_block); __pyx_v_current_block = Py_None; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1988 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1988 * block_index = block_index + 1 * current_block = None * if block_index < len(self.state._dirblocks): # <<<<<<<<<<<<<< * current_block = self.state._dirblocks[block_index] * if not osutils.is_inside( */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___dirblocks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyObject_RichCompare(__pyx_v_block_index, __pyx_t_3, Py_LT); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___dirblocks); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_block_index, __pyx_t_9, Py_LT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1989 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1989 * current_block = None * if block_index < len(self.state._dirblocks): * current_block = self.state._dirblocks[block_index] # <<<<<<<<<<<<<< * if not osutils.is_inside( * entry_path_utf8, current_block[0]): */ - __pyx_t_9 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___dirblocks); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->state, __pyx_n_s___dirblocks); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = PyObject_GetItem(__pyx_t_1, __pyx_v_block_index); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyObject_GetItem(__pyx_t_9, __pyx_v_block_index); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_current_block); - __pyx_v_current_block = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_current_block = __pyx_t_9; + __pyx_t_9 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1990 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1990 * if block_index < len(self.state._dirblocks): * current_block = self.state._dirblocks[block_index] * if not osutils.is_inside( # <<<<<<<<<<<<<< * entry_path_utf8, current_block[0]): * # No entries for this directory at all. */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__is_inside); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__is_inside); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1991 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1991 * current_block = self.state._dirblocks[block_index] * if not osutils.is_inside( * entry_path_utf8, current_block[0]): # <<<<<<<<<<<<<< * # No entries for this directory at all. * current_block = None */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_current_block, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_current_block, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_entry_path_utf8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_entry_path_utf8); __Pyx_GIVEREF(__pyx_v_entry_path_utf8); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + __pyx_t_9 = 0; + __pyx_t_9 = PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = (!__pyx_t_7); if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1993 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1993 * entry_path_utf8, current_block[0]): * # No entries for this directory at all. * current_block = None # <<<<<<<<<<<<<< @@ -17649,7 +17756,7 @@ } __pyx_L20:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1994 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1994 * # No entries for this directory at all. * current_block = None * if current_block is not None: # <<<<<<<<<<<<<< @@ -17659,61 +17766,61 @@ __pyx_t_8 = (__pyx_v_current_block != Py_None); if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1995 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1995 * current_block = None * if current_block is not None: * for entry in current_block[1]: # <<<<<<<<<<<<<< * if entry[1][self.source_index][0] in 'ar': * # Not in the source tree, so doesn't have to be */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_current_block, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_11 = 0; __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_current_block, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) { + __pyx_t_11 = 0; __pyx_t_4 = __pyx_t_9; __Pyx_INCREF(__pyx_t_4); } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; for (;;) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_4)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_9); __pyx_t_11++; } else if (likely(PyTuple_CheckExact(__pyx_t_4))) { if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_4)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_3); __pyx_t_11++; + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_9); __pyx_t_11++; } else { - __pyx_t_3 = PyIter_Next(__pyx_t_4); - if (!__pyx_t_3) { + __pyx_t_9 = PyIter_Next(__pyx_t_4); + if (!__pyx_t_9) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_9); } __Pyx_DECREF(__pyx_v_entry); - __pyx_v_entry = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_entry = __pyx_t_9; + __pyx_t_9 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":1996 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1996 * if current_block is not None: * for entry in current_block[1]: * if entry[1][self.source_index][0] in 'ar': # <<<<<<<<<<<<<< * # Not in the source tree, so doesn't have to be * # included. */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_self->source_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_9, __pyx_v_self->source_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_9, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = ((PySequence_Contains(((PyObject *)__pyx_n_s__ar), __pyx_t_9))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_8 = ((PySequence_Contains(((PyObject *)__pyx_n_s__ar), __pyx_t_3))); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":1999 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1999 * # Not in the source tree, so doesn't have to be * # included. * continue # <<<<<<<<<<<<<< @@ -17725,43 +17832,43 @@ } __pyx_L25:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":2001 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2001 * continue * # Path of the entry itself. * self.search_specific_file_parents.add( # <<<<<<<<<<<<<< * self.pathjoin(*entry[0][:2])) * if changed or self.include_unchanged: */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->search_specific_file_parents, __pyx_n_s__add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyObject_GetAttr(__pyx_v_self->search_specific_file_parents, __pyx_n_s__add); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); - /* "bzrlib/_dirstate_helpers_pyx.pyx":2002 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2002 * # Path of the entry itself. * self.search_specific_file_parents.add( * self.pathjoin(*entry[0][:2])) # <<<<<<<<<<<<<< * if changed or self.include_unchanged: * results.append((result, changed)) */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PySequence_GetSlice(__pyx_t_9, 0, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PySequence_GetSlice(__pyx_t_1, 0, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PySequence_Tuple(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_v_self->pathjoin, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_v_self->pathjoin, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); + __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_L23_continue:; } @@ -17776,7 +17883,7 @@ } __pyx_L16:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":2003 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2003 * self.search_specific_file_parents.add( * self.pathjoin(*entry[0][:2])) * if changed or self.include_unchanged: # <<<<<<<<<<<<<< @@ -17791,7 +17898,7 @@ } if (__pyx_t_7) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":2004 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2004 * self.pathjoin(*entry[0][:2])) * if changed or self.include_unchanged: * results.append((result, changed)) # <<<<<<<<<<<<<< @@ -17802,45 +17909,45 @@ PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_result); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_result); __Pyx_GIVEREF(__pyx_v_result); __Pyx_INCREF(__pyx_v_changed); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_changed); __Pyx_GIVEREF(__pyx_v_changed); - __pyx_t_6 = PyList_Append(__pyx_v_results, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_results), __pyx_t_4); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L26; } __pyx_L26:; __pyx_L12_continue:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":2005 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2005 * if changed or self.include_unchanged: * results.append((result, changed)) * self.searched_exact_paths.add(path_utf8) # <<<<<<<<<<<<<< * return results * */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->searched_exact_paths, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->searched_exact_paths, __pyx_n_s__add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_path_utf8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_path_utf8); __Pyx_GIVEREF(__pyx_v_path_utf8); - __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_L3_continue:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":2006 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2006 * results.append((result, changed)) * self.searched_exact_paths.add(path_utf8) * return results # <<<<<<<<<<<<<< @@ -17882,7 +17989,7 @@ return __pyx_r; } -/* "bzrlib/_dirstate_helpers_pyx.pyx":2008 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2008 * return results * * cdef object _path_info(self, utf8_path, unicode_path): # <<<<<<<<<<<<<< @@ -17910,9 +18017,9 @@ __pyx_v_stat = Py_None; __Pyx_INCREF(Py_None); __pyx_v_e = Py_None; __Pyx_INCREF(Py_None); __pyx_v_utf8_basename = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_dir_info = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_dir_info = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - /* "bzrlib/_dirstate_helpers_pyx.pyx":2013 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2013 * :return: None if unicode_path does not exist, or a path_info tuple. * """ * abspath = self.tree.abspath(unicode_path) # <<<<<<<<<<<<<< @@ -17922,19 +18029,19 @@ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s__abspath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_unicode_path); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_unicode_path); __Pyx_GIVEREF(__pyx_v_unicode_path); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_abspath); __pyx_v_abspath = __pyx_t_3; __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":2014 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2014 * """ * abspath = self.tree.abspath(unicode_path) * try: # <<<<<<<<<<<<<< @@ -17949,7 +18056,7 @@ __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":2015 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2015 * abspath = self.tree.abspath(unicode_path) * try: * stat = os.lstat(abspath) # <<<<<<<<<<<<<< @@ -17962,14 +18069,14 @@ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_abspath); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_abspath); __Pyx_GIVEREF(__pyx_v_abspath); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_stat); __pyx_v_stat = __pyx_t_1; __pyx_t_1 = 0; @@ -17983,7 +18090,7 @@ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":2016 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2016 * try: * stat = os.lstat(abspath) * except OSError, e: # <<<<<<<<<<<<<< @@ -18001,7 +18108,7 @@ __Pyx_DECREF(__pyx_v_e); __pyx_v_e = __pyx_t_3; - /* "bzrlib/_dirstate_helpers_pyx.pyx":2017 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2017 * stat = os.lstat(abspath) * except OSError, e: * if e.errno == errno.ENOENT: # <<<<<<<<<<<<<< @@ -18023,7 +18130,7 @@ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":2019 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2019 * if e.errno == errno.ENOENT: * # the path does not exist. * return None # <<<<<<<<<<<<<< @@ -18041,7 +18148,7 @@ } /*else*/ { - /* "bzrlib/_dirstate_helpers_pyx.pyx":2021 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2021 * return None * else: * raise # <<<<<<<<<<<<<< @@ -18081,7 +18188,7 @@ __pyx_L10_try_end:; } - /* "bzrlib/_dirstate_helpers_pyx.pyx":2022 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2022 * else: * raise * utf8_basename = utf8_path.rsplit('/', 1)[-1] # <<<<<<<<<<<<<< @@ -18090,152 +18197,168 @@ */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_utf8_path, __pyx_n_s__rsplit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_66), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_47)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_47)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_47)); + __Pyx_INCREF(__pyx_int_1); + PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1); + __Pyx_GIVEREF(__pyx_int_1); + __pyx_t_1 = PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_utf8_basename); - __pyx_v_utf8_basename = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_utf8_basename = __pyx_t_3; + __pyx_t_3 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":2024 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2024 * utf8_basename = utf8_path.rsplit('/', 1)[-1] * dir_info = (utf8_path, utf8_basename, * osutils.file_kind_from_stat_mode(stat.st_mode), stat, # <<<<<<<<<<<<<< * abspath) * if dir_info[2] == 'directory': */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s_38); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_v_stat, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s_48); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_v_stat, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":2025 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2025 * dir_info = (utf8_path, utf8_basename, * osutils.file_kind_from_stat_mode(stat.st_mode), stat, * abspath) # <<<<<<<<<<<<<< * if dir_info[2] == 'directory': * if self.tree._directory_is_tree_reference( */ - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_utf8_path); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_utf8_path); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_utf8_path); __Pyx_GIVEREF(__pyx_v_utf8_path); __Pyx_INCREF(__pyx_v_utf8_basename); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_utf8_basename); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_utf8_basename); __Pyx_GIVEREF(__pyx_v_utf8_basename); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); + PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_stat); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_stat); + PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_stat); __Pyx_GIVEREF(__pyx_v_stat); __Pyx_INCREF(__pyx_v_abspath); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_abspath); + PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_abspath); __Pyx_GIVEREF(__pyx_v_abspath); - __pyx_t_2 = 0; + __pyx_t_3 = 0; + 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 = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_v_dir_info)); - __pyx_v_dir_info = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_v_dir_info = ((PyObject *)__pyx_t_2); + __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":2026 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2026 * osutils.file_kind_from_stat_mode(stat.st_mode), stat, * abspath) * if dir_info[2] == 'directory': # <<<<<<<<<<<<<< * if self.tree._directory_is_tree_reference( * unicode_path): */ - __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_dir_info), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_dir_info), 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, ((PyObject *)__pyx_n_s__directory), Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":2027 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2027 * abspath) * if dir_info[2] == 'directory': * if self.tree._directory_is_tree_reference( # <<<<<<<<<<<<<< * unicode_path): * self.root_dir_info = self.root_dir_info[:2] + \ */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s_49); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->tree, __pyx_n_s_39); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); - /* "bzrlib/_dirstate_helpers_pyx.pyx":2028 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2028 * if dir_info[2] == 'directory': * if self.tree._directory_is_tree_reference( * unicode_path): # <<<<<<<<<<<<<< * self.root_dir_info = self.root_dir_info[:2] + \ * ('tree-reference',) + self.root_dir_info[3:] */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_unicode_path); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_unicode_path); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_unicode_path); __Pyx_GIVEREF(__pyx_v_unicode_path); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { - /* "bzrlib/_dirstate_helpers_pyx.pyx":2029 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2029 * if self.tree._directory_is_tree_reference( * unicode_path): * self.root_dir_info = self.root_dir_info[:2] + \ # <<<<<<<<<<<<<< * ('tree-reference',) + self.root_dir_info[3:] * return dir_info */ - __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_self->root_dir_info, 0, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PySequence_GetSlice(__pyx_v_self->root_dir_info, 0, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); - /* "bzrlib/_dirstate_helpers_pyx.pyx":2030 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2030 * unicode_path): * self.root_dir_info = self.root_dir_info[:2] + \ * ('tree-reference',) + self.root_dir_info[3:] # <<<<<<<<<<<<<< * return dir_info */ - __pyx_t_1 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_k_tuple_67)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_self->root_dir_info, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_33)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_33)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_33)); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "bzrlib/_dirstate_helpers_pyx.pyx":2029 + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PySequence_GetSlice(__pyx_v_self->root_dir_info, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2029 * if self.tree._directory_is_tree_reference( * unicode_path): * self.root_dir_info = self.root_dir_info[:2] + \ # <<<<<<<<<<<<<< * ('tree-reference',) + self.root_dir_info[3:] * return dir_info */ - __Pyx_GIVEREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->root_dir_info); __Pyx_DECREF(__pyx_v_self->root_dir_info); - __pyx_v_self->root_dir_info = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_self->root_dir_info = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L15; } __pyx_L15:; @@ -18243,7 +18366,7 @@ } __pyx_L14:; - /* "bzrlib/_dirstate_helpers_pyx.pyx":2031 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":2031 * self.root_dir_info = self.root_dir_info[:2] + \ * ('tree-reference',) + self.root_dir_info[3:] * return dir_info # <<<<<<<<<<<<<< @@ -18274,54 +18397,6 @@ __Pyx_RefNannyFinishContext(); return __pyx_r; } - -/* "bzrlib/_dirstate_helpers_pyx.pyx":1031 - * cdef object use_filesystem_for_exec - * cdef object utf8_decode - * cdef readonly object searched_specific_files # <<<<<<<<<<<<<< - * cdef readonly object searched_exact_paths - * cdef object search_specific_files - */ - -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_23searched_specific_files___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_23searched_specific_files___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_specific_files); - __pyx_r = ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_specific_files; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_dirstate_helpers_pyx.pyx":1032 - * cdef object utf8_decode - * cdef readonly object searched_specific_files - * cdef readonly object searched_exact_paths # <<<<<<<<<<<<<< - * cdef object search_specific_files - * # The parents up to the root of the paths we are searching. - */ - -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_20searched_exact_paths___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_20searched_exact_paths___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_exact_paths); - __pyx_r = ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_exact_paths; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} static struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader; static PyObject *__pyx_tp_new_6bzrlib_21_dirstate_helpers_pyx_Reader(PyTypeObject *t, PyObject *a, PyObject *k) { @@ -18367,7 +18442,7 @@ } static PyMethodDef __pyx_methods_6bzrlib_21_dirstate_helpers_pyx_Reader[] = { - {__Pyx_NAMESTR("_parse_dirblocks"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6Reader_1_parse_dirblocks, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_6Reader_1_parse_dirblocks)}, + {__Pyx_NAMESTR("_parse_dirblocks"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6Reader__parse_dirblocks, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_6Reader__parse_dirblocks)}, {0, 0, 0, 0} }; @@ -18469,7 +18544,7 @@ #endif }; -static PyTypeObject __pyx_type_6bzrlib_21_dirstate_helpers_pyx_Reader = { +PyTypeObject __pyx_type_6bzrlib_21_dirstate_helpers_pyx_Reader = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("bzrlib._dirstate_helpers_pyx.Reader"), /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader), /*tp_basicsize*/ @@ -18493,7 +18568,7 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Reader, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ __Pyx_DOCSTR("Maintain the current location, and return fields as you parse them."), /*tp_doc*/ __pyx_tp_traverse_6bzrlib_21_dirstate_helpers_pyx_Reader, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_21_dirstate_helpers_pyx_Reader, /*tp_clear*/ @@ -18785,8 +18860,8 @@ } static PyMethodDef __pyx_methods_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC[] = { - {__Pyx_NAMESTR("iter_changes"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_2iter_changes, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_3__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("iter_changes"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_iter_changes, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; @@ -18894,7 +18969,7 @@ #endif }; -static PyTypeObject __pyx_type_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC = { +PyTypeObject __pyx_type_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("bzrlib._dirstate_helpers_pyx.ProcessEntryC"), /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC), /*tp_basicsize*/ @@ -18918,14 +18993,14 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_ProcessEntryC, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_1__iter__, /*tp_iter*/ - __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_3__next__, /*tp_iternext*/ + __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC___iter__, /*tp_iter*/ + __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC___next__, /*tp_iternext*/ __pyx_methods_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC, /*tp_getset*/ @@ -18951,6 +19026,15 @@ }; static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("_py_memrchr"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__py_memrchr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx__py_memrchr)}, + {__Pyx_NAMESTR("cmp_by_dirs"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_cmp_by_dirs, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_cmp_by_dirs)}, + {__Pyx_NAMESTR("_cmp_path_by_dirblock"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__cmp_path_by_dirblock, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx__cmp_path_by_dirblock)}, + {__Pyx_NAMESTR("_bisect_path_left"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__bisect_path_left, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx__bisect_path_left)}, + {__Pyx_NAMESTR("_bisect_path_right"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__bisect_path_right, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx__bisect_path_right)}, + {__Pyx_NAMESTR("bisect_dirblock"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_bisect_dirblock, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_bisect_dirblock)}, + {__Pyx_NAMESTR("_read_dirblocks"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx__read_dirblocks, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx__read_dirblocks)}, + {__Pyx_NAMESTR("pack_stat"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_pack_stat, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_pack_stat)}, + {__Pyx_NAMESTR("update_entry"), (PyCFunction)__pyx_pf_6bzrlib_21_dirstate_helpers_pyx_update_entry, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_21_dirstate_helpers_pyx_update_entry)}, {0, 0, 0, 0} }; @@ -18958,7 +19042,7 @@ static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, __Pyx_NAMESTR("_dirstate_helpers_pyx"), - __Pyx_DOCSTR(__pyx_k_68), /* m_doc */ + __Pyx_DOCSTR(__pyx_k_48), /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ @@ -18971,12 +19055,14 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, + {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, + {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, - {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, + {&__pyx_n_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 1}, {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, {&__pyx_n_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 1}, - {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, + {&__pyx_n_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 1}, {&__pyx_n_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 1}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_n_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 1}, @@ -18990,34 +19076,41 @@ {&__pyx_n_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 1}, {&__pyx_n_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 1}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_n_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 1}, - {&__pyx_n_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 1}, + {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0}, + {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0}, {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0}, + {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0}, {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0}, + {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0}, {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0}, - {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0}, - {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0}, + {&__pyx_n_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 1}, + {&__pyx_n_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 1}, + {&__pyx_n_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 1}, {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0}, - {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0}, - {&__pyx_n_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 1}, - {&__pyx_n_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 1}, + {&__pyx_n_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 1}, + {&__pyx_n_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 1}, + {&__pyx_n_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 1}, + {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0}, + {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0}, + {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0}, + {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0}, {&__pyx_n_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 1}, {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0}, + {&__pyx_n_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 1}, + {&__pyx_kp_u_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 1, 0, 0}, + {&__pyx_kp_u_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 1, 0, 0}, + {&__pyx_kp_u_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 1, 0, 0}, {&__pyx_n_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 1}, - {&__pyx_n_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 1}, - {&__pyx_n_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 1}, + {&__pyx_kp_u_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 1, 0, 0}, + {&__pyx_kp_u_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 1, 0, 0}, + {&__pyx_kp_u_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 1, 0, 0}, + {&__pyx_kp_u_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 1, 0, 0}, + {&__pyx_kp_u_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 1, 0, 0}, {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, - {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0}, - {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 0}, - {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0}, - {&__pyx_kp_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 0}, - {&__pyx_n_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 1}, + {&__pyx_kp_u_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 1, 0, 0}, + {&__pyx_kp_u_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 1, 0, 0}, {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_n_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 1}, - {&__pyx_n_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 1}, - {&__pyx_n_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 1}, {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, {&__pyx_n_s__AssertionError, __pyx_k__AssertionError, sizeof(__pyx_k__AssertionError), 0, 0, 1, 1}, @@ -19035,6 +19128,7 @@ {&__pyx_n_s__NULLSTAT, __pyx_k__NULLSTAT, sizeof(__pyx_k__NULLSTAT), 0, 0, 1, 1}, {&__pyx_n_s__NULL_PARENT_DETAILS, __pyx_k__NULL_PARENT_DETAILS, sizeof(__pyx_k__NULL_PARENT_DETAILS), 0, 0, 1, 1}, {&__pyx_n_s__OSError, __pyx_k__OSError, sizeof(__pyx_k__OSError), 0, 0, 1, 1}, + {&__pyx_n_s__Reader, __pyx_k__Reader, sizeof(__pyx_k__Reader), 0, 0, 1, 1}, {&__pyx_n_s__S_IEXEC, __pyx_k__S_IEXEC, sizeof(__pyx_k__S_IEXEC), 0, 0, 1, 1}, {&__pyx_n_s__S_ISREG, __pyx_k__S_ISREG, sizeof(__pyx_k__S_ISREG), 0, 0, 1, 1}, {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1}, @@ -19079,7 +19173,6 @@ {&__pyx_n_s__absent, __pyx_k__absent, sizeof(__pyx_k__absent), 0, 0, 1, 1}, {&__pyx_n_s__abspath, __pyx_k__abspath, sizeof(__pyx_k__abspath), 0, 0, 1, 1}, {&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1}, - {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, {&__pyx_n_s__ar, __pyx_k__ar, sizeof(__pyx_k__ar), 0, 0, 1, 1}, {&__pyx_n_s__b2a_base64, __pyx_k__b2a_base64, sizeof(__pyx_k__b2a_base64), 0, 0, 1, 1}, {&__pyx_n_s__binascii, __pyx_k__binascii, sizeof(__pyx_k__binascii), 0, 0, 1, 1}, @@ -19197,318 +19290,6 @@ return -1; } -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":558 - * - * if self.cur_cstr == NULL: - * raise AssertionError('get_next() called when cur_str is NULL') # <<<<<<<<<<<<<< - * elif self.cur_cstr >= self.end_cstr: - * raise AssertionError('get_next() called when there are no chars' - */ - __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); - PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":560 - * raise AssertionError('get_next() called when cur_str is NULL') - * elif self.cur_cstr >= self.end_cstr: - * raise AssertionError('get_next() called when there are no chars' # <<<<<<<<<<<<<< - * ' left') - * next = self.cur_cstr - */ - __pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_13)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); - PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1126 - * if target_index != 0: - * # A lot of code in here depends on target_index == 0 - * raise errors.BzrError('unsupported target index') # <<<<<<<<<<<<<< - * - * cdef _process_entry(self, entry, path_info): - */ - __pyx_k_tuple_33 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_33)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_32)); - PyTuple_SET_ITEM(__pyx_k_tuple_33, 0, ((PyObject *)__pyx_kp_s_32)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_32)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1200 - * # update the source details variable to be the real - * # location. - * if old_entry == (None, None): # <<<<<<<<<<<<<< - * raise errors.CorruptDirstate(self.state._filename, - * "entry '%s/%s' is considered renamed from %r" - */ - __pyx_k_tuple_35 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_35)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_35, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1299 - * target_parent_entry = self.state._get_entry(self.target_index, - * path_utf8=new_dirname) - * if target_parent_entry == (None, None): # <<<<<<<<<<<<<< - * raise AssertionError( - * "Could not find target parent in wt: %s\nparent of: %s" - */ - __pyx_k_tuple_38 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_38)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_38, 0, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_38, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1381 - * (None, parent_id), - * (None, self.utf8_decode(entry[0][1])[0]), - * (None, None), # <<<<<<<<<<<<<< - * (None, False)), True - * elif _versioned_minikind(source_minikind) and target_minikind == c'a': - */ - __pyx_k_tuple_41 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_41)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_41, 0, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_41, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1424 - * % (source_minikind, target_minikind)) - * ## import pdb;pdb.set_trace() - * return None, None # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __pyx_k_tuple_43 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_43)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_43, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1446 - * # Not the root and not a delete: queue up the parents of the path. - * self.search_specific_file_parents.update( - * osutils.parent_directories(new_path.encode('utf8'))) # <<<<<<<<<<<<<< - * # Add the root directory which parent_directories does not - * # provide. - */ - __pyx_k_tuple_44 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_44)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__utf8)); - PyTuple_SET_ITEM(__pyx_k_tuple_44, 0, ((PyObject *)__pyx_n_s__utf8)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1449 - * # Add the root directory which parent_directories does not - * # provide. - * self.search_specific_file_parents.add('') # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_k_tuple_45 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_45)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_k_tuple_45, 0, ((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1543 - * self.root_entries = self.state._entries_for_path(self.current_root) - * self.root_entries_len = len(self.root_entries) - * self.current_root_unicode = self.current_root.decode('utf8') # <<<<<<<<<<<<<< - * self.root_abspath = self.tree.abspath(self.current_root_unicode) - * try: - */ - __pyx_k_tuple_47 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_47)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__utf8)); - PyTuple_SET_ITEM(__pyx_k_tuple_47, 0, ((PyObject *)__pyx_n_s__utf8)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1562 - * self.current_root_unicode): - * self.root_dir_info = self.root_dir_info[:2] + \ - * ('tree-reference',) + self.root_dir_info[3:] # <<<<<<<<<<<<<< - * if not self.root_entries and not self.root_dir_info: - * # this specified path is not present at all, skip it. - */ - __pyx_k_tuple_50 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_50)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_37)); - PyTuple_SET_ITEM(__pyx_k_tuple_50, 0, ((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1593 - * True, - * (False, False), - * (None, None), # <<<<<<<<<<<<<< - * (None, splitpath(self.current_root_unicode)[-1]), - * (None, self.root_dir_info[2]), - */ - __pyx_k_tuple_51 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_51)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_51, 0, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_51, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1638 - * if self.current_dir_info[0][0] == '': - * # remove .bzr from iteration - * bzr_index = self.bisect_left(self.current_dir_list, ('.bzr',)) # <<<<<<<<<<<<<< - * if self.current_dir_list[bzr_index][0] != '.bzr': - * raise AssertionError() - */ - __pyx_k_tuple_53 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_53)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_52)); - PyTuple_SET_ITEM(__pyx_k_tuple_53, 0, ((PyObject *)__pyx_kp_s_52)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_52)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1696 - * self.utf8_decode(current_path_info[0])[0]): - * current_path_info = current_path_info[:2] + \ - * ('tree-reference',) + current_path_info[3:] # <<<<<<<<<<<<<< - * new_executable = bool( - * stat.S_ISREG(current_path_info[3].st_mode) - */ - __pyx_k_tuple_56 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_56)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_37)); - PyTuple_SET_ITEM(__pyx_k_tuple_56, 0, ((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1704 - * True, - * (False, False), - * (None, None), # <<<<<<<<<<<<<< - * (None, self.utf8_decode(current_path_info[1])[0]), - * (None, current_path_info[2]), - */ - __pyx_k_tuple_57 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_57)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_57, 0, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_57, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1760 - * self.utf8_decode(current_path_info[0])[0]): - * return current_path_info[:2] + \ - * ('tree-reference',) + current_path_info[3:] # <<<<<<<<<<<<<< - * else: - * return current_path_info - */ - __pyx_k_tuple_59 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_59)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_37)); - PyTuple_SET_ITEM(__pyx_k_tuple_59, 0, ((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1872 - * True, - * (False, False), - * (None, None), # <<<<<<<<<<<<<< - * (None, self.utf8_decode(current_path_info[1])[0]), - * (None, current_path_info[2]), - */ - __pyx_k_tuple_61 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_61)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_61, 0, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_k_tuple_61, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":1958 - * "Missing entry for specific path parent %r, %r" % ( - * path_utf8, path_entries)) - * path_info = self._path_info(path_utf8, path_utf8.decode('utf8')) # <<<<<<<<<<<<<< - * for entry in selected_entries: - * if entry[0][2] in self.seen_ids: - */ - __pyx_k_tuple_63 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1958; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_63)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__utf8)); - PyTuple_SET_ITEM(__pyx_k_tuple_63, 0, ((PyObject *)__pyx_n_s__utf8)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":2022 - * else: - * raise - * utf8_basename = utf8_path.rsplit('/', 1)[-1] # <<<<<<<<<<<<<< - * dir_info = (utf8_path, utf8_basename, - * osutils.file_kind_from_stat_mode(stat.st_mode), stat, - */ - __pyx_k_tuple_66 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_66)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_65)); - PyTuple_SET_ITEM(__pyx_k_tuple_66, 0, ((PyObject *)__pyx_kp_s_65)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_65)); - __Pyx_INCREF(__pyx_int_1); - PyTuple_SET_ITEM(__pyx_k_tuple_66, 1, __pyx_int_1); - __Pyx_GIVEREF(__pyx_int_1); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_66)); - - /* "bzrlib/_dirstate_helpers_pyx.pyx":2030 - * unicode_path): - * self.root_dir_info = self.root_dir_info[:2] + \ - * ('tree-reference',) + self.root_dir_info[3:] # <<<<<<<<<<<<<< - * return dir_info - */ - __pyx_k_tuple_67 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_67)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_37)); - PyTuple_SET_ITEM(__pyx_k_tuple_67, 0, ((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - static int __Pyx_InitGlobals(void) { #if PY_VERSION_HEX < 0x02040000 if (unlikely(__Pyx_Py23SetsImport() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -19532,6 +19313,7 @@ PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; + PyObject *__pyx_t_4 = NULL; #if CYTHON_REFNANNY void* __pyx_refnanny = NULL; __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -19557,7 +19339,7 @@ #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_dirstate_helpers_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_68), 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_dirstate_helpers_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_48), 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -19575,8 +19357,6 @@ } /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_absent = Py_None; Py_INCREF(Py_None); __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_file = Py_None; Py_INCREF(Py_None); @@ -19587,15 +19367,23 @@ /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_6bzrlib_21_dirstate_helpers_pyx_Reader = &__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader; + #if PY_MAJOR_VERSION >= 3 __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader.get_next = (char *(*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *, int *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader_get_next; __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader.get_next_str = (PyObject *(*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader_get_next_str; __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader._init = (int (*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader__init; __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader._get_entry = (PyObject *(*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *, int, void **, int *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader__get_entry; + #else + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader.get_next = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader_get_next; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader.get_next_str = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader_get_next_str; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader._init = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader__init; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader._get_entry = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader__get_entry; + #endif if (PyType_Ready(&__pyx_type_6bzrlib_21_dirstate_helpers_pyx_Reader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetVtable(__pyx_type_6bzrlib_21_dirstate_helpers_pyx_Reader.tp_dict, __pyx_vtabptr_6bzrlib_21_dirstate_helpers_pyx_Reader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "Reader", (PyObject *)&__pyx_type_6bzrlib_21_dirstate_helpers_pyx_Reader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_6bzrlib_21_dirstate_helpers_pyx_Reader = &__pyx_type_6bzrlib_21_dirstate_helpers_pyx_Reader; __pyx_vtabptr_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC = &__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC; + #if PY_MAJOR_VERSION >= 3 __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._process_entry = (PyObject *(*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *, PyObject *, PyObject *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__process_entry; __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._gather_result_for_consistency = (int (*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *, PyObject *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__gather_result_for_consistency; __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._update_current_block = (int (*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__update_current_block; @@ -19604,6 +19392,16 @@ __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._loop_one_block = (PyObject *(*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__loop_one_block; __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._next_consistent_entries = (PyObject *(*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__next_consistent_entries; __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._path_info = (PyObject *(*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *, PyObject *, PyObject *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__path_info; + #else + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._process_entry = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__process_entry; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._gather_result_for_consistency = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__gather_result_for_consistency; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._update_current_block = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__update_current_block; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._iter_next = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__iter_next; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._maybe_tree_ref = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__maybe_tree_ref; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._loop_one_block = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__loop_one_block; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._next_consistent_entries = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__next_consistent_entries; + *(void(**)(void))&__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._path_info = (void(*)(void))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__path_info; + #endif if (PyType_Ready(&__pyx_type_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetVtable(__pyx_type_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC.tp_dict, __pyx_vtabptr_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "ProcessEntryC", (PyObject *)&__pyx_type_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -19613,7 +19411,7 @@ /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "bzrlib/_dirstate_helpers_pyx.pyx":22 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":22 * """ * * import binascii # <<<<<<<<<<<<<< @@ -19625,7 +19423,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__binascii, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":23 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":23 * * import binascii * import bisect # <<<<<<<<<<<<<< @@ -19637,7 +19435,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__bisect, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":24 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":24 * import binascii * import bisect * import errno # <<<<<<<<<<<<<< @@ -19649,7 +19447,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__errno, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":25 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":25 * import bisect * import errno * import os # <<<<<<<<<<<<<< @@ -19661,7 +19459,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":26 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":26 * import errno * import os * import stat # <<<<<<<<<<<<<< @@ -19673,7 +19471,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__stat, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":27 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":27 * import os * import stat * import sys # <<<<<<<<<<<<<< @@ -19685,7 +19483,7 @@ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":29 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":29 * import sys * * from bzrlib import cache_utf8, errors, osutils # <<<<<<<<<<<<<< @@ -19720,7 +19518,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":30 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":30 * * from bzrlib import cache_utf8, errors, osutils * from bzrlib.dirstate import DirState # <<<<<<<<<<<<<< @@ -19732,7 +19530,7 @@ __Pyx_INCREF(((PyObject *)__pyx_n_s__DirState)); PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__DirState)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__DirState)); - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_69), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_49), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__DirState); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -19741,7 +19539,7 @@ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":31 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":31 * from bzrlib import cache_utf8, errors, osutils * from bzrlib.dirstate import DirState * from bzrlib.osutils import parent_directories, pathjoin, splitpath # <<<<<<<<<<<<<< @@ -19759,7 +19557,7 @@ __Pyx_INCREF(((PyObject *)__pyx_n_s__splitpath)); PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__splitpath)); __Pyx_GIVEREF(((PyObject *)__pyx_n_s__splitpath)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_70), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_50), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__parent_directories); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -19776,7 +19574,7 @@ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":39 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":39 * # XXX: Perhaps we could get it from a windows header ? * cdef int ERROR_PATH_NOT_FOUND * ERROR_PATH_NOT_FOUND = 3 # <<<<<<<<<<<<<< @@ -19785,7 +19583,7 @@ */ __pyx_v_6bzrlib_21_dirstate_helpers_pyx_ERROR_PATH_NOT_FOUND = 3; - /* "bzrlib/_dirstate_helpers_pyx.pyx":41 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":41 * ERROR_PATH_NOT_FOUND = 3 * cdef int ERROR_DIRECTORY * ERROR_DIRECTORY = 267 # <<<<<<<<<<<<<< @@ -19794,7 +19592,7 @@ */ __pyx_v_6bzrlib_21_dirstate_helpers_pyx_ERROR_DIRECTORY = 267; - /* "bzrlib/_dirstate_helpers_pyx.pyx":126 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":126 * StaticTuple_New, StaticTuple_SET_ITEM * * import_static_tuple_c() # <<<<<<<<<<<<<< @@ -19803,130 +19601,22 @@ */ __pyx_t_3 = import_static_tuple_c(); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_dirstate_helpers_pyx.pyx":142 - * + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":812 * - * def _py_memrchr(s, c): # <<<<<<<<<<<<<< - * """Just to expose _my_memrchr for testing. - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_dirstate_helpers_pyx__py_memrchr, NULL, __pyx_n_s_71); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___py_memrchr, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_dirstate_helpers_pyx.pyx":246 * + * _encode = binascii.b2a_base64 # <<<<<<<<<<<<<< * - * def cmp_by_dirs(path1, path2): # <<<<<<<<<<<<<< - * """Compare two paths directory by directory. * */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_1cmp_by_dirs, NULL, __pyx_n_s_71); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__binascii); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__cmp_by_dirs, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__b2a_base64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyObject_SetAttr(__pyx_m, __pyx_n_s___encode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_dirstate_helpers_pyx.pyx":275 - * - * - * def _cmp_path_by_dirblock(path1, path2): # <<<<<<<<<<<<<< - * """Compare two paths based on what directory they are in. - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_2_cmp_path_by_dirblock, NULL, __pyx_n_s_71); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_72, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_dirstate_helpers_pyx.pyx":377 - * - * - * def _bisect_path_left(paths, path): # <<<<<<<<<<<<<< - * """Return the index where to insert path into paths. - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_3_bisect_path_left, NULL, __pyx_n_s_71); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___bisect_path_left, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_dirstate_helpers_pyx.pyx":430 - * - * - * def _bisect_path_right(paths, path): # <<<<<<<<<<<<<< - * """Return the index where to insert path into paths. - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_4_bisect_path_right, NULL, __pyx_n_s_71); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___bisect_path_right, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_dirstate_helpers_pyx.pyx":483 - * - * - * def bisect_dirblock(dirblocks, dirname, lo=0, hi=None, cache=None): # <<<<<<<<<<<<<< - * """Return the index where to insert dirname into the dirblocks. - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_5bisect_dirblock, NULL, __pyx_n_s_71); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__bisect_dirblock, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_dirstate_helpers_pyx.pyx":779 - * - * - * def _read_dirblocks(state): # <<<<<<<<<<<<<< - * """Read in the dirblocks for the given DirState object. - * - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_6_read_dirblocks, NULL, __pyx_n_s_71); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___read_dirblocks, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_dirstate_helpers_pyx.pyx":812 - * - * - * _encode = binascii.b2a_base64 # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__binascii); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__b2a_base64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___encode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_dirstate_helpers_pyx.pyx":835 - * - * - * def pack_stat(stat_value): # <<<<<<<<<<<<<< - * """Convert stat value into a packed representation quickly with pyrex""" - * return _pack_stat(stat_value) - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_7pack_stat, NULL, __pyx_n_s_71); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pack_stat, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_dirstate_helpers_pyx.pyx":840 - * - * - * def update_entry(self, entry, abspath, stat_value): # <<<<<<<<<<<<<< - * """Update the entry based on what is actually on disk. - * - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_21_dirstate_helpers_pyx_8update_entry, NULL, __pyx_n_s_71); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__update_entry, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_dirstate_helpers_pyx.pyx":985 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":985 * cdef object _kind_relocated * cdef object _kind_tree_reference * _kind_absent = "absent" # <<<<<<<<<<<<<< @@ -19939,7 +19629,7 @@ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__absent)); __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_absent = ((PyObject *)__pyx_n_s__absent); - /* "bzrlib/_dirstate_helpers_pyx.pyx":986 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":986 * cdef object _kind_tree_reference * _kind_absent = "absent" * _kind_file = "file" # <<<<<<<<<<<<<< @@ -19952,7 +19642,7 @@ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file)); __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_file = ((PyObject *)__pyx_n_s__file); - /* "bzrlib/_dirstate_helpers_pyx.pyx":987 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":987 * _kind_absent = "absent" * _kind_file = "file" * _kind_directory = "directory" # <<<<<<<<<<<<<< @@ -19965,7 +19655,7 @@ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__directory)); __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_directory = ((PyObject *)__pyx_n_s__directory); - /* "bzrlib/_dirstate_helpers_pyx.pyx":988 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":988 * _kind_file = "file" * _kind_directory = "directory" * _kind_symlink = "symlink" # <<<<<<<<<<<<<< @@ -19978,7 +19668,7 @@ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__symlink)); __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_symlink = ((PyObject *)__pyx_n_s__symlink); - /* "bzrlib/_dirstate_helpers_pyx.pyx":989 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":989 * _kind_directory = "directory" * _kind_symlink = "symlink" * _kind_relocated = "relocated" # <<<<<<<<<<<<<< @@ -19991,32 +19681,106 @@ __Pyx_GIVEREF(((PyObject *)__pyx_n_s__relocated)); __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_relocated = ((PyObject *)__pyx_n_s__relocated); - /* "bzrlib/_dirstate_helpers_pyx.pyx":990 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":990 * _kind_symlink = "symlink" * _kind_relocated = "relocated" * _kind_tree_reference = "tree-reference" # <<<<<<<<<<<<<< * * */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_37)); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_33)); __Pyx_GOTREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_tree_reference); __Pyx_DECREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_tree_reference); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_37)); - __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_tree_reference = ((PyObject *)__pyx_kp_s_37); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_33)); + __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_tree_reference = ((PyObject *)__pyx_kp_s_33); - /* "bzrlib/_dirstate_helpers_pyx.pyx":1 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_dirstate_helpers_pyx.pyx":1 * # Copyright (C) 2007-2010 Canonical Ltd # <<<<<<<<<<<<<< * # * # This program is free software; you can redistribute it and/or modify */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s___py_memrchr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_51), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__cmp_by_dirs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_52), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s_54); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_53), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s___bisect_path_left); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_55), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s___bisect_path_right); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_56), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__bisect_dirblock); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_57), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__Reader); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___parse_dirblocks); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_58), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s___read_dirblocks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_59), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__pack_stat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_4, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_60), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__update_entry); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_61), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); if (__pyx_m) { __Pyx_AddTraceback("init bzrlib._dirstate_helpers_pyx"); Py_DECREF(__pyx_m); __pyx_m = 0; @@ -20042,6 +19806,19 @@ return result; } +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AS_STRING(kw_name)); + #endif +} + static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, @@ -20072,19 +19849,6 @@ func_name, more_or_less, num_expected, number, num_found); } -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], @@ -20164,143 +19928,6 @@ return -1; } -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - - -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - Py_XINCREF(type); - Py_XINCREF(value); - Py_XINCREF(tb); - /* First, check the traceback argument, replacing None with NULL. */ - if (tb == Py_None) { - Py_DECREF(tb); - tb = 0; - } - else if (tb != NULL && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - /* Next, replace a missing value with None */ - if (value == NULL) { - value = Py_None; - Py_INCREF(value); - } - #if PY_VERSION_HEX < 0x02050000 - if (!PyClass_Check(type)) - #else - if (!PyType_Check(type)) - #endif - { - /* Raising an instance. The value should be a dummy. */ - if (value != Py_None) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - /* Normalize to raise , */ - Py_DECREF(value); - value = type; - #if PY_VERSION_HEX < 0x02050000 - if (PyInstance_Check(type)) { - type = (PyObject*) ((PyInstanceObject*)type)->in_class; - Py_INCREF(type); - } - else { - type = 0; - PyErr_SetString(PyExc_TypeError, - "raise: exception must be an old-style class or instance"); - goto raise_error; - } - #else - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - #endif - } - - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} - -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; -} -#endif - static CYTHON_INLINE long __Pyx_div_long(long a, long b) { long q = a / b; long r = a - q*b; @@ -20456,6 +20083,143 @@ return module; } +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; + PyThreadState *tstate = PyThreadState_GET(); + + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; + tstate->curexc_type = type; + tstate->curexc_value = value; + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +} + +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { + PyThreadState *tstate = PyThreadState_GET(); + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +} + + +#if PY_MAJOR_VERSION < 3 +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + Py_XINCREF(type); + Py_XINCREF(value); + Py_XINCREF(tb); + /* First, check the traceback argument, replacing None with NULL. */ + if (tb == Py_None) { + Py_DECREF(tb); + tb = 0; + } + else if (tb != NULL && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + /* Next, replace a missing value with None */ + if (value == NULL) { + value = Py_None; + Py_INCREF(value); + } + #if PY_VERSION_HEX < 0x02050000 + if (!PyClass_Check(type)) + #else + if (!PyType_Check(type)) + #endif + { + /* Raising an instance. The value should be a dummy. */ + if (value != Py_None) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + /* Normalize to raise , */ + Py_DECREF(value); + value = type; + #if PY_VERSION_HEX < 0x02050000 + if (PyInstance_Check(type)) { + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } + else { + type = 0; + PyErr_SetString(PyExc_TypeError, + "raise: exception must be an old-style class or instance"); + goto raise_error; + } + #else + type = (PyObject*) Py_TYPE(type); + Py_INCREF(type); + if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto raise_error; + } + #endif + } + + __Pyx_ErrRestore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} + +#else /* Python 3+ */ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + if (tb == Py_None) { + tb = 0; + } else if (tb && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto bad; + } + if (value == Py_None) + value = 0; + + if (PyExceptionInstance_Check(type)) { + if (value) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto bad; + } + value = type; + type = (PyObject*) Py_TYPE(value); + } else if (!PyExceptionClass_Check(type)) { + PyErr_SetString(PyExc_TypeError, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } + + PyErr_SetObject(type, value); + + if (tb) { + PyThreadState *tstate = PyThreadState_GET(); + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); + tstate->curexc_traceback = tb; + Py_XDECREF(tmp_tb); + } + } + +bad: + return; +} +#endif + static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { const unsigned char neg_one = (unsigned char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; @@ -20919,13 +20683,13 @@ if (!result) goto bad; if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, + PyErr_Format(PyExc_TypeError, "%s.%s is not a type object", module_name, class_name); goto bad; } if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), + PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); #if PY_VERSION_HEX < 0x02050000 @@ -20935,7 +20699,7 @@ #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, + PyErr_Format(PyExc_ValueError, "%s.%s has the wrong size, try recompiling", module_name, class_name); goto bad; diff -Nru bzr-2.5.0/bzrlib/dirstate.py bzr-2.6.0~beta1/bzrlib/dirstate.py --- bzr-2.5.0/bzrlib/dirstate.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/dirstate.py 2012-03-15 10:00:24.000000000 +0000 @@ -1292,7 +1292,7 @@ parent_trees.append((parent_id, parent_tree)) parent_tree.lock_read() result.set_parent_trees(parent_trees, []) - result.set_state_from_inventory(tree.inventory) + result.set_state_from_inventory(tree.root_inventory) finally: for revid, parent_tree in parent_trees: parent_tree.unlock() diff -Nru bzr-2.5.0/bzrlib/doc_generate/autodoc_man.py bzr-2.6.0~beta1/bzrlib/doc_generate/autodoc_man.py --- bzr-2.5.0/bzrlib/doc_generate/autodoc_man.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/doc_generate/autodoc_man.py 2012-03-15 10:00:24.000000000 +0000 @@ -57,8 +57,8 @@ def man_escape(string): """Escapes strings for man page compatibility""" result = string.replace("\\","\\\\") - result = result.replace("`","\\`") - result = result.replace("'","\\'") + result = result.replace("`","\\'") + result = result.replace("'","\\*(Aq") result = result.replace("-","\\-") return result @@ -111,6 +111,11 @@ doc = "%s\n" % (cmd.__doc__) doc = bzrlib.help_topics.help_as_plain_text(cmd.help()) + # A dot at the beginning of a line is interpreted as a macro. + # Simply join lines that begin with a dot with the previous + # line to work around this. + doc = doc.replace("\n.", ".") + option_str = "" options = cmd.options() if options: @@ -165,6 +170,9 @@ .\\\" .\\\" Generation time: %(timestamp)s .\\\" + +.ie \\n(.g .ds Aq \\(aq +.el .ds Aq ' """ diff -Nru bzr-2.5.0/bzrlib/doc_generate/builders/__init__.py bzr-2.6.0~beta1/bzrlib/doc_generate/builders/__init__.py --- bzr-2.5.0/bzrlib/doc_generate/builders/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/doc_generate/builders/__init__.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -# Copyright (C) 2010 Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -"""Placeholder to allow sphinx builders imports.""" - -from __future__ import absolute_import - diff -Nru bzr-2.5.0/bzrlib/doc_generate/builders/texinfo.py bzr-2.6.0~beta1/bzrlib/doc_generate/builders/texinfo.py --- bzr-2.5.0/bzrlib/doc_generate/builders/texinfo.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/doc_generate/builders/texinfo.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -# Copyright (C) 2010 Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -"""A sphinx builder producing texinfo output.""" - -from __future__ import absolute_import - -from sphinx import builders -from sphinx.builders import text as _text_builder - -from bzrlib.doc_generate.writers import texinfo as texinfo_writer - -class TexinfoBuilder(_text_builder.TextBuilder): - - name = 'texinfo' - format = 'texinfo' - out_suffix = '.texi' - - def prepare_writing(self, docnames): - self.writer = texinfo_writer.TexinfoWriter(self) - - def get_target_uri(self, docname, typ=None): - # FIXME: Revisit when info file generation is defined (the suffix is - # left here for clarity but the final version may just get rid of - # it). And we probalby will join several files into bigger info files - # anyway. -- vila 20100506 - return docname + '.info' - - -def setup(app): - import pdb; pdb.set_trace() - app.add_builder(TexinfoBuilder) diff -Nru bzr-2.5.0/bzrlib/doc_generate/conf.py bzr-2.6.0~beta1/bzrlib/doc_generate/conf.py --- bzr-2.5.0/bzrlib/doc_generate/conf.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/doc_generate/conf.py 2012-03-15 10:00:24.000000000 +0000 @@ -21,8 +21,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.ifconfig', - 'bzrlib.doc_generate.builders.texinfo'] +extensions = ['sphinx.ext.ifconfig',] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff -Nru bzr-2.5.0/bzrlib/doc_generate/writers/__init__.py bzr-2.6.0~beta1/bzrlib/doc_generate/writers/__init__.py --- bzr-2.5.0/bzrlib/doc_generate/writers/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/doc_generate/writers/__init__.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -# Copyright (C) 2010 Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -"""Placeholder to allow sphinx writer imports.""" - -from __future__ import absolute_import - diff -Nru bzr-2.5.0/bzrlib/doc_generate/writers/texinfo.py bzr-2.6.0~beta1/bzrlib/doc_generate/writers/texinfo.py --- bzr-2.5.0/bzrlib/doc_generate/writers/texinfo.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/doc_generate/writers/texinfo.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,534 +0,0 @@ -# Copyright (C) 2010 Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -"""A sphinx/docutil writer producing texinfo output.""" - -from __future__ import absolute_import - -from docutils import ( - nodes, - writers, - ) - -DEBUG = 0 - -class TexinfoWriter(writers.Writer): - - supported = ('texinfo',) - settings_spec = ('No options here.', '', ()) - settings_defaults = {} - - output = None - - def __init__(self, builder): - writers.Writer.__init__(self) - self.builder = builder - - def translate(self): - visitor = TexinfoTranslator(self.document, self.builder) - self.document.walkabout(visitor) - self.output = visitor.body - - -class TexinfoTranslator(nodes.NodeVisitor): - - section_names = ['chapter', 'section', 'subsection', 'subsubsection'] - """texinfo section names differ from the sphinx ones. - - Since this can be confusing, the correspondences are shown below - (shpinx -> texinfo): - part -> chapter - chapter -> section - section -> subsection - subsection -> subsubsection - - Additionally, sphinx defines subsubsections and paragraphs which are - handled as @heading (unnumbered). - """ - - def __init__(self, document, builder): - nodes.NodeVisitor.__init__(self, document) - self.builder = builder - # toctree uses some nodes for different purposes (namely: - # compact_paragraph, bullet_list) that needs to know when they are - # processing a toctree. - self.in_toctree = False - # sections can be embedded and produce different directives depending - # on the depth. - self.section_level = -1 - # By default paragraghs are separated by newlines, but there are some - # exceptions that set it to '' for some subtrees instead - self.paragraph_sep = '\n' - - # The whole document - - def visit_document(self, node): - if DEBUG: - import sys - sys.stdout.write(node.pformat().encode('utf8')) - set_item_list_collector(node, 'text') - - def depart_document(self, node): - # FIXME: info requires a Top node for each info file, but unless we - # chose a global layout to divide the overall documentation into a set - # of info files, there is no criteria to decide for a title. - top_cmd = '''\ -This file has been converted using a beta rst->texinfo converter. -Most of the info links are currently bogus, don't report bugs about them, -this is currently worked on. -@node Top -@top Placeholder -''' - self.body = top_cmd + ''.join(node['text']) - - # Layout - - def visit_section(self, node): - self.section_level += 1 - set_item_list_collector(node, 'text') - - def depart_section(self, node): - title = node['title'] - ids = node.get('ids', []) - try: - section_name = self.section_names[self.section_level] - except IndexError: - # Just use @heading, it's not numbered anyway - section_name = 'heading' - if ids: - # There shouldn't be different ids for a section, so until we - # encounter bugs, just take the first one. - node_cmd = '@node %s\n' % (ids[0],) - else: - node_cmd = '' - section_cmd = '@%s %s\n' % (section_name, title) - text = ''.join(node['text']) - node.parent.collect_text(node_cmd + section_cmd + text) - self.section_level -= 1 - - def visit_topic(self, node): - pass - - def depart_topic(self, node): - pass - - def visit_compound(self, node): - # compound is new in sphinx >= 1.0 and just add a optional layer so we - # relay the text to the parent when it occurs. This may requires a - # cleaner approach once we settle on which sphinx versions we want to - # support. - set_item_list_collector(node, 'text') - - def depart_compound(self, node): - text = ''.join(node['text']) - node.parent.collect_text(text) - - def visit_paragraph(self, node): - set_item_list_collector(node, 'text') - - def depart_paragraph(self, node): - # End the paragraph with a new line (or '' depending on the parent) and - # leave a blank line after it. - text = ''.join(node['text']) + self.paragraph_sep * 2 - node.parent.collect_text(text) - - def visit_compact_paragraph(self, node): - set_item_list_collector(node, 'text') - if node.has_key('toctree'): - self.in_toctree = True - elif self.in_toctree: - set_item_collector(node, 'reference') - - def depart_compact_paragraph(self, node): - # FIXME: Using a different visitor specific to toctree may be a better - # design and makes code clearer. -- vila 20100708 - if node.has_key('toctree'): - if node['text']: - node.parent.collect_text('@menu\n') - node.parent.collect_text(''.join(node['text'])) - node.parent.collect_text('@end menu\n') - self.in_toctree = False - elif self.in_toctree: - # * FIRST-ENTRY-NAME:(FILENAME)NODENAME. DESCRIPTION - # XXX: the file name should probably be adjusted to the targeted - # info file name - node_name, file_name, entry_name = node['reference'] - if not node_name: - node_name = entry_name - description = '' # We can't specify a description in rest AFAICS - # XXX: What if :maxdepth: is not 1 ? - text = '* %s: (%s)%s. %s\n' % (entry_name, file_name, - node_name, description) - node.parent.collect_text(text) - else: - # End the paragraph with a new line (or '' depending on the parent) - # and leave a blank line after it. - text = ''.join(node['text']) + self.paragraph_sep * 2 - node.parent.collect_text(text) - - def visit_literal_block(self, node): - set_item_collector(node, 'text') - - def depart_literal_block(self, node): - text = '@samp{%s}' % ''.join(node['text']) + self.paragraph_sep * 2 - node.parent.collect_text(text) - - def visit_block_quote(self, node): - set_item_list_collector(node, 'text') - - def depart_block_quote(self, node): - node.parent.collect_text('@example\n') - node.parent.collect_text(''.join(node['text'])) - node.parent.collect_text('@end example\n\n') - - def depart_warning(self, node): - pass - - def visit_warning(self, node): - raise nodes.SkipNode # Not implemented yet - - def visit_note(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_note(self, node): - pass - - def visit_footnote(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_footnote(self, node): - pass - - def visit_comment(self, node): - raise nodes.SkipNode # Not implemented yet - - # Attributes - - def visit_title(self, node): - set_item_collector(node, 'text') - - def depart_title(self, node): - node.parent['title'] = node['text'] - - def visit_label(self, node): - raise nodes.SkipNode # Not implemented yet - - def visit_substitution_definition(self, node): - raise nodes.SkipNode # Not implemented yet - - # Plain text - - def visit_Text(self, node): - pass - - def depart_Text(self, node): - text = node.astext() - if '@' in text: - text = text.replace('@', '@@') - if '{' in text: - text = text.replace('{', '@{') - if '}' in text: - text = text.replace('}', '@}') - node.parent.collect_text(text) - - - # Styled text - - def visit_emphasis(self, node): - set_item_collector(node, 'text') - - def depart_emphasis(self, node): - text = '@emph{%s}' % node['text'] - node.parent.collect_text(text) - - def visit_strong(self, node): - set_item_collector(node, 'text') - - def depart_strong(self, node): - text = '@strong{%s}' % node['text'] - node.parent.collect_text(text) - - def visit_literal(self, node): - set_item_collector(node, 'text') - - def depart_literal(self, node): - text = '@code{%s}' % node['text'] - node.parent.collect_text(text) - - # Lists - - def _decorate_list(self, item_list, collect, item_fmt='%s', - head=None, foot=None): - if head is not None: - collect(head) - for item in item_list: - collect(item_fmt % item) - if foot is not None: - collect(foot) - - def visit_bullet_list(self, node): - set_item_list_collector(node, 'list_item') - - def depart_bullet_list(self, node): - l = node['list_item'] - if self.in_toctree: - self._decorate_list(node['list_item'], node.parent.collect_text) - else: - self._decorate_list(node['list_item'], node.parent.collect_text, - '@item\n%s', - # FIXME: Should respect the 'bullet' attribute - '@itemize @bullet\n', '@end itemize\n') - - def visit_enumerated_list(self, node): - set_item_list_collector(node, 'list_item') - - def depart_enumerated_list(self, node): - self._decorate_list(node['list_item'], node.parent.collect_text, - '@item\n%s', - '@enumerate\n', '@end enumerate\n') - - def visit_definition_list(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_definition_list(self, node): - raise nodes.SkipNode # Not implemented yet - - def visit_definition_list_item(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_definition_list_item(self, node): - pass - - def visit_term(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_term(self, node): - pass - - def visit_definition(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_definition(self, node): - pass - - def visit_field_list(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_field_list(self, node): - pass - - def visit_field(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_field(self, node): - pass - - def visit_field_name(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_field_name(self, node): - pass - - def visit_field_body(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_field_body(self, node): - pass - - def visit_list_item(self, node): - set_item_list_collector(node, 'text') - - def depart_list_item(self, node): - text = ''.join(node['text']) - node.parent.collect_list_item(text) - - def visit_option_list(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_option_list(self, node): - pass - - def visit_option_list_item(self, node): - pass - - def depart_option_list_item(self, node): - pass - - def visit_option_group(self, node): - pass - - def depart_option_group(self, node): - pass - - def visit_option(self, node): - pass - - def depart_option(self, node): - pass - - def visit_option_string(self, node): - pass - def depart_option_string(self, node): - pass - - def visit_option_argument(self, node): - pass - - def depart_option_argument(self, node): - pass - - def visit_description(self, node): - pass - def depart_description(self, node): - pass - - # Tables - def visit_table(self, node): - set_item_collector(node, 'table') - - def depart_table(self, node): - node.parent.collect_text(node['table']) - - def visit_tgroup(self, node): - set_item_list_collector(node, 'colspec') - set_item_collector(node, 'head_entries') - set_item_collector(node, 'body_rows') - - def depart_tgroup(self, node): - header = [] - # The '@multitable {xxx}{xxx}' line - self._decorate_list(node['colspec'], header.append, - '{%s}', '@multitable ', '\n') - # The '@headitem xxx @tab yyy...' line - head_entries = node['head_entries'] - if head_entries is not None: - # Not all tables define titles for the columns... rest parser bug ? - # FIXME: need a test - self._decorate_list(head_entries[1:], header.append, - ' @tab %s', - '@headitem %s' % head_entries[0], '\n') - header = ''.join(header) - # The '@item xxx\n @tab yyy\n ...' lines - body_rows = node['body_rows'] - rows = [] - for r in body_rows: - self._decorate_list(r[1:], rows.append, - '@tab %s\n', '@item %s\n' % r[0]) - footer = '@end multitable\n' - node.parent.collect_table(header + ''.join(rows) + footer) - - def visit_colspec(self, node): - pass - - def depart_colspec(self, node): - node.parent.collect_colspec('x' * node['colwidth']) - - def visit_thead(self, node): - set_item_collector(node, 'row') - - def depart_thead(self, node): - node.parent.collect_head_entries(node['row']) - - def visit_tbody(self, node): - set_item_list_collector(node, 'row') - - def depart_tbody(self, node): - node.parent.collect_body_rows(node['row']) - - def visit_row(self, node): - set_item_list_collector(node, 'entry') - - def depart_row(self, node): - node.parent.collect_row(node['entry']) - - def visit_entry(self, node): - set_item_list_collector(node, 'text') - node['par_sep_orig'] = self.paragraph_sep - self.paragraph_sep = '' - - def depart_entry(self, node): - node.parent.collect_entry(''.join(node['text'])) - self.paragraph_sep = node['par_sep_orig'] - - # References - - def visit_reference(self, node): - for c in node.children: - if getattr(c, 'parent', None) is None: - # Bug sphinx - node.setup_child(c) - set_item_collector(node, 'text') - - def depart_reference(self, node): - anchorname = node.get('anchorname', None) - refuri = node.get('refuri', None) - refid = node.get('refid', None) - text = ''.join(node['text']) - collect = getattr(node.parent, 'collect_reference', None) - if collect is not None: - if not self.in_toctree: - raise AssertionError('collect_reference is specific to toctree') - if anchorname is None: - anchorname = '' - if refuri is None: - refuri = '' - collect((anchorname, refuri, text)) - elif refuri is not None: - node.parent.collect_text('@uref{%s,%s}' % (refuri, text)) - elif refid is not None: - # Info format requires that a reference is followed by some - # punctuation char ('.', ','. ')', etc). Rest is more liberal. To - # accommodate, we use pxref inside parenthesis. - node.parent.collect_text('%s (@pxref{%s})' % (text, refid)) - - def visit_footnote_reference(self, node): - raise nodes.SkipNode # Not implemented yet - - def visit_citation_reference(self, node): - raise nodes.SkipNode # Not implemented yet - - def visit_title_reference(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_title_reference(self, node): - pass - - def visit_target(self, node): - raise nodes.SkipNode # Not implemented yet - - def depart_target(self, node): - pass - - def visit_image(self, node): - raise nodes.SkipNode # Not implemented yet - -# Helpers to collect data in parent node - -def set_item_collector(node, name): - node[name] = None - def set_item(item): - node[name] = item - setattr(node, 'collect_' + name, set_item) - - -def set_item_list_collector(node, name, sep=''): - node[name] = [] - node[name + '_sep'] = sep - def append_item(item): - node[name].append(item) - setattr(node, 'collect_' + name, append_item) - - diff -Nru bzr-2.5.0/bzrlib/errors.py bzr-2.6.0~beta1/bzrlib/errors.py --- bzr-2.5.0/bzrlib/errors.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/errors.py 2012-03-15 10:00:24.000000000 +0000 @@ -710,6 +710,15 @@ _fmt = 'Already a branch: "%(path)s".' +class InvalidBranchName(PathError): + + _fmt = "Invalid branch name: %(name)s" + + def __init__(self, name): + BzrError.__init__(self) + self.name = name + + class ParentBranchExists(AlreadyBranchError): _fmt = 'Parent branch already exists: "%(path)s".' @@ -2768,14 +2777,6 @@ _fmt = "No mail-to address (--mail-to) or output (-o) specified." -class UnknownMailClient(BzrError): - - _fmt = "Unknown mail client: %(mail_client)s" - - def __init__(self, mail_client): - BzrError.__init__(self, mail_client=mail_client) - - class MailClientNotFound(BzrError): _fmt = "Unable to find mail client with the following names:"\ diff -Nru bzr-2.5.0/bzrlib/fetch.py bzr-2.6.0~beta1/bzrlib/fetch.py --- bzr-2.5.0/bzrlib/fetch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/fetch.py 2012-03-15 10:00:24.000000000 +0000 @@ -203,16 +203,16 @@ revs = list(revs) while revs: for tree in self.source.revision_trees(revs[:100]): - if tree.inventory.revision_id is None: - tree.inventory.revision_id = tree.get_revision_id() + if tree.root_inventory.revision_id is None: + tree.root_inventory.revision_id = tree.get_revision_id() yield tree revs = revs[100:] def _find_root_ids(self, revs, parent_map, graph): revision_root = {} for tree in self.iter_rev_trees(revs): - revision_id = tree.inventory.root.revision root_id = tree.get_root_id() + revision_id = tree.get_file_revision(root_id, u"") revision_root[revision_id] = root_id # Find out which parents we don't already know root ids for parents = set() diff -Nru bzr-2.5.0/bzrlib/foreign.py bzr-2.6.0~beta1/bzrlib/foreign.py --- bzr-2.5.0/bzrlib/foreign.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/foreign.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2011 Canonical Ltd +# Copyright (C) 2008-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -323,6 +323,7 @@ source_branch, target_branch)) # We successfully created the target, remember it if source_branch.get_push_location() is None or remember: + # FIXME: Should be done only if we succeed ? -- vila 2012-01-18 source_branch.set_push_location(target_branch.base) if not no_rebase: old_last_revid = source_branch.last_revision() diff -Nru bzr-2.5.0/bzrlib/gpg.py bzr-2.6.0~beta1/bzrlib/gpg.py --- bzr-2.5.0/bzrlib/gpg.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/gpg.py 2012-03-15 10:00:24.000000000 +0000 @@ -40,6 +40,11 @@ ) """) +from bzrlib.symbol_versioning import ( + deprecated_in, + deprecated_method, + ) + #verification results SIGNATURE_VALID = 0 SIGNATURE_KEY_MISSING = 1 @@ -48,6 +53,45 @@ SIGNATURE_EXPIRED = 4 +def bulk_verify_signatures(repository, revids, strategy, + process_events_callback=None): + """Do verifications on a set of revisions + + :param repository: repository object + :param revids: list of revision ids to verify + :param strategy: GPG strategy to use + :param process_events_callback: method to call for GUI frontends that + want to keep their UI refreshed + + :return: count dictionary of results of each type, + result list for each revision, + boolean True if all results are verified successfully + """ + count = {SIGNATURE_VALID: 0, + SIGNATURE_KEY_MISSING: 0, + SIGNATURE_NOT_VALID: 0, + SIGNATURE_NOT_SIGNED: 0, + SIGNATURE_EXPIRED: 0} + result = [] + all_verifiable = True + total = len(revids) + pb = ui.ui_factory.nested_progress_bar() + try: + for i, (rev_id, verification_result, uid) in enumerate( + repository.verify_revision_signatures( + revids, strategy)): + pb.update("verifying signatures", i, total) + result.append([rev_id, verification_result, uid]) + count[verification_result] += 1 + if verification_result != SIGNATURE_VALID: + all_verifiable = False + if process_events_callback is not None: + process_events_callback() + finally: + pb.finished() + return (count, result, all_verifiable) + + class DisabledGPGStrategy(object): """A GPG Strategy that makes everything fail.""" @@ -98,50 +142,29 @@ else: self.acceptable_keys.append(pattern) + @deprecated_method(deprecated_in((2, 6, 0))) def do_verifications(self, revisions, repository): - count = {SIGNATURE_VALID: 0, - SIGNATURE_KEY_MISSING: 0, - SIGNATURE_NOT_VALID: 0, - SIGNATURE_NOT_SIGNED: 0, - SIGNATURE_EXPIRED: 0} - result = [] - all_verifiable = True - for rev_id in revisions: - verification_result, uid =\ - repository.verify_revision_signature(rev_id,self) - result.append([rev_id, verification_result, uid]) - count[verification_result] += 1 - if verification_result != SIGNATURE_VALID: - all_verifiable = False - return (count, result, all_verifiable) + return bulk_verify_signatures(repository, revisions, self) + @deprecated_method(deprecated_in((2, 6, 0))) def valid_commits_message(self, count): - return gettext(u"{0} commits with valid signatures").format( - count[SIGNATURE_VALID]) + return valid_commits_message(count) + @deprecated_method(deprecated_in((2, 6, 0))) def unknown_key_message(self, count): - return ngettext(u"{0} commit with unknown key", - u"{0} commits with unknown keys", - count[SIGNATURE_KEY_MISSING]).format( - count[SIGNATURE_KEY_MISSING]) + return unknown_key_message(count) + @deprecated_method(deprecated_in((2, 6, 0))) def commit_not_valid_message(self, count): - return ngettext(u"{0} commit not valid", - u"{0} commits not valid", - count[SIGNATURE_NOT_VALID]).format( - count[SIGNATURE_NOT_VALID]) + return commit_not_valid_message(count) + @deprecated_method(deprecated_in((2, 6, 0))) def commit_not_signed_message(self, count): - return ngettext(u"{0} commit not signed", - u"{0} commits not signed", - count[SIGNATURE_NOT_SIGNED]).format( - count[SIGNATURE_NOT_SIGNED]) + return commit_not_signed_message(count) + @deprecated_method(deprecated_in((2, 6, 0))) def expired_commit_message(self, count): - return ngettext(u"{0} commit with key now expired", - u"{0} commits with key now expired", - count[SIGNATURE_EXPIRED]).format( - count[SIGNATURE_EXPIRED]) + return expired_commit_message(count) def _set_gpg_tty(): @@ -190,7 +213,7 @@ # use the user email address key = config.extract_email_address(self._config_stack.get('email')) return [self._config_stack.get('gpg_signing_command'), '--clearsign', - '-u', key] + '-u', key, '--no-tty'] def sign(self, content): if isinstance(content, unicode): @@ -230,10 +253,10 @@ def verify(self, content, testament): """Check content has a valid signature. - + :param content: the commit signature :param testament: the valid testament string for the commit - + :return: SIGNATURE_VALID or a failed SIGNATURE_ value, key uid if valid """ try: @@ -308,7 +331,7 @@ def set_acceptable_keys(self, command_line_input): """Set the acceptable keys for verifying with this GPGStrategy. - + :param command_line_input: comma separated list of patterns from command line :return: nothing @@ -343,147 +366,192 @@ "No GnuPG key results for pattern: {0}" ).format(pattern)) + @deprecated_method(deprecated_in((2, 6, 0))) def do_verifications(self, revisions, repository, process_events_callback=None): """do verifications on a set of revisions - + :param revisions: list of revision ids to verify :param repository: repository object :param process_events_callback: method to call for GUI frontends that - want to keep their UI refreshed - + want to keep their UI refreshed + :return: count dictionary of results of each type, result list for each revision, boolean True if all results are verified successfully """ - count = {SIGNATURE_VALID: 0, - SIGNATURE_KEY_MISSING: 0, - SIGNATURE_NOT_VALID: 0, - SIGNATURE_NOT_SIGNED: 0, - SIGNATURE_EXPIRED: 0} - result = [] - all_verifiable = True - for rev_id in revisions: - verification_result, uid =\ - repository.verify_revision_signature(rev_id, self) - result.append([rev_id, verification_result, uid]) - count[verification_result] += 1 - if verification_result != SIGNATURE_VALID: - all_verifiable = False - if process_events_callback is not None: - process_events_callback() - return (count, result, all_verifiable) + return bulk_verify_signatures(repository, revisions, self, + process_events_callback) + @deprecated_method(deprecated_in((2, 6, 0))) def verbose_valid_message(self, result): """takes a verify result and returns list of signed commits strings""" - signers = {} - for rev_id, validity, uid in result: - if validity == SIGNATURE_VALID: - signers.setdefault(uid, 0) - signers[uid] += 1 - result = [] - for uid, number in signers.items(): - result.append( ngettext(u"{0} signed {1} commit", - u"{0} signed {1} commits", - number).format(uid, number) ) - return result - + return verbose_valid_message(result) + @deprecated_method(deprecated_in((2, 6, 0))) def verbose_not_valid_message(self, result, repo): """takes a verify result and returns list of not valid commit info""" - signers = {} - for rev_id, validity, empty in result: - if validity == SIGNATURE_NOT_VALID: - revision = repo.get_revision(rev_id) - authors = ', '.join(revision.get_apparent_authors()) - signers.setdefault(authors, 0) - signers[authors] += 1 - result = [] - for authors, number in signers.items(): - result.append( ngettext(u"{0} commit by author {1}", - u"{0} commits by author {1}", - number).format(number, authors) ) - return result + return verbose_not_valid_message(result, repo) + @deprecated_method(deprecated_in((2, 6, 0))) def verbose_not_signed_message(self, result, repo): """takes a verify result and returns list of not signed commit info""" - signers = {} - for rev_id, validity, empty in result: - if validity == SIGNATURE_NOT_SIGNED: - revision = repo.get_revision(rev_id) - authors = ', '.join(revision.get_apparent_authors()) - signers.setdefault(authors, 0) - signers[authors] += 1 - result = [] - for authors, number in signers.items(): - result.append( ngettext(u"{0} commit by author {1}", - u"{0} commits by author {1}", - number).format(number, authors) ) - return result + return verbose_not_valid_message(result, repo) + @deprecated_method(deprecated_in((2, 6, 0))) def verbose_missing_key_message(self, result): """takes a verify result and returns list of missing key info""" - signers = {} - for rev_id, validity, fingerprint in result: - if validity == SIGNATURE_KEY_MISSING: - signers.setdefault(fingerprint, 0) - signers[fingerprint] += 1 - result = [] - for fingerprint, number in signers.items(): - result.append( ngettext(u"Unknown key {0} signed {1} commit", - u"Unknown key {0} signed {1} commits", - number).format(fingerprint, number) ) - return result + return verbose_missing_key_message(result) + @deprecated_method(deprecated_in((2, 6, 0))) def verbose_expired_key_message(self, result, repo): """takes a verify result and returns list of expired key info""" - signers = {} - fingerprint_to_authors = {} - for rev_id, validity, fingerprint in result: - if validity == SIGNATURE_EXPIRED: - revision = repo.get_revision(rev_id) - authors = ', '.join(revision.get_apparent_authors()) - signers.setdefault(fingerprint, 0) - signers[fingerprint] += 1 - fingerprint_to_authors[fingerprint] = authors - result = [] - for fingerprint, number in signers.items(): - result.append( - ngettext(u"{0} commit by author {1} with key {2} now expired", - u"{0} commits by author {1} with key {2} now expired", - number).format( - number, fingerprint_to_authors[fingerprint], fingerprint) ) - return result + return verbose_expired_key_message(result, repo) + @deprecated_method(deprecated_in((2, 6, 0))) def valid_commits_message(self, count): """returns message for number of commits""" - return gettext(u"{0} commits with valid signatures").format( - count[SIGNATURE_VALID]) + return valid_commits_message(count) + @deprecated_method(deprecated_in((2, 6, 0))) def unknown_key_message(self, count): """returns message for number of commits""" - return ngettext(u"{0} commit with unknown key", - u"{0} commits with unknown keys", - count[SIGNATURE_KEY_MISSING]).format( - count[SIGNATURE_KEY_MISSING]) + return unknown_key_message(count) + @deprecated_method(deprecated_in((2, 6, 0))) def commit_not_valid_message(self, count): """returns message for number of commits""" - return ngettext(u"{0} commit not valid", - u"{0} commits not valid", - count[SIGNATURE_NOT_VALID]).format( - count[SIGNATURE_NOT_VALID]) + return commit_not_valid_message(count) + @deprecated_method(deprecated_in((2, 6, 0))) def commit_not_signed_message(self, count): """returns message for number of commits""" - return ngettext(u"{0} commit not signed", - u"{0} commits not signed", - count[SIGNATURE_NOT_SIGNED]).format( - count[SIGNATURE_NOT_SIGNED]) + return commit_not_signed_message(count) + @deprecated_method(deprecated_in((2, 6, 0))) def expired_commit_message(self, count): """returns message for number of commits""" - return ngettext(u"{0} commit with key now expired", - u"{0} commits with key now expired", - count[SIGNATURE_EXPIRED]).format( - count[SIGNATURE_EXPIRED]) + return expired_commit_message(count) + + +def valid_commits_message(count): + """returns message for number of commits""" + return gettext(u"{0} commits with valid signatures").format( + count[SIGNATURE_VALID]) + + +def unknown_key_message(count): + """returns message for number of commits""" + return ngettext(u"{0} commit with unknown key", + u"{0} commits with unknown keys", + count[SIGNATURE_KEY_MISSING]).format( + count[SIGNATURE_KEY_MISSING]) + + +def commit_not_valid_message(count): + """returns message for number of commits""" + return ngettext(u"{0} commit not valid", + u"{0} commits not valid", + count[SIGNATURE_NOT_VALID]).format( + count[SIGNATURE_NOT_VALID]) + + +def commit_not_signed_message(count): + """returns message for number of commits""" + return ngettext(u"{0} commit not signed", + u"{0} commits not signed", + count[SIGNATURE_NOT_SIGNED]).format( + count[SIGNATURE_NOT_SIGNED]) + + +def expired_commit_message(count): + """returns message for number of commits""" + return ngettext(u"{0} commit with key now expired", + u"{0} commits with key now expired", + count[SIGNATURE_EXPIRED]).format( + count[SIGNATURE_EXPIRED]) + + +def verbose_expired_key_message(result, repo): + """takes a verify result and returns list of expired key info""" + signers = {} + fingerprint_to_authors = {} + for rev_id, validity, fingerprint in result: + if validity == SIGNATURE_EXPIRED: + revision = repo.get_revision(rev_id) + authors = ', '.join(revision.get_apparent_authors()) + signers.setdefault(fingerprint, 0) + signers[fingerprint] += 1 + fingerprint_to_authors[fingerprint] = authors + result = [] + for fingerprint, number in signers.items(): + result.append( + ngettext(u"{0} commit by author {1} with key {2} now expired", + u"{0} commits by author {1} with key {2} now expired", + number).format( + number, fingerprint_to_authors[fingerprint], fingerprint)) + return result + + +def verbose_valid_message(result): + """takes a verify result and returns list of signed commits strings""" + signers = {} + for rev_id, validity, uid in result: + if validity == SIGNATURE_VALID: + signers.setdefault(uid, 0) + signers[uid] += 1 + result = [] + for uid, number in signers.items(): + result.append(ngettext(u"{0} signed {1} commit", + u"{0} signed {1} commits", + number).format(uid, number)) + return result + + +def verbose_not_valid_message(result, repo): + """takes a verify result and returns list of not valid commit info""" + signers = {} + for rev_id, validity, empty in result: + if validity == SIGNATURE_NOT_VALID: + revision = repo.get_revision(rev_id) + authors = ', '.join(revision.get_apparent_authors()) + signers.setdefault(authors, 0) + signers[authors] += 1 + result = [] + for authors, number in signers.items(): + result.append(ngettext(u"{0} commit by author {1}", + u"{0} commits by author {1}", + number).format(number, authors)) + return result + + +def verbose_not_signed_message(result, repo): + """takes a verify result and returns list of not signed commit info""" + signers = {} + for rev_id, validity, empty in result: + if validity == SIGNATURE_NOT_SIGNED: + revision = repo.get_revision(rev_id) + authors = ', '.join(revision.get_apparent_authors()) + signers.setdefault(authors, 0) + signers[authors] += 1 + result = [] + for authors, number in signers.items(): + result.append(ngettext(u"{0} commit by author {1}", + u"{0} commits by author {1}", + number).format(number, authors)) + return result + + +def verbose_missing_key_message(result): + """takes a verify result and returns list of missing key info""" + signers = {} + for rev_id, validity, fingerprint in result: + if validity == SIGNATURE_KEY_MISSING: + signers.setdefault(fingerprint, 0) + signers[fingerprint] += 1 + result = [] + for fingerprint, number in signers.items(): + result.append(ngettext(u"Unknown key {0} signed {1} commit", + u"Unknown key {0} signed {1} commits", + number).format(fingerprint, number)) + return result diff -Nru bzr-2.5.0/bzrlib/_groupcompress_pyx.c bzr-2.6.0~beta1/bzrlib/_groupcompress_pyx.c --- bzr-2.5.0/bzrlib/_groupcompress_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_groupcompress_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,4 +1,4 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:25 2012 */ +/* Generated by Cython 0.13 on Thu May 26 17:26:10 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -126,20 +126,15 @@ #define PyBytes_Repr PyString_Repr #define PyBytes_Concat PyString_Concat #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif + #ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) +# define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - #if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) @@ -156,7 +151,7 @@ #endif #if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject + #define PyBoolObject PyLongObject #endif @@ -168,25 +163,6 @@ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif @@ -223,11 +199,6 @@ #include "python-compat.h" #include "delta.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - - /* inline attribute */ #ifndef CYTHON_INLINE #if defined(__GNUC__) @@ -237,7 +208,7 @@ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else - #define CYTHON_INLINE + #define CYTHON_INLINE #endif #endif @@ -245,14 +216,14 @@ #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) +# define CYTHON_UNUSED __attribute__ ((__unused__)) # else -# define CYTHON_UNUSED +# define CYTHON_UNUSED # endif #endif @@ -277,7 +248,7 @@ #ifdef __GNUC__ /* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) +#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ @@ -305,7 +276,7 @@ /* Type declarations */ -/* "bzrlib/_groupcompress_pyx.pyx":130 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":130 * * * cdef class DeltaIndex: # <<<<<<<<<<<<<< @@ -379,19 +350,14 @@ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ +static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ + static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (PyList_Append(L, x) < 0) return NULL; @@ -408,6 +374,11 @@ } } +static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + #ifndef __PYX_FORCE_INIT_THREADS #if PY_VERSION_HEX < 0x02040200 #define __PYX_FORCE_INIT_THREADS 1 @@ -463,7 +434,7 @@ static unsigned char *__pyx_f_6bzrlib_18_groupcompress_pyx__decode_copy_instruction(unsigned char *, unsigned char, unsigned int *, unsigned int *); /*proto*/ static PyObject *__pyx_f_6bzrlib_18_groupcompress_pyx__apply_delta(char *, Py_ssize_t, char *, Py_ssize_t); /*proto*/ #define __Pyx_MODULE_NAME "bzrlib._groupcompress_pyx" -static int __pyx_module_is_main_bzrlib___groupcompress_pyx = 0; +int __pyx_module_is_main_bzrlib___groupcompress_pyx = 0; /* Implementation of bzrlib._groupcompress_pyx */ static PyObject *__pyx_builtin_MemoryError; @@ -475,41 +446,48 @@ static char __pyx_k_1[] = "Failed to allocate %d bytes of memory"; static char __pyx_k_2[] = "Failed to reallocate to %d bytes of memory"; static char __pyx_k_3[] = "Delta function failed to allocate memory"; -static char __pyx_k_5[] = "Delta function requires delta_index param"; -static char __pyx_k_7[] = "Delta function given empty source_info param"; -static char __pyx_k_9[] = "Delta function given invalid source_info param"; -static char __pyx_k_11[] = "Delta function given empty buffer params"; -static char __pyx_k_13[] = "Unrecognised delta result code: %d"; -static char __pyx_k_14[] = "content must be a string"; -static char __pyx_k_16[] = "content must be at least 16 bytes long"; -static char __pyx_k_18[] = "%s(%d, %d)"; -static char __pyx_k_19[] = "delta is not a str"; -static char __pyx_k_21[] = "source is not a str"; -static char __pyx_k_23[] = "_populate_first_index"; -static char __pyx_k_24[] = "_populate_first_index should only be called when we have a single source and no index yet"; -static char __pyx_k_26[] = "if we move self._source_infos, then we need to change all of the index pointers as well."; -static char __pyx_k_28[] = "target is not a str"; -static char __pyx_k_32[] = "delta_size %d smaller than min delta size %d"; -static char __pyx_k_33[] = "Something wrong with: cp_off = %s, cp_size = %s source_size = %s, size = %s"; -static char __pyx_k_34[] = "Got delta opcode: 0, not supported"; -static char __pyx_k_36[] = "Insert instruction longer than remaining bytes: %d > %d"; -static char __pyx_k_37[] = "Did not extract the number of bytes we expected we were left with %d bytes in \"size\", and top - data = %d"; -static char __pyx_k_38[] = "Number of bytes extracted did not match the size encoded in the delta header."; -static char __pyx_k_41[] = "delta starts after source"; -static char __pyx_k_43[] = "delta ends after source"; -static char __pyx_k_45[] = "delta starts after it ends"; -static char __pyx_k_47[] = "encode_base128_int overflowed the buffer"; -static char __pyx_k_49[] = "bytes is not a string"; -static char __pyx_k_51[] = "Data not properly formatted, we ran out of bytes before 0x80 stopped being set."; -static char __pyx_k_53[] = "Compiled extensions for doing compression."; -static char __pyx_k_54[] = "bzrlib._groupcompress_pyx"; -static char __pyx_k_55[] = "apply_delta_to_source"; +static char __pyx_k_4[] = "Delta function requires delta_index param"; +static char __pyx_k_5[] = "Delta function given empty source_info param"; +static char __pyx_k_6[] = "Delta function given invalid source_info param"; +static char __pyx_k_7[] = "Delta function given empty buffer params"; +static char __pyx_k_8[] = "Unrecognised delta result code: %d"; +static char __pyx_k_9[] = "content must be a string"; +static char __pyx_k_10[] = "content must be at least 16 bytes long"; +static char __pyx_k_11[] = "%s(%d, %d)"; +static char __pyx_k_12[] = "delta is not a str"; +static char __pyx_k_13[] = "source is not a str"; +static char __pyx_k_14[] = "_populate_first_index"; +static char __pyx_k_15[] = "_populate_first_index should only be called when we have a single source and no index yet"; +static char __pyx_k_16[] = "if we move self._source_infos, then we need to change all of the index pointers as well."; +static char __pyx_k_17[] = "target is not a str"; +static char __pyx_k_18[] = "delta_size %d smaller than min delta size %d"; +static char __pyx_k_19[] = "Something wrong with: cp_off = %s, cp_size = %s source_size = %s, size = %s"; +static char __pyx_k_20[] = "Got delta opcode: 0, not supported"; +static char __pyx_k_21[] = "Insert instruction longer than remaining bytes: %d > %d"; +static char __pyx_k_22[] = "Did not extract the number of bytes we expected we were left with %d bytes in \"size\", and top - data = %d"; +static char __pyx_k_23[] = "Number of bytes extracted did not match the size encoded in the delta header."; +static char __pyx_k_24[] = "delta starts after source"; +static char __pyx_k_25[] = "delta ends after source"; +static char __pyx_k_26[] = "delta starts after it ends"; +static char __pyx_k_27[] = "encode_base128_int overflowed the buffer"; +static char __pyx_k_28[] = "bytes is not a string"; +static char __pyx_k_29[] = "Data not properly formatted, we ran out of bytes before 0x80 stopped being set."; +static char __pyx_k_30[] = "Compiled extensions for doing compression."; +static char __pyx_k_31[] = "DeltaIndex._dump_index (line 185)"; +static char __pyx_k_32[] = "DeltaIndex.add_delta_source (line 223)"; +static char __pyx_k_33[] = "DeltaIndex.add_source (line 260)"; +static char __pyx_k_34[] = "DeltaIndex.make_delta (line 333)"; +static char __pyx_k_35[] = "make_delta (line 370)"; +static char __pyx_k_36[] = "apply_delta (line 376)"; +static char __pyx_k_37[] = "apply_delta_to_source (line 521)"; +static char __pyx_k_38[] = "apply_delta_to_source"; +static char __pyx_k_39[] = "encode_base128_int (line 549)"; +static char __pyx_k_40[] = "decode_base128_int (line 569)"; static char __pyx_k__buf[] = "buf"; static char __pyx_k__map[] = "map"; static char __pyx_k__size[] = "size"; static char __pyx_k__delta[] = "delta"; static char __pyx_k___index[] = "_index"; -static char __pyx_k__append[] = "append"; static char __pyx_k__source[] = "source"; static char __pyx_k____main__[] = "__main__"; static char __pyx_k____name__[] = "__name__"; @@ -518,12 +496,13 @@ static char __pyx_k__TypeError[] = "TypeError"; static char __pyx_k____class__[] = "__class__"; static char __pyx_k__delta_end[] = "delta_end"; +static char __pyx_k__DeltaIndex[] = "DeltaIndex"; static char __pyx_k__ValueError[] = "ValueError"; static char __pyx_k__add_source[] = "add_source"; static char __pyx_k__agg_offset[] = "agg_offset"; static char __pyx_k__make_delta[] = "make_delta"; static char __pyx_k__MemoryError[] = "MemoryError"; -static char __pyx_k___rabin_hash[] = "_rabin_hash"; +static char __pyx_k___dump_index[] = "_dump_index"; static char __pyx_k__apply_delta[] = "apply_delta"; static char __pyx_k__delta_bytes[] = "delta_bytes"; static char __pyx_k__delta_start[] = "delta_start"; @@ -537,43 +516,52 @@ static char __pyx_k__max_delta_size[] = "max_delta_size"; static char __pyx_k___expand_sources[] = "_expand_sources"; static char __pyx_k___max_num_sources[] = "_max_num_sources"; -static char __pyx_k__make_delta_index[] = "make_delta_index"; +static char __pyx_k__add_delta_source[] = "add_delta_source"; static char __pyx_k__decode_base128_int[] = "decode_base128_int"; static char __pyx_k__encode_base128_int[] = "encode_base128_int"; static char __pyx_k__max_bytes_to_index[] = "max_bytes_to_index"; static char __pyx_k___max_bytes_to_index[] = "_max_bytes_to_index"; static PyObject *__pyx_kp_s_1; +static PyObject *__pyx_kp_s_10; static PyObject *__pyx_kp_s_11; +static PyObject *__pyx_kp_s_12; static PyObject *__pyx_kp_s_13; -static PyObject *__pyx_kp_s_14; +static PyObject *__pyx_n_s_14; +static PyObject *__pyx_kp_s_15; static PyObject *__pyx_kp_s_16; +static PyObject *__pyx_kp_s_17; static PyObject *__pyx_kp_s_18; static PyObject *__pyx_kp_s_19; static PyObject *__pyx_kp_s_2; +static PyObject *__pyx_kp_s_20; static PyObject *__pyx_kp_s_21; -static PyObject *__pyx_n_s_23; +static PyObject *__pyx_kp_s_22; +static PyObject *__pyx_kp_s_23; static PyObject *__pyx_kp_s_24; +static PyObject *__pyx_kp_s_25; static PyObject *__pyx_kp_s_26; +static PyObject *__pyx_kp_s_27; static PyObject *__pyx_kp_s_28; +static PyObject *__pyx_kp_s_29; static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_32; -static PyObject *__pyx_kp_s_33; -static PyObject *__pyx_kp_s_34; -static PyObject *__pyx_kp_s_36; -static PyObject *__pyx_kp_s_37; -static PyObject *__pyx_kp_s_38; -static PyObject *__pyx_kp_s_41; -static PyObject *__pyx_kp_s_43; -static PyObject *__pyx_kp_s_45; -static PyObject *__pyx_kp_s_47; -static PyObject *__pyx_kp_s_49; +static PyObject *__pyx_kp_u_31; +static PyObject *__pyx_kp_u_32; +static PyObject *__pyx_kp_u_33; +static PyObject *__pyx_kp_u_34; +static PyObject *__pyx_kp_u_35; +static PyObject *__pyx_kp_u_36; +static PyObject *__pyx_kp_u_37; +static PyObject *__pyx_n_s_38; +static PyObject *__pyx_kp_u_39; +static PyObject *__pyx_kp_s_4; +static PyObject *__pyx_kp_u_40; static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_51; -static PyObject *__pyx_n_s_54; -static PyObject *__pyx_n_s_55; +static PyObject *__pyx_kp_s_6; static PyObject *__pyx_kp_s_7; +static PyObject *__pyx_kp_s_8; static PyObject *__pyx_kp_s_9; static PyObject *__pyx_n_s__AssertionError; +static PyObject *__pyx_n_s__DeltaIndex; static PyObject *__pyx_n_s__MemoryError; static PyObject *__pyx_n_s__RuntimeError; static PyObject *__pyx_n_s__TypeError; @@ -582,17 +570,17 @@ static PyObject *__pyx_n_s____main__; static PyObject *__pyx_n_s____name__; static PyObject *__pyx_n_s____test__; +static PyObject *__pyx_n_s___dump_index; static PyObject *__pyx_n_s___expand_sources; static PyObject *__pyx_n_s___index; static PyObject *__pyx_n_s___max_bytes_to_index; static PyObject *__pyx_n_s___max_num_sources; -static PyObject *__pyx_n_s___rabin_hash; static PyObject *__pyx_n_s___source_infos; static PyObject *__pyx_n_s___source_offset; static PyObject *__pyx_n_s___sources; +static PyObject *__pyx_n_s__add_delta_source; static PyObject *__pyx_n_s__add_source; static PyObject *__pyx_n_s__agg_offset; -static PyObject *__pyx_n_s__append; static PyObject *__pyx_n_s__apply_delta; static PyObject *__pyx_n_s__buf; static PyObject *__pyx_n_s__decode_base128_int; @@ -602,7 +590,6 @@ static PyObject *__pyx_n_s__delta_start; static PyObject *__pyx_n_s__encode_base128_int; static PyObject *__pyx_n_s__make_delta; -static PyObject *__pyx_n_s__make_delta_index; static PyObject *__pyx_n_s__map; static PyObject *__pyx_n_s__max_bytes_to_index; static PyObject *__pyx_n_s__max_delta_size; @@ -612,31 +599,8 @@ static PyObject *__pyx_n_s__target_bytes; static PyObject *__pyx_n_s__unadded_bytes; static PyObject *__pyx_int_0; -static PyObject *__pyx_k_tuple_4; -static PyObject *__pyx_k_tuple_6; -static PyObject *__pyx_k_tuple_8; -static PyObject *__pyx_k_tuple_10; -static PyObject *__pyx_k_tuple_12; -static PyObject *__pyx_k_tuple_15; -static PyObject *__pyx_k_tuple_17; -static PyObject *__pyx_k_tuple_20; -static PyObject *__pyx_k_tuple_22; -static PyObject *__pyx_k_tuple_25; -static PyObject *__pyx_k_tuple_27; -static PyObject *__pyx_k_tuple_29; -static PyObject *__pyx_k_tuple_30; -static PyObject *__pyx_k_tuple_31; -static PyObject *__pyx_k_tuple_35; -static PyObject *__pyx_k_tuple_39; -static PyObject *__pyx_k_tuple_40; -static PyObject *__pyx_k_tuple_42; -static PyObject *__pyx_k_tuple_44; -static PyObject *__pyx_k_tuple_46; -static PyObject *__pyx_k_tuple_48; -static PyObject *__pyx_k_tuple_50; -static PyObject *__pyx_k_tuple_52; -/* "bzrlib/_groupcompress_pyx.pyx":80 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":80 * * * cdef void *safe_malloc(size_t count) except NULL: # <<<<<<<<<<<<<< @@ -652,7 +616,7 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("safe_malloc"); - /* "bzrlib/_groupcompress_pyx.pyx":82 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":82 * cdef void *safe_malloc(size_t count) except NULL: * cdef void *result * result = malloc(count) # <<<<<<<<<<<<<< @@ -661,7 +625,7 @@ */ __pyx_v_result = malloc(__pyx_v_count); - /* "bzrlib/_groupcompress_pyx.pyx":83 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":83 * cdef void *result * result = malloc(count) * if result == NULL: # <<<<<<<<<<<<<< @@ -671,7 +635,7 @@ __pyx_t_1 = (__pyx_v_result == NULL); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":84 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":84 * result = malloc(count) * if result == NULL: * raise MemoryError('Failed to allocate %d bytes of memory' % (count,)) # <<<<<<<<<<<<<< @@ -681,21 +645,21 @@ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -703,7 +667,7 @@ } __pyx_L3:; - /* "bzrlib/_groupcompress_pyx.pyx":85 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":85 * if result == NULL: * raise MemoryError('Failed to allocate %d bytes of memory' % (count,)) * return result # <<<<<<<<<<<<<< @@ -725,7 +689,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":88 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":88 * * * cdef void *safe_realloc(void * old, size_t count) except NULL: # <<<<<<<<<<<<<< @@ -741,7 +705,7 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("safe_realloc"); - /* "bzrlib/_groupcompress_pyx.pyx":90 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":90 * cdef void *safe_realloc(void * old, size_t count) except NULL: * cdef void *result * result = realloc(old, count) # <<<<<<<<<<<<<< @@ -750,7 +714,7 @@ */ __pyx_v_result = realloc(__pyx_v_old, __pyx_v_count); - /* "bzrlib/_groupcompress_pyx.pyx":91 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":91 * cdef void *result * result = realloc(old, count) * if result == NULL: # <<<<<<<<<<<<<< @@ -760,7 +724,7 @@ __pyx_t_1 = (__pyx_v_result == NULL); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":93 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":93 * if result == NULL: * raise MemoryError('Failed to reallocate to %d bytes of memory' * % (count,)) # <<<<<<<<<<<<<< @@ -770,21 +734,21 @@ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); + __Pyx_GOTREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -792,7 +756,7 @@ } __pyx_L3:; - /* "bzrlib/_groupcompress_pyx.pyx":94 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":94 * raise MemoryError('Failed to reallocate to %d bytes of memory' * % (count,)) * return result # <<<<<<<<<<<<<< @@ -814,7 +778,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":97 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":97 * * * cdef int safe_free(void **val) except -1: # <<<<<<<<<<<<<< @@ -827,21 +791,21 @@ int __pyx_t_1; __Pyx_RefNannySetupContext("safe_free"); - /* "bzrlib/_groupcompress_pyx.pyx":98 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":98 * * cdef int safe_free(void **val) except -1: * assert val != NULL # <<<<<<<<<<<<<< * if val[0] != NULL: * free(val[0]) */ - #ifndef CYTHON_WITHOUT_ASSERTIONS + #ifndef PYREX_WITHOUT_ASSERTIONS if (unlikely(!(__pyx_v_val != NULL))) { PyErr_SetNone(PyExc_AssertionError); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } #endif - /* "bzrlib/_groupcompress_pyx.pyx":99 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":99 * cdef int safe_free(void **val) except -1: * assert val != NULL * if val[0] != NULL: # <<<<<<<<<<<<<< @@ -851,7 +815,7 @@ __pyx_t_1 = ((__pyx_v_val[0]) != NULL); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":100 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":100 * assert val != NULL * if val[0] != NULL: * free(val[0]) # <<<<<<<<<<<<<< @@ -860,7 +824,7 @@ */ free((__pyx_v_val[0])); - /* "bzrlib/_groupcompress_pyx.pyx":101 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":101 * if val[0] != NULL: * free(val[0]) * val[0] = NULL # <<<<<<<<<<<<<< @@ -882,7 +846,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":103 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":103 * val[0] = NULL * * def make_delta_index(source): # <<<<<<<<<<<<<< @@ -891,7 +855,6 @@ */ static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_make_delta_index(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/ -static PyMethodDef __pyx_mdef_6bzrlib_18_groupcompress_pyx_make_delta_index = {__Pyx_NAMESTR("make_delta_index"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_make_delta_index, METH_O, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_make_delta_index(PyObject *__pyx_self, PyObject *__pyx_v_source) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; @@ -899,7 +862,7 @@ __Pyx_RefNannySetupContext("make_delta_index"); __pyx_self = __pyx_self; - /* "bzrlib/_groupcompress_pyx.pyx":104 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":104 * * def make_delta_index(source): * return DeltaIndex(source) # <<<<<<<<<<<<<< @@ -908,13 +871,13 @@ */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_source); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_18_groupcompress_pyx_DeltaIndex)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_18_groupcompress_pyx_DeltaIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; @@ -932,7 +895,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":107 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":107 * * * cdef object _translate_delta_failure(delta_result result): # <<<<<<<<<<<<<< @@ -947,7 +910,7 @@ PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_translate_delta_failure"); - /* "bzrlib/_groupcompress_pyx.pyx":108 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":108 * * cdef object _translate_delta_failure(delta_result result): * if result == DELTA_OUT_OF_MEMORY: # <<<<<<<<<<<<<< @@ -957,7 +920,7 @@ __pyx_t_1 = (__pyx_v_result == DELTA_OUT_OF_MEMORY); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":109 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":109 * cdef object _translate_delta_failure(delta_result result): * if result == DELTA_OUT_OF_MEMORY: * return MemoryError("Delta function failed to allocate memory") # <<<<<<<<<<<<<< @@ -965,15 +928,21 @@ * return ValueError("Delta function requires delta_index param") */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_3)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; goto __pyx_L3; } - /* "bzrlib/_groupcompress_pyx.pyx":110 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":110 * if result == DELTA_OUT_OF_MEMORY: * return MemoryError("Delta function failed to allocate memory") * elif result == DELTA_INDEX_NEEDED: # <<<<<<<<<<<<<< @@ -983,7 +952,7 @@ __pyx_t_1 = (__pyx_v_result == DELTA_INDEX_NEEDED); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":111 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":111 * return MemoryError("Delta function failed to allocate memory") * elif result == DELTA_INDEX_NEEDED: * return ValueError("Delta function requires delta_index param") # <<<<<<<<<<<<<< @@ -991,15 +960,21 @@ * return ValueError("Delta function given empty source_info param") */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_4)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; goto __pyx_L3; } - /* "bzrlib/_groupcompress_pyx.pyx":112 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":112 * elif result == DELTA_INDEX_NEEDED: * return ValueError("Delta function requires delta_index param") * elif result == DELTA_SOURCE_EMPTY: # <<<<<<<<<<<<<< @@ -1009,7 +984,7 @@ __pyx_t_1 = (__pyx_v_result == DELTA_SOURCE_EMPTY); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":113 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":113 * return ValueError("Delta function requires delta_index param") * elif result == DELTA_SOURCE_EMPTY: * return ValueError("Delta function given empty source_info param") # <<<<<<<<<<<<<< @@ -1017,15 +992,21 @@ * return RuntimeError("Delta function given invalid source_info param") */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_5)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; goto __pyx_L3; } - /* "bzrlib/_groupcompress_pyx.pyx":114 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":114 * elif result == DELTA_SOURCE_EMPTY: * return ValueError("Delta function given empty source_info param") * elif result == DELTA_SOURCE_BAD: # <<<<<<<<<<<<<< @@ -1035,7 +1016,7 @@ __pyx_t_1 = (__pyx_v_result == DELTA_SOURCE_BAD); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":115 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":115 * return ValueError("Delta function given empty source_info param") * elif result == DELTA_SOURCE_BAD: * return RuntimeError("Delta function given invalid source_info param") # <<<<<<<<<<<<<< @@ -1043,15 +1024,21 @@ * return ValueError("Delta function given empty buffer params") */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_6)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_6)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; goto __pyx_L3; } - /* "bzrlib/_groupcompress_pyx.pyx":116 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":116 * elif result == DELTA_SOURCE_BAD: * return RuntimeError("Delta function given invalid source_info param") * elif result == DELTA_BUFFER_EMPTY: # <<<<<<<<<<<<<< @@ -1061,7 +1048,7 @@ __pyx_t_1 = (__pyx_v_result == DELTA_BUFFER_EMPTY); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":117 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":117 * return RuntimeError("Delta function given invalid source_info param") * elif result == DELTA_BUFFER_EMPTY: * return ValueError("Delta function given empty buffer params") # <<<<<<<<<<<<<< @@ -1069,16 +1056,22 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_7)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_groupcompress_pyx.pyx":118 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":118 * elif result == DELTA_BUFFER_EMPTY: * return ValueError("Delta function given empty buffer params") * return AssertionError("Unrecognised delta result code: %d" % result) # <<<<<<<<<<<<<< @@ -1086,21 +1079,21 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); @@ -1116,7 +1109,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":121 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":121 * * * def _rabin_hash(content): # <<<<<<<<<<<<<< @@ -1124,18 +1117,17 @@ * raise ValueError('content must be a string') */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_1_rabin_hash(PyObject *__pyx_self, PyObject *__pyx_v_content); /*proto*/ -static PyMethodDef __pyx_mdef_6bzrlib_18_groupcompress_pyx_1_rabin_hash = {__Pyx_NAMESTR("_rabin_hash"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_1_rabin_hash, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_1_rabin_hash(PyObject *__pyx_self, PyObject *__pyx_v_content) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx__rabin_hash(PyObject *__pyx_self, PyObject *__pyx_v_content); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx__rabin_hash(PyObject *__pyx_self, PyObject *__pyx_v_content) { PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; __Pyx_RefNannySetupContext("_rabin_hash"); __pyx_self = __pyx_self; - /* "bzrlib/_groupcompress_pyx.pyx":122 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":122 * * def _rabin_hash(content): * if not PyString_CheckExact(content): # <<<<<<<<<<<<<< @@ -1145,42 +1137,54 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_content)); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":123 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":123 * def _rabin_hash(content): * if not PyString_CheckExact(content): * raise ValueError('content must be a string') # <<<<<<<<<<<<<< * if len(content) < 16: * raise ValueError('content must be at least 16 bytes long') */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "bzrlib/_groupcompress_pyx.pyx":124 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":124 * if not PyString_CheckExact(content): * raise ValueError('content must be a string') * if len(content) < 16: # <<<<<<<<<<<<<< * raise ValueError('content must be at least 16 bytes long') * # Try to cast it to an int, if it can fit */ - __pyx_t_3 = PyObject_Length(__pyx_v_content); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_1 = (__pyx_t_3 < 16); + __pyx_t_4 = PyObject_Length(__pyx_v_content); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_4 < 16); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":125 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":125 * raise ValueError('content must be a string') * if len(content) < 16: * raise ValueError('content must be at least 16 bytes long') # <<<<<<<<<<<<<< * # Try to cast it to an int, if it can fit * return int(rabin_hash((PyString_AS_STRING(content)))) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_10)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -1188,7 +1192,7 @@ } __pyx_L6:; - /* "bzrlib/_groupcompress_pyx.pyx":127 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":127 * raise ValueError('content must be at least 16 bytes long') * # Try to cast it to an int, if it can fit * return int(rabin_hash((PyString_AS_STRING(content)))) # <<<<<<<<<<<<<< @@ -1198,14 +1202,14 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyLong_FromUnsignedLong(rabin_hash(((unsigned char *)PyString_AS_STRING(__pyx_v_content)))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; @@ -1214,7 +1218,7 @@ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("bzrlib._groupcompress_pyx._rabin_hash"); __pyx_r = NULL; __pyx_L0:; @@ -1223,7 +1227,163 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":142 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":135 + * # isn't performance critical + * # cdef readonly list _sources + * cdef readonly object _sources # <<<<<<<<<<<<<< + * cdef source_info *_source_infos + * cdef delta_index *_index + */ + +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_8_sources___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_8_sources___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources); + __pyx_r = ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":138 + * cdef source_info *_source_infos + * cdef delta_index *_index + * cdef public unsigned long _source_offset # <<<<<<<<<<<<<< + * cdef readonly unsigned int _max_num_sources + * cdef public int _max_bytes_to_index + */ + +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_14_source_offset___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_14_source_offset___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._source_offset.__get__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_14_source_offset___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_14_source_offset___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + unsigned long __pyx_t_1; + __Pyx_RefNannySetupContext("__set__"); + __pyx_t_1 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset = __pyx_t_1; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._source_offset.__set__"); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":139 + * cdef delta_index *_index + * cdef public unsigned long _source_offset + * cdef readonly unsigned int _max_num_sources # <<<<<<<<<<<<<< + * cdef public int _max_bytes_to_index + * + */ + +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_16_max_num_sources___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_16_max_num_sources___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_num_sources); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._max_num_sources.__get__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":140 + * cdef public unsigned long _source_offset + * cdef readonly unsigned int _max_num_sources + * cdef public int _max_bytes_to_index # <<<<<<<<<<<<<< + * + * def __init__(self, source=None, max_bytes_to_index=None): + */ + +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_19_max_bytes_to_index___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_19_max_bytes_to_index___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + __Pyx_RefNannySetupContext("__get__"); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_bytes_to_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._max_bytes_to_index.__get__"); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static int __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_19_max_bytes_to_index___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ +static int __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_19_max_bytes_to_index___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + int __pyx_r; + int __pyx_t_1; + __Pyx_RefNannySetupContext("__set__"); + __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_bytes_to_index = __pyx_t_1; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._max_bytes_to_index.__set__"); + __pyx_r = -1; + __pyx_L0:; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":142 * cdef public int _max_bytes_to_index * * def __init__(self, source=None, max_bytes_to_index=None): # <<<<<<<<<<<<<< @@ -1291,7 +1451,7 @@ return -1; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_groupcompress_pyx.pyx":143 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":143 * * def __init__(self, source=None, max_bytes_to_index=None): * self._sources = [] # <<<<<<<<<<<<<< @@ -1306,7 +1466,7 @@ ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_groupcompress_pyx.pyx":144 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":144 * def __init__(self, source=None, max_bytes_to_index=None): * self._sources = [] * self._index = NULL # <<<<<<<<<<<<<< @@ -1315,7 +1475,7 @@ */ ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index = NULL; - /* "bzrlib/_groupcompress_pyx.pyx":145 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":145 * self._sources = [] * self._index = NULL * self._max_num_sources = 65000 # <<<<<<<<<<<<<< @@ -1324,7 +1484,7 @@ */ ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_num_sources = 65000; - /* "bzrlib/_groupcompress_pyx.pyx":147 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":147 * self._max_num_sources = 65000 * self._source_infos = safe_malloc(sizeof(source_info) * * self._max_num_sources) # <<<<<<<<<<<<<< @@ -1333,7 +1493,7 @@ */ __pyx_t_2 = __pyx_f_6bzrlib_18_groupcompress_pyx_safe_malloc(((sizeof(struct source_info)) * ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_num_sources)); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_groupcompress_pyx.pyx":146 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":146 * self._index = NULL * self._max_num_sources = 65000 * self._source_infos = safe_malloc(sizeof(source_info) # <<<<<<<<<<<<<< @@ -1342,7 +1502,7 @@ */ ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_infos = ((struct source_info *)__pyx_t_2); - /* "bzrlib/_groupcompress_pyx.pyx":148 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":148 * self._source_infos = safe_malloc(sizeof(source_info) * * self._max_num_sources) * self._source_offset = 0 # <<<<<<<<<<<<<< @@ -1351,7 +1511,7 @@ */ ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset = 0; - /* "bzrlib/_groupcompress_pyx.pyx":149 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":149 * * self._max_num_sources) * self._source_offset = 0 * self._max_bytes_to_index = 0 # <<<<<<<<<<<<<< @@ -1360,7 +1520,7 @@ */ ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_bytes_to_index = 0; - /* "bzrlib/_groupcompress_pyx.pyx":150 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":150 * self._source_offset = 0 * self._max_bytes_to_index = 0 * if max_bytes_to_index is not None: # <<<<<<<<<<<<<< @@ -1370,7 +1530,7 @@ __pyx_t_3 = (__pyx_v_max_bytes_to_index != Py_None); if (__pyx_t_3) { - /* "bzrlib/_groupcompress_pyx.pyx":151 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":151 * self._max_bytes_to_index = 0 * if max_bytes_to_index is not None: * self._max_bytes_to_index = max_bytes_to_index # <<<<<<<<<<<<<< @@ -1383,7 +1543,7 @@ } __pyx_L6:; - /* "bzrlib/_groupcompress_pyx.pyx":153 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":153 * self._max_bytes_to_index = max_bytes_to_index * * if source is not None: # <<<<<<<<<<<<<< @@ -1393,7 +1553,7 @@ __pyx_t_3 = (__pyx_v_source != Py_None); if (__pyx_t_3) { - /* "bzrlib/_groupcompress_pyx.pyx":154 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":154 * * if source is not None: * self.add_source(source, 0) # <<<<<<<<<<<<<< @@ -1403,17 +1563,17 @@ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add_source); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_source); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_source); __Pyx_GIVEREF(__pyx_v_source); __Pyx_INCREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L7; } @@ -1432,7 +1592,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":156 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":156 * self.add_source(source, 0) * * def __sizeof__(self): # <<<<<<<<<<<<<< @@ -1440,14 +1600,14 @@ * # void* are actually tracked in _sources itself. */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_1__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_1__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex___sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex___sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { Py_ssize_t __pyx_v_size; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__sizeof__"); - /* "bzrlib/_groupcompress_pyx.pyx":169 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":169 * + sizeof(unsigned int)) * + (sizeof(source_info) * self._max_num_sources) * + sizeof_delta_index(self._index)) # <<<<<<<<<<<<<< @@ -1456,7 +1616,7 @@ */ __pyx_v_size = (((((((sizeof(PyObject)) + (sizeof(void *))) + (3 * (sizeof(PyObject *)))) + (sizeof(unsigned long))) + (sizeof(unsigned int))) + ((sizeof(struct source_info)) * ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_num_sources)) + sizeof_delta_index(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index)); - /* "bzrlib/_groupcompress_pyx.pyx":170 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":170 * + (sizeof(source_info) * self._max_num_sources) * + sizeof_delta_index(self._index)) * return size # <<<<<<<<<<<<<< @@ -1482,7 +1642,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":172 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":172 * return size * * def __repr__(self): # <<<<<<<<<<<<<< @@ -1490,8 +1650,8 @@ * len(self._sources), self._source_offset) */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_2__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_2__repr__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex___repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; @@ -1500,7 +1660,7 @@ PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__repr__"); - /* "bzrlib/_groupcompress_pyx.pyx":173 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":173 * * def __repr__(self): * return '%s(%d, %d)' % (self.__class__.__name__, # <<<<<<<<<<<<<< @@ -1514,23 +1674,20 @@ __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_groupcompress_pyx.pyx":174 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":174 * def __repr__(self): * return '%s(%d, %d)' % (self.__class__.__name__, * len(self._sources), self._source_offset) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __pyx_t_1 = ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyObject_Length(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); @@ -1540,9 +1697,9 @@ __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = ((PyObject *)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; @@ -1562,7 +1719,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":176 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":176 * len(self._sources), self._source_offset) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -1570,13 +1727,13 @@ * free_delta_index(self._index) */ -static void __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_3__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_3__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex___dealloc__(PyObject *__pyx_v_self) { int __pyx_t_1; int __pyx_t_2; __Pyx_RefNannySetupContext("__dealloc__"); - /* "bzrlib/_groupcompress_pyx.pyx":177 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":177 * * def __dealloc__(self): * if self._index != NULL: # <<<<<<<<<<<<<< @@ -1586,7 +1743,7 @@ __pyx_t_1 = (((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index != NULL); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":178 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":178 * def __dealloc__(self): * if self._index != NULL: * free_delta_index(self._index) # <<<<<<<<<<<<<< @@ -1595,7 +1752,7 @@ */ free_delta_index(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index); - /* "bzrlib/_groupcompress_pyx.pyx":179 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":179 * if self._index != NULL: * free_delta_index(self._index) * self._index = NULL # <<<<<<<<<<<<<< @@ -1607,7 +1764,7 @@ } __pyx_L5:; - /* "bzrlib/_groupcompress_pyx.pyx":180 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":180 * free_delta_index(self._index) * self._index = NULL * safe_free(&self._source_infos) # <<<<<<<<<<<<<< @@ -1623,7 +1780,7 @@ __Pyx_RefNannyFinishContext(); } -/* "bzrlib/_groupcompress_pyx.pyx":182 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":182 * safe_free(&self._source_infos) * * def _has_index(self): # <<<<<<<<<<<<<< @@ -1631,13 +1788,13 @@ * */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_4_has_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_4_has_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex__has_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex__has_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_has_index"); - /* "bzrlib/_groupcompress_pyx.pyx":183 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":183 * * def _has_index(self): * return (self._index != NULL) # <<<<<<<<<<<<<< @@ -1663,7 +1820,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":185 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":185 * return (self._index != NULL) * * def _dump_index(self): # <<<<<<<<<<<<<< @@ -1671,9 +1828,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_5_dump_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_5_dump_index[] = "Dump the pointers in the index.\n\n This is an arbitrary layout, used for testing. It is not meant to be\n used in production code.\n\n :return: (hash_list, entry_list)\n hash_list A list of offsets, so hash[i] points to the 'hash\n bucket' starting at the given offset and going until\n hash[i+1]\n entry_list A list of (text_offset, hash_val). text_offset is the\n offset in the \"source\" texts, and hash_val is the RABIN\n hash for that offset.\n Note that the entry should be in the hash bucket\n defined by\n hash[(hash_val & mask)] && hash[(hash_val & mask) + 1]\n "; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_5_dump_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex__dump_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ +static char __pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex__dump_index[] = "Dump the pointers in the index.\n\n This is an arbitrary layout, used for testing. It is not meant to be\n used in production code.\n\n :return: (hash_list, entry_list)\n hash_list A list of offsets, so hash[i] points to the 'hash\n bucket' starting at the given offset and going until\n hash[i+1]\n entry_list A list of (text_offset, hash_val). text_offset is the\n offset in the \"source\" texts, and hash_val is the RABIN\n hash for that offset.\n Note that the entry should be in the hash bucket\n defined by\n hash[(hash_val & mask)] && hash[(hash_val & mask) + 1]\n "; +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex__dump_index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { int __pyx_v_pos; unsigned int __pyx_v_text_offset; unsigned int __pyx_v_hash_val; @@ -1688,11 +1845,11 @@ PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_dump_index"); - __pyx_v_hash_list = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_entry_list = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_val = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_hash_list = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_entry_list = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_v_val = ((PyObject *)Py_None); __Pyx_INCREF(Py_None); - /* "bzrlib/_groupcompress_pyx.pyx":206 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":206 * cdef unsigned int hash_val * cdef unsigned int hash_offset * if self._index == NULL: # <<<<<<<<<<<<<< @@ -1702,7 +1859,7 @@ __pyx_t_1 = (((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index == NULL); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":207 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":207 * cdef unsigned int hash_offset * if self._index == NULL: * return None # <<<<<<<<<<<<<< @@ -1717,7 +1874,7 @@ } __pyx_L5:; - /* "bzrlib/_groupcompress_pyx.pyx":208 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":208 * if self._index == NULL: * return None * hash_list = [] # <<<<<<<<<<<<<< @@ -1730,7 +1887,7 @@ __pyx_v_hash_list = __pyx_t_2; __pyx_t_2 = 0; - /* "bzrlib/_groupcompress_pyx.pyx":209 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":209 * return None * hash_list = [] * pos = 0 # <<<<<<<<<<<<<< @@ -1739,7 +1896,7 @@ */ __pyx_v_pos = 0; - /* "bzrlib/_groupcompress_pyx.pyx":210 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":210 * hash_list = [] * pos = 0 * while get_hash_offset(self._index, pos, &hash_offset): # <<<<<<<<<<<<<< @@ -1750,7 +1907,7 @@ __pyx_t_3 = get_hash_offset(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index, __pyx_v_pos, (&__pyx_v_hash_offset)); if (!__pyx_t_3) break; - /* "bzrlib/_groupcompress_pyx.pyx":211 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":211 * pos = 0 * while get_hash_offset(self._index, pos, &hash_offset): * hash_list.append(int(hash_offset)) # <<<<<<<<<<<<<< @@ -1763,27 +1920,27 @@ __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_hash_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyInt_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_3 = PyList_Append(__pyx_v_hash_list, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_hash_list), __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "bzrlib/_groupcompress_pyx.pyx":212 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":212 * while get_hash_offset(self._index, pos, &hash_offset): * hash_list.append(int(hash_offset)) * pos += 1 # <<<<<<<<<<<<<< * entry_list = [] * pos = 0 */ - __pyx_v_pos = (__pyx_v_pos + 1); + __pyx_v_pos += 1; } - /* "bzrlib/_groupcompress_pyx.pyx":213 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":213 * hash_list.append(int(hash_offset)) * pos += 1 * entry_list = [] # <<<<<<<<<<<<<< @@ -1796,7 +1953,7 @@ __pyx_v_entry_list = __pyx_t_2; __pyx_t_2 = 0; - /* "bzrlib/_groupcompress_pyx.pyx":214 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":214 * pos += 1 * entry_list = [] * pos = 0 # <<<<<<<<<<<<<< @@ -1805,7 +1962,7 @@ */ __pyx_v_pos = 0; - /* "bzrlib/_groupcompress_pyx.pyx":215 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":215 * entry_list = [] * pos = 0 * while get_entry_summary(self._index, pos, &text_offset, &hash_val): # <<<<<<<<<<<<<< @@ -1816,7 +1973,7 @@ __pyx_t_3 = get_entry_summary(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index, __pyx_v_pos, (&__pyx_v_text_offset), (&__pyx_v_hash_val)); if (!__pyx_t_3) break; - /* "bzrlib/_groupcompress_pyx.pyx":218 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":218 * # Map back using 'int' so that we don't get Long everywhere, when * # almost everything is <2**31. * val = tuple(map(int, [text_offset, hash_val])) # <<<<<<<<<<<<<< @@ -1836,29 +1993,29 @@ __pyx_t_2 = 0; __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type)))); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)((PyObject*)(&PyInt_Type)))); - __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type)))); + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(((PyObject *)((PyObject*)&PyInt_Type))); + PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)((PyObject*)&PyInt_Type))); + __Pyx_GIVEREF(((PyObject *)((PyObject*)&PyInt_Type))); PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_5)); __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_map, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(__pyx_builtin_map, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyTuple_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_val)); - __pyx_v_val = ((PyObject*)__pyx_t_5); + __pyx_v_val = ((PyObject *)__pyx_t_5); __pyx_t_5 = 0; - /* "bzrlib/_groupcompress_pyx.pyx":219 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":219 * # almost everything is <2**31. * val = tuple(map(int, [text_offset, hash_val])) * entry_list.append(val) # <<<<<<<<<<<<<< @@ -1868,19 +2025,19 @@ if (unlikely(__pyx_v_entry_list == Py_None)) { PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } - __pyx_t_3 = PyList_Append(__pyx_v_entry_list, ((PyObject *)__pyx_v_val)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_entry_list), ((PyObject *)__pyx_v_val)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_groupcompress_pyx.pyx":220 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":220 * val = tuple(map(int, [text_offset, hash_val])) * entry_list.append(val) * pos += 1 # <<<<<<<<<<<<<< * return hash_list, entry_list * */ - __pyx_v_pos = (__pyx_v_pos + 1); + __pyx_v_pos += 1; } - /* "bzrlib/_groupcompress_pyx.pyx":221 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":221 * entry_list.append(val) * pos += 1 * return hash_list, entry_list # <<<<<<<<<<<<<< @@ -1889,14 +2046,14 @@ */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); + __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(((PyObject *)__pyx_v_hash_list)); PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_hash_list)); __Pyx_GIVEREF(((PyObject *)__pyx_v_hash_list)); __Pyx_INCREF(((PyObject *)__pyx_v_entry_list)); PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_entry_list)); __Pyx_GIVEREF(((PyObject *)__pyx_v_entry_list)); - __pyx_r = ((PyObject *)__pyx_t_5); + __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; @@ -1917,7 +2074,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":223 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":223 * return hash_list, entry_list * * def add_delta_source(self, delta, unadded_bytes): # <<<<<<<<<<<<<< @@ -1925,9 +2082,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_6add_delta_source(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_6add_delta_source[] = "Add a new delta to the source texts.\n\n :param delta: The text of the delta, this must be a byte string.\n :param unadded_bytes: Number of bytes that were added to the source\n that were not indexed.\n "; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_6add_delta_source(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_add_delta_source(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_add_delta_source[] = "Add a new delta to the source texts.\n\n :param delta: The text of the delta, this must be a byte string.\n :param unadded_bytes: Number of bytes that were added to the source\n that were not indexed.\n "; +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_add_delta_source(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_delta = 0; PyObject *__pyx_v_unadded_bytes = 0; char *__pyx_v_c_delta; @@ -1939,8 +2096,8 @@ PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; unsigned long __pyx_t_5; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__delta,&__pyx_n_s__unadded_bytes,0}; __Pyx_RefNannySetupContext("add_delta_source"); @@ -1985,7 +2142,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_groupcompress_pyx.pyx":238 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":238 * cdef unsigned int num_indexes * * if not PyString_CheckExact(delta): # <<<<<<<<<<<<<< @@ -1995,36 +2152,39 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_delta)); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":239 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":239 * * if not PyString_CheckExact(delta): * raise TypeError('delta is not a str') # <<<<<<<<<<<<<< * * source_location = len(self._sources) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_12)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "bzrlib/_groupcompress_pyx.pyx":241 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":241 * raise TypeError('delta is not a str') * * source_location = len(self._sources) # <<<<<<<<<<<<<< * if source_location >= self._max_num_sources: * self._expand_sources() */ - __pyx_t_2 = ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_source_location = __pyx_t_3; + __pyx_t_4 = PyObject_Length(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_source_location = __pyx_t_4; - /* "bzrlib/_groupcompress_pyx.pyx":242 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":242 * * source_location = len(self._sources) * if source_location >= self._max_num_sources: # <<<<<<<<<<<<<< @@ -2034,32 +2194,32 @@ __pyx_t_1 = (__pyx_v_source_location >= ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_num_sources); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":243 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":243 * source_location = len(self._sources) * if source_location >= self._max_num_sources: * self._expand_sources() # <<<<<<<<<<<<<< * self._sources.append(delta) * c_delta = PyString_AS_STRING(delta) */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_18_groupcompress_pyx_DeltaIndex *)((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->__pyx_vtab)->_expand_sources(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_18_groupcompress_pyx_DeltaIndex *)((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->__pyx_vtab)->_expand_sources(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7; } __pyx_L7:; - /* "bzrlib/_groupcompress_pyx.pyx":244 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":244 * if source_location >= self._max_num_sources: * self._expand_sources() * self._sources.append(delta) # <<<<<<<<<<<<<< * c_delta = PyString_AS_STRING(delta) * c_delta_size = PyString_GET_SIZE(delta) */ - __pyx_t_2 = __Pyx_PyObject_Append(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources, __pyx_v_delta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_Append(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources, __pyx_v_delta); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_groupcompress_pyx.pyx":245 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":245 * self._expand_sources() * self._sources.append(delta) * c_delta = PyString_AS_STRING(delta) # <<<<<<<<<<<<<< @@ -2068,7 +2228,7 @@ */ __pyx_v_c_delta = PyString_AS_STRING(__pyx_v_delta); - /* "bzrlib/_groupcompress_pyx.pyx":246 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":246 * self._sources.append(delta) * c_delta = PyString_AS_STRING(delta) * c_delta_size = PyString_GET_SIZE(delta) # <<<<<<<<<<<<<< @@ -2077,7 +2237,7 @@ */ __pyx_v_c_delta_size = PyString_GET_SIZE(__pyx_v_delta); - /* "bzrlib/_groupcompress_pyx.pyx":247 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":247 * c_delta = PyString_AS_STRING(delta) * c_delta_size = PyString_GET_SIZE(delta) * src = self._source_infos + source_location # <<<<<<<<<<<<<< @@ -2086,7 +2246,7 @@ */ __pyx_v_src = (((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_infos + __pyx_v_source_location); - /* "bzrlib/_groupcompress_pyx.pyx":248 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":248 * c_delta_size = PyString_GET_SIZE(delta) * src = self._source_infos + source_location * src.buf = c_delta # <<<<<<<<<<<<<< @@ -2095,7 +2255,7 @@ */ __pyx_v_src->buf = __pyx_v_c_delta; - /* "bzrlib/_groupcompress_pyx.pyx":249 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":249 * src = self._source_infos + source_location * src.buf = c_delta * src.size = c_delta_size # <<<<<<<<<<<<<< @@ -2104,37 +2264,34 @@ */ __pyx_v_src->size = __pyx_v_c_delta_size; - /* "bzrlib/_groupcompress_pyx.pyx":250 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":250 * src.buf = c_delta * src.size = c_delta_size * src.agg_offset = self._source_offset + unadded_bytes # <<<<<<<<<<<<<< * with nogil: * res = create_delta_index_from_delta(src, self._index, &index) */ - __pyx_t_2 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_unadded_bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_v_unadded_bytes); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_5 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_2); if (unlikely((__pyx_t_5 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_4); if (unlikely((__pyx_t_5 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_src->agg_offset = __pyx_t_5; - /* "bzrlib/_groupcompress_pyx.pyx":251 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":251 * src.size = c_delta_size * src.agg_offset = self._source_offset + unadded_bytes * with nogil: # <<<<<<<<<<<<<< * res = create_delta_index_from_delta(src, self._index, &index) * if res != DELTA_OK: */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - #endif + { PyThreadState *_save; Py_UNBLOCK_THREADS /*try:*/ { - /* "bzrlib/_groupcompress_pyx.pyx":252 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":252 * src.agg_offset = self._source_offset + unadded_bytes * with nogil: * res = create_delta_index_from_delta(src, self._index, &index) # <<<<<<<<<<<<<< @@ -2144,7 +2301,7 @@ __pyx_v_res = create_delta_index_from_delta(__pyx_v_src, ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index, (&__pyx_v_index)); } - /* "bzrlib/_groupcompress_pyx.pyx":251 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":251 * src.size = c_delta_size * src.agg_offset = self._source_offset + unadded_bytes * with nogil: # <<<<<<<<<<<<<< @@ -2156,7 +2313,7 @@ } } - /* "bzrlib/_groupcompress_pyx.pyx":253 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":253 * with nogil: * res = create_delta_index_from_delta(src, self._index, &index) * if res != DELTA_OK: # <<<<<<<<<<<<<< @@ -2166,23 +2323,23 @@ __pyx_t_1 = (__pyx_v_res != DELTA_OK); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":254 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":254 * res = create_delta_index_from_delta(src, self._index, &index) * if res != DELTA_OK: * raise _translate_delta_failure(res) # <<<<<<<<<<<<<< * self._source_offset = src.agg_offset + src.size * if index != self._index: */ - __pyx_t_4 = __pyx_f_6bzrlib_18_groupcompress_pyx__translate_delta_failure(__pyx_v_res); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __pyx_f_6bzrlib_18_groupcompress_pyx__translate_delta_failure(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L11; } __pyx_L11:; - /* "bzrlib/_groupcompress_pyx.pyx":255 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":255 * if res != DELTA_OK: * raise _translate_delta_failure(res) * self._source_offset = src.agg_offset + src.size # <<<<<<<<<<<<<< @@ -2191,7 +2348,7 @@ */ ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset = (__pyx_v_src->agg_offset + __pyx_v_src->size); - /* "bzrlib/_groupcompress_pyx.pyx":256 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":256 * raise _translate_delta_failure(res) * self._source_offset = src.agg_offset + src.size * if index != self._index: # <<<<<<<<<<<<<< @@ -2201,7 +2358,7 @@ __pyx_t_1 = (__pyx_v_index != ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":257 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":257 * self._source_offset = src.agg_offset + src.size * if index != self._index: * free_delta_index(self._index) # <<<<<<<<<<<<<< @@ -2210,7 +2367,7 @@ */ free_delta_index(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index); - /* "bzrlib/_groupcompress_pyx.pyx":258 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":258 * if index != self._index: * free_delta_index(self._index) * self._index = index # <<<<<<<<<<<<<< @@ -2226,7 +2383,7 @@ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex.add_delta_source"); __pyx_r = NULL; __pyx_L0:; @@ -2235,7 +2392,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":260 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":260 * self._index = index * * def add_source(self, source, unadded_bytes): # <<<<<<<<<<<<<< @@ -2243,9 +2400,9 @@ * */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_7add_source(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_7add_source[] = "Add a new bit of source text to the delta indexes.\n\n :param source: The text in question, this must be a byte string\n :param unadded_bytes: Assume there are this many bytes that didn't get\n added between this source and the end of the previous source.\n :param max_pointers: Add no more than this many entries to the index.\n By default, we sample every 16 bytes, if that would require more\n than max_entries, we will reduce the sampling rate.\n A value of 0 means unlimited, None means use the default limit.\n "; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_7add_source(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_add_source(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_add_source[] = "Add a new bit of source text to the delta indexes.\n\n :param source: The text in question, this must be a byte string\n :param unadded_bytes: Assume there are this many bytes that didn't get\n added between this source and the end of the previous source.\n :param max_pointers: Add no more than this many entries to the index.\n By default, we sample every 16 bytes, if that would require more\n than max_entries, we will reduce the sampling rate.\n A value of 0 means unlimited, None means use the default limit.\n "; +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_add_source(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_source = 0; PyObject *__pyx_v_unadded_bytes = 0; char *__pyx_v_c_source; @@ -2257,10 +2414,10 @@ PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - int __pyx_t_4; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; + int __pyx_t_6; unsigned long __pyx_t_7; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__source,&__pyx_n_s__unadded_bytes,0}; __Pyx_RefNannySetupContext("add_source"); @@ -2305,7 +2462,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_groupcompress_pyx.pyx":280 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":280 * cdef int max_num_entries * * if not PyString_CheckExact(source): # <<<<<<<<<<<<<< @@ -2315,36 +2472,39 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_source)); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":281 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":281 * * if not PyString_CheckExact(source): * raise TypeError('source is not a str') # <<<<<<<<<<<<<< * * source_location = len(self._sources) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "bzrlib/_groupcompress_pyx.pyx":283 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":283 * raise TypeError('source is not a str') * * source_location = len(self._sources) # <<<<<<<<<<<<<< * if source_location >= self._max_num_sources: * self._expand_sources() */ - __pyx_t_2 = ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_source_location = __pyx_t_3; + __pyx_t_4 = PyObject_Length(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_source_location = __pyx_t_4; - /* "bzrlib/_groupcompress_pyx.pyx":284 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":284 * * source_location = len(self._sources) * if source_location >= self._max_num_sources: # <<<<<<<<<<<<<< @@ -2354,21 +2514,21 @@ __pyx_t_1 = (__pyx_v_source_location >= ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_num_sources); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":285 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":285 * source_location = len(self._sources) * if source_location >= self._max_num_sources: * self._expand_sources() # <<<<<<<<<<<<<< * if source_location != 0 and self._index == NULL: * # We were lazy about populating the index, create it now */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_18_groupcompress_pyx_DeltaIndex *)((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->__pyx_vtab)->_expand_sources(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_18_groupcompress_pyx_DeltaIndex *)((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->__pyx_vtab)->_expand_sources(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L7; } __pyx_L7:; - /* "bzrlib/_groupcompress_pyx.pyx":286 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":286 * if source_location >= self._max_num_sources: * self._expand_sources() * if source_location != 0 and self._index == NULL: # <<<<<<<<<<<<<< @@ -2377,39 +2537,39 @@ */ __pyx_t_1 = (__pyx_v_source_location != 0); if (__pyx_t_1) { - __pyx_t_4 = (((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index == NULL); - __pyx_t_5 = __pyx_t_4; + __pyx_t_5 = (((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index == NULL); + __pyx_t_6 = __pyx_t_5; } else { - __pyx_t_5 = __pyx_t_1; + __pyx_t_6 = __pyx_t_1; } - if (__pyx_t_5) { + if (__pyx_t_6) { - /* "bzrlib/_groupcompress_pyx.pyx":288 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":288 * if source_location != 0 and self._index == NULL: * # We were lazy about populating the index, create it now * self._populate_first_index() # <<<<<<<<<<<<<< * self._sources.append(source) * c_source = PyString_AS_STRING(source) */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_18_groupcompress_pyx_DeltaIndex *)((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->__pyx_vtab)->_populate_first_index(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_18_groupcompress_pyx_DeltaIndex *)((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->__pyx_vtab)->_populate_first_index(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L8; } __pyx_L8:; - /* "bzrlib/_groupcompress_pyx.pyx":289 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":289 * # We were lazy about populating the index, create it now * self._populate_first_index() * self._sources.append(source) # <<<<<<<<<<<<<< * c_source = PyString_AS_STRING(source) * c_source_size = PyString_GET_SIZE(source) */ - __pyx_t_2 = __Pyx_PyObject_Append(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources, __pyx_v_source); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_Append(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources, __pyx_v_source); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "bzrlib/_groupcompress_pyx.pyx":290 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":290 * self._populate_first_index() * self._sources.append(source) * c_source = PyString_AS_STRING(source) # <<<<<<<<<<<<<< @@ -2418,7 +2578,7 @@ */ __pyx_v_c_source = PyString_AS_STRING(__pyx_v_source); - /* "bzrlib/_groupcompress_pyx.pyx":291 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":291 * self._sources.append(source) * c_source = PyString_AS_STRING(source) * c_source_size = PyString_GET_SIZE(source) # <<<<<<<<<<<<<< @@ -2427,7 +2587,7 @@ */ __pyx_v_c_source_size = PyString_GET_SIZE(__pyx_v_source); - /* "bzrlib/_groupcompress_pyx.pyx":292 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":292 * c_source = PyString_AS_STRING(source) * c_source_size = PyString_GET_SIZE(source) * src = self._source_infos + source_location # <<<<<<<<<<<<<< @@ -2436,7 +2596,7 @@ */ __pyx_v_src = (((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_infos + __pyx_v_source_location); - /* "bzrlib/_groupcompress_pyx.pyx":293 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":293 * c_source_size = PyString_GET_SIZE(source) * src = self._source_infos + source_location * src.buf = c_source # <<<<<<<<<<<<<< @@ -2445,7 +2605,7 @@ */ __pyx_v_src->buf = __pyx_v_c_source; - /* "bzrlib/_groupcompress_pyx.pyx":294 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":294 * src = self._source_infos + source_location * src.buf = c_source * src.size = c_source_size # <<<<<<<<<<<<<< @@ -2454,23 +2614,23 @@ */ __pyx_v_src->size = __pyx_v_c_source_size; - /* "bzrlib/_groupcompress_pyx.pyx":296 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":296 * src.size = c_source_size * * src.agg_offset = self._source_offset + unadded_bytes # <<<<<<<<<<<<<< * self._source_offset = src.agg_offset + src.size * # We delay creating the index on the first insert */ - __pyx_t_2 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_v_unadded_bytes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_v_unadded_bytes); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_2); if (unlikely((__pyx_t_7 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_6); if (unlikely((__pyx_t_7 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_src->agg_offset = __pyx_t_7; - /* "bzrlib/_groupcompress_pyx.pyx":297 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":297 * * src.agg_offset = self._source_offset + unadded_bytes * self._source_offset = src.agg_offset + src.size # <<<<<<<<<<<<<< @@ -2479,31 +2639,28 @@ */ ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset = (__pyx_v_src->agg_offset + __pyx_v_src->size); - /* "bzrlib/_groupcompress_pyx.pyx":299 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":299 * self._source_offset = src.agg_offset + src.size * # We delay creating the index on the first insert * if source_location != 0: # <<<<<<<<<<<<<< * with nogil: * res = create_delta_index(src, self._index, &index, */ - __pyx_t_5 = (__pyx_v_source_location != 0); - if (__pyx_t_5) { + __pyx_t_6 = (__pyx_v_source_location != 0); + if (__pyx_t_6) { - /* "bzrlib/_groupcompress_pyx.pyx":300 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":300 * # We delay creating the index on the first insert * if source_location != 0: * with nogil: # <<<<<<<<<<<<<< * res = create_delta_index(src, self._index, &index, * self._max_bytes_to_index) */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - #endif + { PyThreadState *_save; Py_UNBLOCK_THREADS /*try:*/ { - /* "bzrlib/_groupcompress_pyx.pyx":302 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":302 * with nogil: * res = create_delta_index(src, self._index, &index, * self._max_bytes_to_index) # <<<<<<<<<<<<<< @@ -2513,7 +2670,7 @@ __pyx_v_res = create_delta_index(__pyx_v_src, ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index, (&__pyx_v_index), ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_bytes_to_index); } - /* "bzrlib/_groupcompress_pyx.pyx":300 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":300 * # We delay creating the index on the first insert * if source_location != 0: * with nogil: # <<<<<<<<<<<<<< @@ -2525,43 +2682,43 @@ } } - /* "bzrlib/_groupcompress_pyx.pyx":303 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":303 * res = create_delta_index(src, self._index, &index, * self._max_bytes_to_index) * if res != DELTA_OK: # <<<<<<<<<<<<<< * raise _translate_delta_failure(res) * if index != self._index: */ - __pyx_t_5 = (__pyx_v_res != DELTA_OK); - if (__pyx_t_5) { + __pyx_t_6 = (__pyx_v_res != DELTA_OK); + if (__pyx_t_6) { - /* "bzrlib/_groupcompress_pyx.pyx":304 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":304 * self._max_bytes_to_index) * if res != DELTA_OK: * raise _translate_delta_failure(res) # <<<<<<<<<<<<<< * if index != self._index: * free_delta_index(self._index) */ - __pyx_t_6 = __pyx_f_6bzrlib_18_groupcompress_pyx__translate_delta_failure(__pyx_v_res); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_Raise(__pyx_t_6, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = __pyx_f_6bzrlib_18_groupcompress_pyx__translate_delta_failure(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L13; } __pyx_L13:; - /* "bzrlib/_groupcompress_pyx.pyx":305 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":305 * if res != DELTA_OK: * raise _translate_delta_failure(res) * if index != self._index: # <<<<<<<<<<<<<< * free_delta_index(self._index) * self._index = index */ - __pyx_t_5 = (__pyx_v_index != ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index); - if (__pyx_t_5) { + __pyx_t_6 = (__pyx_v_index != ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index); + if (__pyx_t_6) { - /* "bzrlib/_groupcompress_pyx.pyx":306 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":306 * raise _translate_delta_failure(res) * if index != self._index: * free_delta_index(self._index) # <<<<<<<<<<<<<< @@ -2570,7 +2727,7 @@ */ free_delta_index(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index); - /* "bzrlib/_groupcompress_pyx.pyx":307 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":307 * if index != self._index: * free_delta_index(self._index) * self._index = index # <<<<<<<<<<<<<< @@ -2589,7 +2746,7 @@ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex.add_source"); __pyx_r = NULL; __pyx_L0:; @@ -2598,7 +2755,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":309 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":309 * self._index = index * * cdef _populate_first_index(self): # <<<<<<<<<<<<<< @@ -2610,64 +2767,65 @@ struct delta_index *__pyx_v_index; delta_result __pyx_v_res; PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; + Py_ssize_t __pyx_t_1; + int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; - int __pyx_t_5; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("_populate_first_index"); - /* "bzrlib/_groupcompress_pyx.pyx":312 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":312 * cdef delta_index *index * cdef delta_result res * if len(self._sources) != 1 or self._index != NULL: # <<<<<<<<<<<<<< * raise AssertionError('_populate_first_index should only be' * ' called when we have a single source and no index yet') */ - __pyx_t_1 = __pyx_v_self->_sources; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = (__pyx_t_2 != 1); - if (!__pyx_t_3) { - __pyx_t_4 = (__pyx_v_self->_index != NULL); - __pyx_t_5 = __pyx_t_4; + __pyx_t_1 = PyObject_Length(__pyx_v_self->_sources); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = (__pyx_t_1 != 1); + if (!__pyx_t_2) { + __pyx_t_3 = (__pyx_v_self->_index != NULL); + __pyx_t_4 = __pyx_t_3; } else { - __pyx_t_5 = __pyx_t_3; + __pyx_t_4 = __pyx_t_2; } - if (__pyx_t_5) { + if (__pyx_t_4) { - /* "bzrlib/_groupcompress_pyx.pyx":313 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":313 * cdef delta_result res * if len(self._sources) != 1 or self._index != NULL: * raise AssertionError('_populate_first_index should only be' # <<<<<<<<<<<<<< * ' called when we have a single source and no index yet') * */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_5); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_15)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_15)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15)); + __pyx_t_6 = PyObject_Call(__pyx_builtin_AssertionError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_groupcompress_pyx.pyx":318 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":318 * # We know that self._index is already NULL, so create_delta_index * # will always create a new index unless there's a malloc failure * with nogil: # <<<<<<<<<<<<<< * res = create_delta_index(&self._source_infos[0], NULL, &index, * self._max_bytes_to_index) */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - #endif + { PyThreadState *_save; Py_UNBLOCK_THREADS /*try:*/ { - /* "bzrlib/_groupcompress_pyx.pyx":320 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":320 * with nogil: * res = create_delta_index(&self._source_infos[0], NULL, &index, * self._max_bytes_to_index) # <<<<<<<<<<<<<< @@ -2677,7 +2835,7 @@ __pyx_v_res = create_delta_index((&(__pyx_v_self->_source_infos[0])), NULL, (&__pyx_v_index), __pyx_v_self->_max_bytes_to_index); } - /* "bzrlib/_groupcompress_pyx.pyx":318 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":318 * # We know that self._index is already NULL, so create_delta_index * # will always create a new index unless there's a malloc failure * with nogil: # <<<<<<<<<<<<<< @@ -2689,33 +2847,33 @@ } } - /* "bzrlib/_groupcompress_pyx.pyx":321 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":321 * res = create_delta_index(&self._source_infos[0], NULL, &index, * self._max_bytes_to_index) * if res != DELTA_OK: # <<<<<<<<<<<<<< * raise _translate_delta_failure(res) * self._index = index */ - __pyx_t_5 = (__pyx_v_res != DELTA_OK); - if (__pyx_t_5) { + __pyx_t_4 = (__pyx_v_res != DELTA_OK); + if (__pyx_t_4) { - /* "bzrlib/_groupcompress_pyx.pyx":322 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":322 * self._max_bytes_to_index) * if res != DELTA_OK: * raise _translate_delta_failure(res) # <<<<<<<<<<<<<< * self._index = index * */ - __pyx_t_1 = __pyx_f_6bzrlib_18_groupcompress_pyx__translate_delta_failure(__pyx_v_res); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __pyx_f_6bzrlib_18_groupcompress_pyx__translate_delta_failure(__pyx_v_res); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __Pyx_Raise(__pyx_t_6, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "bzrlib/_groupcompress_pyx.pyx":323 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":323 * if res != DELTA_OK: * raise _translate_delta_failure(res) * self._index = index # <<<<<<<<<<<<<< @@ -2727,7 +2885,8 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._populate_first_index"); __pyx_r = 0; __pyx_L0:; @@ -2736,7 +2895,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":325 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":325 * self._index = index * * cdef _expand_sources(self): # <<<<<<<<<<<<<< @@ -2747,23 +2906,30 @@ static PyObject *__pyx_f_6bzrlib_18_groupcompress_pyx_10DeltaIndex__expand_sources(struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - void *__pyx_t_2; + PyObject *__pyx_t_2 = NULL; + void *__pyx_t_3; __Pyx_RefNannySetupContext("_expand_sources"); - /* "bzrlib/_groupcompress_pyx.pyx":326 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":326 * * cdef _expand_sources(self): * raise RuntimeError('if we move self._source_infos, then we need to' # <<<<<<<<<<<<<< * ' change all of the index pointers as well.') * self._max_num_sources = self._max_num_sources * 2 */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); + PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_16)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_groupcompress_pyx.pyx":328 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":328 * raise RuntimeError('if we move self._source_infos, then we need to' * ' change all of the index pointers as well.') * self._max_num_sources = self._max_num_sources * 2 # <<<<<<<<<<<<<< @@ -2772,28 +2938,29 @@ */ __pyx_v_self->_max_num_sources = (__pyx_v_self->_max_num_sources * 2); - /* "bzrlib/_groupcompress_pyx.pyx":331 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":331 * self._source_infos = safe_realloc(self._source_infos, * sizeof(source_info) * * self._max_num_sources) # <<<<<<<<<<<<<< * * def make_delta(self, target_bytes, max_delta_size=0): */ - __pyx_t_2 = __pyx_f_6bzrlib_18_groupcompress_pyx_safe_realloc(__pyx_v_self->_source_infos, ((sizeof(struct source_info)) * __pyx_v_self->_max_num_sources)); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = __pyx_f_6bzrlib_18_groupcompress_pyx_safe_realloc(__pyx_v_self->_source_infos, ((sizeof(struct source_info)) * __pyx_v_self->_max_num_sources)); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_groupcompress_pyx.pyx":329 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":329 * ' change all of the index pointers as well.') * self._max_num_sources = self._max_num_sources * 2 * self._source_infos = safe_realloc(self._source_infos, # <<<<<<<<<<<<<< * sizeof(source_info) * * self._max_num_sources) */ - __pyx_v_self->_source_infos = ((struct source_info *)__pyx_t_2); + __pyx_v_self->_source_infos = ((struct source_info *)__pyx_t_3); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._expand_sources"); __pyx_r = 0; __pyx_L0:; @@ -2802,7 +2969,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":333 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":333 * * self._max_num_sources) * * def make_delta(self, target_bytes, max_delta_size=0): # <<<<<<<<<<<<<< @@ -2810,9 +2977,9 @@ * cdef char *target */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_8make_delta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_8make_delta[] = "Create a delta from the current source to the target bytes."; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_8make_delta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_make_delta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_make_delta[] = "Create a delta from the current source to the target bytes."; +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_make_delta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_target_bytes = 0; PyObject *__pyx_v_max_delta_size = 0; char *__pyx_v_target; @@ -2824,9 +2991,10 @@ PyObject *__pyx_v_result; PyObject *__pyx_r = NULL; int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - unsigned long __pyx_t_4; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + unsigned long __pyx_t_5; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__target_bytes,&__pyx_n_s__max_delta_size,0}; __Pyx_RefNannySetupContext("make_delta"); if (unlikely(__pyx_kwds)) { @@ -2874,7 +3042,7 @@ __pyx_L4_argument_unpacking_done:; __pyx_v_result = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_groupcompress_pyx.pyx":342 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":342 * cdef delta_result res * * if self._index == NULL: # <<<<<<<<<<<<<< @@ -2884,21 +3052,18 @@ __pyx_t_1 = (((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index == NULL); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":343 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":343 * * if self._index == NULL: * if len(self._sources) == 0: # <<<<<<<<<<<<<< * return None * # We were just lazy about generating the index */ - __pyx_t_2 = ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = (__pyx_t_3 == 0); + __pyx_t_2 = PyObject_Length(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_1 = (__pyx_t_2 == 0); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":344 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":344 * if self._index == NULL: * if len(self._sources) == 0: * return None # <<<<<<<<<<<<<< @@ -2913,21 +3078,21 @@ } __pyx_L7:; - /* "bzrlib/_groupcompress_pyx.pyx":346 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":346 * return None * # We were just lazy about generating the index * self._populate_first_index() # <<<<<<<<<<<<<< * * if not PyString_CheckExact(target_bytes): */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_18_groupcompress_pyx_DeltaIndex *)((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->__pyx_vtab)->_populate_first_index(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = ((struct __pyx_vtabstruct_6bzrlib_18_groupcompress_pyx_DeltaIndex *)((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->__pyx_vtab)->_populate_first_index(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L6; } __pyx_L6:; - /* "bzrlib/_groupcompress_pyx.pyx":348 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":348 * self._populate_first_index() * * if not PyString_CheckExact(target_bytes): # <<<<<<<<<<<<<< @@ -2937,23 +3102,29 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_target_bytes)); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":349 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":349 * * if not PyString_CheckExact(target_bytes): * raise TypeError('target is not a str') # <<<<<<<<<<<<<< * * target = PyString_AS_STRING(target_bytes) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_17)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_17)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_17)); + __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; - /* "bzrlib/_groupcompress_pyx.pyx":351 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":351 * raise TypeError('target is not a str') * * target = PyString_AS_STRING(target_bytes) # <<<<<<<<<<<<<< @@ -2962,7 +3133,7 @@ */ __pyx_v_target = PyString_AS_STRING(__pyx_v_target_bytes); - /* "bzrlib/_groupcompress_pyx.pyx":352 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":352 * * target = PyString_AS_STRING(target_bytes) * target_size = PyString_GET_SIZE(target_bytes) # <<<<<<<<<<<<<< @@ -2971,31 +3142,28 @@ */ __pyx_v_target_size = PyString_GET_SIZE(__pyx_v_target_bytes); - /* "bzrlib/_groupcompress_pyx.pyx":357 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":357 * # malloc, and can instead use PyString_FromStringAndSize, to * # allocate the bytes into the final string * c_max_delta_size = max_delta_size # <<<<<<<<<<<<<< * with nogil: * res = create_delta(self._index, target, target_size, */ - __pyx_t_4 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_max_delta_size); if (unlikely((__pyx_t_4 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_c_max_delta_size = __pyx_t_4; + __pyx_t_5 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_max_delta_size); if (unlikely((__pyx_t_5 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_c_max_delta_size = __pyx_t_5; - /* "bzrlib/_groupcompress_pyx.pyx":358 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":358 * # allocate the bytes into the final string * c_max_delta_size = max_delta_size * with nogil: # <<<<<<<<<<<<<< * res = create_delta(self._index, target, target_size, * &delta_size, c_max_delta_size, &delta) */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - #endif + { PyThreadState *_save; Py_UNBLOCK_THREADS /*try:*/ { - /* "bzrlib/_groupcompress_pyx.pyx":360 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":360 * with nogil: * res = create_delta(self._index, target, target_size, * &delta_size, c_max_delta_size, &delta) # <<<<<<<<<<<<<< @@ -3005,7 +3173,7 @@ __pyx_v_res = create_delta(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_index, __pyx_v_target, __pyx_v_target_size, (&__pyx_v_delta_size), __pyx_v_c_max_delta_size, (&__pyx_v_delta)); } - /* "bzrlib/_groupcompress_pyx.pyx":358 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":358 * # allocate the bytes into the final string * c_max_delta_size = max_delta_size * with nogil: # <<<<<<<<<<<<<< @@ -3017,7 +3185,7 @@ } } - /* "bzrlib/_groupcompress_pyx.pyx":361 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":361 * res = create_delta(self._index, target, target_size, * &delta_size, c_max_delta_size, &delta) * result = None # <<<<<<<<<<<<<< @@ -3028,7 +3196,7 @@ __Pyx_DECREF(__pyx_v_result); __pyx_v_result = Py_None; - /* "bzrlib/_groupcompress_pyx.pyx":362 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":362 * &delta_size, c_max_delta_size, &delta) * result = None * if res == DELTA_OK: # <<<<<<<<<<<<<< @@ -3038,20 +3206,20 @@ __pyx_t_1 = (__pyx_v_res == DELTA_OK); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":363 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":363 * result = None * if res == DELTA_OK: * result = PyString_FromStringAndSize(delta, delta_size) # <<<<<<<<<<<<<< * free(delta) * elif res != DELTA_SIZE_TOO_BIG: */ - __pyx_t_2 = PyString_FromStringAndSize(((char *)__pyx_v_delta), __pyx_v_delta_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyString_FromStringAndSize(((char *)__pyx_v_delta), __pyx_v_delta_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_v_result = __pyx_t_4; + __pyx_t_4 = 0; - /* "bzrlib/_groupcompress_pyx.pyx":364 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":364 * if res == DELTA_OK: * result = PyString_FromStringAndSize(delta, delta_size) * free(delta) # <<<<<<<<<<<<<< @@ -3062,7 +3230,7 @@ goto __pyx_L12; } - /* "bzrlib/_groupcompress_pyx.pyx":365 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":365 * result = PyString_FromStringAndSize(delta, delta_size) * free(delta) * elif res != DELTA_SIZE_TOO_BIG: # <<<<<<<<<<<<<< @@ -3072,23 +3240,23 @@ __pyx_t_1 = (__pyx_v_res != DELTA_SIZE_TOO_BIG); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":366 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":366 * free(delta) * elif res != DELTA_SIZE_TOO_BIG: * raise _translate_delta_failure(res) # <<<<<<<<<<<<<< * return result * */ - __pyx_t_2 = __pyx_f_6bzrlib_18_groupcompress_pyx__translate_delta_failure(__pyx_v_res); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_4 = __pyx_f_6bzrlib_18_groupcompress_pyx__translate_delta_failure(__pyx_v_res); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_4); + __Pyx_Raise(__pyx_t_4, 0, 0); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L12; } __pyx_L12:; - /* "bzrlib/_groupcompress_pyx.pyx":367 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":367 * elif res != DELTA_SIZE_TOO_BIG: * raise _translate_delta_failure(res) * return result # <<<<<<<<<<<<<< @@ -3103,7 +3271,8 @@ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex.make_delta"); __pyx_r = NULL; __pyx_L0:; @@ -3113,284 +3282,127 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":135 - * # isn't performance critical - * # cdef readonly list _sources - * cdef readonly object _sources # <<<<<<<<<<<<<< - * cdef source_info *_source_infos - * cdef delta_index *_index +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":370 + * + * + * def make_delta(source_bytes, target_bytes): # <<<<<<<<<<<<<< + * """Create a delta, this is a wrapper around DeltaIndex.make_delta.""" + * di = DeltaIndex(source_bytes) */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_8_sources___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_8_sources___get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_make_delta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_18_groupcompress_pyx_make_delta[] = "Create a delta, this is a wrapper around DeltaIndex.make_delta."; +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_make_delta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_source_bytes = 0; + PyObject *__pyx_v_target_bytes = 0; + struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *__pyx_v_di; PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources); - __pyx_r = ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_sources; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__source_bytes,&__pyx_n_s__target_bytes,0}; + __Pyx_RefNannySetupContext("make_delta"); + __pyx_self = __pyx_self; + if (unlikely(__pyx_kwds)) { + Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); + PyObject* values[2] = {0,0}; + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + switch (PyTuple_GET_SIZE(__pyx_args)) { + case 0: + values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__source_bytes); + if (likely(values[0])) kw_args--; + else goto __pyx_L5_argtuple_error; + case 1: + values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__target_bytes); + if (likely(values[1])) kw_args--; + else { + __Pyx_RaiseArgtupleInvalid("make_delta", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + } + if (unlikely(kw_args > 0)) { + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "make_delta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + } + __pyx_v_source_bytes = values[0]; + __pyx_v_target_bytes = values[1]; + } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { + goto __pyx_L5_argtuple_error; + } else { + __pyx_v_source_bytes = PyTuple_GET_ITEM(__pyx_args, 0); + __pyx_v_target_bytes = PyTuple_GET_ITEM(__pyx_args, 1); + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("make_delta", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} + __pyx_L3_error:; + __Pyx_AddTraceback("bzrlib._groupcompress_pyx.make_delta"); __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_v_di = ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)Py_None); __Pyx_INCREF(Py_None); -/* "bzrlib/_groupcompress_pyx.pyx":138 - * cdef source_info *_source_infos - * cdef delta_index *_index - * cdef public unsigned long _source_offset # <<<<<<<<<<<<<< - * cdef readonly unsigned int _max_num_sources - * cdef public int _max_bytes_to_index + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":372 + * def make_delta(source_bytes, target_bytes): + * """Create a delta, this is a wrapper around DeltaIndex.make_delta.""" + * di = DeltaIndex(source_bytes) # <<<<<<<<<<<<<< + * return di.make_delta(target_bytes) + * */ + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_source_bytes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_source_bytes); + __Pyx_GIVEREF(__pyx_v_source_bytes); + __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_18_groupcompress_pyx_DeltaIndex)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(((PyObject *)__pyx_v_di)); + __pyx_v_di = ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_t_2); + __pyx_t_2 = 0; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_14_source_offset___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_14_source_offset___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":373 + * """Create a delta, this is a wrapper around DeltaIndex.make_delta.""" + * di = DeltaIndex(source_bytes) + * return di.make_delta(target_bytes) # <<<<<<<<<<<<<< + * + * + */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_di), __pyx_n_s__make_delta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_v_target_bytes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_target_bytes); + __Pyx_GIVEREF(__pyx_v_target_bytes); + __pyx_t_3 = PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._source_offset.__get__"); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("bzrlib._groupcompress_pyx.make_delta"); __pyx_r = NULL; __pyx_L0:; + __Pyx_DECREF((PyObject *)__pyx_v_di); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static int __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_14_source_offset_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_14_source_offset_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - unsigned long __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_source_offset = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._source_offset.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_groupcompress_pyx.pyx":139 - * cdef delta_index *_index - * cdef public unsigned long _source_offset - * cdef readonly unsigned int _max_num_sources # <<<<<<<<<<<<<< - * cdef public int _max_bytes_to_index - * - */ - -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_16_max_num_sources___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_16_max_num_sources___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_num_sources); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._max_num_sources.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_groupcompress_pyx.pyx":140 - * cdef public unsigned long _source_offset - * cdef readonly unsigned int _max_num_sources - * cdef public int _max_bytes_to_index # <<<<<<<<<<<<<< - * - * def __init__(self, source=None, max_bytes_to_index=None): - */ - -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_19_max_bytes_to_index___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_19_max_bytes_to_index___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_bytes_to_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._max_bytes_to_index.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_19_max_bytes_to_index_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_19_max_bytes_to_index_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_v_self)->_max_bytes_to_index = __pyx_t_1; - - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("bzrlib._groupcompress_pyx.DeltaIndex._max_bytes_to_index.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_groupcompress_pyx.pyx":370 - * - * - * def make_delta(source_bytes, target_bytes): # <<<<<<<<<<<<<< - * """Create a delta, this is a wrapper around DeltaIndex.make_delta.""" - * di = DeltaIndex(source_bytes) - */ - -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_2make_delta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_18_groupcompress_pyx_2make_delta[] = "Create a delta, this is a wrapper around DeltaIndex.make_delta."; -static PyMethodDef __pyx_mdef_6bzrlib_18_groupcompress_pyx_2make_delta = {__Pyx_NAMESTR("make_delta"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_2make_delta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_2make_delta)}; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_2make_delta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyObject *__pyx_v_source_bytes = 0; - PyObject *__pyx_v_target_bytes = 0; - struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *__pyx_v_di; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__source_bytes,&__pyx_n_s__target_bytes,0}; - __Pyx_RefNannySetupContext("make_delta"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__source_bytes); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__target_bytes); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("make_delta", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "make_delta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_source_bytes = values[0]; - __pyx_v_target_bytes = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_source_bytes = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_target_bytes = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("make_delta", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._groupcompress_pyx.make_delta"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_di = ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_groupcompress_pyx.pyx":372 - * def make_delta(source_bytes, target_bytes): - * """Create a delta, this is a wrapper around DeltaIndex.make_delta.""" - * di = DeltaIndex(source_bytes) # <<<<<<<<<<<<<< - * return di.make_delta(target_bytes) - * - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_source_bytes); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_source_bytes); - __Pyx_GIVEREF(__pyx_v_source_bytes); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_18_groupcompress_pyx_DeltaIndex)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_di)); - __pyx_v_di = ((struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_groupcompress_pyx.pyx":373 - * """Create a delta, this is a wrapper around DeltaIndex.make_delta.""" - * di = DeltaIndex(source_bytes) - * return di.make_delta(target_bytes) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_di), __pyx_n_s__make_delta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_target_bytes); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_target_bytes); - __Pyx_GIVEREF(__pyx_v_target_bytes); - __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("bzrlib._groupcompress_pyx.make_delta"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_di); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_groupcompress_pyx.pyx":376 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":376 * * * def apply_delta(source_bytes, delta_bytes): # <<<<<<<<<<<<<< @@ -3398,10 +3410,9 @@ * cdef char *source */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_3apply_delta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_18_groupcompress_pyx_3apply_delta[] = "Apply a delta generated by make_delta to source_bytes."; -static PyMethodDef __pyx_mdef_6bzrlib_18_groupcompress_pyx_3apply_delta = {__Pyx_NAMESTR("apply_delta"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_3apply_delta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_3apply_delta)}; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_3apply_delta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_apply_delta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_18_groupcompress_pyx_apply_delta[] = "Apply a delta generated by make_delta to source_bytes."; +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_apply_delta(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_source_bytes = 0; PyObject *__pyx_v_delta_bytes = 0; char *__pyx_v_source; @@ -3457,7 +3468,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_groupcompress_pyx.pyx":383 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":383 * cdef Py_ssize_t delta_size * * if not PyString_CheckExact(source_bytes): # <<<<<<<<<<<<<< @@ -3467,23 +3478,29 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_source_bytes)); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":384 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":384 * * if not PyString_CheckExact(source_bytes): * raise TypeError('source is not a str') # <<<<<<<<<<<<<< * if not PyString_CheckExact(delta_bytes): * raise TypeError('delta is not a str') */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_30), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "bzrlib/_groupcompress_pyx.pyx":385 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":385 * if not PyString_CheckExact(source_bytes): * raise TypeError('source is not a str') * if not PyString_CheckExact(delta_bytes): # <<<<<<<<<<<<<< @@ -3493,15 +3510,21 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_delta_bytes)); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":386 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":386 * raise TypeError('source is not a str') * if not PyString_CheckExact(delta_bytes): * raise TypeError('delta is not a str') # <<<<<<<<<<<<<< * source = PyString_AS_STRING(source_bytes) * source_size = PyString_GET_SIZE(source_bytes) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_12)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3509,7 +3532,7 @@ } __pyx_L7:; - /* "bzrlib/_groupcompress_pyx.pyx":387 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":387 * if not PyString_CheckExact(delta_bytes): * raise TypeError('delta is not a str') * source = PyString_AS_STRING(source_bytes) # <<<<<<<<<<<<<< @@ -3518,7 +3541,7 @@ */ __pyx_v_source = PyString_AS_STRING(__pyx_v_source_bytes); - /* "bzrlib/_groupcompress_pyx.pyx":388 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":388 * raise TypeError('delta is not a str') * source = PyString_AS_STRING(source_bytes) * source_size = PyString_GET_SIZE(source_bytes) # <<<<<<<<<<<<<< @@ -3527,7 +3550,7 @@ */ __pyx_v_source_size = PyString_GET_SIZE(__pyx_v_source_bytes); - /* "bzrlib/_groupcompress_pyx.pyx":389 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":389 * source = PyString_AS_STRING(source_bytes) * source_size = PyString_GET_SIZE(source_bytes) * delta = PyString_AS_STRING(delta_bytes) # <<<<<<<<<<<<<< @@ -3536,7 +3559,7 @@ */ __pyx_v_delta = PyString_AS_STRING(__pyx_v_delta_bytes); - /* "bzrlib/_groupcompress_pyx.pyx":390 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":390 * source_size = PyString_GET_SIZE(source_bytes) * delta = PyString_AS_STRING(delta_bytes) * delta_size = PyString_GET_SIZE(delta_bytes) # <<<<<<<<<<<<<< @@ -3545,7 +3568,7 @@ */ __pyx_v_delta_size = PyString_GET_SIZE(__pyx_v_delta_bytes); - /* "bzrlib/_groupcompress_pyx.pyx":393 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":393 * # Code taken from patch-delta.c, only brought here to give better error * # handling, and to avoid double allocating memory * if (delta_size < DELTA_SIZE_MIN): # <<<<<<<<<<<<<< @@ -3555,7 +3578,7 @@ __pyx_t_1 = (__pyx_v_delta_size < DELTA_SIZE_MIN); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":396 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":396 * # XXX: Invalid delta block * raise RuntimeError('delta_size %d smaller than min delta size %d' * % (delta_size, DELTA_SIZE_MIN)) # <<<<<<<<<<<<<< @@ -3567,24 +3590,24 @@ __pyx_t_3 = PyInt_FromSsize_t(DELTA_SIZE_MIN); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_32), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); + __Pyx_GOTREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -3592,7 +3615,7 @@ } __pyx_L8:; - /* "bzrlib/_groupcompress_pyx.pyx":398 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":398 * % (delta_size, DELTA_SIZE_MIN)) * * return _apply_delta(source, source_size, delta, delta_size) # <<<<<<<<<<<<<< @@ -3620,7 +3643,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":401 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":401 * * * cdef unsigned char *_decode_copy_instruction(unsigned char *bytes, # <<<<<<<<<<<<<< @@ -3636,7 +3659,7 @@ long __pyx_t_1; int __pyx_t_2; - /* "bzrlib/_groupcompress_pyx.pyx":415 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":415 * """ * cdef unsigned int off, size, count * off = 0 # <<<<<<<<<<<<<< @@ -3645,7 +3668,7 @@ */ __pyx_v_off = 0; - /* "bzrlib/_groupcompress_pyx.pyx":416 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":416 * cdef unsigned int off, size, count * off = 0 * size = 0 # <<<<<<<<<<<<<< @@ -3654,7 +3677,7 @@ */ __pyx_v_size = 0; - /* "bzrlib/_groupcompress_pyx.pyx":417 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":417 * off = 0 * size = 0 * count = 0 # <<<<<<<<<<<<<< @@ -3663,7 +3686,7 @@ */ __pyx_v_count = 0; - /* "bzrlib/_groupcompress_pyx.pyx":418 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":418 * size = 0 * count = 0 * if (cmd & 0x01): # <<<<<<<<<<<<<< @@ -3673,7 +3696,7 @@ __pyx_t_1 = (__pyx_v_cmd & 0x01); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":419 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":419 * count = 0 * if (cmd & 0x01): * off = bytes[count] # <<<<<<<<<<<<<< @@ -3682,7 +3705,7 @@ */ __pyx_v_off = (__pyx_v_bytes[__pyx_v_count]); - /* "bzrlib/_groupcompress_pyx.pyx":420 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":420 * if (cmd & 0x01): * off = bytes[count] * count = count + 1 # <<<<<<<<<<<<<< @@ -3694,7 +3717,7 @@ } __pyx_L3:; - /* "bzrlib/_groupcompress_pyx.pyx":421 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":421 * off = bytes[count] * count = count + 1 * if (cmd & 0x02): # <<<<<<<<<<<<<< @@ -3704,7 +3727,7 @@ __pyx_t_1 = (__pyx_v_cmd & 0x02); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":422 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":422 * count = count + 1 * if (cmd & 0x02): * off = off | (bytes[count] << 8) # <<<<<<<<<<<<<< @@ -3713,7 +3736,7 @@ */ __pyx_v_off = (__pyx_v_off | ((__pyx_v_bytes[__pyx_v_count]) << 8)); - /* "bzrlib/_groupcompress_pyx.pyx":423 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":423 * if (cmd & 0x02): * off = off | (bytes[count] << 8) * count = count + 1 # <<<<<<<<<<<<<< @@ -3725,7 +3748,7 @@ } __pyx_L4:; - /* "bzrlib/_groupcompress_pyx.pyx":424 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":424 * off = off | (bytes[count] << 8) * count = count + 1 * if (cmd & 0x04): # <<<<<<<<<<<<<< @@ -3735,7 +3758,7 @@ __pyx_t_1 = (__pyx_v_cmd & 0x04); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":425 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":425 * count = count + 1 * if (cmd & 0x04): * off = off | (bytes[count] << 16) # <<<<<<<<<<<<<< @@ -3744,7 +3767,7 @@ */ __pyx_v_off = (__pyx_v_off | ((__pyx_v_bytes[__pyx_v_count]) << 16)); - /* "bzrlib/_groupcompress_pyx.pyx":426 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":426 * if (cmd & 0x04): * off = off | (bytes[count] << 16) * count = count + 1 # <<<<<<<<<<<<<< @@ -3756,7 +3779,7 @@ } __pyx_L5:; - /* "bzrlib/_groupcompress_pyx.pyx":427 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":427 * off = off | (bytes[count] << 16) * count = count + 1 * if (cmd & 0x08): # <<<<<<<<<<<<<< @@ -3766,7 +3789,7 @@ __pyx_t_1 = (__pyx_v_cmd & 0x08); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":428 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":428 * count = count + 1 * if (cmd & 0x08): * off = off | (bytes[count] << 24) # <<<<<<<<<<<<<< @@ -3775,7 +3798,7 @@ */ __pyx_v_off = (__pyx_v_off | ((__pyx_v_bytes[__pyx_v_count]) << 24)); - /* "bzrlib/_groupcompress_pyx.pyx":429 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":429 * if (cmd & 0x08): * off = off | (bytes[count] << 24) * count = count + 1 # <<<<<<<<<<<<<< @@ -3787,7 +3810,7 @@ } __pyx_L6:; - /* "bzrlib/_groupcompress_pyx.pyx":430 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":430 * off = off | (bytes[count] << 24) * count = count + 1 * if (cmd & 0x10): # <<<<<<<<<<<<<< @@ -3797,7 +3820,7 @@ __pyx_t_1 = (__pyx_v_cmd & 0x10); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":431 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":431 * count = count + 1 * if (cmd & 0x10): * size = bytes[count] # <<<<<<<<<<<<<< @@ -3806,7 +3829,7 @@ */ __pyx_v_size = (__pyx_v_bytes[__pyx_v_count]); - /* "bzrlib/_groupcompress_pyx.pyx":432 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":432 * if (cmd & 0x10): * size = bytes[count] * count = count + 1 # <<<<<<<<<<<<<< @@ -3818,7 +3841,7 @@ } __pyx_L7:; - /* "bzrlib/_groupcompress_pyx.pyx":433 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":433 * size = bytes[count] * count = count + 1 * if (cmd & 0x20): # <<<<<<<<<<<<<< @@ -3828,7 +3851,7 @@ __pyx_t_1 = (__pyx_v_cmd & 0x20); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":434 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":434 * count = count + 1 * if (cmd & 0x20): * size = size | (bytes[count] << 8) # <<<<<<<<<<<<<< @@ -3837,7 +3860,7 @@ */ __pyx_v_size = (__pyx_v_size | ((__pyx_v_bytes[__pyx_v_count]) << 8)); - /* "bzrlib/_groupcompress_pyx.pyx":435 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":435 * if (cmd & 0x20): * size = size | (bytes[count] << 8) * count = count + 1 # <<<<<<<<<<<<<< @@ -3849,7 +3872,7 @@ } __pyx_L8:; - /* "bzrlib/_groupcompress_pyx.pyx":436 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":436 * size = size | (bytes[count] << 8) * count = count + 1 * if (cmd & 0x40): # <<<<<<<<<<<<<< @@ -3859,7 +3882,7 @@ __pyx_t_1 = (__pyx_v_cmd & 0x40); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":437 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":437 * count = count + 1 * if (cmd & 0x40): * size = size | (bytes[count] << 16) # <<<<<<<<<<<<<< @@ -3868,7 +3891,7 @@ */ __pyx_v_size = (__pyx_v_size | ((__pyx_v_bytes[__pyx_v_count]) << 16)); - /* "bzrlib/_groupcompress_pyx.pyx":438 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":438 * if (cmd & 0x40): * size = size | (bytes[count] << 16) * count = count + 1 # <<<<<<<<<<<<<< @@ -3880,7 +3903,7 @@ } __pyx_L9:; - /* "bzrlib/_groupcompress_pyx.pyx":439 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":439 * size = size | (bytes[count] << 16) * count = count + 1 * if (size == 0): # <<<<<<<<<<<<<< @@ -3890,7 +3913,7 @@ __pyx_t_2 = (__pyx_v_size == 0); if (__pyx_t_2) { - /* "bzrlib/_groupcompress_pyx.pyx":440 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":440 * count = count + 1 * if (size == 0): * size = 0x10000 # <<<<<<<<<<<<<< @@ -3902,7 +3925,7 @@ } __pyx_L10:; - /* "bzrlib/_groupcompress_pyx.pyx":441 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":441 * if (size == 0): * size = 0x10000 * offset[0] = off # <<<<<<<<<<<<<< @@ -3911,7 +3934,7 @@ */ (__pyx_v_offset[0]) = __pyx_v_off; - /* "bzrlib/_groupcompress_pyx.pyx":442 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":442 * size = 0x10000 * offset[0] = off * length[0] = size # <<<<<<<<<<<<<< @@ -3920,7 +3943,7 @@ */ (__pyx_v_length[0]) = __pyx_v_size; - /* "bzrlib/_groupcompress_pyx.pyx":443 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":443 * offset[0] = off * length[0] = size * return bytes + count # <<<<<<<<<<<<<< @@ -3935,7 +3958,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":446 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":446 * * * cdef object _apply_delta(char *source, Py_ssize_t source_size, # <<<<<<<<<<<<<< @@ -3968,7 +3991,7 @@ __Pyx_RefNannySetupContext("_apply_delta"); __pyx_v_result = Py_None; __Pyx_INCREF(Py_None); - /* "bzrlib/_groupcompress_pyx.pyx":455 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":455 * cdef int failed * * data = delta # <<<<<<<<<<<<<< @@ -3977,7 +4000,7 @@ */ __pyx_v_data = ((unsigned char *)__pyx_v_delta); - /* "bzrlib/_groupcompress_pyx.pyx":456 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":456 * * data = delta * top = data + delta_size # <<<<<<<<<<<<<< @@ -3986,7 +4009,7 @@ */ __pyx_v_top = (__pyx_v_data + __pyx_v_delta_size); - /* "bzrlib/_groupcompress_pyx.pyx":459 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":459 * * # now the result size * size = get_delta_hdr_size(&data, top) # <<<<<<<<<<<<<< @@ -3995,7 +4018,7 @@ */ __pyx_v_size = get_delta_hdr_size((&__pyx_v_data), __pyx_v_top); - /* "bzrlib/_groupcompress_pyx.pyx":460 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":460 * # now the result size * size = get_delta_hdr_size(&data, top) * result = PyString_FromStringAndSize(NULL, size) # <<<<<<<<<<<<<< @@ -4008,7 +4031,7 @@ __pyx_v_result = __pyx_t_1; __pyx_t_1 = 0; - /* "bzrlib/_groupcompress_pyx.pyx":461 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":461 * size = get_delta_hdr_size(&data, top) * result = PyString_FromStringAndSize(NULL, size) * dst_buf = PyString_AS_STRING(result) # <<<<<<<<<<<<<< @@ -4017,7 +4040,7 @@ */ __pyx_v_dst_buf = ((unsigned char *)PyString_AS_STRING(__pyx_v_result)); - /* "bzrlib/_groupcompress_pyx.pyx":463 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":463 * dst_buf = PyString_AS_STRING(result) * * failed = 0 # <<<<<<<<<<<<<< @@ -4026,21 +4049,18 @@ */ __pyx_v_failed = 0; - /* "bzrlib/_groupcompress_pyx.pyx":464 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":464 * * failed = 0 * with nogil: # <<<<<<<<<<<<<< * out = dst_buf * while (data < top): */ - { - #ifdef WITH_THREAD - PyThreadState *_save; - #endif + { PyThreadState *_save; Py_UNBLOCK_THREADS /*try:*/ { - /* "bzrlib/_groupcompress_pyx.pyx":465 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":465 * failed = 0 * with nogil: * out = dst_buf # <<<<<<<<<<<<<< @@ -4049,7 +4069,7 @@ */ __pyx_v_out = __pyx_v_dst_buf; - /* "bzrlib/_groupcompress_pyx.pyx":466 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":466 * with nogil: * out = dst_buf * while (data < top): # <<<<<<<<<<<<<< @@ -4060,7 +4080,7 @@ __pyx_t_2 = (__pyx_v_data < __pyx_v_top); if (!__pyx_t_2) break; - /* "bzrlib/_groupcompress_pyx.pyx":467 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":467 * out = dst_buf * while (data < top): * cmd = data[0] # <<<<<<<<<<<<<< @@ -4069,7 +4089,7 @@ */ __pyx_v_cmd = (__pyx_v_data[0]); - /* "bzrlib/_groupcompress_pyx.pyx":468 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":468 * while (data < top): * cmd = data[0] * data = data + 1 # <<<<<<<<<<<<<< @@ -4078,7 +4098,7 @@ */ __pyx_v_data = (__pyx_v_data + 1); - /* "bzrlib/_groupcompress_pyx.pyx":469 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":469 * cmd = data[0] * data = data + 1 * if (cmd & 0x80): # <<<<<<<<<<<<<< @@ -4088,7 +4108,7 @@ __pyx_t_3 = (__pyx_v_cmd & 0x80); if (__pyx_t_3) { - /* "bzrlib/_groupcompress_pyx.pyx":471 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":471 * if (cmd & 0x80): * # Copy instruction * data = _decode_copy_instruction(data, cmd, &cp_off, &cp_size) # <<<<<<<<<<<<<< @@ -4097,7 +4117,7 @@ */ __pyx_v_data = __pyx_f_6bzrlib_18_groupcompress_pyx__decode_copy_instruction(__pyx_v_data, __pyx_v_cmd, (&__pyx_v_cp_off), (&__pyx_v_cp_size)); - /* "bzrlib/_groupcompress_pyx.pyx":472 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":472 * # Copy instruction * data = _decode_copy_instruction(data, cmd, &cp_off, &cp_size) * if (cp_off + cp_size < cp_size or # <<<<<<<<<<<<<< @@ -4107,7 +4127,7 @@ __pyx_t_2 = ((__pyx_v_cp_off + __pyx_v_cp_size) < __pyx_v_cp_size); if (!__pyx_t_2) { - /* "bzrlib/_groupcompress_pyx.pyx":473 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":473 * data = _decode_copy_instruction(data, cmd, &cp_off, &cp_size) * if (cp_off + cp_size < cp_size or * cp_off + cp_size > source_size or # <<<<<<<<<<<<<< @@ -4117,7 +4137,7 @@ __pyx_t_4 = ((__pyx_v_cp_off + __pyx_v_cp_size) > ((unsigned int)__pyx_v_source_size)); if (!__pyx_t_4) { - /* "bzrlib/_groupcompress_pyx.pyx":474 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":474 * if (cp_off + cp_size < cp_size or * cp_off + cp_size > source_size or * cp_size > size): # <<<<<<<<<<<<<< @@ -4135,7 +4155,7 @@ } if (__pyx_t_4) { - /* "bzrlib/_groupcompress_pyx.pyx":475 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":475 * cp_off + cp_size > source_size or * cp_size > size): * failed = 1 # <<<<<<<<<<<<<< @@ -4144,7 +4164,7 @@ */ __pyx_v_failed = 1; - /* "bzrlib/_groupcompress_pyx.pyx":476 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":476 * cp_size > size): * failed = 1 * break # <<<<<<<<<<<<<< @@ -4156,7 +4176,7 @@ } __pyx_L9:; - /* "bzrlib/_groupcompress_pyx.pyx":477 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":477 * failed = 1 * break * memcpy(out, source + cp_off, cp_size) # <<<<<<<<<<<<<< @@ -4165,7 +4185,7 @@ */ memcpy(__pyx_v_out, (__pyx_v_source + __pyx_v_cp_off), __pyx_v_cp_size); - /* "bzrlib/_groupcompress_pyx.pyx":478 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":478 * break * memcpy(out, source + cp_off, cp_size) * out = out + cp_size # <<<<<<<<<<<<<< @@ -4174,7 +4194,7 @@ */ __pyx_v_out = (__pyx_v_out + __pyx_v_cp_size); - /* "bzrlib/_groupcompress_pyx.pyx":479 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":479 * memcpy(out, source + cp_off, cp_size) * out = out + cp_size * size = size - cp_size # <<<<<<<<<<<<<< @@ -4186,7 +4206,7 @@ } /*else*/ { - /* "bzrlib/_groupcompress_pyx.pyx":482 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":482 * else: * # Insert instruction * if cmd == 0: # <<<<<<<<<<<<<< @@ -4196,7 +4216,7 @@ __pyx_t_4 = (__pyx_v_cmd == 0); if (__pyx_t_4) { - /* "bzrlib/_groupcompress_pyx.pyx":486 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":486 * # extensions. In the mean time we must fail when * # encountering them (might be data corruption). * failed = 2 # <<<<<<<<<<<<<< @@ -4205,7 +4225,7 @@ */ __pyx_v_failed = 2; - /* "bzrlib/_groupcompress_pyx.pyx":487 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":487 * # encountering them (might be data corruption). * failed = 2 * break # <<<<<<<<<<<<<< @@ -4217,7 +4237,7 @@ } __pyx_L10:; - /* "bzrlib/_groupcompress_pyx.pyx":488 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":488 * failed = 2 * break * if cmd > size: # <<<<<<<<<<<<<< @@ -4227,7 +4247,7 @@ __pyx_t_4 = (__pyx_v_cmd > __pyx_v_size); if (__pyx_t_4) { - /* "bzrlib/_groupcompress_pyx.pyx":489 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":489 * break * if cmd > size: * failed = 3 # <<<<<<<<<<<<<< @@ -4236,7 +4256,7 @@ */ __pyx_v_failed = 3; - /* "bzrlib/_groupcompress_pyx.pyx":490 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":490 * if cmd > size: * failed = 3 * break # <<<<<<<<<<<<<< @@ -4248,7 +4268,7 @@ } __pyx_L11:; - /* "bzrlib/_groupcompress_pyx.pyx":491 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":491 * failed = 3 * break * memcpy(out, data, cmd) # <<<<<<<<<<<<<< @@ -4257,7 +4277,7 @@ */ memcpy(__pyx_v_out, __pyx_v_data, __pyx_v_cmd); - /* "bzrlib/_groupcompress_pyx.pyx":492 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":492 * break * memcpy(out, data, cmd) * out = out + cmd # <<<<<<<<<<<<<< @@ -4266,7 +4286,7 @@ */ __pyx_v_out = (__pyx_v_out + __pyx_v_cmd); - /* "bzrlib/_groupcompress_pyx.pyx":493 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":493 * memcpy(out, data, cmd) * out = out + cmd * data = data + cmd # <<<<<<<<<<<<<< @@ -4275,7 +4295,7 @@ */ __pyx_v_data = (__pyx_v_data + __pyx_v_cmd); - /* "bzrlib/_groupcompress_pyx.pyx":494 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":494 * out = out + cmd * data = data + cmd * size = size - cmd # <<<<<<<<<<<<<< @@ -4289,7 +4309,7 @@ __pyx_L7_break:; } - /* "bzrlib/_groupcompress_pyx.pyx":464 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":464 * * failed = 0 * with nogil: # <<<<<<<<<<<<<< @@ -4301,7 +4321,7 @@ } } - /* "bzrlib/_groupcompress_pyx.pyx":495 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":495 * data = data + cmd * size = size - cmd * if failed: # <<<<<<<<<<<<<< @@ -4310,25 +4330,17 @@ */ if (__pyx_v_failed) { - /* "bzrlib/_groupcompress_pyx.pyx":503 - * elif failed == 2: - * raise ValueError('Got delta opcode: 0, not supported') - * elif failed == 3: # <<<<<<<<<<<<<< - * raise ValueError('Insert instruction longer than remaining' - * ' bytes: %d > %d' % (cmd, size)) - */ - switch (__pyx_v_failed) { - - /* "bzrlib/_groupcompress_pyx.pyx":496 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":496 * size = size - cmd * if failed: * if failed == 1: # <<<<<<<<<<<<<< * raise ValueError('Something wrong with:' * ' cp_off = %s, cp_size = %s' */ + switch (__pyx_v_failed) { case 1: - /* "bzrlib/_groupcompress_pyx.pyx":500 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":500 * ' cp_off = %s, cp_size = %s' * ' source_size = %s, size = %s' * % (cp_off, cp_size, source_size, size)) # <<<<<<<<<<<<<< @@ -4344,7 +4356,7 @@ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); + __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_7); @@ -4357,23 +4369,23 @@ __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_33), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_19), __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); + __Pyx_GOTREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_9)); __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_9, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; - /* "bzrlib/_groupcompress_pyx.pyx":501 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":501 * ' source_size = %s, size = %s' * % (cp_off, cp_size, source_size, size)) * elif failed == 2: # <<<<<<<<<<<<<< @@ -4382,21 +4394,27 @@ */ case 2: - /* "bzrlib/_groupcompress_pyx.pyx":502 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":502 * % (cp_off, cp_size, source_size, size)) * elif failed == 2: * raise ValueError('Got delta opcode: 0, not supported') # <<<<<<<<<<<<<< * elif failed == 3: * raise ValueError('Insert instruction longer than remaining' */ - __pyx_t_9 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); - __Pyx_Raise(__pyx_t_9, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_20)); + PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_20)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20)); + __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; - /* "bzrlib/_groupcompress_pyx.pyx":503 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":503 * elif failed == 2: * raise ValueError('Got delta opcode: 0, not supported') * elif failed == 3: # <<<<<<<<<<<<<< @@ -4405,38 +4423,38 @@ */ case 3: - /* "bzrlib/_groupcompress_pyx.pyx":505 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":505 * elif failed == 3: * raise ValueError('Insert instruction longer than remaining' * ' bytes: %d > %d' % (cmd, size)) # <<<<<<<<<<<<<< * * # sanity check */ - __pyx_t_9 = PyInt_FromLong(__pyx_v_cmd); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_10 = PyInt_FromLong(__pyx_v_cmd); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10); + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); - __pyx_t_9 = 0; + PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_36), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(((PyObject *)__pyx_t_9)); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); - __pyx_t_10 = 0; - __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_Raise(__pyx_t_10, 0, 0); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_GOTREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_9)); + __Pyx_GIVEREF(((PyObject *)__pyx_t_9)); + __pyx_t_9 = 0; + __pyx_t_9 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_9, 0, 0); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } @@ -4444,7 +4462,7 @@ } __pyx_L12:; - /* "bzrlib/_groupcompress_pyx.pyx":508 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":508 * * # sanity check * if (data != top or size != 0): # <<<<<<<<<<<<<< @@ -4460,41 +4478,41 @@ } if (__pyx_t_6) { - /* "bzrlib/_groupcompress_pyx.pyx":511 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":511 * raise RuntimeError('Did not extract the number of bytes we expected' * ' we were left with %d bytes in "size", and top - data = %d' * % (size, (top - data))) # <<<<<<<<<<<<<< * return None * */ - __pyx_t_10 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = PyInt_FromLong((__pyx_v_top - __pyx_v_data)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8); + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); + __Pyx_GIVEREF(__pyx_t_9); + PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); - __pyx_t_10 = 0; + __pyx_t_9 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_37), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_22), __pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_8)); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); + PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_8)); __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_8, 0, 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /* "bzrlib/_groupcompress_pyx.pyx":512 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":512 * ' we were left with %d bytes in "size", and top - data = %d' * % (size, (top - data))) * return None # <<<<<<<<<<<<<< @@ -4509,7 +4527,7 @@ } __pyx_L13:; - /* "bzrlib/_groupcompress_pyx.pyx":515 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":515 * * # *dst_size = out - dst_buf; * if (out - dst_buf) != PyString_GET_SIZE(result): # <<<<<<<<<<<<<< @@ -4519,23 +4537,29 @@ __pyx_t_6 = ((__pyx_v_out - __pyx_v_dst_buf) != PyString_GET_SIZE(__pyx_v_result)); if (__pyx_t_6) { - /* "bzrlib/_groupcompress_pyx.pyx":516 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":516 * # *dst_size = out - dst_buf; * if (out - dst_buf) != PyString_GET_SIZE(result): * raise RuntimeError('Number of bytes extracted did not match the' # <<<<<<<<<<<<<< * ' size encoded in the delta header.') * return result */ - __pyx_t_8 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_39), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); - __Pyx_Raise(__pyx_t_8, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_23)); + PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_23)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23)); + __pyx_t_10 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_Raise(__pyx_t_10, 0, 0); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L14; } __pyx_L14:; - /* "bzrlib/_groupcompress_pyx.pyx":518 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":518 * raise RuntimeError('Number of bytes extracted did not match the' * ' size encoded in the delta header.') * return result # <<<<<<<<<<<<<< @@ -4564,7 +4588,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":521 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":521 * * * def apply_delta_to_source(source, delta_start, delta_end): # <<<<<<<<<<<<<< @@ -4572,10 +4596,9 @@ * cdef char *c_source */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_4apply_delta_to_source(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_18_groupcompress_pyx_4apply_delta_to_source[] = "Extract a delta from source bytes, and apply it."; -static PyMethodDef __pyx_mdef_6bzrlib_18_groupcompress_pyx_4apply_delta_to_source = {__Pyx_NAMESTR("apply_delta_to_source"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_4apply_delta_to_source, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_4apply_delta_to_source)}; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_4apply_delta_to_source(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_apply_delta_to_source(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_18_groupcompress_pyx_apply_delta_to_source[] = "Extract a delta from source bytes, and apply it."; +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_apply_delta_to_source(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_source = 0; PyObject *__pyx_v_delta_start = 0; PyObject *__pyx_v_delta_end = 0; @@ -4588,7 +4611,8 @@ PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__source,&__pyx_n_s__delta_start,&__pyx_n_s__delta_end,0}; __Pyx_RefNannySetupContext("apply_delta_to_source"); __pyx_self = __pyx_self; @@ -4642,7 +4666,7 @@ return NULL; __pyx_L4_argument_unpacking_done:; - /* "bzrlib/_groupcompress_pyx.pyx":529 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":529 * cdef Py_ssize_t c_delta_start, c_delta_end * * if not PyString_CheckExact(source): # <<<<<<<<<<<<<< @@ -4652,23 +4676,29 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_source)); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":530 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":530 * * if not PyString_CheckExact(source): * raise TypeError('source is not a str') # <<<<<<<<<<<<<< * c_source_size = PyString_GET_SIZE(source) * c_delta_start = delta_start */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_13)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; - /* "bzrlib/_groupcompress_pyx.pyx":531 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":531 * if not PyString_CheckExact(source): * raise TypeError('source is not a str') * c_source_size = PyString_GET_SIZE(source) # <<<<<<<<<<<<<< @@ -4677,27 +4707,27 @@ */ __pyx_v_c_source_size = PyString_GET_SIZE(__pyx_v_source); - /* "bzrlib/_groupcompress_pyx.pyx":532 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":532 * raise TypeError('source is not a str') * c_source_size = PyString_GET_SIZE(source) * c_delta_start = delta_start # <<<<<<<<<<<<<< * c_delta_end = delta_end * if c_delta_start >= c_source_size: */ - __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_delta_start); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_c_delta_start = __pyx_t_3; + __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_delta_start); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_c_delta_start = __pyx_t_4; - /* "bzrlib/_groupcompress_pyx.pyx":533 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":533 * c_source_size = PyString_GET_SIZE(source) * c_delta_start = delta_start * c_delta_end = delta_end # <<<<<<<<<<<<<< * if c_delta_start >= c_source_size: * raise ValueError('delta starts after source') */ - __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_delta_end); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_c_delta_end = __pyx_t_3; + __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_delta_end); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_v_c_delta_end = __pyx_t_4; - /* "bzrlib/_groupcompress_pyx.pyx":534 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":534 * c_delta_start = delta_start * c_delta_end = delta_end * if c_delta_start >= c_source_size: # <<<<<<<<<<<<<< @@ -4707,15 +4737,21 @@ __pyx_t_1 = (__pyx_v_c_delta_start >= __pyx_v_c_source_size); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":535 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":535 * c_delta_end = delta_end * if c_delta_start >= c_source_size: * raise ValueError('delta starts after source') # <<<<<<<<<<<<<< * if c_delta_end > c_source_size: * raise ValueError('delta ends after source') */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_42), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_24)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_24)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_24)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4723,7 +4759,7 @@ } __pyx_L7:; - /* "bzrlib/_groupcompress_pyx.pyx":536 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":536 * if c_delta_start >= c_source_size: * raise ValueError('delta starts after source') * if c_delta_end > c_source_size: # <<<<<<<<<<<<<< @@ -4733,23 +4769,29 @@ __pyx_t_1 = (__pyx_v_c_delta_end > __pyx_v_c_source_size); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":537 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":537 * raise ValueError('delta starts after source') * if c_delta_end > c_source_size: * raise ValueError('delta ends after source') # <<<<<<<<<<<<<< * if c_delta_start >= c_delta_end: * raise ValueError('delta starts after it ends') */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_25)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_25)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_25)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; - /* "bzrlib/_groupcompress_pyx.pyx":538 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":538 * if c_delta_end > c_source_size: * raise ValueError('delta ends after source') * if c_delta_start >= c_delta_end: # <<<<<<<<<<<<<< @@ -4759,15 +4801,21 @@ __pyx_t_1 = (__pyx_v_c_delta_start >= __pyx_v_c_delta_end); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":539 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":539 * raise ValueError('delta ends after source') * if c_delta_start >= c_delta_end: * raise ValueError('delta starts after it ends') # <<<<<<<<<<<<<< * * c_delta_size = c_delta_end - c_delta_start */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_46), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_26)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_26)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_26)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -4775,7 +4823,7 @@ } __pyx_L9:; - /* "bzrlib/_groupcompress_pyx.pyx":541 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":541 * raise ValueError('delta starts after it ends') * * c_delta_size = c_delta_end - c_delta_start # <<<<<<<<<<<<<< @@ -4784,7 +4832,7 @@ */ __pyx_v_c_delta_size = (__pyx_v_c_delta_end - __pyx_v_c_delta_start); - /* "bzrlib/_groupcompress_pyx.pyx":542 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":542 * * c_delta_size = c_delta_end - c_delta_start * c_source = PyString_AS_STRING(source) # <<<<<<<<<<<<<< @@ -4793,7 +4841,7 @@ */ __pyx_v_c_source = PyString_AS_STRING(__pyx_v_source); - /* "bzrlib/_groupcompress_pyx.pyx":543 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":543 * c_delta_size = c_delta_end - c_delta_start * c_source = PyString_AS_STRING(source) * c_delta = c_source + c_delta_start # <<<<<<<<<<<<<< @@ -4802,7 +4850,7 @@ */ __pyx_v_c_delta = (__pyx_v_c_source + __pyx_v_c_delta_start); - /* "bzrlib/_groupcompress_pyx.pyx":546 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":546 * # We don't use source_size, because we know the delta should not refer to * # any bytes after it starts * return _apply_delta(c_source, c_delta_start, c_delta, c_delta_size) # <<<<<<<<<<<<<< @@ -4820,6 +4868,7 @@ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("bzrlib._groupcompress_pyx.apply_delta_to_source"); __pyx_r = NULL; __pyx_L0:; @@ -4828,7 +4877,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":549 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":549 * * * def encode_base128_int(val): # <<<<<<<<<<<<<< @@ -4836,10 +4885,9 @@ * cdef unsigned int c_val */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_5encode_base128_int(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ -static char __pyx_doc_6bzrlib_18_groupcompress_pyx_5encode_base128_int[] = "Convert an integer into a 7-bit lsb encoding."; -static PyMethodDef __pyx_mdef_6bzrlib_18_groupcompress_pyx_5encode_base128_int = {__Pyx_NAMESTR("encode_base128_int"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_5encode_base128_int, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_5encode_base128_int)}; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_5encode_base128_int(PyObject *__pyx_self, PyObject *__pyx_v_val) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_encode_base128_int(PyObject *__pyx_self, PyObject *__pyx_v_val); /*proto*/ +static char __pyx_doc_6bzrlib_18_groupcompress_pyx_encode_base128_int[] = "Convert an integer into a 7-bit lsb encoding."; +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_encode_base128_int(PyObject *__pyx_self, PyObject *__pyx_v_val) { unsigned int __pyx_v_c_val; Py_ssize_t __pyx_v_count; unsigned char __pyx_v_c_bytes[8]; @@ -4849,10 +4897,11 @@ int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("encode_base128_int"); __pyx_self = __pyx_self; - /* "bzrlib/_groupcompress_pyx.pyx":556 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":556 * cdef unsigned char c_bytes[8] # max size for 32-bit int is 5 bytes * * c_val = val # <<<<<<<<<<<<<< @@ -4862,7 +4911,7 @@ __pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_val); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_c_val = __pyx_t_1; - /* "bzrlib/_groupcompress_pyx.pyx":557 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":557 * * c_val = val * count = 0 # <<<<<<<<<<<<<< @@ -4871,7 +4920,7 @@ */ __pyx_v_count = 0; - /* "bzrlib/_groupcompress_pyx.pyx":558 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":558 * c_val = val * count = 0 * while c_val >= 0x80 and count < 8: # <<<<<<<<<<<<<< @@ -4888,7 +4937,7 @@ } if (!__pyx_t_4) break; - /* "bzrlib/_groupcompress_pyx.pyx":559 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":559 * count = 0 * while c_val >= 0x80 and count < 8: * c_bytes[count] = ((c_val | 0x80) & 0xFF) # <<<<<<<<<<<<<< @@ -4897,7 +4946,7 @@ */ (__pyx_v_c_bytes[__pyx_v_count]) = ((unsigned char)((__pyx_v_c_val | 0x80) & 0xFF)); - /* "bzrlib/_groupcompress_pyx.pyx":560 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":560 * while c_val >= 0x80 and count < 8: * c_bytes[count] = ((c_val | 0x80) & 0xFF) * c_val = c_val >> 7 # <<<<<<<<<<<<<< @@ -4906,7 +4955,7 @@ */ __pyx_v_c_val = (__pyx_v_c_val >> 7); - /* "bzrlib/_groupcompress_pyx.pyx":561 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":561 * c_bytes[count] = ((c_val | 0x80) & 0xFF) * c_val = c_val >> 7 * count = count + 1 # <<<<<<<<<<<<<< @@ -4916,7 +4965,7 @@ __pyx_v_count = (__pyx_v_count + 1); } - /* "bzrlib/_groupcompress_pyx.pyx":562 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":562 * c_val = c_val >> 7 * count = count + 1 * if count >= 8 or c_val >= 0x80: # <<<<<<<<<<<<<< @@ -4932,23 +4981,29 @@ } if (__pyx_t_3) { - /* "bzrlib/_groupcompress_pyx.pyx":563 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":563 * count = count + 1 * if count >= 8 or c_val >= 0x80: * raise ValueError('encode_base128_int overflowed the buffer') # <<<<<<<<<<<<<< * c_bytes[count] = (c_val & 0xFF) * count = count + 1 */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_48), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_27)); + PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_27)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_27)); + __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_Raise(__pyx_t_6, 0, 0); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; - /* "bzrlib/_groupcompress_pyx.pyx":564 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":564 * if count >= 8 or c_val >= 0x80: * raise ValueError('encode_base128_int overflowed the buffer') * c_bytes[count] = (c_val & 0xFF) # <<<<<<<<<<<<<< @@ -4957,7 +5012,7 @@ */ (__pyx_v_c_bytes[__pyx_v_count]) = ((unsigned char)(__pyx_v_c_val & 0xFF)); - /* "bzrlib/_groupcompress_pyx.pyx":565 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":565 * raise ValueError('encode_base128_int overflowed the buffer') * c_bytes[count] = (c_val & 0xFF) * count = count + 1 # <<<<<<<<<<<<<< @@ -4966,7 +5021,7 @@ */ __pyx_v_count = (__pyx_v_count + 1); - /* "bzrlib/_groupcompress_pyx.pyx":566 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":566 * c_bytes[count] = (c_val & 0xFF) * count = count + 1 * return PyString_FromStringAndSize(c_bytes, count) # <<<<<<<<<<<<<< @@ -4974,16 +5029,17 @@ * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = PyString_FromStringAndSize(((char *)__pyx_v_c_bytes), __pyx_v_count); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_6 = PyString_FromStringAndSize(((char *)__pyx_v_c_bytes), __pyx_v_count); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_6); + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("bzrlib._groupcompress_pyx.encode_base128_int"); __pyx_r = NULL; __pyx_L0:; @@ -4992,7 +5048,7 @@ return __pyx_r; } -/* "bzrlib/_groupcompress_pyx.pyx":569 +/* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":569 * * * def decode_base128_int(bytes): # <<<<<<<<<<<<<< @@ -5000,10 +5056,9 @@ * cdef int offset */ -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_6decode_base128_int(PyObject *__pyx_self, PyObject *__pyx_v_bytes); /*proto*/ -static char __pyx_doc_6bzrlib_18_groupcompress_pyx_6decode_base128_int[] = "Decode an integer from a 7-bit lsb encoding."; -static PyMethodDef __pyx_mdef_6bzrlib_18_groupcompress_pyx_6decode_base128_int = {__Pyx_NAMESTR("decode_base128_int"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_6decode_base128_int, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_6decode_base128_int)}; -static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_6decode_base128_int(PyObject *__pyx_self, PyObject *__pyx_v_bytes) { +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_decode_base128_int(PyObject *__pyx_self, PyObject *__pyx_v_bytes); /*proto*/ +static char __pyx_doc_6bzrlib_18_groupcompress_pyx_decode_base128_int[] = "Decode an integer from a 7-bit lsb encoding."; +static PyObject *__pyx_pf_6bzrlib_18_groupcompress_pyx_decode_base128_int(PyObject *__pyx_self, PyObject *__pyx_v_bytes) { int __pyx_v_offset; int __pyx_v_val; unsigned int __pyx_v_uval; @@ -5013,14 +5068,14 @@ PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - long __pyx_t_4; - PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_3 = NULL; + int __pyx_t_4; + long __pyx_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("decode_base128_int"); __pyx_self = __pyx_self; - /* "bzrlib/_groupcompress_pyx.pyx":578 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":578 * cdef unsigned char *c_bytes * * offset = 0 # <<<<<<<<<<<<<< @@ -5029,7 +5084,7 @@ */ __pyx_v_offset = 0; - /* "bzrlib/_groupcompress_pyx.pyx":579 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":579 * * offset = 0 * val = 0 # <<<<<<<<<<<<<< @@ -5038,7 +5093,7 @@ */ __pyx_v_val = 0; - /* "bzrlib/_groupcompress_pyx.pyx":580 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":580 * offset = 0 * val = 0 * shift = 0 # <<<<<<<<<<<<<< @@ -5047,7 +5102,7 @@ */ __pyx_v_shift = 0; - /* "bzrlib/_groupcompress_pyx.pyx":581 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":581 * val = 0 * shift = 0 * if not PyString_CheckExact(bytes): # <<<<<<<<<<<<<< @@ -5057,23 +5112,29 @@ __pyx_t_1 = (!PyString_CheckExact(__pyx_v_bytes)); if (__pyx_t_1) { - /* "bzrlib/_groupcompress_pyx.pyx":582 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":582 * shift = 0 * if not PyString_CheckExact(bytes): * raise TypeError('bytes is not a string') # <<<<<<<<<<<<<< * c_bytes = PyString_AS_STRING(bytes) * # We take off 1, because we have to be able to decode the non-expanded byte */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_28)); + PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_28)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28)); + __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_Raise(__pyx_t_3, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L5; } __pyx_L5:; - /* "bzrlib/_groupcompress_pyx.pyx":583 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":583 * if not PyString_CheckExact(bytes): * raise TypeError('bytes is not a string') * c_bytes = PyString_AS_STRING(bytes) # <<<<<<<<<<<<<< @@ -5082,7 +5143,7 @@ */ __pyx_v_c_bytes = ((unsigned char *)PyString_AS_STRING(__pyx_v_bytes)); - /* "bzrlib/_groupcompress_pyx.pyx":585 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":585 * c_bytes = PyString_AS_STRING(bytes) * # We take off 1, because we have to be able to decode the non-expanded byte * num_low_bytes = PyString_GET_SIZE(bytes) - 1 # <<<<<<<<<<<<<< @@ -5091,7 +5152,7 @@ */ __pyx_v_num_low_bytes = (PyString_GET_SIZE(__pyx_v_bytes) - 1); - /* "bzrlib/_groupcompress_pyx.pyx":586 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":586 * # We take off 1, because we have to be able to decode the non-expanded byte * num_low_bytes = PyString_GET_SIZE(bytes) - 1 * while (c_bytes[offset] & 0x80) and offset < num_low_bytes: # <<<<<<<<<<<<<< @@ -5101,13 +5162,13 @@ while (1) { if (((__pyx_v_c_bytes[__pyx_v_offset]) & 0x80)) { __pyx_t_1 = (__pyx_v_offset < __pyx_v_num_low_bytes); - __pyx_t_3 = __pyx_t_1; + __pyx_t_4 = __pyx_t_1; } else { - __pyx_t_3 = ((__pyx_v_c_bytes[__pyx_v_offset]) & 0x80); + __pyx_t_4 = ((__pyx_v_c_bytes[__pyx_v_offset]) & 0x80); } - if (!__pyx_t_3) break; + if (!__pyx_t_4) break; - /* "bzrlib/_groupcompress_pyx.pyx":587 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":587 * num_low_bytes = PyString_GET_SIZE(bytes) - 1 * while (c_bytes[offset] & 0x80) and offset < num_low_bytes: * val = val | ((c_bytes[offset] & 0x7F) << shift) # <<<<<<<<<<<<<< @@ -5116,7 +5177,7 @@ */ __pyx_v_val = (__pyx_v_val | (((__pyx_v_c_bytes[__pyx_v_offset]) & 0x7F) << __pyx_v_shift)); - /* "bzrlib/_groupcompress_pyx.pyx":588 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":588 * while (c_bytes[offset] & 0x80) and offset < num_low_bytes: * val = val | ((c_bytes[offset] & 0x7F) << shift) * shift = shift + 7 # <<<<<<<<<<<<<< @@ -5125,7 +5186,7 @@ */ __pyx_v_shift = (__pyx_v_shift + 7); - /* "bzrlib/_groupcompress_pyx.pyx":589 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":589 * val = val | ((c_bytes[offset] & 0x7F) << shift) * shift = shift + 7 * offset = offset + 1 # <<<<<<<<<<<<<< @@ -5135,25 +5196,31 @@ __pyx_v_offset = (__pyx_v_offset + 1); } - /* "bzrlib/_groupcompress_pyx.pyx":590 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":590 * shift = shift + 7 * offset = offset + 1 * if c_bytes[offset] & 0x80: # <<<<<<<<<<<<<< * raise ValueError('Data not properly formatted, we ran out of' * ' bytes before 0x80 stopped being set.') */ - __pyx_t_4 = ((__pyx_v_c_bytes[__pyx_v_offset]) & 0x80); - if (__pyx_t_4) { + __pyx_t_5 = ((__pyx_v_c_bytes[__pyx_v_offset]) & 0x80); + if (__pyx_t_5) { - /* "bzrlib/_groupcompress_pyx.pyx":591 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":591 * offset = offset + 1 * if c_bytes[offset] & 0x80: * raise ValueError('Data not properly formatted, we ran out of' # <<<<<<<<<<<<<< * ' bytes before 0x80 stopped being set.') * val = val | (c_bytes[offset] << shift) */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_52), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(((PyObject *)__pyx_kp_s_29)); + PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_29)); + __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29)); + __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -5161,7 +5228,7 @@ } __pyx_L8:; - /* "bzrlib/_groupcompress_pyx.pyx":593 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":593 * raise ValueError('Data not properly formatted, we ran out of' * ' bytes before 0x80 stopped being set.') * val = val | (c_bytes[offset] << shift) # <<<<<<<<<<<<<< @@ -5170,7 +5237,7 @@ */ __pyx_v_val = (__pyx_v_val | ((__pyx_v_c_bytes[__pyx_v_offset]) << __pyx_v_shift)); - /* "bzrlib/_groupcompress_pyx.pyx":594 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":594 * ' bytes before 0x80 stopped being set.') * val = val | (c_bytes[offset] << shift) * offset = offset + 1 # <<<<<<<<<<<<<< @@ -5179,17 +5246,17 @@ */ __pyx_v_offset = (__pyx_v_offset + 1); - /* "bzrlib/_groupcompress_pyx.pyx":595 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":595 * val = val | (c_bytes[offset] << shift) * offset = offset + 1 * if val < 0: # <<<<<<<<<<<<<< * uval = val * return uval, offset */ - __pyx_t_3 = (__pyx_v_val < 0); - if (__pyx_t_3) { + __pyx_t_4 = (__pyx_v_val < 0); + if (__pyx_t_4) { - /* "bzrlib/_groupcompress_pyx.pyx":596 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":596 * offset = offset + 1 * if val < 0: * uval = val # <<<<<<<<<<<<<< @@ -5198,7 +5265,7 @@ */ __pyx_v_uval = ((unsigned int)__pyx_v_val); - /* "bzrlib/_groupcompress_pyx.pyx":597 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":597 * if val < 0: * uval = val * return uval, offset # <<<<<<<<<<<<<< @@ -5208,24 +5275,24 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_uval); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyInt_FromLong(__pyx_v_offset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyInt_FromLong(__pyx_v_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); + __Pyx_GOTREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_2 = 0; - __pyx_t_5 = 0; - __pyx_r = ((PyObject *)__pyx_t_6); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; goto __pyx_L9; } __pyx_L9:; - /* "bzrlib/_groupcompress_pyx.pyx":598 + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":598 * uval = val * return uval, offset * return val, offset # <<<<<<<<<<<<<< @@ -5235,17 +5302,17 @@ __Pyx_XDECREF(__pyx_r); __pyx_t_6 = PyInt_FromLong(__pyx_v_val); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyInt_FromLong(__pyx_v_offset); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_3 = PyInt_FromLong(__pyx_v_offset); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); + __Pyx_GOTREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); __pyx_t_6 = 0; - __pyx_t_5 = 0; - __pyx_r = ((PyObject *)__pyx_t_2); + __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; @@ -5253,7 +5320,7 @@ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("bzrlib._groupcompress_pyx.decode_base128_int"); __pyx_r = NULL; @@ -5280,7 +5347,7 @@ PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); - __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_3__dealloc__(o); + __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); @@ -5317,7 +5384,7 @@ static int __pyx_setprop_6bzrlib_18_groupcompress_pyx_10DeltaIndex__source_offset(PyObject *o, PyObject *v, void *x) { if (v) { - return __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_14_source_offset_1__set__(o, v); + return __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_14_source_offset___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); @@ -5335,7 +5402,7 @@ static int __pyx_setprop_6bzrlib_18_groupcompress_pyx_10DeltaIndex__max_bytes_to_index(PyObject *o, PyObject *v, void *x) { if (v) { - return __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_19_max_bytes_to_index_1__set__(o, v); + return __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_19_max_bytes_to_index___set__(o, v); } else { PyErr_SetString(PyExc_NotImplementedError, "__del__"); @@ -5344,12 +5411,12 @@ } static PyMethodDef __pyx_methods_6bzrlib_18_groupcompress_pyx_DeltaIndex[] = { - {__Pyx_NAMESTR("__sizeof__"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_1__sizeof__, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("_has_index"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_4_has_index, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("_dump_index"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_5_dump_index, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_5_dump_index)}, - {__Pyx_NAMESTR("add_delta_source"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_6add_delta_source, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_6add_delta_source)}, - {__Pyx_NAMESTR("add_source"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_7add_source, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_7add_source)}, - {__Pyx_NAMESTR("make_delta"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_8make_delta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_8make_delta)}, + {__Pyx_NAMESTR("__sizeof__"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex___sizeof__, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_has_index"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex__has_index, METH_NOARGS, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_dump_index"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex__dump_index, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex__dump_index)}, + {__Pyx_NAMESTR("add_delta_source"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_add_delta_source, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_add_delta_source)}, + {__Pyx_NAMESTR("add_source"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_add_source, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_add_source)}, + {__Pyx_NAMESTR("make_delta"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_make_delta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_10DeltaIndex_make_delta)}, {0, 0, 0, 0} }; @@ -5459,7 +5526,7 @@ #endif }; -static PyTypeObject __pyx_type_6bzrlib_18_groupcompress_pyx_DeltaIndex = { +PyTypeObject __pyx_type_6bzrlib_18_groupcompress_pyx_DeltaIndex = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("bzrlib._groupcompress_pyx.DeltaIndex"), /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex), /*tp_basicsize*/ @@ -5473,7 +5540,7 @@ #else 0, /*reserved*/ #endif - __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex_2__repr__, /*tp_repr*/ + __pyx_pf_6bzrlib_18_groupcompress_pyx_10DeltaIndex___repr__, /*tp_repr*/ &__pyx_tp_as_number_DeltaIndex, /*tp_as_number*/ &__pyx_tp_as_sequence_DeltaIndex, /*tp_as_sequence*/ &__pyx_tp_as_mapping_DeltaIndex, /*tp_as_mapping*/ @@ -5483,7 +5550,7 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_DeltaIndex, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6bzrlib_18_groupcompress_pyx_DeltaIndex, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_18_groupcompress_pyx_DeltaIndex, /*tp_clear*/ @@ -5516,6 +5583,13 @@ }; static PyMethodDef __pyx_methods[] = { + {__Pyx_NAMESTR("make_delta_index"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_make_delta_index, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("_rabin_hash"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx__rabin_hash, METH_O, __Pyx_DOCSTR(0)}, + {__Pyx_NAMESTR("make_delta"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_make_delta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_make_delta)}, + {__Pyx_NAMESTR("apply_delta"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_apply_delta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_apply_delta)}, + {__Pyx_NAMESTR("apply_delta_to_source"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_apply_delta_to_source, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_apply_delta_to_source)}, + {__Pyx_NAMESTR("encode_base128_int"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_encode_base128_int, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_encode_base128_int)}, + {__Pyx_NAMESTR("decode_base128_int"), (PyCFunction)__pyx_pf_6bzrlib_18_groupcompress_pyx_decode_base128_int, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_18_groupcompress_pyx_decode_base128_int)}, {0, 0, 0, 0} }; @@ -5523,7 +5597,7 @@ static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, __Pyx_NAMESTR("_groupcompress_pyx"), - __Pyx_DOCSTR(__pyx_k_53), /* m_doc */ + __Pyx_DOCSTR(__pyx_k_30), /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ @@ -5535,37 +5609,46 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, + {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, + {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, - {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0}, + {&__pyx_n_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 1}, + {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, + {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0}, {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, + {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0}, {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0}, - {&__pyx_n_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 1}, + {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0}, + {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0}, {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0}, + {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0}, {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0}, + {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0}, {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0}, + {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0}, - {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0}, - {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0}, - {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0}, - {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0}, - {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0}, - {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0}, - {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0}, - {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0}, - {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0}, - {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0}, + {&__pyx_kp_u_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 1, 0, 0}, + {&__pyx_kp_u_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 1, 0, 0}, + {&__pyx_kp_u_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 1, 0, 0}, + {&__pyx_kp_u_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 1, 0, 0}, + {&__pyx_kp_u_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 1, 0, 0}, + {&__pyx_kp_u_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 1, 0, 0}, + {&__pyx_kp_u_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 1, 0, 0}, + {&__pyx_n_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 1}, + {&__pyx_kp_u_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 1, 0, 0}, + {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, + {&__pyx_kp_u_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 1, 0, 0}, {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0}, - {&__pyx_n_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 1}, - {&__pyx_n_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 1}, + {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, + {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, {&__pyx_n_s__AssertionError, __pyx_k__AssertionError, sizeof(__pyx_k__AssertionError), 0, 0, 1, 1}, + {&__pyx_n_s__DeltaIndex, __pyx_k__DeltaIndex, sizeof(__pyx_k__DeltaIndex), 0, 0, 1, 1}, {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1}, {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, @@ -5574,17 +5657,17 @@ {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1}, {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, + {&__pyx_n_s___dump_index, __pyx_k___dump_index, sizeof(__pyx_k___dump_index), 0, 0, 1, 1}, {&__pyx_n_s___expand_sources, __pyx_k___expand_sources, sizeof(__pyx_k___expand_sources), 0, 0, 1, 1}, {&__pyx_n_s___index, __pyx_k___index, sizeof(__pyx_k___index), 0, 0, 1, 1}, {&__pyx_n_s___max_bytes_to_index, __pyx_k___max_bytes_to_index, sizeof(__pyx_k___max_bytes_to_index), 0, 0, 1, 1}, {&__pyx_n_s___max_num_sources, __pyx_k___max_num_sources, sizeof(__pyx_k___max_num_sources), 0, 0, 1, 1}, - {&__pyx_n_s___rabin_hash, __pyx_k___rabin_hash, sizeof(__pyx_k___rabin_hash), 0, 0, 1, 1}, {&__pyx_n_s___source_infos, __pyx_k___source_infos, sizeof(__pyx_k___source_infos), 0, 0, 1, 1}, {&__pyx_n_s___source_offset, __pyx_k___source_offset, sizeof(__pyx_k___source_offset), 0, 0, 1, 1}, {&__pyx_n_s___sources, __pyx_k___sources, sizeof(__pyx_k___sources), 0, 0, 1, 1}, + {&__pyx_n_s__add_delta_source, __pyx_k__add_delta_source, sizeof(__pyx_k__add_delta_source), 0, 0, 1, 1}, {&__pyx_n_s__add_source, __pyx_k__add_source, sizeof(__pyx_k__add_source), 0, 0, 1, 1}, {&__pyx_n_s__agg_offset, __pyx_k__agg_offset, sizeof(__pyx_k__agg_offset), 0, 0, 1, 1}, - {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, {&__pyx_n_s__apply_delta, __pyx_k__apply_delta, sizeof(__pyx_k__apply_delta), 0, 0, 1, 1}, {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1}, {&__pyx_n_s__decode_base128_int, __pyx_k__decode_base128_int, sizeof(__pyx_k__decode_base128_int), 0, 0, 1, 1}, @@ -5594,7 +5677,6 @@ {&__pyx_n_s__delta_start, __pyx_k__delta_start, sizeof(__pyx_k__delta_start), 0, 0, 1, 1}, {&__pyx_n_s__encode_base128_int, __pyx_k__encode_base128_int, sizeof(__pyx_k__encode_base128_int), 0, 0, 1, 1}, {&__pyx_n_s__make_delta, __pyx_k__make_delta, sizeof(__pyx_k__make_delta), 0, 0, 1, 1}, - {&__pyx_n_s__make_delta_index, __pyx_k__make_delta_index, sizeof(__pyx_k__make_delta_index), 0, 0, 1, 1}, {&__pyx_n_s__map, __pyx_k__map, sizeof(__pyx_k__map), 0, 0, 1, 1}, {&__pyx_n_s__max_bytes_to_index, __pyx_k__max_bytes_to_index, sizeof(__pyx_k__max_bytes_to_index), 0, 0, 1, 1}, {&__pyx_n_s__max_delta_size, __pyx_k__max_delta_size, sizeof(__pyx_k__max_delta_size), 0, 0, 1, 1}, @@ -5617,337 +5699,6 @@ return -1; } -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "bzrlib/_groupcompress_pyx.pyx":109 - * cdef object _translate_delta_failure(delta_result result): - * if result == DELTA_OUT_OF_MEMORY: - * return MemoryError("Delta function failed to allocate memory") # <<<<<<<<<<<<<< - * elif result == DELTA_INDEX_NEEDED: - * return ValueError("Delta function requires delta_index param") - */ - __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4)); - - /* "bzrlib/_groupcompress_pyx.pyx":111 - * return MemoryError("Delta function failed to allocate memory") - * elif result == DELTA_INDEX_NEEDED: - * return ValueError("Delta function requires delta_index param") # <<<<<<<<<<<<<< - * elif result == DELTA_SOURCE_EMPTY: - * return ValueError("Delta function given empty source_info param") - */ - __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_6)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, ((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); - - /* "bzrlib/_groupcompress_pyx.pyx":113 - * return ValueError("Delta function requires delta_index param") - * elif result == DELTA_SOURCE_EMPTY: - * return ValueError("Delta function given empty source_info param") # <<<<<<<<<<<<<< - * elif result == DELTA_SOURCE_BAD: - * return RuntimeError("Delta function given invalid source_info param") - */ - __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); - PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); - - /* "bzrlib/_groupcompress_pyx.pyx":115 - * return ValueError("Delta function given empty source_info param") - * elif result == DELTA_SOURCE_BAD: - * return RuntimeError("Delta function given invalid source_info param") # <<<<<<<<<<<<<< - * elif result == DELTA_BUFFER_EMPTY: - * return ValueError("Delta function given empty buffer params") - */ - __pyx_k_tuple_10 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_10)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); - PyTuple_SET_ITEM(__pyx_k_tuple_10, 0, ((PyObject *)__pyx_kp_s_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10)); - - /* "bzrlib/_groupcompress_pyx.pyx":117 - * return RuntimeError("Delta function given invalid source_info param") - * elif result == DELTA_BUFFER_EMPTY: - * return ValueError("Delta function given empty buffer params") # <<<<<<<<<<<<<< - * return AssertionError("Unrecognised delta result code: %d" % result) - * - */ - __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_12)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_11)); - PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); - - /* "bzrlib/_groupcompress_pyx.pyx":123 - * def _rabin_hash(content): - * if not PyString_CheckExact(content): - * raise ValueError('content must be a string') # <<<<<<<<<<<<<< - * if len(content) < 16: - * raise ValueError('content must be at least 16 bytes long') - */ - __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_14)); - PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15)); - - /* "bzrlib/_groupcompress_pyx.pyx":125 - * raise ValueError('content must be a string') - * if len(content) < 16: - * raise ValueError('content must be at least 16 bytes long') # <<<<<<<<<<<<<< - * # Try to cast it to an int, if it can fit - * return int(rabin_hash((PyString_AS_STRING(content)))) - */ - __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); - PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); - - /* "bzrlib/_groupcompress_pyx.pyx":239 - * - * if not PyString_CheckExact(delta): - * raise TypeError('delta is not a str') # <<<<<<<<<<<<<< - * - * source_location = len(self._sources) - */ - __pyx_k_tuple_20 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_20)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); - PyTuple_SET_ITEM(__pyx_k_tuple_20, 0, ((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20)); - - /* "bzrlib/_groupcompress_pyx.pyx":281 - * - * if not PyString_CheckExact(source): - * raise TypeError('source is not a str') # <<<<<<<<<<<<<< - * - * source_location = len(self._sources) - */ - __pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_22)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_21)); - PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22)); - - /* "bzrlib/_groupcompress_pyx.pyx":313 - * cdef delta_result res - * if len(self._sources) != 1 or self._index != NULL: - * raise AssertionError('_populate_first_index should only be' # <<<<<<<<<<<<<< - * ' called when we have a single source and no index yet') - * - */ - __pyx_k_tuple_25 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_25)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_24)); - PyTuple_SET_ITEM(__pyx_k_tuple_25, 0, ((PyObject *)__pyx_kp_s_24)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_24)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25)); - - /* "bzrlib/_groupcompress_pyx.pyx":326 - * - * cdef _expand_sources(self): - * raise RuntimeError('if we move self._source_infos, then we need to' # <<<<<<<<<<<<<< - * ' change all of the index pointers as well.') - * self._max_num_sources = self._max_num_sources * 2 - */ - __pyx_k_tuple_27 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_27)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_26)); - PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_kp_s_26)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_26)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27)); - - /* "bzrlib/_groupcompress_pyx.pyx":349 - * - * if not PyString_CheckExact(target_bytes): - * raise TypeError('target is not a str') # <<<<<<<<<<<<<< - * - * target = PyString_AS_STRING(target_bytes) - */ - __pyx_k_tuple_29 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_29)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_28)); - PyTuple_SET_ITEM(__pyx_k_tuple_29, 0, ((PyObject *)__pyx_kp_s_28)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_28)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29)); - - /* "bzrlib/_groupcompress_pyx.pyx":384 - * - * if not PyString_CheckExact(source_bytes): - * raise TypeError('source is not a str') # <<<<<<<<<<<<<< - * if not PyString_CheckExact(delta_bytes): - * raise TypeError('delta is not a str') - */ - __pyx_k_tuple_30 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_30)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_21)); - PyTuple_SET_ITEM(__pyx_k_tuple_30, 0, ((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30)); - - /* "bzrlib/_groupcompress_pyx.pyx":386 - * raise TypeError('source is not a str') - * if not PyString_CheckExact(delta_bytes): - * raise TypeError('delta is not a str') # <<<<<<<<<<<<<< - * source = PyString_AS_STRING(source_bytes) - * source_size = PyString_GET_SIZE(source_bytes) - */ - __pyx_k_tuple_31 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_31)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); - PyTuple_SET_ITEM(__pyx_k_tuple_31, 0, ((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31)); - - /* "bzrlib/_groupcompress_pyx.pyx":502 - * % (cp_off, cp_size, source_size, size)) - * elif failed == 2: - * raise ValueError('Got delta opcode: 0, not supported') # <<<<<<<<<<<<<< - * elif failed == 3: - * raise ValueError('Insert instruction longer than remaining' - */ - __pyx_k_tuple_35 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_35)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_34)); - PyTuple_SET_ITEM(__pyx_k_tuple_35, 0, ((PyObject *)__pyx_kp_s_34)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_34)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35)); - - /* "bzrlib/_groupcompress_pyx.pyx":516 - * # *dst_size = out - dst_buf; - * if (out - dst_buf) != PyString_GET_SIZE(result): - * raise RuntimeError('Number of bytes extracted did not match the' # <<<<<<<<<<<<<< - * ' size encoded in the delta header.') - * return result - */ - __pyx_k_tuple_39 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_39)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_38)); - PyTuple_SET_ITEM(__pyx_k_tuple_39, 0, ((PyObject *)__pyx_kp_s_38)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_38)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39)); - - /* "bzrlib/_groupcompress_pyx.pyx":530 - * - * if not PyString_CheckExact(source): - * raise TypeError('source is not a str') # <<<<<<<<<<<<<< - * c_source_size = PyString_GET_SIZE(source) - * c_delta_start = delta_start - */ - __pyx_k_tuple_40 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_40)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_21)); - PyTuple_SET_ITEM(__pyx_k_tuple_40, 0, ((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40)); - - /* "bzrlib/_groupcompress_pyx.pyx":535 - * c_delta_end = delta_end - * if c_delta_start >= c_source_size: - * raise ValueError('delta starts after source') # <<<<<<<<<<<<<< - * if c_delta_end > c_source_size: - * raise ValueError('delta ends after source') - */ - __pyx_k_tuple_42 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_42)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_41)); - PyTuple_SET_ITEM(__pyx_k_tuple_42, 0, ((PyObject *)__pyx_kp_s_41)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_41)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42)); - - /* "bzrlib/_groupcompress_pyx.pyx":537 - * raise ValueError('delta starts after source') - * if c_delta_end > c_source_size: - * raise ValueError('delta ends after source') # <<<<<<<<<<<<<< - * if c_delta_start >= c_delta_end: - * raise ValueError('delta starts after it ends') - */ - __pyx_k_tuple_44 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_44)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_43)); - PyTuple_SET_ITEM(__pyx_k_tuple_44, 0, ((PyObject *)__pyx_kp_s_43)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_43)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44)); - - /* "bzrlib/_groupcompress_pyx.pyx":539 - * raise ValueError('delta ends after source') - * if c_delta_start >= c_delta_end: - * raise ValueError('delta starts after it ends') # <<<<<<<<<<<<<< - * - * c_delta_size = c_delta_end - c_delta_start - */ - __pyx_k_tuple_46 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_46)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_45)); - PyTuple_SET_ITEM(__pyx_k_tuple_46, 0, ((PyObject *)__pyx_kp_s_45)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_45)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46)); - - /* "bzrlib/_groupcompress_pyx.pyx":563 - * count = count + 1 - * if count >= 8 or c_val >= 0x80: - * raise ValueError('encode_base128_int overflowed the buffer') # <<<<<<<<<<<<<< - * c_bytes[count] = (c_val & 0xFF) - * count = count + 1 - */ - __pyx_k_tuple_48 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_48)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_47)); - PyTuple_SET_ITEM(__pyx_k_tuple_48, 0, ((PyObject *)__pyx_kp_s_47)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_47)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_48)); - - /* "bzrlib/_groupcompress_pyx.pyx":582 - * shift = 0 - * if not PyString_CheckExact(bytes): - * raise TypeError('bytes is not a string') # <<<<<<<<<<<<<< - * c_bytes = PyString_AS_STRING(bytes) - * # We take off 1, because we have to be able to decode the non-expanded byte - */ - __pyx_k_tuple_50 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_50)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_49)); - PyTuple_SET_ITEM(__pyx_k_tuple_50, 0, ((PyObject *)__pyx_kp_s_49)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_49)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50)); - - /* "bzrlib/_groupcompress_pyx.pyx":591 - * offset = offset + 1 - * if c_bytes[offset] & 0x80: - * raise ValueError('Data not properly formatted, we ran out of' # <<<<<<<<<<<<<< - * ' bytes before 0x80 stopped being set.') - * val = val | (c_bytes[offset] << shift) - */ - __pyx_k_tuple_52 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_52)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_51)); - PyTuple_SET_ITEM(__pyx_k_tuple_52, 0, ((PyObject *)__pyx_kp_s_51)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_51)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; @@ -5965,6 +5716,8 @@ #endif { PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; #if CYTHON_REFNANNY void* __pyx_refnanny = NULL; __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); @@ -5990,7 +5743,7 @@ #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_groupcompress_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_53), 0, PYTHON_API_VERSION); + __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_groupcompress_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_30), 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif @@ -6008,14 +5761,17 @@ } /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ __pyx_vtabptr_6bzrlib_18_groupcompress_pyx_DeltaIndex = &__pyx_vtable_6bzrlib_18_groupcompress_pyx_DeltaIndex; + #if PY_MAJOR_VERSION >= 3 __pyx_vtable_6bzrlib_18_groupcompress_pyx_DeltaIndex._populate_first_index = (PyObject *(*)(struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *))__pyx_f_6bzrlib_18_groupcompress_pyx_10DeltaIndex__populate_first_index; __pyx_vtable_6bzrlib_18_groupcompress_pyx_DeltaIndex._expand_sources = (PyObject *(*)(struct __pyx_obj_6bzrlib_18_groupcompress_pyx_DeltaIndex *))__pyx_f_6bzrlib_18_groupcompress_pyx_10DeltaIndex__expand_sources; + #else + *(void(**)(void))&__pyx_vtable_6bzrlib_18_groupcompress_pyx_DeltaIndex._populate_first_index = (void(*)(void))__pyx_f_6bzrlib_18_groupcompress_pyx_10DeltaIndex__populate_first_index; + *(void(**)(void))&__pyx_vtable_6bzrlib_18_groupcompress_pyx_DeltaIndex._expand_sources = (void(*)(void))__pyx_f_6bzrlib_18_groupcompress_pyx_10DeltaIndex__expand_sources; + #endif if (PyType_Ready(&__pyx_type_6bzrlib_18_groupcompress_pyx_DeltaIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetVtable(__pyx_type_6bzrlib_18_groupcompress_pyx_DeltaIndex.tp_dict, __pyx_vtabptr_6bzrlib_18_groupcompress_pyx_DeltaIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "DeltaIndex", (PyObject *)&__pyx_type_6bzrlib_18_groupcompress_pyx_DeltaIndex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} @@ -6024,102 +5780,95 @@ /*--- Function import code ---*/ /*--- Execution code ---*/ - /* "bzrlib/_groupcompress_pyx.pyx":103 - * val[0] = NULL - * - * def make_delta_index(source): # <<<<<<<<<<<<<< - * return DeltaIndex(source) - * - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_18_groupcompress_pyx_make_delta_index, NULL, __pyx_n_s_54); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__make_delta_index, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_groupcompress_pyx.pyx":121 - * - * - * def _rabin_hash(content): # <<<<<<<<<<<<<< - * if not PyString_CheckExact(content): - * raise ValueError('content must be a string') - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_18_groupcompress_pyx_1_rabin_hash, NULL, __pyx_n_s_54); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___rabin_hash, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_groupcompress_pyx.pyx":370 - * - * - * def make_delta(source_bytes, target_bytes): # <<<<<<<<<<<<<< - * """Create a delta, this is a wrapper around DeltaIndex.make_delta.""" - * di = DeltaIndex(source_bytes) - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_18_groupcompress_pyx_2make_delta, NULL, __pyx_n_s_54); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__make_delta, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_groupcompress_pyx.pyx":376 - * - * - * def apply_delta(source_bytes, delta_bytes): # <<<<<<<<<<<<<< - * """Apply a delta generated by make_delta to source_bytes.""" - * cdef char *source - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_18_groupcompress_pyx_3apply_delta, NULL, __pyx_n_s_54); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__apply_delta, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_groupcompress_pyx.pyx":521 - * - * - * def apply_delta_to_source(source, delta_start, delta_end): # <<<<<<<<<<<<<< - * """Extract a delta from source bytes, and apply it.""" - * cdef char *c_source - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_18_groupcompress_pyx_4apply_delta_to_source, NULL, __pyx_n_s_54); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_55, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_groupcompress_pyx.pyx":549 - * - * - * def encode_base128_int(val): # <<<<<<<<<<<<<< - * """Convert an integer into a 7-bit lsb encoding.""" - * cdef unsigned int c_val - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_18_groupcompress_pyx_5encode_base128_int, NULL, __pyx_n_s_54); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__encode_base128_int, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_groupcompress_pyx.pyx":569 - * - * - * def decode_base128_int(bytes): # <<<<<<<<<<<<<< - * """Decode an integer from a 7-bit lsb encoding.""" - * cdef int offset - */ - __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_18_groupcompress_pyx_6decode_base128_int, NULL, __pyx_n_s_54); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decode_base128_int, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_groupcompress_pyx.pyx":1 - * # Copyright (C) 2008, 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<< - * # - * # This program is free software; you can redistribute it and/or modify + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_groupcompress_pyx.pyx":1 + * # Copyright (C) 2008, 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<< + * # + * # This program is free software; you can redistribute it and/or modify */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__DeltaIndex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s___dump_index); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_31), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__DeltaIndex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__add_delta_source); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_32), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__DeltaIndex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__add_source); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_33), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__DeltaIndex); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__make_delta); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_34), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__make_delta); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_35), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__apply_delta); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_36), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s_38); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_37), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__encode_base128_int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetAttrString(__pyx_t_3, "__doc__"); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_39), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetAttr(__pyx_m, __pyx_n_s__decode_base128_int); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_2, "__doc__"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_40), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { __Pyx_AddTraceback("init bzrlib._groupcompress_pyx"); Py_DECREF(__pyx_m); __pyx_m = 0; @@ -6145,6 +5894,128 @@ return result; } +static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) +{ + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION >= 3 + "%s() got multiple values for keyword argument '%U'", func_name, kw_name); + #else + "%s() got multiple values for keyword argument '%s'", func_name, + PyString_AS_STRING(kw_name)); + #endif +} + +static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, + Py_ssize_t num_max, + Py_ssize_t num_found) +{ + Py_ssize_t num_expected; + const char *number, *more_or_less; + + if (num_found < num_min) { + num_expected = num_min; + more_or_less = "at least"; + } else { + num_expected = num_max; + more_or_less = "at most"; + } + if (exact) { + more_or_less = "exactly"; + } + number = (num_expected == 1) ? "" : "s"; + PyErr_Format(PyExc_TypeError, + #if PY_VERSION_HEX < 0x02050000 + "%s() takes %s %d positional argument%s (%d given)", + #else + "%s() takes %s %zd positional argument%s (%zd given)", + #endif + func_name, more_or_less, num_expected, number, num_found); +} + +static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, + PyObject *values[], + Py_ssize_t num_pos_args, + const char* function_name) +{ + PyObject *key = 0, *value = 0; + Py_ssize_t pos = 0; + PyObject*** name; + PyObject*** first_kw_arg = argnames + num_pos_args; + + while (PyDict_Next(kwds, &pos, &key, &value)) { + name = first_kw_arg; + while (*name && (**name != key)) name++; + if (*name) { + values[name-argnames] = value; + } else { + #if PY_MAJOR_VERSION < 3 + if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { + #else + if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { + #endif + goto invalid_keyword_type; + } else { + for (name = first_kw_arg; *name; name++) { + #if PY_MAJOR_VERSION >= 3 + if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && + PyUnicode_Compare(**name, key) == 0) break; + #else + if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && + _PyString_Eq(**name, key)) break; + #endif + } + if (*name) { + values[name-argnames] = value; + } else { + /* unexpected keyword found */ + for (name=argnames; name != first_kw_arg; name++) { + if (**name == key) goto arg_passed_twice; + #if PY_MAJOR_VERSION >= 3 + if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && + PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; + #else + if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && + _PyString_Eq(**name, key)) goto arg_passed_twice; + #endif + } + if (kwds2) { + if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; + } else { + goto invalid_keyword; + } + } + } + } + } + return 0; +arg_passed_twice: + __Pyx_RaiseDoubleKeywordsError(function_name, **name); + goto bad; +invalid_keyword_type: + PyErr_Format(PyExc_TypeError, + "%s() keywords must be strings", function_name); + goto bad; +invalid_keyword: + PyErr_Format(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + "%s() got an unexpected keyword argument '%s'", + function_name, PyString_AsString(key)); + #else + "%s() got an unexpected keyword argument '%U'", + function_name, key); + #endif +bad: + return -1; +} + static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); @@ -6282,128 +6153,6 @@ } #endif -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} - static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { const unsigned char neg_one = (unsigned char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; diff -Nru bzr-2.5.0/bzrlib/help.py bzr-2.6.0~beta1/bzrlib/help.py --- bzr-2.5.0/bzrlib/help.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/help.py 2012-03-15 10:00:24.000000000 +0000 @@ -31,6 +31,7 @@ help_topics, osutils, plugin, + ui, utextwrap, ) @@ -38,7 +39,7 @@ def help(topic=None, outfile=None): """Write the help for the specific topic to outfile""" if outfile is None: - outfile = sys.stdout + outfile = ui.ui_factory.make_output_stream() indices = HelpIndices() @@ -63,7 +64,7 @@ def help_commands(outfile=None): """List all commands""" if outfile is None: - outfile = sys.stdout + outfile = ui.ui_factory.make_output_stream() outfile.write(_help_commands_to_text('commands')) diff -Nru bzr-2.5.0/bzrlib/help_topics/__init__.py bzr-2.6.0~beta1/bzrlib/help_topics/__init__.py --- bzr-2.5.0/bzrlib/help_topics/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/help_topics/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -739,13 +739,13 @@ topic_registry.register('basic', _basic_help, "Basic commands", SECT_HIDDEN) topic_registry.register('topics', _help_on_topics, "Topics list", SECT_HIDDEN) def get_current_formats_topic(topic): - from bzrlib import bzrdir + from bzrlib import controldir return "Current Storage Formats\n\n" + \ - bzrdir.format_registry.help_topic(topic) + controldir.format_registry.help_topic(topic) def get_other_formats_topic(topic): - from bzrlib import bzrdir + from bzrlib import controldir return "Other Storage Formats\n\n" + \ - bzrdir.format_registry.help_topic(topic) + controldir.format_registry.help_topic(topic) topic_registry.register('current-formats', get_current_formats_topic, 'Current storage formats') topic_registry.register('other-formats', get_other_formats_topic, diff -Nru bzr-2.5.0/bzrlib/hooks.py bzr-2.6.0~beta1/bzrlib/hooks.py --- bzr-2.5.0/bzrlib/hooks.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/hooks.py 2012-03-15 10:00:24.000000000 +0000 @@ -106,12 +106,6 @@ return pyutils.get_named_object(module_name, member_name) -@symbol_versioning.deprecated_function(symbol_versioning.deprecated_in((2, 3))) -def known_hooks_key_to_parent_and_attribute(key): - """See KnownHooksRegistry.key_to_parent_and_attribute.""" - return known_hooks.key_to_parent_and_attribute(key) - - class Hooks(dict): """A dictionary mapping hook name to a list of callables. @@ -153,18 +147,6 @@ deprecated=deprecated, callbacks=callbacks) self[name] = hookpoint - @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4))) - def create_hook(self, hook): - """Create a hook which can have callbacks registered for it. - - :param hook: The hook to create. An object meeting the protocol of - bzrlib.hooks.HookPoint. It's name is used as the key for future - lookups. - """ - if hook.name in self: - raise errors.DuplicateKey(hook.name) - self[hook.name] = hook - def docs(self): """Generate the documentation for this Hooks instance. diff -Nru bzr-2.5.0/bzrlib/__init__.py bzr-2.6.0~beta1/bzrlib/__init__.py --- bzr-2.5.0/bzrlib/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -55,7 +55,7 @@ # Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a # releaselevel of 'dev' for unreleased under-development code. -version_info = (2, 5, 0, 'final', 0) +version_info = (2, 6, 0, 'beta', 1) # API compatibility version api_minimum_version = (2, 4, 0) diff -Nru bzr-2.5.0/bzrlib/inventory.py bzr-2.6.0~beta1/bzrlib/inventory.py --- bzr-2.5.0/bzrlib/inventory.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/inventory.py 2012-03-15 10:00:24.000000000 +0000 @@ -633,24 +633,6 @@ inserted, other than through the Inventory API. """ - @deprecated_method(deprecated_in((2, 4, 0))) - def __contains__(self, file_id): - """True if this entry contains a file with given id. - - >>> inv = Inventory() - >>> inv.add(InventoryFile('123', 'foo.c', ROOT_ID)) - InventoryFile('123', 'foo.c', parent_id='TREE_ROOT', sha1=None, len=None, revision=None) - >>> inv.has_id('123') - True - >>> inv.has_id('456') - False - - Note that this method along with __iter__ are not encouraged for use as - they are less clear than specific query methods - they may be rmeoved - in the future. - """ - return self.has_id(file_id) - def has_filename(self, filename): return bool(self.path2id(filename)) @@ -850,22 +832,6 @@ descend(self.root, u'') return accum - def directories(self): - """Return (path, entry) pairs for all directories, including the root. - """ - accum = [] - def descend(parent_ie, parent_path): - accum.append((parent_path, parent_ie)) - - kids = [(ie.name, ie) for ie in parent_ie.children.itervalues() if ie.kind == 'directory'] - kids.sort() - - for name, child_ie in kids: - child_path = osutils.pathjoin(parent_path, name) - descend(child_ie, child_path) - descend(self.root, u'') - return accum - def path2id(self, relpath): """Walk down through directories to return entry of last component. @@ -2127,13 +2093,16 @@ def path2id(self, relpath): """See CommonInventory.path2id().""" # TODO: perhaps support negative hits? - result = self._path_to_fileid_cache.get(relpath, None) - if result is not None: - return result if isinstance(relpath, basestring): names = osutils.splitpath(relpath) else: names = relpath + if relpath == []: + relpath = [""] + relpath = osutils.pathjoin(*relpath) + result = self._path_to_fileid_cache.get(relpath, None) + if result is not None: + return result current_id = self.root_id if current_id is None: return None diff -Nru bzr-2.5.0/bzrlib/_knit_load_data_pyx.c bzr-2.6.0~beta1/bzrlib/_knit_load_data_pyx.c --- bzr-2.5.0/bzrlib/_knit_load_data_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_knit_load_data_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,317 +1,64 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:26 2012 */ +/* Generated by Pyrex 0.9.8.5 on Fri Oct 8 14:00:57 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif - -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif - -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif - +#include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include -#define __PYX_HAVE_API__bzrlib___knit_load_data_pyx #include "stdlib.h" #include "string.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif +typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ -/* inline attribute */ -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif +static PyObject *__pyx_m; +static PyObject *__pyx_b; +static int __pyx_lineno; +static char *__pyx_filename; +static char **__pyx_f; -/* unused attribute */ -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif +static char __pyx_mdoc[] = "Pyrex extensions to knit parsing."; -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*/ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -/* Type Conversion Predeclarations */ +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static const char *__pyx_f[] = { - "_knit_load_data_pyx.pyx", -}; +static void __Pyx_AddTraceback(char *funcname); /*proto*/ + +/* Declarations from bzrlib._knit_load_data_pyx */ -/* Type declarations */ -/* "bzrlib/_knit_load_data_pyx.pyx":76 - * - * - * cdef class KnitIndexReader: # <<<<<<<<<<<<<< - * - * cdef object kndx - */ +/* Declarations from implementation of bzrlib._knit_load_data_pyx */ struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader { PyObject_HEAD @@ -328,952 +75,428 @@ struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader { int (*validate)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *); - PyObject *(*process_options)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *, char *, char *); - PyObject *(*process_parents)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *, char *, char *); - int (*process_one_record)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *, char *, char *); + PyObject *(*process_options)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *,char *,char *); + PyObject *(*process_parents)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *,char *,char *); + int (*process_one_record)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *,char *,char *); int (*process_next_record)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *); }; static struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_vtabptr_6bzrlib_19_knit_load_data_pyx_KnitIndexReader; -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif - -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); - end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +static PyTypeObject *__pyx_ptype_6bzrlib_19_knit_load_data_pyx_KnitIndexReader = 0; +static int __pyx_f_6bzrlib_19_knit_load_data_pyx_string_to_int_safe(char *,char *,int *); /*proto*/ -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ +static char __pyx_k1[] = "%r is not a valid integer"; +static char __pyx_k2[] = "_cache"; +static char __pyx_k3[] = "_history"; +static char __pyx_k4[] = "kndx._cache must be a python dict"; +static char __pyx_k5[] = "kndx._history must be a python list"; +static char __pyx_k6[] = "Parent index refers to a revision which does not exist yet. %d > %d"; +static char __pyx_k7[] = "errors"; +static char __pyx_k8[] = "KnitCorrupt"; +static char __pyx_k9[] = "_filename"; +static char __pyx_k10[] = "line %r: %s"; +static char __pyx_k11[] = "check_header"; +static char __pyx_k12[] = "read"; +static char __pyx_k13[] = "sys"; +static char __pyx_k14[] = "bzrlib"; + +static PyObject *__pyx_n_KnitCorrupt; +static PyObject *__pyx_n__cache; +static PyObject *__pyx_n__filename; +static PyObject *__pyx_n__history; +static PyObject *__pyx_n_bzrlib; +static PyObject *__pyx_n_check_header; +static PyObject *__pyx_n_errors; +static PyObject *__pyx_n_read; +static PyObject *__pyx_n_sys; + +static PyObject *__pyx_k1p; +static PyObject *__pyx_k4p; +static PyObject *__pyx_k5p; +static PyObject *__pyx_k6p; +static PyObject *__pyx_k10p; -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_KnitCorrupt, 1, __pyx_k8, sizeof(__pyx_k8)}, + {&__pyx_n__cache, 1, __pyx_k2, sizeof(__pyx_k2)}, + {&__pyx_n__filename, 1, __pyx_k9, sizeof(__pyx_k9)}, + {&__pyx_n__history, 1, __pyx_k3, sizeof(__pyx_k3)}, + {&__pyx_n_bzrlib, 1, __pyx_k14, sizeof(__pyx_k14)}, + {&__pyx_n_check_header, 1, __pyx_k11, sizeof(__pyx_k11)}, + {&__pyx_n_errors, 1, __pyx_k7, sizeof(__pyx_k7)}, + {&__pyx_n_read, 1, __pyx_k12, sizeof(__pyx_k12)}, + {&__pyx_n_sys, 1, __pyx_k13, sizeof(__pyx_k13)}, + {&__pyx_k1p, 0, __pyx_k1, sizeof(__pyx_k1)}, + {&__pyx_k4p, 0, __pyx_k4, sizeof(__pyx_k4)}, + {&__pyx_k5p, 0, __pyx_k5, sizeof(__pyx_k5)}, + {&__pyx_k6p, 0, __pyx_k6, sizeof(__pyx_k6)}, + {&__pyx_k10p, 0, __pyx_k10, sizeof(__pyx_k10)}, + {0, 0, 0, 0} +}; -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from bzrlib._knit_load_data_pyx */ -static PyTypeObject *__pyx_ptype_6bzrlib_19_knit_load_data_pyx_KnitIndexReader = 0; -static int __pyx_f_6bzrlib_19_knit_load_data_pyx_string_to_int_safe(char *, char *, int *); /*proto*/ -#define __Pyx_MODULE_NAME "bzrlib._knit_load_data_pyx" -static int __pyx_module_is_main_bzrlib___knit_load_data_pyx = 0; /* Implementation of bzrlib._knit_load_data_pyx */ -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_IndexError; -static char __pyx_k_1[] = "%r is not a valid integer"; -static char __pyx_k_2[] = "kndx._cache must be a python dict"; -static char __pyx_k_4[] = "kndx._history must be a python list"; -static char __pyx_k_6[] = "Parent index refers to a revision which does not exist yet. %d > %d"; -static char __pyx_k_7[] = "line %r: %s"; -static char __pyx_k_8[] = "Pyrex extensions to knit parsing."; -static char __pyx_k_9[] = "bzrlib._knit_load_data_pyx"; -static char __pyx_k__fp[] = "fp"; -static char __pyx_k__sys[] = "sys"; -static char __pyx_k__kndx[] = "kndx"; -static char __pyx_k__read[] = "read"; -static char __pyx_k__cache[] = "cache"; -static char __pyx_k___cache[] = "_cache"; -static char __pyx_k__bzrlib[] = "bzrlib"; -static char __pyx_k__errors[] = "errors"; -static char __pyx_k__cur_str[] = "cur_str"; -static char __pyx_k__end_str[] = "end_str"; -static char __pyx_k__history[] = "history"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k___history[] = "_history"; -static char __pyx_k__validate[] = "validate"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k___filename[] = "_filename"; -static char __pyx_k__IndexError[] = "IndexError"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k__KnitCorrupt[] = "KnitCorrupt"; -static char __pyx_k__history_len[] = "history_len"; -static char __pyx_k___load_data_c[] = "_load_data_c"; -static char __pyx_k__check_header[] = "check_header"; -static char __pyx_k__process_options[] = "process_options"; -static char __pyx_k__process_parents[] = "process_parents"; -static char __pyx_k__process_one_record[] = "process_one_record"; -static char __pyx_k__process_next_record[] = "process_next_record"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_6; -static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_n_s_9; -static PyObject *__pyx_n_s__IndexError; -static PyObject *__pyx_n_s__KnitCorrupt; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___cache; -static PyObject *__pyx_n_s___filename; -static PyObject *__pyx_n_s___history; -static PyObject *__pyx_n_s___load_data_c; -static PyObject *__pyx_n_s__bzrlib; -static PyObject *__pyx_n_s__cache; -static PyObject *__pyx_n_s__check_header; -static PyObject *__pyx_n_s__cur_str; -static PyObject *__pyx_n_s__end_str; -static PyObject *__pyx_n_s__errors; -static PyObject *__pyx_n_s__fp; -static PyObject *__pyx_n_s__history; -static PyObject *__pyx_n_s__history_len; -static PyObject *__pyx_n_s__kndx; -static PyObject *__pyx_n_s__process_next_record; -static PyObject *__pyx_n_s__process_one_record; -static PyObject *__pyx_n_s__process_options; -static PyObject *__pyx_n_s__process_parents; -static PyObject *__pyx_n_s__read; -static PyObject *__pyx_n_s__sys; -static PyObject *__pyx_n_s__validate; -static PyObject *__pyx_k_tuple_3; -static PyObject *__pyx_k_tuple_5; - -/* "bzrlib/_knit_load_data_pyx.pyx":51 - * - * - * cdef int string_to_int_safe(char *s, char *end, int *out) except -1: # <<<<<<<<<<<<<< - * """Convert a base10 string to an integer. - * - */ -static int __pyx_f_6bzrlib_19_knit_load_data_pyx_string_to_int_safe(char *__pyx_v_s, char *__pyx_v_end, int *__pyx_v_out) { +static int __pyx_f_6bzrlib_19_knit_load_data_pyx_string_to_int_safe(char *__pyx_v_s,char *__pyx_v_end,int *__pyx_v_out) { char *__pyx_v_integer_end; PyObject *__pyx_v_py_s; int __pyx_r; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("string_to_int_safe"); - __pyx_v_py_s = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_knit_load_data_pyx.pyx":69 - * # We can't just return the integer because of how pyrex determines when - * # there is an exception. - * out[0] = strtol(s, &integer_end, 10) # <<<<<<<<<<<<<< - * if integer_end != end: - * py_s = PyString_FromStringAndSize(s, end-s) - */ - (__pyx_v_out[0]) = ((int)strtol(__pyx_v_s, (&__pyx_v_integer_end), 10)); - - /* "bzrlib/_knit_load_data_pyx.pyx":70 - * # there is an exception. - * out[0] = strtol(s, &integer_end, 10) - * if integer_end != end: # <<<<<<<<<<<<<< - * py_s = PyString_FromStringAndSize(s, end-s) - * raise ValueError('%r is not a valid integer' % (py_s,)) - */ - __pyx_t_1 = (__pyx_v_integer_end != __pyx_v_end); - if (__pyx_t_1) { - - /* "bzrlib/_knit_load_data_pyx.pyx":71 - * out[0] = strtol(s, &integer_end, 10) - * if integer_end != end: - * py_s = PyString_FromStringAndSize(s, end-s) # <<<<<<<<<<<<<< - * raise ValueError('%r is not a valid integer' % (py_s,)) - * return 0 - */ - __pyx_t_2 = PyString_FromStringAndSize(__pyx_v_s, (__pyx_v_end - __pyx_v_s)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_py_s); - __pyx_v_py_s = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":72 - * if integer_end != end: - * py_s = PyString_FromStringAndSize(s, end-s) - * raise ValueError('%r is not a valid integer' % (py_s,)) # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_py_s); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_py_s); - __Pyx_GIVEREF(__pyx_v_py_s); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + __pyx_v_py_s = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":69 */ + (__pyx_v_out[0]) = ((int)strtol(__pyx_v_s,(&__pyx_v_integer_end),10)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":70 */ + __pyx_1 = (__pyx_v_integer_end != __pyx_v_end); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":71 */ + __pyx_2 = PyString_FromStringAndSize(__pyx_v_s,(__pyx_v_end - __pyx_v_s)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; goto __pyx_L1;} + Py_DECREF(__pyx_v_py_s); + __pyx_v_py_s = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":72 */ + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + Py_INCREF(__pyx_v_py_s); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_py_s); + __pyx_3 = PyNumber_Remainder(__pyx_k1p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_knit_load_data_pyx.pyx":73 - * py_s = PyString_FromStringAndSize(s, end-s) - * raise ValueError('%r is not a valid integer' % (py_s,)) - * return 0 # <<<<<<<<<<<<<< - * - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":73 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.string_to_int_safe"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_DECREF(__pyx_v_py_s); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_py_s); return __pyx_r; } -/* "bzrlib/_knit_load_data_pyx.pyx":89 - * cdef int history_len - * - * def __init__(self, kndx, fp): # <<<<<<<<<<<<<< - * self.kndx = kndx - * self.fp = fp - */ - -static int __pyx_pf_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_kndx = 0; PyObject *__pyx_v_fp = 0; int __pyx_r; - PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__kndx,&__pyx_n_s__fp,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kndx); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fp); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_kndx = values[0]; - __pyx_v_fp = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_kndx = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_fp = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.KnitIndexReader.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "bzrlib/_knit_load_data_pyx.pyx":90 - * - * def __init__(self, kndx, fp): - * self.kndx = kndx # <<<<<<<<<<<<<< - * self.fp = fp - * - */ - __Pyx_INCREF(__pyx_v_kndx); - __Pyx_GIVEREF(__pyx_v_kndx); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->kndx); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->kndx); + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {"kndx","fp",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_kndx, &__pyx_v_fp)) return -1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_kndx); + Py_INCREF(__pyx_v_fp); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":90 */ + Py_INCREF(__pyx_v_kndx); + Py_DECREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->kndx); ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->kndx = __pyx_v_kndx; - /* "bzrlib/_knit_load_data_pyx.pyx":91 - * def __init__(self, kndx, fp): - * self.kndx = kndx - * self.fp = fp # <<<<<<<<<<<<<< - * - * self.cache = kndx._cache - */ - __Pyx_INCREF(__pyx_v_fp); - __Pyx_GIVEREF(__pyx_v_fp); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":91 */ + Py_INCREF(__pyx_v_fp); + Py_DECREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp); ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp = __pyx_v_fp; - /* "bzrlib/_knit_load_data_pyx.pyx":93 - * self.fp = fp - * - * self.cache = kndx._cache # <<<<<<<<<<<<<< - * self.history = kndx._history - * - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_kndx, __pyx_n_s___cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->cache); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->cache); - ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->cache = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":94 - * - * self.cache = kndx._cache - * self.history = kndx._history # <<<<<<<<<<<<<< - * - * self.cur_str = NULL - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_kndx, __pyx_n_s___history); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->history); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->history); - ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->history = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":96 - * self.history = kndx._history - * - * self.cur_str = NULL # <<<<<<<<<<<<<< - * self.end_str = NULL - * self.history_len = 0 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":93 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_kndx, __pyx_n__cache); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;} + Py_DECREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->cache); + ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->cache = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":94 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_kndx, __pyx_n__history); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} + Py_DECREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->history); + ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->history = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":96 */ ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->cur_str = NULL; - /* "bzrlib/_knit_load_data_pyx.pyx":97 - * - * self.cur_str = NULL - * self.end_str = NULL # <<<<<<<<<<<<<< - * self.history_len = 0 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":97 */ ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->end_str = NULL; - /* "bzrlib/_knit_load_data_pyx.pyx":98 - * self.cur_str = NULL - * self.end_str = NULL - * self.history_len = 0 # <<<<<<<<<<<<<< - * - * cdef int validate(self) except -1: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":98 */ ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->history_len = 0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.KnitIndexReader.__init__"); __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_kndx); + Py_DECREF(__pyx_v_fp); return __pyx_r; } -/* "bzrlib/_knit_load_data_pyx.pyx":100 - * self.history_len = 0 - * - * cdef int validate(self) except -1: # <<<<<<<<<<<<<< - * if not PyDict_CheckExact(self.cache): - * raise TypeError('kndx._cache must be a python dict') - */ - -static int __pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_validate(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_self) { +static int __pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_validate(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_self) { int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannySetupContext("validate"); - - /* "bzrlib/_knit_load_data_pyx.pyx":101 - * - * cdef int validate(self) except -1: - * if not PyDict_CheckExact(self.cache): # <<<<<<<<<<<<<< - * raise TypeError('kndx._cache must be a python dict') - * if not PyList_CheckExact(self.history): - */ - __pyx_t_1 = __pyx_v_self->cache; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = (!PyDict_CheckExact(__pyx_t_1)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "bzrlib/_knit_load_data_pyx.pyx":102 - * cdef int validate(self) except -1: - * if not PyDict_CheckExact(self.cache): - * raise TypeError('kndx._cache must be a python dict') # <<<<<<<<<<<<<< - * if not PyList_CheckExact(self.history): - * raise TypeError('kndx._history must be a python list') - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":101 */ + __pyx_1 = (!PyDict_CheckExact(__pyx_v_self->cache)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;} + Py_INCREF(__pyx_k4p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k4p); + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":103 */ + __pyx_1 = (!PyList_CheckExact(__pyx_v_self->history)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;} + Py_INCREF(__pyx_k5p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k5p); + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_knit_load_data_pyx.pyx":103 - * if not PyDict_CheckExact(self.cache): - * raise TypeError('kndx._cache must be a python dict') - * if not PyList_CheckExact(self.history): # <<<<<<<<<<<<<< - * raise TypeError('kndx._history must be a python list') - * return 0 - */ - __pyx_t_1 = __pyx_v_self->history; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = (!PyList_CheckExact(__pyx_t_1)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "bzrlib/_knit_load_data_pyx.pyx":104 - * raise TypeError('kndx._cache must be a python dict') - * if not PyList_CheckExact(self.history): - * raise TypeError('kndx._history must be a python list') # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "bzrlib/_knit_load_data_pyx.pyx":105 - * if not PyList_CheckExact(self.history): - * raise TypeError('kndx._history must be a python list') - * return 0 # <<<<<<<<<<<<<< - * - * cdef object process_options(self, char *option_str, char *end): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":105 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.KnitIndexReader.validate"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_knit_load_data_pyx.pyx":107 - * return 0 - * - * cdef object process_options(self, char *option_str, char *end): # <<<<<<<<<<<<<< - * """Process the options string into a list.""" - * cdef char *next - */ - -static PyObject *__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_options(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_self, char *__pyx_v_option_str, char *__pyx_v_end) { +static PyObject *__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_options(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_self,char *__pyx_v_option_str,char *__pyx_v_end) { char *__pyx_v_next; PyObject *__pyx_v_final_options; PyObject *__pyx_v_next_option; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("process_options"); - __pyx_v_final_options = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_next_option = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_knit_load_data_pyx.pyx":119 - * # return options.split(',') - * - * final_options = [] # <<<<<<<<<<<<<< - * - * while option_str < end: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_final_options)); - __pyx_v_final_options = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":121 - * final_options = [] - * - * while option_str < end: # <<<<<<<<<<<<<< - * next = memchr(option_str, c',', end - option_str) - * if next == NULL: - */ + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + Py_INCREF(__pyx_v_self); + __pyx_v_final_options = Py_None; Py_INCREF(Py_None); + __pyx_v_next_option = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":119 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} + Py_DECREF(__pyx_v_final_options); + __pyx_v_final_options = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":121 */ while (1) { - __pyx_t_2 = (__pyx_v_option_str < __pyx_v_end); - if (!__pyx_t_2) break; + __pyx_2 = (__pyx_v_option_str < __pyx_v_end); + if (!__pyx_2) break; - /* "bzrlib/_knit_load_data_pyx.pyx":122 - * - * while option_str < end: - * next = memchr(option_str, c',', end - option_str) # <<<<<<<<<<<<<< - * if next == NULL: - * next = end - */ - __pyx_v_next = ((char *)memchr(__pyx_v_option_str, ',', (__pyx_v_end - __pyx_v_option_str))); - - /* "bzrlib/_knit_load_data_pyx.pyx":123 - * while option_str < end: - * next = memchr(option_str, c',', end - option_str) - * if next == NULL: # <<<<<<<<<<<<<< - * next = end - * next_option = PyString_FromStringAndSize(option_str, - */ - __pyx_t_2 = (__pyx_v_next == NULL); - if (__pyx_t_2) { - - /* "bzrlib/_knit_load_data_pyx.pyx":124 - * next = memchr(option_str, c',', end - option_str) - * if next == NULL: - * next = end # <<<<<<<<<<<<<< - * next_option = PyString_FromStringAndSize(option_str, - * next - option_str) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":122 */ + __pyx_v_next = ((char *)memchr(__pyx_v_option_str,',',(__pyx_v_end - __pyx_v_option_str))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":123 */ + __pyx_2 = (__pyx_v_next == NULL); + if (__pyx_2) { __pyx_v_next = __pyx_v_end; - goto __pyx_L5; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":125 */ + __pyx_1 = PyString_FromStringAndSize(__pyx_v_option_str,(__pyx_v_next - __pyx_v_option_str)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;} + Py_DECREF(__pyx_v_next_option); + __pyx_v_next_option = __pyx_1; + __pyx_1 = 0; - /* "bzrlib/_knit_load_data_pyx.pyx":126 - * next = end - * next_option = PyString_FromStringAndSize(option_str, - * next - option_str) # <<<<<<<<<<<<<< - * PyList_Append(final_options, next_option) - * - */ - __pyx_t_1 = PyString_FromStringAndSize(__pyx_v_option_str, (__pyx_v_next - __pyx_v_option_str)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_next_option); - __pyx_v_next_option = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":127 - * next_option = PyString_FromStringAndSize(option_str, - * next - option_str) - * PyList_Append(final_options, next_option) # <<<<<<<<<<<<<< - * - * # Move past the ',' - */ - __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_final_options), __pyx_v_next_option); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_knit_load_data_pyx.pyx":130 - * - * # Move past the ',' - * option_str = next+1 # <<<<<<<<<<<<<< - * - * return final_options - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":127 */ + __pyx_2 = PyList_Append(__pyx_v_final_options,__pyx_v_next_option); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":130 */ __pyx_v_option_str = (__pyx_v_next + 1); } - /* "bzrlib/_knit_load_data_pyx.pyx":132 - * option_str = next+1 - * - * return final_options # <<<<<<<<<<<<<< - * - * cdef object process_parents(self, char *parent_str, char *end): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_final_options)); - __pyx_r = ((PyObject *)__pyx_v_final_options); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":132 */ + Py_INCREF(__pyx_v_final_options); + __pyx_r = __pyx_v_final_options; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.KnitIndexReader.process_options"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_final_options); - __Pyx_DECREF(__pyx_v_next_option); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_final_options); + Py_DECREF(__pyx_v_next_option); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_knit_load_data_pyx.pyx":134 - * return final_options - * - * cdef object process_parents(self, char *parent_str, char *end): # <<<<<<<<<<<<<< - * cdef char *next - * cdef int int_parent - */ - -static PyObject *__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_parents(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_self, char *__pyx_v_parent_str, char *__pyx_v_end) { +static PyObject *__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_parents(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_self,char *__pyx_v_parent_str,char *__pyx_v_end) { char *__pyx_v_next; int __pyx_v_int_parent; PyObject *__pyx_v_parents; PyObject *__pyx_v_parent; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("process_parents"); - __pyx_v_parents = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_parent = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_knit_load_data_pyx.pyx":151 - * # return real_parents - * - * parents = [] # <<<<<<<<<<<<<< - * while parent_str <= end: - * next = memchr(parent_str, c' ', end - parent_str) - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_parents)); - __pyx_v_parents = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":152 - * - * parents = [] - * while parent_str <= end: # <<<<<<<<<<<<<< - * next = memchr(parent_str, c' ', end - parent_str) - * if next == NULL or next >= end or next == parent_str: - */ + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_parents = Py_None; Py_INCREF(Py_None); + __pyx_v_parent = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":151 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;} + Py_DECREF(__pyx_v_parents); + __pyx_v_parents = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":152 */ while (1) { - __pyx_t_2 = (__pyx_v_parent_str <= __pyx_v_end); - if (!__pyx_t_2) break; + __pyx_2 = (__pyx_v_parent_str <= __pyx_v_end); + if (!__pyx_2) break; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":153 */ + __pyx_v_next = ((char *)memchr(__pyx_v_parent_str,' ',(__pyx_v_end - __pyx_v_parent_str))); - /* "bzrlib/_knit_load_data_pyx.pyx":153 - * parents = [] - * while parent_str <= end: - * next = memchr(parent_str, c' ', end - parent_str) # <<<<<<<<<<<<<< - * if next == NULL or next >= end or next == parent_str: - * break - */ - __pyx_v_next = ((char *)memchr(__pyx_v_parent_str, ' ', (__pyx_v_end - __pyx_v_parent_str))); - - /* "bzrlib/_knit_load_data_pyx.pyx":154 - * while parent_str <= end: - * next = memchr(parent_str, c' ', end - parent_str) - * if next == NULL or next >= end or next == parent_str: # <<<<<<<<<<<<<< - * break - * - */ - __pyx_t_2 = (__pyx_v_next == NULL); - if (!__pyx_t_2) { - __pyx_t_3 = (__pyx_v_next >= __pyx_v_end); - if (!__pyx_t_3) { - __pyx_t_4 = (__pyx_v_next == __pyx_v_parent_str); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_3; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":154 */ + __pyx_2 = (__pyx_v_next == NULL); + if (!__pyx_2) { + __pyx_2 = (__pyx_v_next >= __pyx_v_end); + if (!__pyx_2) { + __pyx_2 = (__pyx_v_next == __pyx_v_parent_str); } - __pyx_t_3 = __pyx_t_5; - } else { - __pyx_t_3 = __pyx_t_2; } - if (__pyx_t_3) { - - /* "bzrlib/_knit_load_data_pyx.pyx":155 - * next = memchr(parent_str, c' ', end - parent_str) - * if next == NULL or next >= end or next == parent_str: - * break # <<<<<<<<<<<<<< - * - * if parent_str[0] == c'.': - */ - goto __pyx_L4_break; - goto __pyx_L5; + if (__pyx_2) { + goto __pyx_L3; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; - /* "bzrlib/_knit_load_data_pyx.pyx":157 - * break - * - * if parent_str[0] == c'.': # <<<<<<<<<<<<<< - * # This is an explicit revision id - * parent_str = parent_str + 1 - */ - __pyx_t_3 = ((__pyx_v_parent_str[0]) == '.'); - if (__pyx_t_3) { - - /* "bzrlib/_knit_load_data_pyx.pyx":159 - * if parent_str[0] == c'.': - * # This is an explicit revision id - * parent_str = parent_str + 1 # <<<<<<<<<<<<<< - * parent = PyString_FromStringAndSize(parent_str, - * next - parent_str) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":157 */ + __pyx_2 = ((__pyx_v_parent_str[0]) == '.'); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":159 */ __pyx_v_parent_str = (__pyx_v_parent_str + 1); - /* "bzrlib/_knit_load_data_pyx.pyx":161 - * parent_str = parent_str + 1 - * parent = PyString_FromStringAndSize(parent_str, - * next - parent_str) # <<<<<<<<<<<<<< - * else: - * # This in an integer mapping to original - */ - __pyx_t_1 = PyString_FromStringAndSize(__pyx_v_parent_str, (__pyx_v_next - __pyx_v_parent_str)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_parent); - __pyx_v_parent = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L6; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":160 */ + __pyx_1 = PyString_FromStringAndSize(__pyx_v_parent_str,(__pyx_v_next - __pyx_v_parent_str)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; goto __pyx_L1;} + Py_DECREF(__pyx_v_parent); + __pyx_v_parent = __pyx_1; + __pyx_1 = 0; + goto __pyx_L5; } /*else*/ { - /* "bzrlib/_knit_load_data_pyx.pyx":164 - * else: - * # This in an integer mapping to original - * string_to_int_safe(parent_str, next, &int_parent) # <<<<<<<<<<<<<< - * - * if int_parent >= self.history_len: - */ - __pyx_t_6 = __pyx_f_6bzrlib_19_knit_load_data_pyx_string_to_int_safe(__pyx_v_parent_str, __pyx_v_next, (&__pyx_v_int_parent)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_knit_load_data_pyx.pyx":166 - * string_to_int_safe(parent_str, next, &int_parent) - * - * if int_parent >= self.history_len: # <<<<<<<<<<<<<< - * raise IndexError('Parent index refers to a revision which' - * ' does not exist yet.' - */ - __pyx_t_3 = (__pyx_v_int_parent >= __pyx_v_self->history_len); - if (__pyx_t_3) { - - /* "bzrlib/_knit_load_data_pyx.pyx":169 - * raise IndexError('Parent index refers to a revision which' - * ' does not exist yet.' - * ' %d > %d' % (int_parent, self.history_len)) # <<<<<<<<<<<<<< - * parent = PyList_GET_ITEM(self.history, int_parent) - * # PyList_GET_ITEM steals a reference - */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_int_parent); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyInt_FromLong(__pyx_v_self->history_len); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_1 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_7)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); - __pyx_t_7 = 0; - __pyx_t_7 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":164 */ + __pyx_2 = __pyx_f_6bzrlib_19_knit_load_data_pyx_string_to_int_safe(__pyx_v_parent_str,__pyx_v_next,(&__pyx_v_int_parent)); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":166 */ + __pyx_2 = (__pyx_v_int_parent >= __pyx_v_self->history_len); + if (__pyx_2) { + __pyx_1 = PyInt_FromLong(__pyx_v_int_parent); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_self->history_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_1 = 0; + __pyx_3 = 0; + __pyx_1 = PyNumber_Remainder(__pyx_k6p, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); + __pyx_1 = 0; + __pyx_4 = PyObject_CallObject(PyExc_IndexError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} + goto __pyx_L6; } - __pyx_L7:; + __pyx_L6:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":170 */ + __pyx_1 = PyList_GET_ITEM(__pyx_v_self->history,__pyx_v_int_parent); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} + Py_DECREF(__pyx_v_parent); + __pyx_v_parent = __pyx_1; + __pyx_1 = 0; - /* "bzrlib/_knit_load_data_pyx.pyx":170 - * ' does not exist yet.' - * ' %d > %d' % (int_parent, self.history_len)) - * parent = PyList_GET_ITEM(self.history, int_parent) # <<<<<<<<<<<<<< - * # PyList_GET_ITEM steals a reference - * Py_INCREF(parent) - */ - __pyx_t_7 = __pyx_v_self->history; - __Pyx_INCREF(__pyx_t_7); - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_v_int_parent); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_v_parent); - __pyx_v_parent = __pyx_t_8; - __pyx_t_8 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":172 - * parent = PyList_GET_ITEM(self.history, int_parent) - * # PyList_GET_ITEM steals a reference - * Py_INCREF(parent) # <<<<<<<<<<<<<< - * PyList_Append(parents, parent) - * parent_str = next + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":172 */ Py_INCREF(__pyx_v_parent); } - __pyx_L6:; + __pyx_L5:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":173 */ + __pyx_2 = PyList_Append(__pyx_v_parents,__pyx_v_parent); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;} - /* "bzrlib/_knit_load_data_pyx.pyx":173 - * # PyList_GET_ITEM steals a reference - * Py_INCREF(parent) - * PyList_Append(parents, parent) # <<<<<<<<<<<<<< - * parent_str = next + 1 - * return tuple(parents) - */ - __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_parents), __pyx_v_parent); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_knit_load_data_pyx.pyx":174 - * Py_INCREF(parent) - * PyList_Append(parents, parent) - * parent_str = next + 1 # <<<<<<<<<<<<<< - * return tuple(parents) - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":174 */ __pyx_v_parent_str = (__pyx_v_next + 1); } - __pyx_L4_break:; + __pyx_L3:; - /* "bzrlib/_knit_load_data_pyx.pyx":175 - * PyList_Append(parents, parent) - * parent_str = next + 1 - * return tuple(parents) # <<<<<<<<<<<<<< - * - * cdef int process_one_record(self, char *start, char *end) except -1: - */ - __Pyx_XDECREF(__pyx_r); - if (unlikely(__pyx_v_parents == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_8 = ((PyObject *)PyList_AsTuple(__pyx_v_parents)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - __pyx_r = ((PyObject *)__pyx_t_8); - __pyx_t_8 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":175 */ + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + Py_INCREF(__pyx_v_parents); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_parents); + __pyx_4 = PyObject_CallObject(((PyObject *)(&PyTuple_Type)), __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_r = __pyx_4; + __pyx_4 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.KnitIndexReader.process_parents"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_parents); - __Pyx_DECREF(__pyx_v_parent); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_parents); + Py_DECREF(__pyx_v_parent); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_knit_load_data_pyx.pyx":177 - * return tuple(parents) - * - * cdef int process_one_record(self, char *start, char *end) except -1: # <<<<<<<<<<<<<< - * """Take a simple string and split it into an index record.""" - * cdef char *version_id_str - */ - -static int __pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_one_record(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_self, char *__pyx_v_start, char *__pyx_v_end) { +static int __pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_one_record(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_self,char *__pyx_v_start,char *__pyx_v_end) { char *__pyx_v_version_id_str; int __pyx_v_version_id_size; char *__pyx_v_option_str; @@ -1291,958 +514,429 @@ PyObject *__pyx_v_py_line; PyObject *__pyx_v_index; int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - void *__pyx_t_12; - __Pyx_RefNannySetupContext("process_one_record"); - __pyx_v_version_id = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_options = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_parents = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_e = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_py_line = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_index = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_knit_load_data_pyx.pyx":191 - * cdef void *cache_entry - * - * version_id_str = start # <<<<<<<<<<<<<< - * option_str = memchr(version_id_str, c' ', end - version_id_str) - * if option_str == NULL or option_str >= end: - */ + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + PyObject *__pyx_6 = 0; + PyObject *__pyx_7 = 0; + PyObject *__pyx_8 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_version_id = Py_None; Py_INCREF(Py_None); + __pyx_v_options = Py_None; Py_INCREF(Py_None); + __pyx_v_parents = Py_None; Py_INCREF(Py_None); + __pyx_v_e = Py_None; Py_INCREF(Py_None); + __pyx_v_py_line = Py_None; Py_INCREF(Py_None); + __pyx_v_index = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":191 */ __pyx_v_version_id_str = __pyx_v_start; - /* "bzrlib/_knit_load_data_pyx.pyx":192 - * - * version_id_str = start - * option_str = memchr(version_id_str, c' ', end - version_id_str) # <<<<<<<<<<<<<< - * if option_str == NULL or option_str >= end: - * # Short entry - */ - __pyx_v_option_str = ((char *)memchr(__pyx_v_version_id_str, ' ', (__pyx_v_end - __pyx_v_version_id_str))); - - /* "bzrlib/_knit_load_data_pyx.pyx":193 - * version_id_str = start - * option_str = memchr(version_id_str, c' ', end - version_id_str) - * if option_str == NULL or option_str >= end: # <<<<<<<<<<<<<< - * # Short entry - * return 0 - */ - __pyx_t_1 = (__pyx_v_option_str == NULL); - if (!__pyx_t_1) { - __pyx_t_2 = (__pyx_v_option_str >= __pyx_v_end); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "bzrlib/_knit_load_data_pyx.pyx":195 - * if option_str == NULL or option_str >= end: - * # Short entry - * return 0 # <<<<<<<<<<<<<< - * version_id_size = (option_str - version_id_str) - * # Move past the space character - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":192 */ + __pyx_v_option_str = ((char *)memchr(__pyx_v_version_id_str,' ',(__pyx_v_end - __pyx_v_version_id_str))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":193 */ + __pyx_1 = (__pyx_v_option_str == NULL); + if (!__pyx_1) { + __pyx_1 = (__pyx_v_option_str >= __pyx_v_end); + } + if (__pyx_1) { __pyx_r = 0; goto __pyx_L0; - goto __pyx_L3; + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_knit_load_data_pyx.pyx":196 - * # Short entry - * return 0 - * version_id_size = (option_str - version_id_str) # <<<<<<<<<<<<<< - * # Move past the space character - * option_str = option_str + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":196 */ __pyx_v_version_id_size = (__pyx_v_option_str - __pyx_v_version_id_str); - /* "bzrlib/_knit_load_data_pyx.pyx":198 - * version_id_size = (option_str - version_id_str) - * # Move past the space character - * option_str = option_str + 1 # <<<<<<<<<<<<<< - * - * pos_str = memchr(option_str, c' ', end - option_str) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":198 */ __pyx_v_option_str = (__pyx_v_option_str + 1); - /* "bzrlib/_knit_load_data_pyx.pyx":200 - * option_str = option_str + 1 - * - * pos_str = memchr(option_str, c' ', end - option_str) # <<<<<<<<<<<<<< - * if pos_str == NULL or pos_str >= end: - * # Short entry - */ - __pyx_v_pos_str = ((char *)memchr(__pyx_v_option_str, ' ', (__pyx_v_end - __pyx_v_option_str))); - - /* "bzrlib/_knit_load_data_pyx.pyx":201 - * - * pos_str = memchr(option_str, c' ', end - option_str) - * if pos_str == NULL or pos_str >= end: # <<<<<<<<<<<<<< - * # Short entry - * return 0 - */ - __pyx_t_3 = (__pyx_v_pos_str == NULL); - if (!__pyx_t_3) { - __pyx_t_1 = (__pyx_v_pos_str >= __pyx_v_end); - __pyx_t_2 = __pyx_t_1; - } else { - __pyx_t_2 = __pyx_t_3; - } - if (__pyx_t_2) { - - /* "bzrlib/_knit_load_data_pyx.pyx":203 - * if pos_str == NULL or pos_str >= end: - * # Short entry - * return 0 # <<<<<<<<<<<<<< - * option_end = pos_str - * pos_str = pos_str + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":200 */ + __pyx_v_pos_str = ((char *)memchr(__pyx_v_option_str,' ',(__pyx_v_end - __pyx_v_option_str))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":201 */ + __pyx_1 = (__pyx_v_pos_str == NULL); + if (!__pyx_1) { + __pyx_1 = (__pyx_v_pos_str >= __pyx_v_end); + } + if (__pyx_1) { __pyx_r = 0; goto __pyx_L0; - goto __pyx_L4; + goto __pyx_L3; } - __pyx_L4:; + __pyx_L3:; - /* "bzrlib/_knit_load_data_pyx.pyx":204 - * # Short entry - * return 0 - * option_end = pos_str # <<<<<<<<<<<<<< - * pos_str = pos_str + 1 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":204 */ __pyx_v_option_end = __pyx_v_pos_str; - /* "bzrlib/_knit_load_data_pyx.pyx":205 - * return 0 - * option_end = pos_str - * pos_str = pos_str + 1 # <<<<<<<<<<<<<< - * - * size_str = memchr(pos_str, c' ', end - pos_str) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":205 */ __pyx_v_pos_str = (__pyx_v_pos_str + 1); - /* "bzrlib/_knit_load_data_pyx.pyx":207 - * pos_str = pos_str + 1 - * - * size_str = memchr(pos_str, c' ', end - pos_str) # <<<<<<<<<<<<<< - * if size_str == NULL or size_str >= end: - * # Short entry - */ - __pyx_v_size_str = ((char *)memchr(__pyx_v_pos_str, ' ', (__pyx_v_end - __pyx_v_pos_str))); - - /* "bzrlib/_knit_load_data_pyx.pyx":208 - * - * size_str = memchr(pos_str, c' ', end - pos_str) - * if size_str == NULL or size_str >= end: # <<<<<<<<<<<<<< - * # Short entry - * return 0 - */ - __pyx_t_2 = (__pyx_v_size_str == NULL); - if (!__pyx_t_2) { - __pyx_t_3 = (__pyx_v_size_str >= __pyx_v_end); - __pyx_t_1 = __pyx_t_3; - } else { - __pyx_t_1 = __pyx_t_2; - } - if (__pyx_t_1) { - - /* "bzrlib/_knit_load_data_pyx.pyx":210 - * if size_str == NULL or size_str >= end: - * # Short entry - * return 0 # <<<<<<<<<<<<<< - * size_str = size_str + 1 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":207 */ + __pyx_v_size_str = ((char *)memchr(__pyx_v_pos_str,' ',(__pyx_v_end - __pyx_v_pos_str))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":208 */ + __pyx_1 = (__pyx_v_size_str == NULL); + if (!__pyx_1) { + __pyx_1 = (__pyx_v_size_str >= __pyx_v_end); + } + if (__pyx_1) { __pyx_r = 0; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; - /* "bzrlib/_knit_load_data_pyx.pyx":211 - * # Short entry - * return 0 - * size_str = size_str + 1 # <<<<<<<<<<<<<< - * - * parent_str = memchr(size_str, c' ', end - size_str) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":211 */ __pyx_v_size_str = (__pyx_v_size_str + 1); - /* "bzrlib/_knit_load_data_pyx.pyx":213 - * size_str = size_str + 1 - * - * parent_str = memchr(size_str, c' ', end - size_str) # <<<<<<<<<<<<<< - * if parent_str == NULL or parent_str >= end: - * # Missing parents - */ - __pyx_v_parent_str = ((char *)memchr(__pyx_v_size_str, ' ', (__pyx_v_end - __pyx_v_size_str))); - - /* "bzrlib/_knit_load_data_pyx.pyx":214 - * - * parent_str = memchr(size_str, c' ', end - size_str) - * if parent_str == NULL or parent_str >= end: # <<<<<<<<<<<<<< - * # Missing parents - * return 0 - */ - __pyx_t_1 = (__pyx_v_parent_str == NULL); - if (!__pyx_t_1) { - __pyx_t_2 = (__pyx_v_parent_str >= __pyx_v_end); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "bzrlib/_knit_load_data_pyx.pyx":216 - * if parent_str == NULL or parent_str >= end: - * # Missing parents - * return 0 # <<<<<<<<<<<<<< - * parent_str = parent_str + 1 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":213 */ + __pyx_v_parent_str = ((char *)memchr(__pyx_v_size_str,' ',(__pyx_v_end - __pyx_v_size_str))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":214 */ + __pyx_1 = (__pyx_v_parent_str == NULL); + if (!__pyx_1) { + __pyx_1 = (__pyx_v_parent_str >= __pyx_v_end); + } + if (__pyx_1) { __pyx_r = 0; goto __pyx_L0; - goto __pyx_L6; + goto __pyx_L5; } - __pyx_L6:; + __pyx_L5:; - /* "bzrlib/_knit_load_data_pyx.pyx":217 - * # Missing parents - * return 0 - * parent_str = parent_str + 1 # <<<<<<<<<<<<<< - * - * version_id = PyString_FromStringAndSize(version_id_str, - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":217 */ __pyx_v_parent_str = (__pyx_v_parent_str + 1); - /* "bzrlib/_knit_load_data_pyx.pyx":220 - * - * version_id = PyString_FromStringAndSize(version_id_str, - * version_id_size) # <<<<<<<<<<<<<< - * options = self.process_options(option_str, option_end) - * - */ - __pyx_t_4 = PyString_FromStringAndSize(__pyx_v_version_id_str, __pyx_v_version_id_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_v_version_id); - __pyx_v_version_id = __pyx_t_4; - __pyx_t_4 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":221 - * version_id = PyString_FromStringAndSize(version_id_str, - * version_id_size) - * options = self.process_options(option_str, option_end) # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self->__pyx_vtab)->process_options(__pyx_v_self, __pyx_v_option_str, __pyx_v_option_end); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_v_options); - __pyx_v_options = __pyx_t_4; - __pyx_t_4 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":223 - * options = self.process_options(option_str, option_end) - * - * try: # <<<<<<<<<<<<<< - * string_to_int_safe(pos_str, size_str - 1, &pos) - * string_to_int_safe(size_str, parent_str - 1, &size) - */ - { - PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; - __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); - __Pyx_XGOTREF(__pyx_save_exc_type); - __Pyx_XGOTREF(__pyx_save_exc_value); - __Pyx_XGOTREF(__pyx_save_exc_tb); - /*try:*/ { - - /* "bzrlib/_knit_load_data_pyx.pyx":224 - * - * try: - * string_to_int_safe(pos_str, size_str - 1, &pos) # <<<<<<<<<<<<<< - * string_to_int_safe(size_str, parent_str - 1, &size) - * parents = self.process_parents(parent_str, end) - */ - __pyx_t_5 = __pyx_f_6bzrlib_19_knit_load_data_pyx_string_to_int_safe(__pyx_v_pos_str, (__pyx_v_size_str - 1), (&__pyx_v_pos)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - - /* "bzrlib/_knit_load_data_pyx.pyx":225 - * try: - * string_to_int_safe(pos_str, size_str - 1, &pos) - * string_to_int_safe(size_str, parent_str - 1, &size) # <<<<<<<<<<<<<< - * parents = self.process_parents(parent_str, end) - * except (ValueError, IndexError), e: - */ - __pyx_t_5 = __pyx_f_6bzrlib_19_knit_load_data_pyx_string_to_int_safe(__pyx_v_size_str, (__pyx_v_parent_str - 1), (&__pyx_v_size)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - - /* "bzrlib/_knit_load_data_pyx.pyx":226 - * string_to_int_safe(pos_str, size_str - 1, &pos) - * string_to_int_safe(size_str, parent_str - 1, &size) - * parents = self.process_parents(parent_str, end) # <<<<<<<<<<<<<< - * except (ValueError, IndexError), e: - * py_line = PyString_FromStringAndSize(start, end - start) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self->__pyx_vtab)->process_parents(__pyx_v_self, __pyx_v_parent_str, __pyx_v_end); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L7_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_v_parents); - __pyx_v_parents = __pyx_t_4; - __pyx_t_4 = 0; - } - __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; - __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; - __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; - goto __pyx_L14_try_end; - __pyx_L7_error:; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":227 - * string_to_int_safe(size_str, parent_str - 1, &size) - * parents = self.process_parents(parent_str, end) - * except (ValueError, IndexError), e: # <<<<<<<<<<<<<< - * py_line = PyString_FromStringAndSize(start, end - start) - * raise errors.KnitCorrupt(self.kndx._filename, - */ - __pyx_t_5 = PyErr_ExceptionMatches(__pyx_builtin_ValueError) || PyErr_ExceptionMatches(__pyx_builtin_IndexError); - if (__pyx_t_5) { - __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.KnitIndexReader.process_one_record"); - if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_6); - __Pyx_DECREF(__pyx_v_e); - __pyx_v_e = __pyx_t_6; - - /* "bzrlib/_knit_load_data_pyx.pyx":228 - * parents = self.process_parents(parent_str, end) - * except (ValueError, IndexError), e: - * py_line = PyString_FromStringAndSize(start, end - start) # <<<<<<<<<<<<<< - * raise errors.KnitCorrupt(self.kndx._filename, - * "line %r: %s" % (py_line, e)) - */ - __pyx_t_8 = PyString_FromStringAndSize(__pyx_v_start, (__pyx_v_end - __pyx_v_start)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_v_py_line); - __pyx_v_py_line = __pyx_t_8; - __pyx_t_8 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":229 - * except (ValueError, IndexError), e: - * py_line = PyString_FromStringAndSize(start, end - start) - * raise errors.KnitCorrupt(self.kndx._filename, # <<<<<<<<<<<<<< - * "line %r: %s" % (py_line, e)) - * - */ - __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__KnitCorrupt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_GetAttr(__pyx_v_self->kndx, __pyx_n_s___filename); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_8); - - /* "bzrlib/_knit_load_data_pyx.pyx":230 - * py_line = PyString_FromStringAndSize(start, end - start) - * raise errors.KnitCorrupt(self.kndx._filename, - * "line %r: %s" % (py_line, e)) # <<<<<<<<<<<<<< - * - * cache_entry = PyDict_GetItem_void(self.cache, version_id) - */ - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __Pyx_INCREF(__pyx_v_py_line); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_py_line); - __Pyx_GIVEREF(__pyx_v_py_line); - __Pyx_INCREF(__pyx_v_e); - PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_e); - __Pyx_GIVEREF(__pyx_v_e); - __pyx_t_11 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_t_11)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_11)); - __pyx_t_8 = 0; - __pyx_t_11 = 0; - __pyx_t_11 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __Pyx_Raise(__pyx_t_11, 0, 0); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L8_exception_handled; - } - __pyx_L9_except_error:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - goto __pyx_L1_error; - __pyx_L8_exception_handled:; - __Pyx_XGIVEREF(__pyx_save_exc_type); - __Pyx_XGIVEREF(__pyx_save_exc_value); - __Pyx_XGIVEREF(__pyx_save_exc_tb); - __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); - __pyx_L14_try_end:; - } - - /* "bzrlib/_knit_load_data_pyx.pyx":232 - * "line %r: %s" % (py_line, e)) - * - * cache_entry = PyDict_GetItem_void(self.cache, version_id) # <<<<<<<<<<<<<< - * if cache_entry == NULL: - * PyList_Append(self.history, version_id) - */ - __pyx_t_7 = __pyx_v_self->cache; - __Pyx_INCREF(__pyx_t_7); - __pyx_v_cache_entry = PyDict_GetItem(__pyx_t_7, __pyx_v_version_id); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":233 - * - * cache_entry = PyDict_GetItem_void(self.cache, version_id) - * if cache_entry == NULL: # <<<<<<<<<<<<<< - * PyList_Append(self.history, version_id) - * index = self.history_len - */ - __pyx_t_3 = (__pyx_v_cache_entry == NULL); - if (__pyx_t_3) { - - /* "bzrlib/_knit_load_data_pyx.pyx":234 - * cache_entry = PyDict_GetItem_void(self.cache, version_id) - * if cache_entry == NULL: - * PyList_Append(self.history, version_id) # <<<<<<<<<<<<<< - * index = self.history_len - * self.history_len = self.history_len + 1 - */ - __pyx_t_7 = __pyx_v_self->history; - __Pyx_INCREF(__pyx_t_7); - __pyx_t_5 = PyList_Append(__pyx_t_7, __pyx_v_version_id); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":235 - * if cache_entry == NULL: - * PyList_Append(self.history, version_id) - * index = self.history_len # <<<<<<<<<<<<<< - * self.history_len = self.history_len + 1 - * else: - */ - __pyx_t_7 = PyInt_FromLong(__pyx_v_self->history_len); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_v_index); - __pyx_v_index = __pyx_t_7; - __pyx_t_7 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":236 - * PyList_Append(self.history, version_id) - * index = self.history_len - * self.history_len = self.history_len + 1 # <<<<<<<<<<<<<< - * else: - * # PyTuple_GetItem_void_void does *not* increment the reference - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":219 */ + __pyx_2 = PyString_FromStringAndSize(__pyx_v_version_id_str,__pyx_v_version_id_size); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;} + Py_DECREF(__pyx_v_version_id); + __pyx_v_version_id = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":221 */ + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self->__pyx_vtab)->process_options(__pyx_v_self,__pyx_v_option_str,__pyx_v_option_end); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} + Py_DECREF(__pyx_v_options); + __pyx_v_options = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":223 */ + /*try:*/ { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":224 */ + __pyx_1 = __pyx_f_6bzrlib_19_knit_load_data_pyx_string_to_int_safe(__pyx_v_pos_str,(__pyx_v_size_str - 1),(&__pyx_v_pos)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L6;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":225 */ + __pyx_1 = __pyx_f_6bzrlib_19_knit_load_data_pyx_string_to_int_safe(__pyx_v_size_str,(__pyx_v_parent_str - 1),(&__pyx_v_size)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L6;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":226 */ + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self->__pyx_vtab)->process_parents(__pyx_v_self,__pyx_v_parent_str,__pyx_v_end); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L6;} + Py_DECREF(__pyx_v_parents); + __pyx_v_parents = __pyx_2; + __pyx_2 = 0; + } + goto __pyx_L7; + __pyx_L6:; + Py_XDECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":227 */ + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} + Py_INCREF(PyExc_ValueError); + PyTuple_SET_ITEM(__pyx_2, 0, PyExc_ValueError); + Py_INCREF(PyExc_IndexError); + PyTuple_SET_ITEM(__pyx_2, 1, PyExc_IndexError); + __pyx_1 = PyErr_ExceptionMatches(__pyx_2); + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (__pyx_1) { + __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.process_one_record"); + if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} + Py_INCREF(__pyx_3); + Py_DECREF(__pyx_v_e); + __pyx_v_e = __pyx_3; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":228 */ + __pyx_5 = PyString_FromStringAndSize(__pyx_v_start,(__pyx_v_end - __pyx_v_start)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} + Py_DECREF(__pyx_v_py_line); + __pyx_v_py_line = __pyx_5; + __pyx_5 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":229 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_errors); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_6 = PyObject_GetAttr(__pyx_5, __pyx_n_KnitCorrupt); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_5 = PyObject_GetAttr(__pyx_v_self->kndx, __pyx_n__filename); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_7 = PyTuple_New(2); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + Py_INCREF(__pyx_v_py_line); + PyTuple_SET_ITEM(__pyx_7, 0, __pyx_v_py_line); + Py_INCREF(__pyx_v_e); + PyTuple_SET_ITEM(__pyx_7, 1, __pyx_v_e); + __pyx_8 = PyNumber_Remainder(__pyx_k10p, __pyx_7); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + __pyx_7 = PyTuple_New(2); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_7, 0, __pyx_5); + PyTuple_SET_ITEM(__pyx_7, 1, __pyx_8); + __pyx_5 = 0; + __pyx_8 = 0; + __pyx_5 = PyObject_CallObject(__pyx_6, __pyx_7); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + Py_DECREF(__pyx_7); __pyx_7 = 0; + __Pyx_Raise(__pyx_5, 0, 0); + Py_DECREF(__pyx_5); __pyx_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + goto __pyx_L7; + } + goto __pyx_L1; + __pyx_L7:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":232 */ + __pyx_v_cache_entry = PyDict_GetItem(__pyx_v_self->cache,__pyx_v_version_id); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":233 */ + __pyx_1 = (__pyx_v_cache_entry == NULL); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":234 */ + __pyx_1 = PyList_Append(__pyx_v_self->history,__pyx_v_version_id); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":235 */ + __pyx_8 = PyInt_FromLong(__pyx_v_self->history_len); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;} + Py_DECREF(__pyx_v_index); + __pyx_v_index = __pyx_8; + __pyx_8 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":236 */ __pyx_v_self->history_len = (__pyx_v_self->history_len + 1); - goto __pyx_L17; + goto __pyx_L8; } /*else*/ { + Py_INCREF(((PyObject *)PyTuple_GET_ITEM(__pyx_v_cache_entry,5))); + Py_DECREF(__pyx_v_index); + __pyx_v_index = ((PyObject *)PyTuple_GET_ITEM(__pyx_v_cache_entry,5)); + } + __pyx_L8:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":242 */ + __pyx_6 = PyInt_FromLong(__pyx_v_pos); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; goto __pyx_L1;} + __pyx_7 = PyInt_FromLong(__pyx_v_size); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; goto __pyx_L1;} + __pyx_5 = PyTuple_New(6); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; goto __pyx_L1;} + Py_INCREF(__pyx_v_version_id); + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_version_id); + Py_INCREF(__pyx_v_options); + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_v_options); + PyTuple_SET_ITEM(__pyx_5, 2, __pyx_6); + PyTuple_SET_ITEM(__pyx_5, 3, __pyx_7); + Py_INCREF(__pyx_v_parents); + PyTuple_SET_ITEM(__pyx_5, 4, __pyx_v_parents); + Py_INCREF(__pyx_v_index); + PyTuple_SET_ITEM(__pyx_5, 5, __pyx_v_index); + __pyx_6 = 0; + __pyx_7 = 0; + __pyx_1 = PyDict_SetItem(__pyx_v_self->cache,__pyx_v_version_id,__pyx_5); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "bzrlib/_knit_load_data_pyx.pyx":240 - * # PyTuple_GetItem_void_void does *not* increment the reference - * # counter, but casting to does. - * index = PyTuple_GetItem_void_void(cache_entry, 5) # <<<<<<<<<<<<<< - * - * PyDict_SetItem(self.cache, version_id, - */ - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_v_cache_entry, 5); - __Pyx_INCREF(((PyObject *)__pyx_t_12)); - __Pyx_DECREF(__pyx_v_index); - __pyx_v_index = ((PyObject *)__pyx_t_12); - } - __pyx_L17:; - - /* "bzrlib/_knit_load_data_pyx.pyx":242 - * index = PyTuple_GetItem_void_void(cache_entry, 5) - * - * PyDict_SetItem(self.cache, version_id, # <<<<<<<<<<<<<< - * (version_id, - * options, - */ - __pyx_t_7 = __pyx_v_self->cache; - __Pyx_INCREF(__pyx_t_7); - - /* "bzrlib/_knit_load_data_pyx.pyx":245 - * (version_id, - * options, - * pos, # <<<<<<<<<<<<<< - * size, - * parents, - */ - __pyx_t_6 = PyInt_FromLong(__pyx_v_pos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - - /* "bzrlib/_knit_load_data_pyx.pyx":246 - * options, - * pos, - * size, # <<<<<<<<<<<<<< - * parents, - * index, - */ - __pyx_t_4 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - - /* "bzrlib/_knit_load_data_pyx.pyx":248 - * size, - * parents, - * index, # <<<<<<<<<<<<<< - * )) - * return 1 - */ - __pyx_t_11 = PyTuple_New(6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_11)); - __Pyx_INCREF(__pyx_v_version_id); - PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_version_id); - __Pyx_GIVEREF(__pyx_v_version_id); - __Pyx_INCREF(__pyx_v_options); - PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_options); - __Pyx_GIVEREF(__pyx_v_options); - PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_parents); - PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_v_parents); - __Pyx_GIVEREF(__pyx_v_parents); - __Pyx_INCREF(__pyx_v_index); - PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_v_index); - __Pyx_GIVEREF(__pyx_v_index); - __pyx_t_6 = 0; - __pyx_t_4 = 0; - __pyx_t_5 = PyDict_SetItem(__pyx_t_7, __pyx_v_version_id, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":250 - * index, - * )) - * return 1 # <<<<<<<<<<<<<< - * - * cdef int process_next_record(self) except -1: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":250 */ __pyx_r = 1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); + Py_XDECREF(__pyx_6); + Py_XDECREF(__pyx_7); + Py_XDECREF(__pyx_8); __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.KnitIndexReader.process_one_record"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_DECREF(__pyx_v_version_id); - __Pyx_DECREF(__pyx_v_options); - __Pyx_DECREF(__pyx_v_parents); - __Pyx_DECREF(__pyx_v_e); - __Pyx_DECREF(__pyx_v_py_line); - __Pyx_DECREF(__pyx_v_index); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_version_id); + Py_DECREF(__pyx_v_options); + Py_DECREF(__pyx_v_parents); + Py_DECREF(__pyx_v_e); + Py_DECREF(__pyx_v_py_line); + Py_DECREF(__pyx_v_index); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_knit_load_data_pyx.pyx":252 - * return 1 - * - * cdef int process_next_record(self) except -1: # <<<<<<<<<<<<<< - * """Process the next record in the file.""" - * cdef char *last - */ - -static int __pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_next_record(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_self) { +static int __pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_next_record(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_self) { char *__pyx_v_last; char *__pyx_v_start; int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("process_next_record"); - - /* "bzrlib/_knit_load_data_pyx.pyx":257 - * cdef char *start - * - * start = self.cur_str # <<<<<<<<<<<<<< - * # Find the next newline - * last = memchr(start, c'\n', self.end_str - start) - */ + int __pyx_1; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":257 */ __pyx_v_start = __pyx_v_self->cur_str; - /* "bzrlib/_knit_load_data_pyx.pyx":259 - * start = self.cur_str - * # Find the next newline - * last = memchr(start, c'\n', self.end_str - start) # <<<<<<<<<<<<<< - * if last == NULL: - * # Process until the end of the file - */ - __pyx_v_last = ((char *)memchr(__pyx_v_start, '\n', (__pyx_v_self->end_str - __pyx_v_start))); - - /* "bzrlib/_knit_load_data_pyx.pyx":260 - * # Find the next newline - * last = memchr(start, c'\n', self.end_str - start) - * if last == NULL: # <<<<<<<<<<<<<< - * # Process until the end of the file - * last = self.end_str - 1 - */ - __pyx_t_1 = (__pyx_v_last == NULL); - if (__pyx_t_1) { - - /* "bzrlib/_knit_load_data_pyx.pyx":262 - * if last == NULL: - * # Process until the end of the file - * last = self.end_str - 1 # <<<<<<<<<<<<<< - * self.cur_str = self.end_str - * else: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":259 */ + __pyx_v_last = ((char *)memchr(__pyx_v_start,'\n',(__pyx_v_self->end_str - __pyx_v_start))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":260 */ + __pyx_1 = (__pyx_v_last == NULL); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":262 */ __pyx_v_last = (__pyx_v_self->end_str - 1); - /* "bzrlib/_knit_load_data_pyx.pyx":263 - * # Process until the end of the file - * last = self.end_str - 1 - * self.cur_str = self.end_str # <<<<<<<<<<<<<< - * else: - * # The last character is right before the '\n' - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":263 */ __pyx_v_self->cur_str = __pyx_v_self->end_str; - goto __pyx_L3; + goto __pyx_L2; } /*else*/ { - /* "bzrlib/_knit_load_data_pyx.pyx":267 - * # The last character is right before the '\n' - * # And the next string is right after it - * self.cur_str = last + 1 # <<<<<<<<<<<<<< - * last = last - 1 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":267 */ __pyx_v_self->cur_str = (__pyx_v_last + 1); - /* "bzrlib/_knit_load_data_pyx.pyx":268 - * # And the next string is right after it - * self.cur_str = last + 1 - * last = last - 1 # <<<<<<<<<<<<<< - * - * if last <= start or last[0] != c':': - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":268 */ __pyx_v_last = (__pyx_v_last - 1); } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_knit_load_data_pyx.pyx":270 - * last = last - 1 - * - * if last <= start or last[0] != c':': # <<<<<<<<<<<<<< - * # Incomplete record - * return 0 - */ - __pyx_t_1 = (__pyx_v_last <= __pyx_v_start); - if (!__pyx_t_1) { - __pyx_t_2 = ((__pyx_v_last[0]) != ':'); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "bzrlib/_knit_load_data_pyx.pyx":272 - * if last <= start or last[0] != c':': - * # Incomplete record - * return 0 # <<<<<<<<<<<<<< - * - * return self.process_one_record(start, last) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":270 */ + __pyx_1 = (__pyx_v_last <= __pyx_v_start); + if (!__pyx_1) { + __pyx_1 = ((__pyx_v_last[0]) != ':'); + } + if (__pyx_1) { __pyx_r = 0; goto __pyx_L0; - goto __pyx_L4; + goto __pyx_L3; } - __pyx_L4:; + __pyx_L3:; - /* "bzrlib/_knit_load_data_pyx.pyx":274 - * return 0 - * - * return self.process_one_record(start, last) # <<<<<<<<<<<<<< - * - * def read(self): - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self->__pyx_vtab)->process_one_record(__pyx_v_self, __pyx_v_start, __pyx_v_last); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_r = __pyx_t_4; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":274 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self->__pyx_vtab)->process_one_record(__pyx_v_self,__pyx_v_start,__pyx_v_last); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; goto __pyx_L1;} + __pyx_r = __pyx_1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.KnitIndexReader.process_next_record"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_knit_load_data_pyx.pyx":276 - * return self.process_one_record(start, last) - * - * def read(self): # <<<<<<<<<<<<<< - * cdef int text_size - * - */ - -static PyObject *__pyx_pf_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_1read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_1read(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_text_size; PyObject *__pyx_v_text; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - __Pyx_RefNannySetupContext("read"); - __pyx_v_text = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_knit_load_data_pyx.pyx":279 - * cdef int text_size - * - * self.validate() # <<<<<<<<<<<<<< - * - * self.kndx.check_header(self.fp) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->__pyx_vtab)->validate(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_knit_load_data_pyx.pyx":281 - * self.validate() - * - * self.kndx.check_header(self.fp) # <<<<<<<<<<<<<< - * - * # We read the whole thing at once - */ - __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->kndx, __pyx_n_s__check_header); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp); - __Pyx_GIVEREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":291 - * # completely. However self.fp may be a 'file-like' object - * # it is not guaranteed to be a real file. - * text = self.fp.read() # <<<<<<<<<<<<<< - * text_size = PyString_Size(text) - * self.cur_str = PyString_AsString(text) - */ - __pyx_t_4 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp, __pyx_n_s__read); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_text); - __pyx_v_text = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":292 - * # it is not guaranteed to be a real file. - * text = self.fp.read() - * text_size = PyString_Size(text) # <<<<<<<<<<<<<< - * self.cur_str = PyString_AsString(text) - * # This points to the last character in the string - */ + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_v_text = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":279 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->__pyx_vtab)->validate(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":281 */ + __pyx_2 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->kndx, __pyx_n_check_header); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} + Py_INCREF(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp); + PyTuple_SET_ITEM(__pyx_3, 0, ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":291 */ + __pyx_2 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->fp, __pyx_n_read); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_v_text); + __pyx_v_text = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":292 */ __pyx_v_text_size = PyString_Size(__pyx_v_text); - /* "bzrlib/_knit_load_data_pyx.pyx":293 - * text = self.fp.read() - * text_size = PyString_Size(text) - * self.cur_str = PyString_AsString(text) # <<<<<<<<<<<<<< - * # This points to the last character in the string - * self.end_str = self.cur_str + text_size - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":293 */ ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->cur_str = PyString_AsString(__pyx_v_text); - /* "bzrlib/_knit_load_data_pyx.pyx":295 - * self.cur_str = PyString_AsString(text) - * # This points to the last character in the string - * self.end_str = self.cur_str + text_size # <<<<<<<<<<<<<< - * - * while self.cur_str < self.end_str: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":295 */ ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->end_str = (((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->cur_str + __pyx_v_text_size); - /* "bzrlib/_knit_load_data_pyx.pyx":297 - * self.end_str = self.cur_str + text_size - * - * while self.cur_str < self.end_str: # <<<<<<<<<<<<<< - * self.process_next_record() - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":297 */ while (1) { - __pyx_t_5 = (((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->cur_str < ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->end_str); - if (!__pyx_t_5) break; - - /* "bzrlib/_knit_load_data_pyx.pyx":298 - * - * while self.cur_str < self.end_str: - * self.process_next_record() # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->__pyx_vtab)->process_next_record(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_1 = (((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->cur_str < ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->end_str); + if (!__pyx_1) break; + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)->__pyx_vtab)->process_next_record(((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_v_self)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;} } - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._knit_load_data_pyx.KnitIndexReader.read"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_text); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_text); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_knit_load_data_pyx.pyx":301 - * - * - * def _load_data_c(kndx, fp): # <<<<<<<<<<<<<< - * """Load the knit index file into memory.""" - * reader = KnitIndexReader(kndx, fp) - */ - -static PyObject *__pyx_pf_6bzrlib_19_knit_load_data_pyx__load_data_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_19_knit_load_data_pyx__load_data_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6bzrlib_19_knit_load_data_pyx__load_data_c[] = "Load the knit index file into memory."; -static PyMethodDef __pyx_mdef_6bzrlib_19_knit_load_data_pyx__load_data_c = {__Pyx_NAMESTR("_load_data_c"), (PyCFunction)__pyx_pf_6bzrlib_19_knit_load_data_pyx__load_data_c, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_19_knit_load_data_pyx__load_data_c)}; -static PyObject *__pyx_pf_6bzrlib_19_knit_load_data_pyx__load_data_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_f_6bzrlib_19_knit_load_data_pyx__load_data_c(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_kndx = 0; PyObject *__pyx_v_fp = 0; - struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *__pyx_v_reader; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__kndx,&__pyx_n_s__fp,0}; - __Pyx_RefNannySetupContext("_load_data_c"); - __pyx_self = __pyx_self; - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kndx); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fp); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("_load_data_c", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "_load_data_c") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_kndx = values[0]; - __pyx_v_fp = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_kndx = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_fp = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_load_data_c", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._knit_load_data_pyx._load_data_c"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_reader = ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_knit_load_data_pyx.pyx":303 - * def _load_data_c(kndx, fp): - * """Load the knit index file into memory.""" - * reader = KnitIndexReader(kndx, fp) # <<<<<<<<<<<<<< - * reader.read() - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_kndx); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_kndx); - __Pyx_GIVEREF(__pyx_v_kndx); - __Pyx_INCREF(__pyx_v_fp); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_fp); - __Pyx_GIVEREF(__pyx_v_fp); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_19_knit_load_data_pyx_KnitIndexReader)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_reader)); - __pyx_v_reader = ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":304 - * """Load the knit index file into memory.""" - * reader = KnitIndexReader(kndx, fp) - * reader.read() # <<<<<<<<<<<<<< - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_reader), __pyx_n_s__read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_v_reader; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {"kndx","fp",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_kndx, &__pyx_v_fp)) return 0; + Py_INCREF(__pyx_v_kndx); + Py_INCREF(__pyx_v_fp); + __pyx_v_reader = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":303 */ + __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;} + Py_INCREF(__pyx_v_kndx); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_kndx); + Py_INCREF(__pyx_v_fp); + PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_fp); + __pyx_2 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_19_knit_load_data_pyx_KnitIndexReader), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_v_reader); + __pyx_v_reader = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":304 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_reader, __pyx_n_read); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._knit_load_data_pyx._load_data_c"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_reader); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_reader); + Py_DECREF(__pyx_v_kndx); + Py_DECREF(__pyx_v_fp); return __pyx_r; } static struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader __pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader; @@ -2252,7 +946,7 @@ PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)o); - p->__pyx_vtab = __pyx_vtabptr_6bzrlib_19_knit_load_data_pyx_KnitIndexReader; + *(struct __pyx_vtabstruct_6bzrlib_19_knit_load_data_pyx_KnitIndexReader **)&p->__pyx_vtab = __pyx_vtabptr_6bzrlib_19_knit_load_data_pyx_KnitIndexReader; p->kndx = Py_None; Py_INCREF(Py_None); p->fp = Py_None; Py_INCREF(Py_None); p->cache = Py_None; Py_INCREF(Py_None); @@ -2266,7 +960,7 @@ Py_XDECREF(p->fp); Py_XDECREF(p->cache); Py_XDECREF(p->history); - (*Py_TYPE(o)->tp_free)(o); + (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_6bzrlib_19_knit_load_data_pyx_KnitIndexReader(PyObject *o, visitproc v, void *a) { @@ -2289,24 +983,24 @@ static int __pyx_tp_clear_6bzrlib_19_knit_load_data_pyx_KnitIndexReader(PyObject *o) { struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *p = (struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *)o; - PyObject* tmp; - tmp = ((PyObject*)p->kndx); + PyObject *t; + t = p->kndx; p->kndx = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->fp); + Py_XDECREF(t); + t = p->fp; p->fp = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->cache); + Py_XDECREF(t); + t = p->cache; p->cache = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->history); + Py_XDECREF(t); + t = p->history; p->history = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); + Py_XDECREF(t); return 0; } -static PyMethodDef __pyx_methods_6bzrlib_19_knit_load_data_pyx_KnitIndexReader[] = { - {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pf_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_1read, METH_NOARGS, __Pyx_DOCSTR(0)}, +static struct PyMethodDef __pyx_methods_6bzrlib_19_knit_load_data_pyx_KnitIndexReader[] = { + {"read", (PyCFunction)__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_read, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; @@ -2314,9 +1008,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -2330,28 +1022,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -2363,7 +1043,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; @@ -2388,40 +1068,23 @@ }; static PyBufferProcs __pyx_tp_as_buffer_KnitIndexReader = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; -static PyTypeObject __pyx_type_6bzrlib_19_knit_load_data_pyx_KnitIndexReader = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._knit_load_data_pyx.KnitIndexReader"), /*tp_name*/ +PyTypeObject __pyx_type_6bzrlib_19_knit_load_data_pyx_KnitIndexReader = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._knit_load_data_pyx.KnitIndexReader", /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_19_knit_load_data_pyx_KnitIndexReader, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif 0, /*tp_repr*/ &__pyx_tp_as_number_KnitIndexReader, /*tp_as_number*/ &__pyx_tp_as_sequence_KnitIndexReader, /*tp_as_sequence*/ @@ -2432,7 +1095,7 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_KnitIndexReader, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_6bzrlib_19_knit_load_data_pyx_KnitIndexReader, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_19_knit_load_data_pyx_KnitIndexReader, /*tp_clear*/ @@ -2448,7 +1111,7 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader___init__, /*tp_init*/ + __pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6bzrlib_19_knit_load_data_pyx_KnitIndexReader, /*tp_new*/ 0, /*tp_free*/ @@ -2458,302 +1121,73 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif }; -static PyMethodDef __pyx_methods[] = { +static struct PyMethodDef __pyx_methods[] = { + {"_load_data_c", (PyCFunction)__pyx_f_6bzrlib_19_knit_load_data_pyx__load_data_c, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_19_knit_load_data_pyx__load_data_c}, {0, 0, 0, 0} }; -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("_knit_load_data_pyx"), - __Pyx_DOCSTR(__pyx_k_8), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, - {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_n_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 1}, - {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1}, - {&__pyx_n_s__KnitCorrupt, __pyx_k__KnitCorrupt, sizeof(__pyx_k__KnitCorrupt), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___cache, __pyx_k___cache, sizeof(__pyx_k___cache), 0, 0, 1, 1}, - {&__pyx_n_s___filename, __pyx_k___filename, sizeof(__pyx_k___filename), 0, 0, 1, 1}, - {&__pyx_n_s___history, __pyx_k___history, sizeof(__pyx_k___history), 0, 0, 1, 1}, - {&__pyx_n_s___load_data_c, __pyx_k___load_data_c, sizeof(__pyx_k___load_data_c), 0, 0, 1, 1}, - {&__pyx_n_s__bzrlib, __pyx_k__bzrlib, sizeof(__pyx_k__bzrlib), 0, 0, 1, 1}, - {&__pyx_n_s__cache, __pyx_k__cache, sizeof(__pyx_k__cache), 0, 0, 1, 1}, - {&__pyx_n_s__check_header, __pyx_k__check_header, sizeof(__pyx_k__check_header), 0, 0, 1, 1}, - {&__pyx_n_s__cur_str, __pyx_k__cur_str, sizeof(__pyx_k__cur_str), 0, 0, 1, 1}, - {&__pyx_n_s__end_str, __pyx_k__end_str, sizeof(__pyx_k__end_str), 0, 0, 1, 1}, - {&__pyx_n_s__errors, __pyx_k__errors, sizeof(__pyx_k__errors), 0, 0, 1, 1}, - {&__pyx_n_s__fp, __pyx_k__fp, sizeof(__pyx_k__fp), 0, 0, 1, 1}, - {&__pyx_n_s__history, __pyx_k__history, sizeof(__pyx_k__history), 0, 0, 1, 1}, - {&__pyx_n_s__history_len, __pyx_k__history_len, sizeof(__pyx_k__history_len), 0, 0, 1, 1}, - {&__pyx_n_s__kndx, __pyx_k__kndx, sizeof(__pyx_k__kndx), 0, 0, 1, 1}, - {&__pyx_n_s__process_next_record, __pyx_k__process_next_record, sizeof(__pyx_k__process_next_record), 0, 0, 1, 1}, - {&__pyx_n_s__process_one_record, __pyx_k__process_one_record, sizeof(__pyx_k__process_one_record), 0, 0, 1, 1}, - {&__pyx_n_s__process_options, __pyx_k__process_options, sizeof(__pyx_k__process_options), 0, 0, 1, 1}, - {&__pyx_n_s__process_parents, __pyx_k__process_parents, sizeof(__pyx_k__process_parents), 0, 0, 1, 1}, - {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1}, - {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1}, - {&__pyx_n_s__validate, __pyx_k__validate, sizeof(__pyx_k__validate), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); +static void __pyx_init_filenames(void); /*proto*/ - /* "bzrlib/_knit_load_data_pyx.pyx":102 - * cdef int validate(self) except -1: - * if not PyDict_CheckExact(self.cache): - * raise TypeError('kndx._cache must be a python dict') # <<<<<<<<<<<<<< - * if not PyList_CheckExact(self.history): - * raise TypeError('kndx._history must be a python list') - */ - __pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_3)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); - PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, ((PyObject *)__pyx_kp_s_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3)); - - /* "bzrlib/_knit_load_data_pyx.pyx":104 - * raise TypeError('kndx._cache must be a python dict') - * if not PyList_CheckExact(self.history): - * raise TypeError('kndx._history must be a python list') # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); - PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC init_knit_load_data_pyx(void); /*proto*/ -PyMODINIT_FUNC init_knit_load_data_pyx(void) -#else -PyMODINIT_FUNC PyInit__knit_load_data_pyx(void); /*proto*/ -PyMODINIT_FUNC PyInit__knit_load_data_pyx(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__knit_load_data_pyx(void)", __LINE__, __FILE__); - #endif - __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;} - __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;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_knit_load_data_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_8), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_knit_load_data_pyx(void) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + __pyx_init_filenames(); + __pyx_m = Py_InitModule4("_knit_load_data_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_bzrlib___knit_load_data_pyx) { - 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;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ + __pyx_b = PyImport_AddModule("__builtin__"); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; __pyx_vtabptr_6bzrlib_19_knit_load_data_pyx_KnitIndexReader = &__pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader; - __pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.validate = (int (*)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *))__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_validate; - __pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.process_options = (PyObject *(*)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *, char *, char *))__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_options; - __pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.process_parents = (PyObject *(*)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *, char *, char *))__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_parents; - __pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.process_one_record = (int (*)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *, char *, char *))__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_one_record; - __pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.process_next_record = (int (*)(struct __pyx_obj_6bzrlib_19_knit_load_data_pyx_KnitIndexReader *))__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_next_record; - if (PyType_Ready(&__pyx_type_6bzrlib_19_knit_load_data_pyx_KnitIndexReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.tp_dict, __pyx_vtabptr_6bzrlib_19_knit_load_data_pyx_KnitIndexReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "KnitIndexReader", (PyObject *)&__pyx_type_6bzrlib_19_knit_load_data_pyx_KnitIndexReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(void(**)(void))&__pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.validate = (void(*)(void))__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_validate; + *(void(**)(void))&__pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.process_options = (void(*)(void))__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_options; + *(void(**)(void))&__pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.process_parents = (void(*)(void))__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_parents; + *(void(**)(void))&__pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.process_one_record = (void(*)(void))__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_one_record; + *(void(**)(void))&__pyx_vtable_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.process_next_record = (void(*)(void))__pyx_f_6bzrlib_19_knit_load_data_pyx_15KnitIndexReader_process_next_record; + __pyx_type_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.tp_free = _PyObject_GC_Del; + if (PyType_Ready(&__pyx_type_6bzrlib_19_knit_load_data_pyx_KnitIndexReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} + if (__Pyx_SetVtable(__pyx_type_6bzrlib_19_knit_load_data_pyx_KnitIndexReader.tp_dict, __pyx_vtabptr_6bzrlib_19_knit_load_data_pyx_KnitIndexReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "KnitIndexReader", (PyObject *)&__pyx_type_6bzrlib_19_knit_load_data_pyx_KnitIndexReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;} __pyx_ptype_6bzrlib_19_knit_load_data_pyx_KnitIndexReader = &__pyx_type_6bzrlib_19_knit_load_data_pyx_KnitIndexReader; - /*--- Type import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "bzrlib/_knit_load_data_pyx.pyx":19 - * """Pyrex extensions to knit parsing.""" - * - * import sys # <<<<<<<<<<<<<< - * - * from bzrlib import errors - */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":21 - * import sys - * - * from bzrlib import errors # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__errors)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__errors)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__errors)); - __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 = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__errors); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__errors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":301 - * - * - * def _load_data_c(kndx, fp): # <<<<<<<<<<<<<< - * """Load the knit index file into memory.""" - * reader = KnitIndexReader(kndx, fp) - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_19_knit_load_data_pyx__load_data_c, NULL, __pyx_n_s_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___load_data_c, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_knit_load_data_pyx.pyx":1 - * # Copyright (C) 2007-2010 Canonical Ltd # <<<<<<<<<<<<<< - * # - * # This program is free software; you can redistribute it and/or modify - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - 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;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - __Pyx_AddTraceback("init bzrlib._knit_load_data_pyx"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init bzrlib._knit_load_data_pyx"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":19 */ + __pyx_1 = __Pyx_Import(__pyx_n_sys, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_sys, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":21 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} + Py_INCREF(__pyx_n_errors); + PyList_SET_ITEM(__pyx_1, 0, __pyx_n_errors); + __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_errors); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_errors, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_knit_load_data_pyx.pyx":301 */ return; - #else - return __pyx_m; - #endif + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("bzrlib._knit_load_data_pyx"); } -/* Runtime support code */ +static char *__pyx_filenames[] = { + "_knit_load_data_pyx.pyx", +}; -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} +/* Runtime support code */ -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } - -#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); @@ -2794,13 +1228,12 @@ Py_INCREF(type); } else { - type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else - type = (PyObject*) Py_TYPE(type); + type = (PyObject*) type->ob_type; Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, @@ -2809,8 +1242,7 @@ } #endif } - - __Pyx_ErrRestore(type, value, tb); + PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); @@ -2819,251 +1251,77 @@ return; } -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { + PyThreadState *tstate = PyThreadState_Get(); + PyErr_Fetch(type, value, tb); + PyErr_NormalizeException(type, value, tb); + if (PyErr_Occurred()) goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - + Py_INCREF(*type); + Py_INCREF(*value); + Py_INCREF(*tb); + Py_XDECREF(tstate->exc_type); + Py_XDECREF(tstate->exc_value); + Py_XDECREF(tstate->exc_traceback); + tstate->exc_type = *type; + tstate->exc_value = *value; + tstate->exc_traceback = *tb; + return 0; bad: - return; -} -#endif - -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); + Py_XDECREF(*type); + Py_XDECREF(*value); + Py_XDECREF(*tb); + return -1; } -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + if (!*t->p) + return -1; + if (t->i) + PyString_InternInPlace(t->p); + ++t; } return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; } -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { - PyObject *local_type, *local_value, *local_tb; - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - PyErr_NormalizeException(&local_type, &local_value, &local_tb); - if (unlikely(tstate->curexc_type)) +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + PyObject *pycobj = 0; + int result; + + pycobj = PyCObject_FromVoidPtr(vtable, 0); + if (!pycobj) goto bad; - #if PY_MAJOR_VERSION >= 3 - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0) goto bad; - #endif - *type = local_type; - *value = local_value; - *tb = local_tb; - Py_INCREF(local_type); - Py_INCREF(local_value); - Py_INCREF(local_tb); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - /* Make sure tstate is in a consistent state when we XDECREF - these objects (XDECREF may run arbitrary code). */ - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} + result = 0; + goto done; - -static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->exc_type; - *value = tstate->exc_value; - *tb = tstate->exc_traceback; - Py_XINCREF(*type); - Py_XINCREF(*value); - Py_XINCREF(*tb); -} - -static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = type; - tstate->exc_value = value; - tstate->exc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); +bad: + result = -1; +done: + Py_XDECREF(pycobj); + return result; } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; + PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) + __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); + if (!__import__) goto bad; if (from_list) list = from_list; @@ -3079,488 +1337,57 @@ empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); + module = PyObject_CallFunction(__import__, "OOOO", + name, global_dict, empty_dict, list); bad: Py_XDECREF(empty_list); - Py_XDECREF(py_import); + Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - #include "compile.h" #include "frameobject.h" #include "traceback.h" -static void __Pyx_AddTraceback(const char *funcname) { +static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; + PyObject *empty_tuple = 0; + PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } + py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; + empty_tuple = PyTuple_New(0); + if (!empty_tuple) goto bad; + empty_string = PyString_FromString(""); + if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + empty_string, /*PyObject *code,*/ + empty_tuple, /*PyObject *consts,*/ + empty_tuple, /*PyObject *names,*/ + empty_tuple, /*PyObject *varnames,*/ + empty_tuple, /*PyObject *freevars,*/ + empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ + empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ + PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ @@ -3571,128 +1398,8 @@ bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); + Py_XDECREF(empty_tuple); + Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} - -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff -Nru bzr-2.5.0/bzrlib/_known_graph_pyx.c bzr-2.6.0~beta1/bzrlib/_known_graph_pyx.c --- bzr-2.5.0/bzrlib/_known_graph_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_known_graph_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,316 +1,86 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:27 2012 */ +/* Generated by Pyrex 0.9.8.5 on Fri Oct 8 14:00:57 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif - -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif - -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif - +#include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif - -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif #endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) +#ifdef __cplusplus +#define __PYX_EXTERN_C extern "C" #else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) +#define __PYX_EXTERN_C extern #endif +#include +#include "python-compat.h" -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif +typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif +static PyObject *__pyx_m; +static PyObject *__pyx_b; +static int __pyx_lineno; +static char *__pyx_filename; +static char **__pyx_f; -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) -#endif +static char __pyx_mdoc[] = "Implementation of Graph algorithms when we have already loaded everything.\n"; -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif -#include -#define __PYX_HAVE_API__bzrlib___known_graph_pyx -#include "python-compat.h" +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ +static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/ -/* inline attribute */ -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif +static void __Pyx_WriteUnraisable(char *name); /*proto*/ -/* unused attribute */ -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -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*/ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -/* Type Conversion Predeclarations */ +static void __Pyx_AddTraceback(char *funcname); /*proto*/ -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) +/* Declarations from bzrlib._known_graph_pyx */ -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; +/* Declarations from implementation of bzrlib._known_graph_pyx */ -static const char *__pyx_f[] = { - "_known_graph_pyx.pyx", +struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode { + PyObject_HEAD + struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_vtab; + PyObject *key; + PyObject *parents; + PyObject *children; + long gdfo; + int seen; + PyObject *extra; }; -/* Type declarations */ - -/* "bzrlib/_known_graph_pyx.pyx":666 - * - * - * cdef class _MergeSortNode: # <<<<<<<<<<<<<< - * """Tracks information about a node during the merge_sort operation.""" - * - */ +struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph { + PyObject_HEAD + struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *__pyx_vtab; + PyObject *_nodes; + PyObject *_known_heads; + int do_cache; +}; struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode { PyObject_HEAD @@ -329,49 +99,6 @@ int completed; }; -/* "bzrlib/_known_graph_pyx.pyx":192 - * cdef class _MergeSorter - * - * cdef class KnownGraph: # <<<<<<<<<<<<<< - * """This is a class which assumes we already know the full graph.""" - * - */ - -struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph { - PyObject_HEAD - struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *__pyx_vtab; - PyObject *_nodes; - PyObject *_known_heads; - int do_cache; -}; - -/* "bzrlib/_known_graph_pyx.pyx":63 - * - * - * cdef class _KnownGraphNode: # <<<<<<<<<<<<<< - * """Represents a single object in the known graph.""" - * - */ - -struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode { - PyObject_HEAD - struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_vtab; - PyObject *key; - PyObject *parents; - PyObject *children; - long gdfo; - int seen; - PyObject *extra; -}; - -/* "bzrlib/_known_graph_pyx.pyx":190 - * - * - * cdef class _MergeSorter # <<<<<<<<<<<<<< - * - * cdef class KnownGraph: - */ - struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter { PyObject_HEAD struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_vtab; @@ -383,17 +110,15 @@ }; -/* "bzrlib/_known_graph_pyx.pyx":724 - * - * - * cdef class _MergeSorter: # <<<<<<<<<<<<<< - * """This class does the work of computing the merge_sort ordering. - * - */ +struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__KnownGraphNode { + PyObject *(*clear_references)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *); +}; +static struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_vtabptr_6bzrlib_16_known_graph_pyx__KnownGraphNode; + struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter { - struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *(*_get_ms_node)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *, struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *); - PyObject *(*_push_node)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *, struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *, long); + struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *(*_get_ms_node)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *,struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *); + PyObject *(*_push_node)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *,struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *,long); PyObject *(*_pop_node)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *); PyObject *(*_schedule_stack)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *); PyObject *(*topo_order)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *); @@ -401,27 +126,12 @@ static struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSorter; -/* "bzrlib/_known_graph_pyx.pyx":63 - * - * - * cdef class _KnownGraphNode: # <<<<<<<<<<<<<< - * """Represents a single object in the known graph.""" - * - */ - -struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__KnownGraphNode { - PyObject *(*clear_references)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *); +struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph { + struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *(*_get_or_create_node)(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *,PyObject *); + PyObject *(*_populate_parents)(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *,struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *,PyObject *); }; -static struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_vtabptr_6bzrlib_16_known_graph_pyx__KnownGraphNode; - +static struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *__pyx_vtabptr_6bzrlib_16_known_graph_pyx_KnownGraph; -/* "bzrlib/_known_graph_pyx.pyx":666 - * - * - * cdef class _MergeSortNode: # <<<<<<<<<<<<<< - * """Tracks information about a node during the merge_sort operation.""" - * - */ struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSortNode { int (*has_pending_parents)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *); @@ -429,1668 +139,656 @@ }; static struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSortNode; - -/* "bzrlib/_known_graph_pyx.pyx":192 - * cdef class _MergeSorter - * - * cdef class KnownGraph: # <<<<<<<<<<<<<< - * """This is a class which assumes we already know the full graph.""" - * - */ - -struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph { - struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *(*_get_or_create_node)(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *, PyObject *); - PyObject *(*_populate_parents)(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *, struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *, PyObject *); -}; -static struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *__pyx_vtabptr_6bzrlib_16_known_graph_pyx_KnownGraph; - -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif - -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); - end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { - PyObject *r; - if (!j) return NULL; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - return r; -} - - -#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_List_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { - PyObject *r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - -#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Tuple_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { - if (likely(o != Py_None)) { - if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - PyObject *r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - return r; - } - else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { - PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); - Py_INCREF(r); - return r; - } - } - return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); -} - - -#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ - __Pyx_GetItemInt_Fast(o, i) : \ - __Pyx_GetItemInt_Generic(o, to_py_func(i))) - -static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { - PyObject *r; - if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { - r = PyList_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { - r = PyTuple_GET_ITEM(o, i); - Py_INCREF(r); - } - else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { - r = PySequence_GetItem(o, i); - } - else { - r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); - } - return r; -} - -static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; } -static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { - return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b); -} - -static CYTHON_INLINE PyObject* __Pyx_PyObject_Pop(PyObject* L) { - PyObject *r, *m; -#if PY_VERSION_HEX >= 0x02040000 - if (likely(PyList_CheckExact(L)) - /* Check that both the size is positive and no reallocation shrinking needs to be done. */ - && likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) { - Py_SIZE(L) -= 1; - return PyList_GET_ITEM(L, PyList_GET_SIZE(L)); - } -#endif - m = __Pyx_GetAttrString(L, "pop"); - if (!m) return NULL; - r = PyObject_CallObject(m, NULL); - Py_DECREF(m); - return r; -} - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -#if PY_VERSION_HEX < 0x02050000 -#ifndef PyAnySet_CheckExact - -#define PyAnySet_CheckExact(ob) \ - ((ob)->ob_type == &PySet_Type || \ - (ob)->ob_type == &PyFrozenSet_Type) - -#define PySet_New(iterable) \ - PyObject_CallFunctionObjArgs((PyObject *)&PySet_Type, (iterable), NULL) - -#define Pyx_PyFrozenSet_New(iterable) \ - PyObject_CallFunctionObjArgs((PyObject *)&PyFrozenSet_Type, (iterable), NULL) - -#define PySet_Size(anyset) \ - PyObject_Size((anyset)) - -#define PySet_Contains(anyset, key) \ - PySequence_Contains((anyset), (key)) - -#define PySet_Pop(set) \ - PyObject_CallMethod(set, (char *)"pop", NULL) - -static CYTHON_INLINE int PySet_Clear(PyObject *set) { - PyObject *ret = PyObject_CallMethod(set, (char *)"clear", NULL); - if (!ret) return -1; - Py_DECREF(ret); return 0; -} - -static CYTHON_INLINE int PySet_Discard(PyObject *set, PyObject *key) { - PyObject *ret = PyObject_CallMethod(set, (char *)"discard", (char *)"O", key); - if (!ret) return -1; - Py_DECREF(ret); return 0; -} - -static CYTHON_INLINE int PySet_Add(PyObject *set, PyObject *key) { - PyObject *ret = PyObject_CallMethod(set, (char *)"add", (char *)"O", key); - if (!ret) return -1; - Py_DECREF(ret); return 0; -} - -#endif /* PyAnySet_CheckExact (<= Py2.4) */ - -#if PY_VERSION_HEX < 0x02040000 -#ifndef Py_SETOBJECT_H -#define Py_SETOBJECT_H - -static PyTypeObject *__Pyx_PySet_Type = NULL; -static PyTypeObject *__Pyx_PyFrozenSet_Type = NULL; - -#define PySet_Type (*__Pyx_PySet_Type) -#define PyFrozenSet_Type (*__Pyx_PyFrozenSet_Type) - -#define PyAnySet_Check(ob) \ - (PyAnySet_CheckExact(ob) || \ - PyType_IsSubtype((ob)->ob_type, &PySet_Type) || \ - PyType_IsSubtype((ob)->ob_type, &PyFrozenSet_Type)) - -#define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type) - -static int __Pyx_Py23SetsImport(void) { - PyObject *sets=0, *Set=0, *ImmutableSet=0; - - sets = PyImport_ImportModule((char *)"sets"); - if (!sets) goto bad; - Set = PyObject_GetAttrString(sets, (char *)"Set"); - if (!Set) goto bad; - ImmutableSet = PyObject_GetAttrString(sets, (char *)"ImmutableSet"); - if (!ImmutableSet) goto bad; - Py_DECREF(sets); - - __Pyx_PySet_Type = (PyTypeObject*) Set; - __Pyx_PyFrozenSet_Type = (PyTypeObject*) ImmutableSet; - - return 0; - - bad: - Py_XDECREF(sets); - Py_XDECREF(Set); - Py_XDECREF(ImmutableSet); - return -1; -} - -#else -static int __Pyx_Py23SetsImport(void) { return 0; } -#endif /* !Py_SETOBJECT_H */ -#endif /* < Py2.4 */ -#endif /* < Py2.5 */ - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static void __Pyx_WriteUnraisable(const char *name); /*proto*/ - -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ - -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from bzrlib._known_graph_pyx */ - static PyTypeObject *__pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode = 0; static PyTypeObject *__pyx_ptype_6bzrlib_16_known_graph_pyx__MergeSorter = 0; static PyTypeObject *__pyx_ptype_6bzrlib_16_known_graph_pyx_KnownGraph = 0; static PyTypeObject *__pyx_ptype_6bzrlib_16_known_graph_pyx__MergeSortNode = 0; -static PyObject *__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION = 0; -static struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(PyObject *, Py_ssize_t); /*proto*/ -static struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(PyObject *, Py_ssize_t); /*proto*/ -static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx__sort_list_nodes(PyObject *, int); /*proto*/ -#define __Pyx_MODULE_NAME "bzrlib._known_graph_pyx" -static int __pyx_module_is_main_bzrlib___known_graph_pyx = 0; +static PyObject *__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION; +static struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(PyObject *,Py_ssize_t); /*proto*/ +static struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(PyObject *,Py_ssize_t); /*proto*/ +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx__sort_list_nodes(PyObject *,int); /*proto*/ + +static char __pyx_k1[] = "append"; +static char __pyx_k2[] = "%s(%s gdfo:%s par:%s child:%s)"; +static char __pyx_k3[] = "__class__"; +static char __pyx_k4[] = "__name__"; +static char __pyx_k5[] = "lst_or_tpl must be a list or tuple."; +static char __pyx_k6[] = "sort"; +static char __pyx_k7[] = "key"; +static char __pyx_k8[] = "get_key"; +static char __pyx_k9[] = "reverse"; +static char __pyx_k10[] = "_initialize_nodes"; +static char __pyx_k11[] = "_find_gdfo"; +static char __pyx_k12[] = "parent_map should be a dict of {key:parent_keys}"; +static char __pyx_k13[] = "_find_tails"; +static char __pyx_k14[] = "clear"; +static char __pyx_k15[] = "Parent key mismatch, existing node %s has parents of %s not %s"; +static char __pyx_k16[] = "deque"; +static char __pyx_k17[] = "popleft"; +static char __pyx_k18[] = "frozenset"; +static char __pyx_k19[] = "key %s not in nodes"; +static char __pyx_k20[] = "pop"; +static char __pyx_k21[] = "extend"; +static char __pyx_k22[] = "errors"; +static char __pyx_k23[] = "GraphCycleError"; +static char __pyx_k24[] = "_find_tips"; +static char __pyx_k25[] = ""; +static char __pyx_k26[] = "sorted"; +static char __pyx_k27[] = "parent_keys"; +static char __pyx_k28[] = "child_keys"; +static char __pyx_k29[] = "%s(%s depth:%s rev:%s,%s,%s first:%s seen:%s)"; +static char __pyx_k30[] = "Something wrong with: %s"; +static char __pyx_k31[] = "ghost nodes should not be pushed onto the stack: %s"; +static char __pyx_k32[] = "collections"; +static char __pyx_k33[] = "gc"; +static char __pyx_k34[] = "bzrlib"; +static char __pyx_k35[] = "revision"; +static char __pyx_k36[] = "NULL_REVISION"; + +static PyObject *__pyx_n_GraphCycleError; +static PyObject *__pyx_n_NULL_REVISION; +static PyObject *__pyx_n___class__; +static PyObject *__pyx_n___name__; +static PyObject *__pyx_n__find_gdfo; +static PyObject *__pyx_n__find_tails; +static PyObject *__pyx_n__find_tips; +static PyObject *__pyx_n__initialize_nodes; +static PyObject *__pyx_n_append; +static PyObject *__pyx_n_bzrlib; +static PyObject *__pyx_n_child_keys; +static PyObject *__pyx_n_clear; +static PyObject *__pyx_n_collections; +static PyObject *__pyx_n_deque; +static PyObject *__pyx_n_errors; +static PyObject *__pyx_n_extend; +static PyObject *__pyx_n_frozenset; +static PyObject *__pyx_n_gc; +static PyObject *__pyx_n_get_key; +static PyObject *__pyx_n_key; +static PyObject *__pyx_n_parent_keys; +static PyObject *__pyx_n_pop; +static PyObject *__pyx_n_popleft; +static PyObject *__pyx_n_reverse; +static PyObject *__pyx_n_revision; +static PyObject *__pyx_n_sort; +static PyObject *__pyx_n_sorted; + +static PyObject *__pyx_k2p; +static PyObject *__pyx_k5p; +static PyObject *__pyx_k12p; +static PyObject *__pyx_k15p; +static PyObject *__pyx_k19p; +static PyObject *__pyx_k25p; +static PyObject *__pyx_k29p; +static PyObject *__pyx_k30p; +static PyObject *__pyx_k31p; + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_GraphCycleError, 1, __pyx_k23, sizeof(__pyx_k23)}, + {&__pyx_n_NULL_REVISION, 1, __pyx_k36, sizeof(__pyx_k36)}, + {&__pyx_n___class__, 1, __pyx_k3, sizeof(__pyx_k3)}, + {&__pyx_n___name__, 1, __pyx_k4, sizeof(__pyx_k4)}, + {&__pyx_n__find_gdfo, 1, __pyx_k11, sizeof(__pyx_k11)}, + {&__pyx_n__find_tails, 1, __pyx_k13, sizeof(__pyx_k13)}, + {&__pyx_n__find_tips, 1, __pyx_k24, sizeof(__pyx_k24)}, + {&__pyx_n__initialize_nodes, 1, __pyx_k10, sizeof(__pyx_k10)}, + {&__pyx_n_append, 1, __pyx_k1, sizeof(__pyx_k1)}, + {&__pyx_n_bzrlib, 1, __pyx_k34, sizeof(__pyx_k34)}, + {&__pyx_n_child_keys, 1, __pyx_k28, sizeof(__pyx_k28)}, + {&__pyx_n_clear, 1, __pyx_k14, sizeof(__pyx_k14)}, + {&__pyx_n_collections, 1, __pyx_k32, sizeof(__pyx_k32)}, + {&__pyx_n_deque, 1, __pyx_k16, sizeof(__pyx_k16)}, + {&__pyx_n_errors, 1, __pyx_k22, sizeof(__pyx_k22)}, + {&__pyx_n_extend, 1, __pyx_k21, sizeof(__pyx_k21)}, + {&__pyx_n_frozenset, 1, __pyx_k18, sizeof(__pyx_k18)}, + {&__pyx_n_gc, 1, __pyx_k33, sizeof(__pyx_k33)}, + {&__pyx_n_get_key, 1, __pyx_k8, sizeof(__pyx_k8)}, + {&__pyx_n_key, 1, __pyx_k7, sizeof(__pyx_k7)}, + {&__pyx_n_parent_keys, 1, __pyx_k27, sizeof(__pyx_k27)}, + {&__pyx_n_pop, 1, __pyx_k20, sizeof(__pyx_k20)}, + {&__pyx_n_popleft, 1, __pyx_k17, sizeof(__pyx_k17)}, + {&__pyx_n_reverse, 1, __pyx_k9, sizeof(__pyx_k9)}, + {&__pyx_n_revision, 1, __pyx_k35, sizeof(__pyx_k35)}, + {&__pyx_n_sort, 1, __pyx_k6, sizeof(__pyx_k6)}, + {&__pyx_n_sorted, 1, __pyx_k26, sizeof(__pyx_k26)}, + {&__pyx_k2p, 0, __pyx_k2, sizeof(__pyx_k2)}, + {&__pyx_k5p, 0, __pyx_k5, sizeof(__pyx_k5)}, + {&__pyx_k12p, 0, __pyx_k12, sizeof(__pyx_k12)}, + {&__pyx_k15p, 0, __pyx_k15, sizeof(__pyx_k15)}, + {&__pyx_k19p, 0, __pyx_k19, sizeof(__pyx_k19)}, + {&__pyx_k25p, 0, __pyx_k25, sizeof(__pyx_k25)}, + {&__pyx_k29p, 0, __pyx_k29, sizeof(__pyx_k29)}, + {&__pyx_k30p, 0, __pyx_k30, sizeof(__pyx_k30)}, + {&__pyx_k31p, 0, __pyx_k31, sizeof(__pyx_k31)}, + {0, 0, 0, 0} +}; + +static PyObject *__pyx_d1; + /* Implementation of bzrlib._known_graph_pyx */ -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_KeyError; -static PyObject *__pyx_builtin_sorted; -static PyObject *__pyx_builtin_RuntimeError; -static char __pyx_k_1[] = "%s(%s gdfo:%s par:%s child:%s)"; -static char __pyx_k_2[] = "lst_or_tpl must be a list or tuple."; -static char __pyx_k_5[] = "parent_map should be a dict of {key:parent_keys}"; -static char __pyx_k_7[] = "Parent key mismatch, existing node %s has parents of %s not %s"; -static char __pyx_k_8[] = "key %s not in nodes"; -static char __pyx_k_9[] = ""; -static char __pyx_k_10[] = "%s(%s depth:%s rev:%s,%s,%s first:%s seen:%s)"; -static char __pyx_k_11[] = "Something wrong with: %s"; -static char __pyx_k_12[] = "_revno_to_branch_count"; -static char __pyx_k_13[] = "ghost nodes should not be pushed onto the stack: %s"; -static char __pyx_k_14[] = "Implementation of Graph algorithms when we have already loaded everything.\n"; -static char __pyx_k_15[] = "bzrlib._known_graph_pyx"; -static char __pyx_k__gc[] = "gc"; -static char __pyx_k__key[] = "key"; -static char __pyx_k__pop[] = "pop"; -static char __pyx_k__gdfo[] = "gdfo"; -static char __pyx_k__seen[] = "seen"; -static char __pyx_k__sort[] = "sort"; -static char __pyx_k__clear[] = "clear"; -static char __pyx_k__deque[] = "deque"; -static char __pyx_k__extra[] = "extra"; -static char __pyx_k__graph[] = "graph"; -static char __pyx_k___nodes[] = "_nodes"; -static char __pyx_k___revno[] = "_revno"; -static char __pyx_k__append[] = "append"; -static char __pyx_k__bzrlib[] = "bzrlib"; -static char __pyx_k__errors[] = "errors"; -static char __pyx_k__extend[] = "extend"; -static char __pyx_k__sorted[] = "sorted"; -static char __pyx_k__get_key[] = "get_key"; -static char __pyx_k__parents[] = "parents"; -static char __pyx_k__popleft[] = "popleft"; -static char __pyx_k__reverse[] = "reverse"; -static char __pyx_k__tip_key[] = "tip_key"; -static char __pyx_k__KeyError[] = "KeyError"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____name__[] = "__name__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__children[] = "children"; -static char __pyx_k__do_cache[] = "do_cache"; -static char __pyx_k__revision[] = "revision"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k____class__[] = "__class__"; -static char __pyx_k___pop_node[] = "_pop_node"; -static char __pyx_k__completed[] = "completed"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k___find_gdfo[] = "_find_gdfo"; -static char __pyx_k___find_tips[] = "_find_tips"; -static char __pyx_k___push_node[] = "_push_node"; -static char __pyx_k__child_keys[] = "child_keys"; -static char __pyx_k__parent_map[] = "parent_map"; -static char __pyx_k__topo_order[] = "topo_order"; -static char __pyx_k___find_tails[] = "_find_tails"; -static char __pyx_k___revno_last[] = "_revno_last"; -static char __pyx_k__collections[] = "collections"; -static char __pyx_k__known_graph[] = "known_graph"; -static char __pyx_k__left_parent[] = "left_parent"; -static char __pyx_k__merge_depth[] = "merge_depth"; -static char __pyx_k__parent_keys[] = "parent_keys"; -static char __pyx_k__RuntimeError[] = "RuntimeError"; -static char __pyx_k___get_ms_node[] = "_get_ms_node"; -static char __pyx_k___known_heads[] = "_known_heads"; -static char __pyx_k___revno_first[] = "_revno_first"; -static char __pyx_k__end_of_merge[] = "end_of_merge"; -static char __pyx_k__NULL_REVISION[] = "NULL_REVISION"; -static char __pyx_k___revno_second[] = "_revno_second"; -static char __pyx_k__seen_by_child[] = "seen_by_child"; -static char __pyx_k__is_first_child[] = "is_first_child"; -static char __pyx_k__GraphCycleError[] = "GraphCycleError"; -static char __pyx_k___schedule_stack[] = "_schedule_stack"; -static char __pyx_k__pending_parents[] = "pending_parents"; -static char __pyx_k___last_stack_item[] = "_last_stack_item"; -static char __pyx_k___scheduled_nodes[] = "_scheduled_nodes"; -static char __pyx_k__clear_references[] = "clear_references"; -static char __pyx_k___initialize_nodes[] = "_initialize_nodes"; -static char __pyx_k___populate_parents[] = "_populate_parents"; -static char __pyx_k___depth_first_stack[] = "_depth_first_stack"; -static char __pyx_k___get_or_create_node[] = "_get_or_create_node"; -static char __pyx_k__has_pending_parents[] = "has_pending_parents"; -static char __pyx_k__left_pending_parent[] = "left_pending_parent"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_kp_s_10; -static PyObject *__pyx_kp_s_11; -static PyObject *__pyx_n_s_12; -static PyObject *__pyx_kp_s_13; -static PyObject *__pyx_n_s_15; -static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_7; -static PyObject *__pyx_kp_s_8; -static PyObject *__pyx_kp_s_9; -static PyObject *__pyx_n_s__GraphCycleError; -static PyObject *__pyx_n_s__KeyError; -static PyObject *__pyx_n_s__NULL_REVISION; -static PyObject *__pyx_n_s__RuntimeError; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____class__; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____name__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___depth_first_stack; -static PyObject *__pyx_n_s___find_gdfo; -static PyObject *__pyx_n_s___find_tails; -static PyObject *__pyx_n_s___find_tips; -static PyObject *__pyx_n_s___get_ms_node; -static PyObject *__pyx_n_s___get_or_create_node; -static PyObject *__pyx_n_s___initialize_nodes; -static PyObject *__pyx_n_s___known_heads; -static PyObject *__pyx_n_s___last_stack_item; -static PyObject *__pyx_n_s___nodes; -static PyObject *__pyx_n_s___pop_node; -static PyObject *__pyx_n_s___populate_parents; -static PyObject *__pyx_n_s___push_node; -static PyObject *__pyx_n_s___revno; -static PyObject *__pyx_n_s___revno_first; -static PyObject *__pyx_n_s___revno_last; -static PyObject *__pyx_n_s___revno_second; -static PyObject *__pyx_n_s___schedule_stack; -static PyObject *__pyx_n_s___scheduled_nodes; -static PyObject *__pyx_n_s__append; -static PyObject *__pyx_n_s__bzrlib; -static PyObject *__pyx_n_s__child_keys; -static PyObject *__pyx_n_s__children; -static PyObject *__pyx_n_s__clear; -static PyObject *__pyx_n_s__clear_references; -static PyObject *__pyx_n_s__collections; -static PyObject *__pyx_n_s__completed; -static PyObject *__pyx_n_s__deque; -static PyObject *__pyx_n_s__do_cache; -static PyObject *__pyx_n_s__end_of_merge; -static PyObject *__pyx_n_s__errors; -static PyObject *__pyx_n_s__extend; -static PyObject *__pyx_n_s__extra; -static PyObject *__pyx_n_s__gc; -static PyObject *__pyx_n_s__gdfo; -static PyObject *__pyx_n_s__get_key; -static PyObject *__pyx_n_s__graph; -static PyObject *__pyx_n_s__has_pending_parents; -static PyObject *__pyx_n_s__is_first_child; -static PyObject *__pyx_n_s__key; -static PyObject *__pyx_n_s__known_graph; -static PyObject *__pyx_n_s__left_parent; -static PyObject *__pyx_n_s__left_pending_parent; -static PyObject *__pyx_n_s__merge_depth; -static PyObject *__pyx_n_s__parent_keys; -static PyObject *__pyx_n_s__parent_map; -static PyObject *__pyx_n_s__parents; -static PyObject *__pyx_n_s__pending_parents; -static PyObject *__pyx_n_s__pop; -static PyObject *__pyx_n_s__popleft; -static PyObject *__pyx_n_s__reverse; -static PyObject *__pyx_n_s__revision; -static PyObject *__pyx_n_s__seen; -static PyObject *__pyx_n_s__seen_by_child; -static PyObject *__pyx_n_s__sort; -static PyObject *__pyx_n_s__sorted; -static PyObject *__pyx_n_s__tip_key; -static PyObject *__pyx_n_s__topo_order; -static PyObject *__pyx_int_0; -static PyObject *__pyx_int_1; -static PyObject *__pyx_k_4; -static PyObject *__pyx_k_tuple_3; -static PyObject *__pyx_k_tuple_6; - -/* "bzrlib/_known_graph_pyx.pyx":73 - * cdef object extra - * - * def __init__(self, key): # <<<<<<<<<<<<<< - * self.key = key - * self.parents = None - */ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; int __pyx_r; - PyObject *__pyx_t_1 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_key = values[0]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._known_graph_pyx._KnownGraphNode.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "bzrlib/_known_graph_pyx.pyx":74 - * - * def __init__(self, key): - * self.key = key # <<<<<<<<<<<<<< - * self.parents = None - * - */ - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->key); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->key); + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {"key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return -1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":74 */ + Py_INCREF(__pyx_v_key); + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->key); ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->key = __pyx_v_key; - /* "bzrlib/_known_graph_pyx.pyx":75 - * def __init__(self, key): - * self.key = key - * self.parents = None # <<<<<<<<<<<<<< - * - * self.children = [] - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":75 */ + Py_INCREF(Py_None); + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents); ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents = Py_None; - /* "bzrlib/_known_graph_pyx.pyx":77 - * self.parents = None - * - * self.children = [] # <<<<<<<<<<<<<< - * # Greatest distance from origin - * self.gdfo = -1 - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":79 - * self.children = [] - * # Greatest distance from origin - * self.gdfo = -1 # <<<<<<<<<<<<<< - * self.seen = 0 - * self.extra = None - */ - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->gdfo = -1; - - /* "bzrlib/_known_graph_pyx.pyx":80 - * # Greatest distance from origin - * self.gdfo = -1 - * self.seen = 0 # <<<<<<<<<<<<<< - * self.extra = None - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":77 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; goto __pyx_L1;} + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children); + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":79 */ + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->gdfo = (-1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":80 */ ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->seen = 0; - /* "bzrlib/_known_graph_pyx.pyx":81 - * self.gdfo = -1 - * self.seen = 0 - * self.extra = None # <<<<<<<<<<<<<< - * - * property child_keys: - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->extra); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->extra); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":81 */ + Py_INCREF(Py_None); + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->extra); ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->extra = Py_None; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._known_graph_pyx._KnownGraphNode.__init__"); __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":84 - * - * property child_keys: - * def __get__(self): # <<<<<<<<<<<<<< - * cdef _KnownGraphNode child - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_10child_keys___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_10child_keys___get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_10child_keys___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_10child_keys___get__(PyObject *__pyx_v_self) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_child; PyObject *__pyx_v_keys; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("__get__"); - __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_keys = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":87 - * cdef _KnownGraphNode child - * - * keys = [] # <<<<<<<<<<<<<< - * for child in self.children: - * PyList_Append(keys, child.key) - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_keys)); - __pyx_v_keys = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":88 - * - * keys = [] - * for child in self.children: # <<<<<<<<<<<<<< - * PyList_Append(keys, child.key) - * return keys - */ - if (PyList_CheckExact(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children) || PyTuple_CheckExact(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children)) { - __pyx_t_2 = 0; __pyx_t_1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children; __Pyx_INCREF(__pyx_t_1); - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - } + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + int __pyx_3; + Py_INCREF(__pyx_v_self); + __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_keys = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":87 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;} + Py_DECREF(__pyx_v_keys); + __pyx_v_keys = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":88 */ + __pyx_1 = PyObject_GetIter(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; - } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; - } else { - __pyx_t_3 = PyIter_Next(__pyx_t_1); - if (!__pyx_t_3) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_3); + __pyx_2 = PyIter_Next(__pyx_1); + if (!__pyx_2) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} + break; } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_child)); - __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":89 - * keys = [] - * for child in self.children: - * PyList_Append(keys, child.key) # <<<<<<<<<<<<<< - * return keys - * - */ - __pyx_t_3 = __pyx_v_child->key; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_keys), __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":90 - * for child in self.children: - * PyList_Append(keys, child.key) - * return keys # <<<<<<<<<<<<<< - * - * property parent_keys: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_keys)); - __pyx_r = ((PyObject *)__pyx_v_keys); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); + if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_child)); + __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_2); + __pyx_2 = 0; + __pyx_3 = PyList_Append(__pyx_v_keys,__pyx_v_child->key); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;} + } + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":90 */ + Py_INCREF(__pyx_v_keys); + __pyx_r = __pyx_v_keys; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._known_graph_pyx._KnownGraphNode.child_keys.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_child); - __Pyx_DECREF(__pyx_v_keys); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_child); + Py_DECREF(__pyx_v_keys); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":93 - * - * property parent_keys: - * def __get__(self): # <<<<<<<<<<<<<< - * if self.parents is None: - * return None - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_11parent_keys___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_11parent_keys___get__(PyObject *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_11parent_keys___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_11parent_keys___get__(PyObject *__pyx_v_self) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_parent; PyObject *__pyx_v_keys; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - __Pyx_RefNannySetupContext("__get__"); - __pyx_v_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_keys = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":94 - * property parent_keys: - * def __get__(self): - * if self.parents is None: # <<<<<<<<<<<<<< - * return None - * - */ - __pyx_t_1 = (((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents == Py_None); - if (__pyx_t_1) { - - /* "bzrlib/_known_graph_pyx.pyx":95 - * def __get__(self): - * if self.parents is None: - * return None # <<<<<<<<<<<<<< - * - * cdef _KnownGraphNode parent - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_keys = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":94 */ + __pyx_1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents == Py_None; + if (__pyx_1) { + Py_INCREF(Py_None); __pyx_r = Py_None; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_known_graph_pyx.pyx":99 - * cdef _KnownGraphNode parent - * - * keys = [] # <<<<<<<<<<<<<< - * for parent in self.parents: - * PyList_Append(keys, parent.key) - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_v_keys)); - __pyx_v_keys = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":100 - * - * keys = [] - * for parent in self.parents: # <<<<<<<<<<<<<< - * PyList_Append(keys, parent.key) - * return keys - */ - if (PyList_CheckExact(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents) || PyTuple_CheckExact(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents)) { - __pyx_t_3 = 0; __pyx_t_2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents; __Pyx_INCREF(__pyx_t_2); - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":99 */ + __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;} + Py_DECREF(__pyx_v_keys); + __pyx_v_keys = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":100 */ + __pyx_2 = PyObject_GetIter(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; - } else if (likely(PyTuple_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; - } else { - __pyx_t_4 = PyIter_Next(__pyx_t_2); - if (!__pyx_t_4) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_4); + __pyx_3 = PyIter_Next(__pyx_2); + if (!__pyx_3) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} + break; } - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_parent)); - __pyx_v_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":101 - * keys = [] - * for parent in self.parents: - * PyList_Append(keys, parent.key) # <<<<<<<<<<<<<< - * return keys - * - */ - __pyx_t_4 = __pyx_v_parent->key; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_5 = PyList_Append(((PyObject *)__pyx_v_keys), __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":102 - * for parent in self.parents: - * PyList_Append(keys, parent.key) - * return keys # <<<<<<<<<<<<<< - * - * cdef clear_references(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_keys)); - __pyx_r = ((PyObject *)__pyx_v_keys); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_parent)); + __pyx_v_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_3); + __pyx_3 = 0; + __pyx_1 = PyList_Append(__pyx_v_keys,__pyx_v_parent->key); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;} + } + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":102 */ + Py_INCREF(__pyx_v_keys); + __pyx_r = __pyx_v_keys; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._known_graph_pyx._KnownGraphNode.parent_keys.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_parent); - __Pyx_DECREF(__pyx_v_keys); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_parent); + Py_DECREF(__pyx_v_keys); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":104 - * return keys - * - * cdef clear_references(self): # <<<<<<<<<<<<<< - * self.parents = None - * self.children = None - */ - -static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_clear_references(struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("clear_references"); - - /* "bzrlib/_known_graph_pyx.pyx":105 - * - * cdef clear_references(self): - * self.parents = None # <<<<<<<<<<<<<< - * self.children = None - * - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->parents); - __Pyx_DECREF(__pyx_v_self->parents); +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_clear_references(struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_self) { + PyObject *__pyx_r; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":105 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_self->parents); __pyx_v_self->parents = Py_None; - /* "bzrlib/_known_graph_pyx.pyx":106 - * cdef clear_references(self): - * self.parents = None - * self.children = None # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->children); - __Pyx_DECREF(__pyx_v_self->children); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":106 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_self->children); __pyx_v_self->children = Py_None; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + __pyx_r = Py_None; Py_INCREF(Py_None); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":108 - * self.children = None - * - * def __repr__(self): # <<<<<<<<<<<<<< - * cdef _KnownGraphNode node - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_1__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_1__repr__(PyObject *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode___repr__(PyObject *__pyx_v_self) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; PyObject *__pyx_v_parent_keys; PyObject *__pyx_v_child_keys; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("__repr__"); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_parent_keys = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_child_keys = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":111 - * cdef _KnownGraphNode node - * - * parent_keys = [] # <<<<<<<<<<<<<< - * if self.parents is not None: - * for node in self.parents: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_parent_keys)); - __pyx_v_parent_keys = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":112 - * - * parent_keys = [] - * if self.parents is not None: # <<<<<<<<<<<<<< - * for node in self.parents: - * parent_keys.append(node.key) - */ - __pyx_t_2 = (((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents != Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":113 - * parent_keys = [] - * if self.parents is not None: - * for node in self.parents: # <<<<<<<<<<<<<< - * parent_keys.append(node.key) - * child_keys = [] - */ - if (PyList_CheckExact(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents) || PyTuple_CheckExact(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents)) { - __pyx_t_3 = 0; __pyx_t_1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents; __Pyx_INCREF(__pyx_t_1); - } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - } + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_parent_keys = Py_None; Py_INCREF(Py_None); + __pyx_v_child_keys = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":111 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;} + Py_DECREF(__pyx_v_parent_keys); + __pyx_v_parent_keys = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":112 */ + __pyx_2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents != Py_None; + if (__pyx_2) { + __pyx_1 = PyObject_GetIter(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->parents); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; - } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; - } else { - __pyx_t_4 = PyIter_Next(__pyx_t_1); - if (!__pyx_t_4) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_4); + __pyx_3 = PyIter_Next(__pyx_1); + if (!__pyx_3) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;} + break; } - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":114 - * if self.parents is not None: - * for node in self.parents: - * parent_keys.append(node.key) # <<<<<<<<<<<<<< - * child_keys = [] - * if self.children is not None: - */ - if (unlikely(__pyx_v_parent_keys == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_GetAttr(__pyx_v_parent_keys, __pyx_n_append); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + Py_INCREF(__pyx_v_node->key); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_node->key); + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + } + Py_DECREF(__pyx_1); __pyx_1 = 0; + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":115 */ + __pyx_3 = PyList_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + Py_DECREF(__pyx_v_child_keys); + __pyx_v_child_keys = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":116 */ + __pyx_2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children != Py_None; + if (__pyx_2) { + __pyx_4 = PyObject_GetIter(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;} + for (;;) { + __pyx_5 = PyIter_Next(__pyx_4); + if (!__pyx_5) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;} + break; } - __pyx_t_4 = __pyx_v_node->key; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_5 = PyList_Append(__pyx_v_parent_keys, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_5); + __pyx_5 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_v_child_keys, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;} + Py_INCREF(__pyx_v_node->key); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_node->key); + __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; goto __pyx_L5; } __pyx_L5:; - /* "bzrlib/_known_graph_pyx.pyx":115 - * for node in self.parents: - * parent_keys.append(node.key) - * child_keys = [] # <<<<<<<<<<<<<< - * if self.children is not None: - * for node in self.children: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_child_keys)); - __pyx_v_child_keys = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":116 - * parent_keys.append(node.key) - * child_keys = [] - * if self.children is not None: # <<<<<<<<<<<<<< - * for node in self.children: - * child_keys.append(node.key) - */ - __pyx_t_2 = (((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children != Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":117 - * child_keys = [] - * if self.children is not None: - * for node in self.children: # <<<<<<<<<<<<<< - * child_keys.append(node.key) - * return '%s(%s gdfo:%s par:%s child:%s)' % ( - */ - if (PyList_CheckExact(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children) || PyTuple_CheckExact(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children)) { - __pyx_t_3 = 0; __pyx_t_1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children; __Pyx_INCREF(__pyx_t_1); - } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - } - for (;;) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; - } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; - } else { - __pyx_t_4 = PyIter_Next(__pyx_t_1); - if (!__pyx_t_4) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":118 - * if self.children is not None: - * for node in self.children: - * child_keys.append(node.key) # <<<<<<<<<<<<<< - * return '%s(%s gdfo:%s par:%s child:%s)' % ( - * self.__class__.__name__, self.key, self.gdfo, - */ - if (unlikely(__pyx_v_child_keys == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __pyx_t_4 = __pyx_v_node->key; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_5 = PyList_Append(__pyx_v_child_keys, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L8; - } - __pyx_L8:; - - /* "bzrlib/_known_graph_pyx.pyx":119 - * for node in self.children: - * child_keys.append(node.key) - * return '%s(%s gdfo:%s par:%s child:%s)' % ( # <<<<<<<<<<<<<< - * self.__class__.__name__, self.key, self.gdfo, - * parent_keys, child_keys) - */ - __Pyx_XDECREF(__pyx_r); - - /* "bzrlib/_known_graph_pyx.pyx":120 - * child_keys.append(node.key) - * return '%s(%s gdfo:%s par:%s child:%s)' % ( - * self.__class__.__name__, self.key, self.gdfo, # <<<<<<<<<<<<<< - * parent_keys, child_keys) - * - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____name__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->gdfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - - /* "bzrlib/_known_graph_pyx.pyx":121 - * return '%s(%s gdfo:%s par:%s child:%s)' % ( - * self.__class__.__name__, self.key, self.gdfo, - * parent_keys, child_keys) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->key); - PyTuple_SET_ITEM(__pyx_t_6, 1, ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->key); - __Pyx_GIVEREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->key); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_INCREF(((PyObject *)__pyx_v_parent_keys)); - PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_parent_keys)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_parent_keys)); - __Pyx_INCREF(((PyObject *)__pyx_v_child_keys)); - PyTuple_SET_ITEM(__pyx_t_6, 4, ((PyObject *)__pyx_v_child_keys)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_child_keys)); - __pyx_t_4 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":119 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n___name__); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_5 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->gdfo); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} + __pyx_4 = PyTuple_New(5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + Py_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->key); + PyTuple_SET_ITEM(__pyx_4, 1, ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->key); + PyTuple_SET_ITEM(__pyx_4, 2, __pyx_5); + Py_INCREF(__pyx_v_parent_keys); + PyTuple_SET_ITEM(__pyx_4, 3, __pyx_v_parent_keys); + Py_INCREF(__pyx_v_child_keys); + PyTuple_SET_ITEM(__pyx_4, 4, __pyx_v_child_keys); + __pyx_3 = 0; + __pyx_5 = 0; + __pyx_1 = PyNumber_Remainder(__pyx_k2p, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); __Pyx_AddTraceback("bzrlib._known_graph_pyx._KnownGraphNode.__repr__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF(__pyx_v_parent_keys); - __Pyx_DECREF(__pyx_v_child_keys); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_known_graph_pyx.pyx":69 - * cdef object parents - * cdef object children - * cdef public long gdfo # <<<<<<<<<<<<<< - * cdef int seen - * cdef object extra - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_4gdfo___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_4gdfo___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->gdfo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._known_graph_pyx._KnownGraphNode.gdfo.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_4gdfo_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_4gdfo_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - long __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyInt_AsLong(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_self)->gdfo = __pyx_t_1; - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("bzrlib._known_graph_pyx._KnownGraphNode.gdfo.__set__"); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_parent_keys); + Py_DECREF(__pyx_v_child_keys); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":124 - * - * - * cdef _KnownGraphNode _get_list_node(lst, Py_ssize_t pos): # <<<<<<<<<<<<<< - * cdef PyObject *temp_node - * - */ - -static struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(PyObject *__pyx_v_lst, Py_ssize_t __pyx_v_pos) { +static struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(PyObject *__pyx_v_lst,Py_ssize_t __pyx_v_pos) { PyObject *__pyx_v_temp_node; - struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_r = NULL; - __Pyx_RefNannySetupContext("_get_list_node"); + struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_r; + Py_INCREF(__pyx_v_lst); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":127 */ + __pyx_v_temp_node = PyList_GET_ITEM(__pyx_v_lst,__pyx_v_pos); - /* "bzrlib/_known_graph_pyx.pyx":127 - * cdef PyObject *temp_node - * - * temp_node = PyList_GET_ITEM(lst, pos) # <<<<<<<<<<<<<< - * return <_KnownGraphNode>temp_node - * - */ - __pyx_v_temp_node = PyList_GET_ITEM(__pyx_v_lst, __pyx_v_pos); - - /* "bzrlib/_known_graph_pyx.pyx":128 - * - * temp_node = PyList_GET_ITEM(lst, pos) - * return <_KnownGraphNode>temp_node # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node))); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":128 */ + Py_INCREF(((PyObject *)__pyx_v_temp_node)); __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node); goto __pyx_L0; - __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); + __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_lst); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":131 - * - * - * cdef _KnownGraphNode _get_tuple_node(tpl, Py_ssize_t pos): # <<<<<<<<<<<<<< - * cdef PyObject *temp_node - * - */ - -static struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(PyObject *__pyx_v_tpl, Py_ssize_t __pyx_v_pos) { +static struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(PyObject *__pyx_v_tpl,Py_ssize_t __pyx_v_pos) { PyObject *__pyx_v_temp_node; - struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_r = NULL; - __Pyx_RefNannySetupContext("_get_tuple_node"); + struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_r; + Py_INCREF(__pyx_v_tpl); - /* "bzrlib/_known_graph_pyx.pyx":134 - * cdef PyObject *temp_node - * - * temp_node = PyTuple_GET_ITEM(tpl, pos) # <<<<<<<<<<<<<< - * return <_KnownGraphNode>temp_node - * - */ - __pyx_v_temp_node = PyTuple_GET_ITEM(__pyx_v_tpl, __pyx_v_pos); - - /* "bzrlib/_known_graph_pyx.pyx":135 - * - * temp_node = PyTuple_GET_ITEM(tpl, pos) - * return <_KnownGraphNode>temp_node # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node))); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":134 */ + __pyx_v_temp_node = PyTuple_GET_ITEM(__pyx_v_tpl,__pyx_v_pos); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":135 */ + Py_INCREF(((PyObject *)__pyx_v_temp_node)); __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node); goto __pyx_L0; - __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); + __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_tpl); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":138 - * - * - * def get_key(node): # <<<<<<<<<<<<<< - * cdef _KnownGraphNode real_node - * real_node = node - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_get_key(PyObject *__pyx_self, PyObject *__pyx_v_node); /*proto*/ -static PyMethodDef __pyx_mdef_6bzrlib_16_known_graph_pyx_get_key = {__Pyx_NAMESTR("get_key"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_get_key, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_get_key(PyObject *__pyx_self, PyObject *__pyx_v_node) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_get_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_get_key(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_node = 0; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_real_node; - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("get_key"); - __pyx_self = __pyx_self; - __pyx_v_real_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":140 - * def get_key(node): - * cdef _KnownGraphNode real_node - * real_node = node # <<<<<<<<<<<<<< - * return real_node.key - * - */ - if (!(likely(((__pyx_v_node) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_node, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_node); - __Pyx_DECREF(((PyObject *)__pyx_v_real_node)); + PyObject *__pyx_r; + static char *__pyx_argnames[] = {"node",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_node)) return 0; + Py_INCREF(__pyx_v_node); + __pyx_v_real_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":140 */ + if (!__Pyx_TypeTest(__pyx_v_node, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;} + Py_INCREF(__pyx_v_node); + Py_DECREF(((PyObject *)__pyx_v_real_node)); __pyx_v_real_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_node); - /* "bzrlib/_known_graph_pyx.pyx":141 - * cdef _KnownGraphNode real_node - * real_node = node - * return real_node.key # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_real_node->key); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":141 */ + Py_INCREF(__pyx_v_real_node->key); __pyx_r = __pyx_v_real_node->key; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; __Pyx_AddTraceback("bzrlib._known_graph_pyx.get_key"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_real_node); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_real_node); + Py_DECREF(__pyx_v_node); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":144 - * - * - * cdef object _sort_list_nodes(object lst_or_tpl, int reverse): # <<<<<<<<<<<<<< - * """Sort a list of _KnownGraphNode objects. - * - */ - -static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx__sort_list_nodes(PyObject *__pyx_v_lst_or_tpl, int __pyx_v_reverse) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx__sort_list_nodes(PyObject *__pyx_v_lst_or_tpl,int __pyx_v_reverse) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node1; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node2; int __pyx_v_do_swap; int __pyx_v_is_tuple; Py_ssize_t __pyx_v_length; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - Py_ssize_t __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - __Pyx_RefNannySetupContext("_sort_list_nodes"); - __Pyx_INCREF(__pyx_v_lst_or_tpl); - __pyx_v_node1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_node2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":154 - * cdef Py_ssize_t length - * - * is_tuple = PyTuple_CheckExact(lst_or_tpl) # <<<<<<<<<<<<<< - * if not (is_tuple or PyList_CheckExact(lst_or_tpl)): - * raise TypeError('lst_or_tpl must be a list or tuple.') - */ + PyObject *__pyx_r; + int __pyx_1; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_ssize_t __pyx_5; + PyObject *__pyx_6 = 0; + PyObject *__pyx_7 = 0; + Py_INCREF(__pyx_v_lst_or_tpl); + __pyx_v_node1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_node2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":154 */ __pyx_v_is_tuple = PyTuple_CheckExact(__pyx_v_lst_or_tpl); - /* "bzrlib/_known_graph_pyx.pyx":155 - * - * is_tuple = PyTuple_CheckExact(lst_or_tpl) - * if not (is_tuple or PyList_CheckExact(lst_or_tpl)): # <<<<<<<<<<<<<< - * raise TypeError('lst_or_tpl must be a list or tuple.') - * length = len(lst_or_tpl) - */ - if (!__pyx_v_is_tuple) { - __pyx_t_1 = PyList_CheckExact(__pyx_v_lst_or_tpl); - __pyx_t_2 = __pyx_t_1; - } else { - __pyx_t_2 = __pyx_v_is_tuple; - } - __pyx_t_3 = (!__pyx_t_2); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":156 - * is_tuple = PyTuple_CheckExact(lst_or_tpl) - * if not (is_tuple or PyList_CheckExact(lst_or_tpl)): - * raise TypeError('lst_or_tpl must be a list or tuple.') # <<<<<<<<<<<<<< - * length = len(lst_or_tpl) - * if length == 0 or length == 1: - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":155 */ + __pyx_1 = __pyx_v_is_tuple; + if (!__pyx_1) { + __pyx_1 = PyList_CheckExact(__pyx_v_lst_or_tpl); + } + __pyx_2 = (!__pyx_1); + if (__pyx_2) { + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L1;} + Py_INCREF(__pyx_k5p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k5p); + __pyx_4 = PyObject_CallObject(PyExc_TypeError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":157 */ + __pyx_5 = PyObject_Length(__pyx_v_lst_or_tpl); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L1;} + __pyx_v_length = __pyx_5; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":158 */ + __pyx_1 = (__pyx_v_length == 0); + if (!__pyx_1) { + __pyx_1 = (__pyx_v_length == 1); } - __pyx_L3:; - - /* "bzrlib/_known_graph_pyx.pyx":157 - * if not (is_tuple or PyList_CheckExact(lst_or_tpl)): - * raise TypeError('lst_or_tpl must be a list or tuple.') - * length = len(lst_or_tpl) # <<<<<<<<<<<<<< - * if length == 0 or length == 1: - * return lst_or_tpl - */ - __pyx_t_5 = PyObject_Length(__pyx_v_lst_or_tpl); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_length = __pyx_t_5; - - /* "bzrlib/_known_graph_pyx.pyx":158 - * raise TypeError('lst_or_tpl must be a list or tuple.') - * length = len(lst_or_tpl) - * if length == 0 or length == 1: # <<<<<<<<<<<<<< - * return lst_or_tpl - * if length == 2: - */ - switch (__pyx_v_length) { - case 0: - case 1: - - /* "bzrlib/_known_graph_pyx.pyx":159 - * length = len(lst_or_tpl) - * if length == 0 or length == 1: - * return lst_or_tpl # <<<<<<<<<<<<<< - * if length == 2: - * if is_tuple: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_lst_or_tpl); + if (__pyx_1) { + Py_INCREF(__pyx_v_lst_or_tpl); __pyx_r = __pyx_v_lst_or_tpl; goto __pyx_L0; - break; + goto __pyx_L3; } + __pyx_L3:; - /* "bzrlib/_known_graph_pyx.pyx":160 - * if length == 0 or length == 1: - * return lst_or_tpl - * if length == 2: # <<<<<<<<<<<<<< - * if is_tuple: - * node1 = _get_tuple_node(lst_or_tpl, 0) - */ - __pyx_t_3 = (__pyx_v_length == 2); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":161 - * return lst_or_tpl - * if length == 2: - * if is_tuple: # <<<<<<<<<<<<<< - * node1 = _get_tuple_node(lst_or_tpl, 0) - * node2 = _get_tuple_node(lst_or_tpl, 1) - */ - if (__pyx_v_is_tuple) { - - /* "bzrlib/_known_graph_pyx.pyx":162 - * if length == 2: - * if is_tuple: - * node1 = _get_tuple_node(lst_or_tpl, 0) # <<<<<<<<<<<<<< - * node2 = _get_tuple_node(lst_or_tpl, 1) - * else: - */ - __pyx_t_4 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_v_lst_or_tpl, 0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_v_node1)); - __pyx_v_node1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":163 - * if is_tuple: - * node1 = _get_tuple_node(lst_or_tpl, 0) - * node2 = _get_tuple_node(lst_or_tpl, 1) # <<<<<<<<<<<<<< - * else: - * node1 = _get_list_node(lst_or_tpl, 0) - */ - __pyx_t_4 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_v_lst_or_tpl, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_v_node2)); - __pyx_v_node2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_4); - __pyx_t_4 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":160 */ + __pyx_2 = (__pyx_v_length == 2); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":161 */ + __pyx_1 = __pyx_v_is_tuple; + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":162 */ + __pyx_3 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_v_lst_or_tpl,0)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node1)); + __pyx_v_node1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":163 */ + __pyx_4 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_v_lst_or_tpl,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node2)); + __pyx_v_node2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_4); + __pyx_4 = 0; goto __pyx_L5; } /*else*/ { - /* "bzrlib/_known_graph_pyx.pyx":165 - * node2 = _get_tuple_node(lst_or_tpl, 1) - * else: - * node1 = _get_list_node(lst_or_tpl, 0) # <<<<<<<<<<<<<< - * node2 = _get_list_node(lst_or_tpl, 1) - * if reverse: - */ - __pyx_t_4 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_lst_or_tpl, 0)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_v_node1)); - __pyx_v_node1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":166 - * else: - * node1 = _get_list_node(lst_or_tpl, 0) - * node2 = _get_list_node(lst_or_tpl, 1) # <<<<<<<<<<<<<< - * if reverse: - * do_swap = PyObject_RichCompareBool(node1.key, node2.key, Py_LT) - */ - __pyx_t_4 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_lst_or_tpl, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_v_node2)); - __pyx_v_node2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_4); - __pyx_t_4 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":165 */ + __pyx_3 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_lst_or_tpl,0)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node1)); + __pyx_v_node1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":166 */ + __pyx_4 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_lst_or_tpl,1)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node2)); + __pyx_v_node2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_4); + __pyx_4 = 0; } __pyx_L5:; - /* "bzrlib/_known_graph_pyx.pyx":167 - * node1 = _get_list_node(lst_or_tpl, 0) - * node2 = _get_list_node(lst_or_tpl, 1) - * if reverse: # <<<<<<<<<<<<<< - * do_swap = PyObject_RichCompareBool(node1.key, node2.key, Py_LT) - * else: - */ - if (__pyx_v_reverse) { - - /* "bzrlib/_known_graph_pyx.pyx":168 - * node2 = _get_list_node(lst_or_tpl, 1) - * if reverse: - * do_swap = PyObject_RichCompareBool(node1.key, node2.key, Py_LT) # <<<<<<<<<<<<<< - * else: - * do_swap = PyObject_RichCompareBool(node2.key, node1.key, Py_LT) - */ - __pyx_t_4 = __pyx_v_node1->key; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_6 = __pyx_v_node2->key; - __Pyx_INCREF(__pyx_t_6); - __pyx_v_do_swap = PyObject_RichCompareBool(__pyx_t_4, __pyx_t_6, Py_LT); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":167 */ + __pyx_2 = __pyx_v_reverse; + if (__pyx_2) { + __pyx_v_do_swap = PyObject_RichCompareBool(__pyx_v_node1->key,__pyx_v_node2->key,Py_LT); goto __pyx_L6; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":170 - * do_swap = PyObject_RichCompareBool(node1.key, node2.key, Py_LT) - * else: - * do_swap = PyObject_RichCompareBool(node2.key, node1.key, Py_LT) # <<<<<<<<<<<<<< - * if not do_swap: - * return lst_or_tpl - */ - __pyx_t_6 = __pyx_v_node2->key; - __Pyx_INCREF(__pyx_t_6); - __pyx_t_4 = __pyx_v_node1->key; - __Pyx_INCREF(__pyx_t_4); - __pyx_v_do_swap = PyObject_RichCompareBool(__pyx_t_6, __pyx_t_4, Py_LT); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_do_swap = PyObject_RichCompareBool(__pyx_v_node2->key,__pyx_v_node1->key,Py_LT); } __pyx_L6:; - /* "bzrlib/_known_graph_pyx.pyx":171 - * else: - * do_swap = PyObject_RichCompareBool(node2.key, node1.key, Py_LT) - * if not do_swap: # <<<<<<<<<<<<<< - * return lst_or_tpl - * if is_tuple: - */ - __pyx_t_3 = (!__pyx_v_do_swap); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":172 - * do_swap = PyObject_RichCompareBool(node2.key, node1.key, Py_LT) - * if not do_swap: - * return lst_or_tpl # <<<<<<<<<<<<<< - * if is_tuple: - * return (node2, node1) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_lst_or_tpl); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":171 */ + __pyx_1 = (!__pyx_v_do_swap); + if (__pyx_1) { + Py_INCREF(__pyx_v_lst_or_tpl); __pyx_r = __pyx_v_lst_or_tpl; goto __pyx_L0; goto __pyx_L7; } __pyx_L7:; - /* "bzrlib/_known_graph_pyx.pyx":173 - * if not do_swap: - * return lst_or_tpl - * if is_tuple: # <<<<<<<<<<<<<< - * return (node2, node1) - * else: - */ - if (__pyx_v_is_tuple) { - - /* "bzrlib/_known_graph_pyx.pyx":174 - * return lst_or_tpl - * if is_tuple: - * return (node2, node1) # <<<<<<<<<<<<<< - * else: - * # Swap 'in-place', since lists are mutable - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(((PyObject *)__pyx_v_node2)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_node2)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_node2)); - __Pyx_INCREF(((PyObject *)__pyx_v_node1)); - PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_node1)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_node1)); - __pyx_r = ((PyObject *)__pyx_t_4); - __pyx_t_4 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":173 */ + __pyx_2 = __pyx_v_is_tuple; + if (__pyx_2) { + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_v_node2)); + PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_node2)); + Py_INCREF(((PyObject *)__pyx_v_node1)); + PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_node1)); + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; goto __pyx_L8; } /*else*/ { - /* "bzrlib/_known_graph_pyx.pyx":177 - * else: - * # Swap 'in-place', since lists are mutable - * Py_INCREF(node1) # <<<<<<<<<<<<<< - * PyList_SetItem(lst_or_tpl, 1, node1) - * Py_INCREF(node2) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":177 */ Py_INCREF(((PyObject *)__pyx_v_node1)); - /* "bzrlib/_known_graph_pyx.pyx":178 - * # Swap 'in-place', since lists are mutable - * Py_INCREF(node1) - * PyList_SetItem(lst_or_tpl, 1, node1) # <<<<<<<<<<<<<< - * Py_INCREF(node2) - * PyList_SetItem(lst_or_tpl, 0, node2) - */ - __pyx_t_1 = PyList_SetItem(__pyx_v_lst_or_tpl, 1, ((PyObject *)__pyx_v_node1)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_known_graph_pyx.pyx":179 - * Py_INCREF(node1) - * PyList_SetItem(lst_or_tpl, 1, node1) - * Py_INCREF(node2) # <<<<<<<<<<<<<< - * PyList_SetItem(lst_or_tpl, 0, node2) - * return lst_or_tpl - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":178 */ + __pyx_1 = PyList_SetItem(__pyx_v_lst_or_tpl,1,((PyObject *)__pyx_v_node1)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":179 */ Py_INCREF(((PyObject *)__pyx_v_node2)); - /* "bzrlib/_known_graph_pyx.pyx":180 - * PyList_SetItem(lst_or_tpl, 1, node1) - * Py_INCREF(node2) - * PyList_SetItem(lst_or_tpl, 0, node2) # <<<<<<<<<<<<<< - * return lst_or_tpl - * # For all other sizes, we just use 'sorted()' - */ - __pyx_t_1 = PyList_SetItem(__pyx_v_lst_or_tpl, 0, ((PyObject *)__pyx_v_node2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_known_graph_pyx.pyx":181 - * Py_INCREF(node2) - * PyList_SetItem(lst_or_tpl, 0, node2) - * return lst_or_tpl # <<<<<<<<<<<<<< - * # For all other sizes, we just use 'sorted()' - * if is_tuple: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_lst_or_tpl); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":180 */ + __pyx_2 = PyList_SetItem(__pyx_v_lst_or_tpl,0,((PyObject *)__pyx_v_node2)); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":181 */ + Py_INCREF(__pyx_v_lst_or_tpl); __pyx_r = __pyx_v_lst_or_tpl; goto __pyx_L0; } @@ -2099,1212 +797,617 @@ } __pyx_L4:; - /* "bzrlib/_known_graph_pyx.pyx":183 - * return lst_or_tpl - * # For all other sizes, we just use 'sorted()' - * if is_tuple: # <<<<<<<<<<<<<< - * # Note that sorted() is just list(iterable).sort() - * lst_or_tpl = list(lst_or_tpl) - */ - if (__pyx_v_is_tuple) { - - /* "bzrlib/_known_graph_pyx.pyx":185 - * if is_tuple: - * # Note that sorted() is just list(iterable).sort() - * lst_or_tpl = list(lst_or_tpl) # <<<<<<<<<<<<<< - * lst_or_tpl.sort(key=get_key, reverse=reverse) - * return lst_or_tpl - */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_v_lst_or_tpl); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_lst_or_tpl); - __Pyx_GIVEREF(__pyx_v_lst_or_tpl); - __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_v_lst_or_tpl); - __pyx_v_lst_or_tpl = __pyx_t_6; - __pyx_t_6 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":183 */ + __pyx_1 = __pyx_v_is_tuple; + if (__pyx_1) { + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} + Py_INCREF(__pyx_v_lst_or_tpl); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_lst_or_tpl); + __pyx_3 = PyObject_CallObject(((PyObject *)(&PyList_Type)), __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_v_lst_or_tpl); + __pyx_v_lst_or_tpl = __pyx_3; + __pyx_3 = 0; goto __pyx_L9; } __pyx_L9:; - /* "bzrlib/_known_graph_pyx.pyx":186 - * # Note that sorted() is just list(iterable).sort() - * lst_or_tpl = list(lst_or_tpl) - * lst_or_tpl.sort(key=get_key, reverse=reverse) # <<<<<<<<<<<<<< - * return lst_or_tpl - * - */ - __pyx_t_6 = PyObject_GetAttr(__pyx_v_lst_or_tpl, __pyx_n_s__sort); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_key); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__key), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyInt_FromLong(__pyx_v_reverse); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__reverse), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":187 - * lst_or_tpl = list(lst_or_tpl) - * lst_or_tpl.sort(key=get_key, reverse=reverse) - * return lst_or_tpl # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_lst_or_tpl); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":186 */ + __pyx_4 = PyObject_GetAttr(__pyx_v_lst_or_tpl, __pyx_n_sort); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + __pyx_6 = PyDict_New(); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + __pyx_7 = __Pyx_GetName(__pyx_m, __pyx_n_get_key); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_6, __pyx_n_key, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + __pyx_7 = PyInt_FromLong(__pyx_v_reverse); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_6, __pyx_n_reverse, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + Py_DECREF(__pyx_7); __pyx_7 = 0; + __pyx_7 = PyEval_CallObjectWithKeywords(__pyx_4, __pyx_3, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_6); __pyx_6 = 0; + Py_DECREF(__pyx_7); __pyx_7 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":187 */ + Py_INCREF(__pyx_v_lst_or_tpl); __pyx_r = __pyx_v_lst_or_tpl; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); + __pyx_L1:; + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_6); + Py_XDECREF(__pyx_7); __Pyx_AddTraceback("bzrlib._known_graph_pyx._sort_list_nodes"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node1); - __Pyx_DECREF((PyObject *)__pyx_v_node2); - __Pyx_DECREF(__pyx_v_lst_or_tpl); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node1); + Py_DECREF(__pyx_v_node2); + Py_DECREF(__pyx_v_lst_or_tpl); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":199 - * cdef public int do_cache - * - * def __init__(self, parent_map, do_cache=True): # <<<<<<<<<<<<<< - * """Create a new KnownGraph instance. - * - */ - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph___init__[] = "Create a new KnownGraph instance.\n\n :param parent_map: A dictionary mapping key => parent_keys\n "; -struct wrapperbase __pyx_wrapperbase_6bzrlib_16_known_graph_pyx_10KnownGraph___init__; -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_parent_map = 0; PyObject *__pyx_v_do_cache = 0; int __pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__parent_map,&__pyx_n_s__do_cache,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - values[1] = __pyx_k_4; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent_map); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__do_cache); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_parent_map = values[0]; - __pyx_v_do_cache = values[1]; - } else { - __pyx_v_do_cache = __pyx_k_4; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_do_cache = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: __pyx_v_parent_map = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "bzrlib/_known_graph_pyx.pyx":205 - * """ - * # tests at pre-allocating the node dict actually slowed things down - * self._nodes = {} # <<<<<<<<<<<<<< - * # Maps {sorted(revision_id, revision_id): heads} - * self._known_heads = {} - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":207 - * self._nodes = {} - * # Maps {sorted(revision_id, revision_id): heads} - * self._known_heads = {} # <<<<<<<<<<<<<< - * self.do_cache = int(do_cache) - * # TODO: consider disabling gc since we are allocating a lot of nodes - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":208 - * # Maps {sorted(revision_id, revision_id): heads} - * self._known_heads = {} - * self.do_cache = int(do_cache) # <<<<<<<<<<<<<< - * # TODO: consider disabling gc since we are allocating a lot of nodes - * # that won't be collectable anyway. real world testing has not - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_do_cache); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_do_cache); - __Pyx_GIVEREF(__pyx_v_do_cache); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->do_cache = __pyx_t_3; - - /* "bzrlib/_known_graph_pyx.pyx":212 - * # that won't be collectable anyway. real world testing has not - * # shown a specific impact, yet. - * self._initialize_nodes(parent_map) # <<<<<<<<<<<<<< - * self._find_gdfo() - * - */ - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___initialize_nodes); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_parent_map); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_parent_map); - __Pyx_GIVEREF(__pyx_v_parent_map); - __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":213 - * # shown a specific impact, yet. - * self._initialize_nodes(parent_map) - * self._find_gdfo() # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___find_gdfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + int __pyx_3; + PyObject *__pyx_4 = 0; + static char *__pyx_argnames[] = {"parent_map","do_cache",0}; + __pyx_v_do_cache = __pyx_d1; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_parent_map, &__pyx_v_do_cache)) return -1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_parent_map); + Py_INCREF(__pyx_v_do_cache); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":205 */ + __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;} + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":207 */ + __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads); + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":208 */ + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;} + Py_INCREF(__pyx_v_do_cache); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_do_cache); + __pyx_2 = PyObject_CallObject(((PyObject *)(&PyInt_Type)), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->do_cache = __pyx_3; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":212 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n__initialize_nodes); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} + Py_INCREF(__pyx_v_parent_map); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_parent_map); + __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":213 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n__find_gdfo); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.__init__"); __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_parent_map); + Py_DECREF(__pyx_v_do_cache); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":215 - * self._find_gdfo() - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * cdef _KnownGraphNode child - * cdef Py_ssize_t pos - */ - -static void __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_1__dealloc__(PyObject *__pyx_v_self) { +static void __pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph___dealloc__(PyObject *__pyx_v_self) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_child; Py_ssize_t __pyx_v_pos; PyObject *__pyx_v_temp_node; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannySetupContext("__dealloc__"); - __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":220 - * cdef PyObject *temp_node - * - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): # <<<<<<<<<<<<<< - * child = <_KnownGraphNode>temp_node - * child.clear_references() - */ + int __pyx_1; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":220 */ while (1) { - __pyx_t_1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyDict_Next(__pyx_t_1, (&__pyx_v_pos), NULL, (&__pyx_v_temp_node)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!__pyx_t_2) break; - - /* "bzrlib/_known_graph_pyx.pyx":221 - * - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): - * child = <_KnownGraphNode>temp_node # <<<<<<<<<<<<<< - * child.clear_references() - * - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node))); - __Pyx_DECREF(((PyObject *)__pyx_v_child)); + __pyx_1 = PyDict_Next(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes,(&__pyx_v_pos),NULL,(&__pyx_v_temp_node)); + if (!__pyx_1) break; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":221 */ + Py_INCREF(((PyObject *)__pyx_v_temp_node)); + Py_DECREF(((PyObject *)__pyx_v_child)); __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node); - /* "bzrlib/_known_graph_pyx.pyx":222 - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): - * child = <_KnownGraphNode>temp_node - * child.clear_references() # <<<<<<<<<<<<<< - * - * cdef _KnownGraphNode _get_or_create_node(self, key): - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_child->__pyx_vtab)->clear_references(__pyx_v_child); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":222 */ + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_child->__pyx_vtab)->clear_references(__pyx_v_child); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; } goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.__dealloc__"); __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_child); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_child); + Py_DECREF(__pyx_v_self); } -/* "bzrlib/_known_graph_pyx.pyx":224 - * child.clear_references() - * - * cdef _KnownGraphNode _get_or_create_node(self, key): # <<<<<<<<<<<<<< - * cdef PyObject *temp_node - * cdef _KnownGraphNode node - */ - -static struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__get_or_create_node(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *__pyx_v_self, PyObject *__pyx_v_key) { +static struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__get_or_create_node(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *__pyx_v_self,PyObject *__pyx_v_key) { PyObject *__pyx_v_temp_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; - struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("_get_or_create_node"); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":228 - * cdef _KnownGraphNode node - * - * temp_node = PyDict_GetItem(self._nodes, key) # <<<<<<<<<<<<<< - * if temp_node == NULL: - * node = _KnownGraphNode(key) - */ - __pyx_t_1 = __pyx_v_self->_nodes; - __Pyx_INCREF(__pyx_t_1); - __pyx_v_temp_node = PyDict_GetItem(__pyx_t_1, __pyx_v_key); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":229 - * - * temp_node = PyDict_GetItem(self._nodes, key) - * if temp_node == NULL: # <<<<<<<<<<<<<< - * node = _KnownGraphNode(key) - * PyDict_SetItem(self._nodes, key, node) - */ - __pyx_t_2 = (__pyx_v_temp_node == NULL); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":230 - * temp_node = PyDict_GetItem(self._nodes, key) - * if temp_node == NULL: - * node = _KnownGraphNode(key) # <<<<<<<<<<<<<< - * PyDict_SetItem(self._nodes, key, node) - * else: - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":231 - * if temp_node == NULL: - * node = _KnownGraphNode(key) - * PyDict_SetItem(self._nodes, key, node) # <<<<<<<<<<<<<< - * else: - * node = <_KnownGraphNode>temp_node - */ - __pyx_t_3 = __pyx_v_self->_nodes; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyDict_SetItem(__pyx_t_3, __pyx_v_key, ((PyObject *)__pyx_v_node)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L3; + struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":228 */ + __pyx_v_temp_node = PyDict_GetItem(__pyx_v_self->_nodes,__pyx_v_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":229 */ + __pyx_1 = (__pyx_v_temp_node == NULL); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":230 */ + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + Py_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_key); + __pyx_3 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":231 */ + __pyx_1 = PyDict_SetItem(__pyx_v_self->_nodes,__pyx_v_key,((PyObject *)__pyx_v_node)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} + goto __pyx_L2; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":233 - * PyDict_SetItem(self._nodes, key, node) - * else: - * node = <_KnownGraphNode>temp_node # <<<<<<<<<<<<<< - * return node - * - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node))); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); + Py_INCREF(((PyObject *)__pyx_v_temp_node)); + Py_DECREF(((PyObject *)__pyx_v_node)); __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node); } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_known_graph_pyx.pyx":234 - * else: - * node = <_KnownGraphNode>temp_node - * return node # <<<<<<<<<<<<<< - * - * cdef _populate_parents(self, _KnownGraphNode node, parent_keys): - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_node)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":234 */ + Py_INCREF(((PyObject *)__pyx_v_node)); __pyx_r = __pyx_v_node; goto __pyx_L0; - __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); + __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph._get_or_create_node"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":236 - * return node - * - * cdef _populate_parents(self, _KnownGraphNode node, parent_keys): # <<<<<<<<<<<<<< - * cdef Py_ssize_t num_parent_keys, pos - * cdef _KnownGraphNode parent_node - */ - -static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__populate_parents(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *__pyx_v_self, struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node, PyObject *__pyx_v_parent_keys) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__populate_parents(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *__pyx_v_self,struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node,PyObject *__pyx_v_parent_keys) { Py_ssize_t __pyx_v_num_parent_keys; Py_ssize_t __pyx_v_pos; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_parent_node; PyObject *__pyx_v_parent_nodes; - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("_populate_parents"); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_parent_nodes = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":240 - * cdef _KnownGraphNode parent_node - * - * num_parent_keys = len(parent_keys) # <<<<<<<<<<<<<< - * # We know how many parents, so we pre allocate the tuple - * parent_nodes = PyTuple_New(num_parent_keys) - */ - __pyx_t_1 = PyObject_Length(__pyx_v_parent_keys); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_num_parent_keys = __pyx_t_1; - - /* "bzrlib/_known_graph_pyx.pyx":242 - * num_parent_keys = len(parent_keys) - * # We know how many parents, so we pre allocate the tuple - * parent_nodes = PyTuple_New(num_parent_keys) # <<<<<<<<<<<<<< - * for pos from 0 <= pos < num_parent_keys: - * # Note: it costs us 10ms out of 40ms to lookup all of these - */ - __pyx_t_2 = PyTuple_New(__pyx_v_num_parent_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_parent_nodes); - __pyx_v_parent_nodes = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":243 - * # We know how many parents, so we pre allocate the tuple - * parent_nodes = PyTuple_New(num_parent_keys) - * for pos from 0 <= pos < num_parent_keys: # <<<<<<<<<<<<<< - * # Note: it costs us 10ms out of 40ms to lookup all of these - * # parents, it doesn't seem to be an allocation overhead, - */ - __pyx_t_1 = __pyx_v_num_parent_keys; - for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_1; __pyx_v_pos++) { - - /* "bzrlib/_known_graph_pyx.pyx":251 - * # node. - * # We use [] because parent_keys may be a tuple or list - * parent_node = self._get_or_create_node(parent_keys[pos]) # <<<<<<<<<<<<<< - * # PyTuple_SET_ITEM will steal a reference, so INCREF first - * Py_INCREF(parent_node) - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_parent_keys, __pyx_v_pos, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self->__pyx_vtab)->_get_or_create_node(__pyx_v_self, __pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_parent_node)); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":253 - * parent_node = self._get_or_create_node(parent_keys[pos]) - * # PyTuple_SET_ITEM will steal a reference, so INCREF first - * Py_INCREF(parent_node) # <<<<<<<<<<<<<< - * PyTuple_SET_ITEM(parent_nodes, pos, parent_node) - * PyList_Append(parent_node.children, node) - */ + PyObject *__pyx_r; + Py_ssize_t __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + int __pyx_4; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_node); + Py_INCREF(__pyx_v_parent_keys); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_parent_nodes = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":240 */ + __pyx_1 = PyObject_Length(__pyx_v_parent_keys); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} + __pyx_v_num_parent_keys = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":242 */ + __pyx_2 = PyTuple_New(__pyx_v_num_parent_keys); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; goto __pyx_L1;} + Py_DECREF(__pyx_v_parent_nodes); + __pyx_v_parent_nodes = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":243 */ + for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_v_num_parent_keys; ++__pyx_v_pos) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":251 */ + __pyx_2 = __Pyx_GetItemInt(__pyx_v_parent_keys, __pyx_v_pos); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} + __pyx_3 = ((PyObject *)((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self->__pyx_vtab)->_get_or_create_node(__pyx_v_self,__pyx_2)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(((PyObject *)__pyx_v_parent_node)); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":253 */ Py_INCREF(((PyObject *)__pyx_v_parent_node)); - /* "bzrlib/_known_graph_pyx.pyx":254 - * # PyTuple_SET_ITEM will steal a reference, so INCREF first - * Py_INCREF(parent_node) - * PyTuple_SET_ITEM(parent_nodes, pos, parent_node) # <<<<<<<<<<<<<< - * PyList_Append(parent_node.children, node) - * node.parents = parent_nodes - */ - PyTuple_SET_ITEM(__pyx_v_parent_nodes, __pyx_v_pos, ((PyObject *)__pyx_v_parent_node)); - - /* "bzrlib/_known_graph_pyx.pyx":255 - * Py_INCREF(parent_node) - * PyTuple_SET_ITEM(parent_nodes, pos, parent_node) - * PyList_Append(parent_node.children, node) # <<<<<<<<<<<<<< - * node.parents = parent_nodes - * - */ - __pyx_t_3 = __pyx_v_parent_node->children; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = PyList_Append(__pyx_t_3, ((PyObject *)__pyx_v_node)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - - /* "bzrlib/_known_graph_pyx.pyx":256 - * PyTuple_SET_ITEM(parent_nodes, pos, parent_node) - * PyList_Append(parent_node.children, node) - * node.parents = parent_nodes # <<<<<<<<<<<<<< - * - * def _initialize_nodes(self, parent_map): - */ - __Pyx_INCREF(__pyx_v_parent_nodes); - __Pyx_GIVEREF(__pyx_v_parent_nodes); - __Pyx_GOTREF(__pyx_v_node->parents); - __Pyx_DECREF(__pyx_v_node->parents); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":254 */ + PyTuple_SET_ITEM(__pyx_v_parent_nodes,__pyx_v_pos,((PyObject *)__pyx_v_parent_node)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":255 */ + __pyx_4 = PyList_Append(__pyx_v_parent_node->children,((PyObject *)__pyx_v_node)); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;} + } + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":256 */ + Py_INCREF(__pyx_v_parent_nodes); + Py_DECREF(__pyx_v_node->parents); __pyx_v_node->parents = __pyx_v_parent_nodes; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph._populate_parents"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_parent_node); - __Pyx_DECREF(__pyx_v_parent_nodes); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_parent_node); + Py_DECREF(__pyx_v_parent_nodes); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_parent_keys); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":258 - * node.parents = parent_nodes - * - * def _initialize_nodes(self, parent_map): # <<<<<<<<<<<<<< - * """Populate self._nodes. - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_2_initialize_nodes(PyObject *__pyx_v_self, PyObject *__pyx_v_parent_map); /*proto*/ -static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_2_initialize_nodes[] = "Populate self._nodes.\n\n After this has finished:\n - self._nodes will have an entry for every entry in parent_map.\n - ghosts will have a parent_keys = None,\n - all nodes found will also have child_keys populated with all known\n child keys,\n "; -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_2_initialize_nodes(PyObject *__pyx_v_self, PyObject *__pyx_v_parent_map) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__initialize_nodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph__initialize_nodes[] = "Populate self._nodes.\n\n After this has finished:\n - self._nodes will have an entry for every entry in parent_map.\n - ghosts will have a parent_keys = None,\n - all nodes found will also have child_keys populated with all known\n child keys,\n "; +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__initialize_nodes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_parent_map = 0; PyObject *__pyx_v_temp_key; PyObject *__pyx_v_temp_parent_keys; Py_ssize_t __pyx_v_pos; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; PyObject *__pyx_v_key; PyObject *__pyx_v_parent_keys; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_RefNannySetupContext("_initialize_nodes"); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_parent_keys = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":272 - * cdef _KnownGraphNode parent_node - * - * if not PyDict_CheckExact(parent_map): # <<<<<<<<<<<<<< - * raise TypeError('parent_map should be a dict of {key:parent_keys}') - * # for key, parent_keys in parent_map.iteritems(): - */ - __pyx_t_1 = (!PyDict_CheckExact(__pyx_v_parent_map)); - if (__pyx_t_1) { - - /* "bzrlib/_known_graph_pyx.pyx":273 - * - * if not PyDict_CheckExact(parent_map): - * raise TypeError('parent_map should be a dict of {key:parent_keys}') # <<<<<<<<<<<<<< - * # for key, parent_keys in parent_map.iteritems(): - * pos = 0 - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + static char *__pyx_argnames[] = {"parent_map",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_parent_map)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_parent_map); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_key = Py_None; Py_INCREF(Py_None); + __pyx_v_parent_keys = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":272 */ + __pyx_1 = (!PyDict_CheckExact(__pyx_v_parent_map)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; goto __pyx_L1;} + Py_INCREF(__pyx_k12p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k12p); + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_known_graph_pyx.pyx":275 - * raise TypeError('parent_map should be a dict of {key:parent_keys}') - * # for key, parent_keys in parent_map.iteritems(): - * pos = 0 # <<<<<<<<<<<<<< - * while PyDict_Next(parent_map, &pos, &temp_key, &temp_parent_keys): - * key = temp_key - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":275 */ __pyx_v_pos = 0; - /* "bzrlib/_known_graph_pyx.pyx":276 - * # for key, parent_keys in parent_map.iteritems(): - * pos = 0 - * while PyDict_Next(parent_map, &pos, &temp_key, &temp_parent_keys): # <<<<<<<<<<<<<< - * key = temp_key - * parent_keys = temp_parent_keys - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":276 */ while (1) { - __pyx_t_3 = PyDict_Next(__pyx_v_parent_map, (&__pyx_v_pos), (&__pyx_v_temp_key), (&__pyx_v_temp_parent_keys)); - if (!__pyx_t_3) break; + __pyx_1 = PyDict_Next(__pyx_v_parent_map,(&__pyx_v_pos),(&__pyx_v_temp_key),(&__pyx_v_temp_parent_keys)); + if (!__pyx_1) break; - /* "bzrlib/_known_graph_pyx.pyx":277 - * pos = 0 - * while PyDict_Next(parent_map, &pos, &temp_key, &temp_parent_keys): - * key = temp_key # <<<<<<<<<<<<<< - * parent_keys = temp_parent_keys - * node = self._get_or_create_node(key) - */ - __Pyx_INCREF(((PyObject *)__pyx_v_temp_key)); - __Pyx_DECREF(__pyx_v_key); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":277 */ + Py_INCREF(((PyObject *)__pyx_v_temp_key)); + Py_DECREF(__pyx_v_key); __pyx_v_key = ((PyObject *)__pyx_v_temp_key); - /* "bzrlib/_known_graph_pyx.pyx":278 - * while PyDict_Next(parent_map, &pos, &temp_key, &temp_parent_keys): - * key = temp_key - * parent_keys = temp_parent_keys # <<<<<<<<<<<<<< - * node = self._get_or_create_node(key) - * self._populate_parents(node, parent_keys) - */ - __Pyx_INCREF(((PyObject *)__pyx_v_temp_parent_keys)); - __Pyx_DECREF(__pyx_v_parent_keys); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":278 */ + Py_INCREF(((PyObject *)__pyx_v_temp_parent_keys)); + Py_DECREF(__pyx_v_parent_keys); __pyx_v_parent_keys = ((PyObject *)__pyx_v_temp_parent_keys); - /* "bzrlib/_known_graph_pyx.pyx":279 - * key = temp_key - * parent_keys = temp_parent_keys - * node = self._get_or_create_node(key) # <<<<<<<<<<<<<< - * self._populate_parents(node, parent_keys) - * - */ - __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->__pyx_vtab)->_get_or_create_node(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self), __pyx_v_key)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":280 - * parent_keys = temp_parent_keys - * node = self._get_or_create_node(key) - * self._populate_parents(node, parent_keys) # <<<<<<<<<<<<<< - * - * def _find_tails(self): - */ - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->__pyx_vtab)->_populate_parents(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self), __pyx_v_node, __pyx_v_parent_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":279 */ + __pyx_2 = ((PyObject *)((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->__pyx_vtab)->_get_or_create_node(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self),__pyx_v_key)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_2); + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":280 */ + __pyx_3 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->__pyx_vtab)->_populate_parents(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self),__pyx_v_node,__pyx_v_parent_keys); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + } + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph._initialize_nodes"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF(__pyx_v_key); - __Pyx_DECREF(__pyx_v_parent_keys); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_key); + Py_DECREF(__pyx_v_parent_keys); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_parent_map); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":282 - * self._populate_parents(node, parent_keys) - * - * def _find_tails(self): # <<<<<<<<<<<<<< - * cdef PyObject *temp_node - * cdef _KnownGraphNode node - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_3_find_tails(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_3_find_tails(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__find_tails(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__find_tails(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_temp_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; Py_ssize_t __pyx_v_pos; PyObject *__pyx_v_tails; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("_find_tails"); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_tails = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":287 - * cdef Py_ssize_t pos - * - * tails = [] # <<<<<<<<<<<<<< - * pos = 0 - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_tails)); - __pyx_v_tails = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":288 - * - * tails = [] - * pos = 0 # <<<<<<<<<<<<<< - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node - */ + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_tails = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":287 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;} + Py_DECREF(__pyx_v_tails); + __pyx_v_tails = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":288 */ __pyx_v_pos = 0; - /* "bzrlib/_known_graph_pyx.pyx":289 - * tails = [] - * pos = 0 - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): # <<<<<<<<<<<<<< - * node = <_KnownGraphNode>temp_node - * if node.parents is None or PyTuple_GET_SIZE(node.parents) == 0: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":289 */ while (1) { - __pyx_t_1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyDict_Next(__pyx_t_1, (&__pyx_v_pos), NULL, (&__pyx_v_temp_node)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!__pyx_t_2) break; - - /* "bzrlib/_known_graph_pyx.pyx":290 - * pos = 0 - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node # <<<<<<<<<<<<<< - * if node.parents is None or PyTuple_GET_SIZE(node.parents) == 0: - * node.gdfo = 1 - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node))); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); + __pyx_2 = PyDict_Next(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes,(&__pyx_v_pos),NULL,(&__pyx_v_temp_node)); + if (!__pyx_2) break; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":290 */ + Py_INCREF(((PyObject *)__pyx_v_temp_node)); + Py_DECREF(((PyObject *)__pyx_v_node)); __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node); - /* "bzrlib/_known_graph_pyx.pyx":291 - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node - * if node.parents is None or PyTuple_GET_SIZE(node.parents) == 0: # <<<<<<<<<<<<<< - * node.gdfo = 1 - * PyList_Append(tails, node) - */ - __pyx_t_3 = (__pyx_v_node->parents == Py_None); - if (!__pyx_t_3) { - __pyx_t_1 = __pyx_v_node->parents; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = (PyTuple_GET_SIZE(__pyx_t_1) == 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_3; - } - if (__pyx_t_5) { - - /* "bzrlib/_known_graph_pyx.pyx":292 - * node = <_KnownGraphNode>temp_node - * if node.parents is None or PyTuple_GET_SIZE(node.parents) == 0: - * node.gdfo = 1 # <<<<<<<<<<<<<< - * PyList_Append(tails, node) - * return tails - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":291 */ + __pyx_2 = __pyx_v_node->parents == Py_None; + if (!__pyx_2) { + __pyx_2 = (PyTuple_GET_SIZE(__pyx_v_node->parents) == 0); + } + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":292 */ __pyx_v_node->gdfo = 1; - /* "bzrlib/_known_graph_pyx.pyx":293 - * if node.parents is None or PyTuple_GET_SIZE(node.parents) == 0: - * node.gdfo = 1 - * PyList_Append(tails, node) # <<<<<<<<<<<<<< - * return tails - * - */ - __pyx_t_2 = PyList_Append(((PyObject *)__pyx_v_tails), ((PyObject *)__pyx_v_node)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":293 */ + __pyx_2 = PyList_Append(__pyx_v_tails,((PyObject *)__pyx_v_node)); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L7:; + __pyx_L4:; } - /* "bzrlib/_known_graph_pyx.pyx":294 - * node.gdfo = 1 - * PyList_Append(tails, node) - * return tails # <<<<<<<<<<<<<< - * - * def _find_tips(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_tails)); - __pyx_r = ((PyObject *)__pyx_v_tails); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":294 */ + Py_INCREF(__pyx_v_tails); + __pyx_r = __pyx_v_tails; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph._find_tails"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF(__pyx_v_tails); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_tails); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":296 - * return tails - * - * def _find_tips(self): # <<<<<<<<<<<<<< - * cdef PyObject *temp_node - * cdef _KnownGraphNode node - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_4_find_tips(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_4_find_tips(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__find_tips(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__find_tips(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_temp_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; Py_ssize_t __pyx_v_pos; PyObject *__pyx_v_tips; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("_find_tips"); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_tips = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":301 - * cdef Py_ssize_t pos - * - * tips = [] # <<<<<<<<<<<<<< - * pos = 0 - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_tips)); - __pyx_v_tips = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":302 - * - * tips = [] - * pos = 0 # <<<<<<<<<<<<<< - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node - */ + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_tips = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":301 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;} + Py_DECREF(__pyx_v_tips); + __pyx_v_tips = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":302 */ __pyx_v_pos = 0; - /* "bzrlib/_known_graph_pyx.pyx":303 - * tips = [] - * pos = 0 - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): # <<<<<<<<<<<<<< - * node = <_KnownGraphNode>temp_node - * if PyList_GET_SIZE(node.children) == 0: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":303 */ while (1) { - __pyx_t_1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyDict_Next(__pyx_t_1, (&__pyx_v_pos), NULL, (&__pyx_v_temp_node)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (!__pyx_t_2) break; - - /* "bzrlib/_known_graph_pyx.pyx":304 - * pos = 0 - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node # <<<<<<<<<<<<<< - * if PyList_GET_SIZE(node.children) == 0: - * PyList_Append(tips, node) - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node))); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); + __pyx_2 = PyDict_Next(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes,(&__pyx_v_pos),NULL,(&__pyx_v_temp_node)); + if (!__pyx_2) break; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":304 */ + Py_INCREF(((PyObject *)__pyx_v_temp_node)); + Py_DECREF(((PyObject *)__pyx_v_node)); __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node); - /* "bzrlib/_known_graph_pyx.pyx":305 - * while PyDict_Next(self._nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node - * if PyList_GET_SIZE(node.children) == 0: # <<<<<<<<<<<<<< - * PyList_Append(tips, node) - * return tips - */ - __pyx_t_1 = __pyx_v_node->children; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = (PyList_GET_SIZE(__pyx_t_1) == 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":306 - * node = <_KnownGraphNode>temp_node - * if PyList_GET_SIZE(node.children) == 0: - * PyList_Append(tips, node) # <<<<<<<<<<<<<< - * return tips - * - */ - __pyx_t_2 = PyList_Append(((PyObject *)__pyx_v_tips), ((PyObject *)__pyx_v_node)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":305 */ + __pyx_2 = (PyList_GET_SIZE(__pyx_v_node->children) == 0); + if (__pyx_2) { + __pyx_2 = PyList_Append(__pyx_v_tips,((PyObject *)__pyx_v_node)); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L7:; + __pyx_L4:; } - /* "bzrlib/_known_graph_pyx.pyx":307 - * if PyList_GET_SIZE(node.children) == 0: - * PyList_Append(tips, node) - * return tips # <<<<<<<<<<<<<< - * - * def _find_gdfo(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_tips)); - __pyx_r = ((PyObject *)__pyx_v_tips); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":307 */ + Py_INCREF(__pyx_v_tips); + __pyx_r = __pyx_v_tips; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph._find_tips"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF(__pyx_v_tips); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_tips); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":309 - * return tips - * - * def _find_gdfo(self): # <<<<<<<<<<<<<< - * cdef _KnownGraphNode node - * cdef _KnownGraphNode child - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_5_find_gdfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_5_find_gdfo(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__find_gdfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__find_gdfo(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_child; Py_ssize_t __pyx_v_pos; Py_ssize_t __pyx_v_last_item; long __pyx_v_next_gdfo; PyObject *__pyx_v_pending; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("_find_gdfo"); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_pending = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":318 - * cdef long next_gdfo - * - * pending = self._find_tails() # <<<<<<<<<<<<<< - * - * last_item = PyList_GET_SIZE(pending) - 1 - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___find_tails); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_pending); - __pyx_v_pending = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":320 - * pending = self._find_tails() - * - * last_item = PyList_GET_SIZE(pending) - 1 # <<<<<<<<<<<<<< - * while last_item >= 0: - * # Avoid pop followed by push, instead, peek, and replace - */ + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + int __pyx_3; + Py_ssize_t __pyx_4; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_pending = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":318 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n__find_tails); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_v_pending); + __pyx_v_pending = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":320 */ __pyx_v_last_item = (PyList_GET_SIZE(__pyx_v_pending) - 1); - /* "bzrlib/_known_graph_pyx.pyx":321 - * - * last_item = PyList_GET_SIZE(pending) - 1 - * while last_item >= 0: # <<<<<<<<<<<<<< - * # Avoid pop followed by push, instead, peek, and replace - * # timing shows this is 930ms => 770ms for OOo - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":321 */ while (1) { - __pyx_t_3 = (__pyx_v_last_item >= 0); - if (!__pyx_t_3) break; + __pyx_3 = (__pyx_v_last_item >= 0); + if (!__pyx_3) break; - /* "bzrlib/_known_graph_pyx.pyx":324 - * # Avoid pop followed by push, instead, peek, and replace - * # timing shows this is 930ms => 770ms for OOo - * node = _get_list_node(pending, last_item) # <<<<<<<<<<<<<< - * last_item = last_item - 1 - * next_gdfo = node.gdfo + 1 - */ - __pyx_t_2 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_pending, __pyx_v_last_item)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":325 - * # timing shows this is 930ms => 770ms for OOo - * node = _get_list_node(pending, last_item) - * last_item = last_item - 1 # <<<<<<<<<<<<<< - * next_gdfo = node.gdfo + 1 - * for pos from 0 <= pos < PyList_GET_SIZE(node.children): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":324 */ + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_pending,__pyx_v_last_item)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_1); + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":325 */ __pyx_v_last_item = (__pyx_v_last_item - 1); - /* "bzrlib/_known_graph_pyx.pyx":326 - * node = _get_list_node(pending, last_item) - * last_item = last_item - 1 - * next_gdfo = node.gdfo + 1 # <<<<<<<<<<<<<< - * for pos from 0 <= pos < PyList_GET_SIZE(node.children): - * child = _get_list_node(node.children, pos) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":326 */ __pyx_v_next_gdfo = (__pyx_v_node->gdfo + 1); - /* "bzrlib/_known_graph_pyx.pyx":327 - * last_item = last_item - 1 - * next_gdfo = node.gdfo + 1 - * for pos from 0 <= pos < PyList_GET_SIZE(node.children): # <<<<<<<<<<<<<< - * child = _get_list_node(node.children, pos) - * if next_gdfo > child.gdfo: - */ - __pyx_t_2 = __pyx_v_node->children; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_4 = PyList_GET_SIZE(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_4; __pyx_v_pos++) { - - /* "bzrlib/_known_graph_pyx.pyx":328 - * next_gdfo = node.gdfo + 1 - * for pos from 0 <= pos < PyList_GET_SIZE(node.children): - * child = _get_list_node(node.children, pos) # <<<<<<<<<<<<<< - * if next_gdfo > child.gdfo: - * child.gdfo = next_gdfo - */ - __pyx_t_2 = __pyx_v_node->children; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_t_2, __pyx_v_pos)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_child)); - __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":329 - * for pos from 0 <= pos < PyList_GET_SIZE(node.children): - * child = _get_list_node(node.children, pos) - * if next_gdfo > child.gdfo: # <<<<<<<<<<<<<< - * child.gdfo = next_gdfo - * child.seen = child.seen + 1 - */ - __pyx_t_3 = (__pyx_v_next_gdfo > __pyx_v_child->gdfo); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":330 - * child = _get_list_node(node.children, pos) - * if next_gdfo > child.gdfo: - * child.gdfo = next_gdfo # <<<<<<<<<<<<<< - * child.seen = child.seen + 1 - * if child.seen == PyTuple_GET_SIZE(child.parents): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":327 */ + __pyx_4 = PyList_GET_SIZE(__pyx_v_node->children); + for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_4; ++__pyx_v_pos) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":328 */ + __pyx_2 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_node->children,__pyx_v_pos)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_child)); + __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_2); + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":329 */ + __pyx_3 = (__pyx_v_next_gdfo > __pyx_v_child->gdfo); + if (__pyx_3) { __pyx_v_child->gdfo = __pyx_v_next_gdfo; - goto __pyx_L9; + goto __pyx_L6; } - __pyx_L9:; + __pyx_L6:; - /* "bzrlib/_known_graph_pyx.pyx":331 - * if next_gdfo > child.gdfo: - * child.gdfo = next_gdfo - * child.seen = child.seen + 1 # <<<<<<<<<<<<<< - * if child.seen == PyTuple_GET_SIZE(child.parents): - * # This child is populated, queue it to be walked - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":331 */ __pyx_v_child->seen = (__pyx_v_child->seen + 1); - /* "bzrlib/_known_graph_pyx.pyx":332 - * child.gdfo = next_gdfo - * child.seen = child.seen + 1 - * if child.seen == PyTuple_GET_SIZE(child.parents): # <<<<<<<<<<<<<< - * # This child is populated, queue it to be walked - * last_item = last_item + 1 - */ - __pyx_t_1 = __pyx_v_child->parents; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = (__pyx_v_child->seen == PyTuple_GET_SIZE(__pyx_t_1)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":334 - * if child.seen == PyTuple_GET_SIZE(child.parents): - * # This child is populated, queue it to be walked - * last_item = last_item + 1 # <<<<<<<<<<<<<< - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(child) # SetItem steals a ref - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":332 */ + __pyx_3 = (__pyx_v_child->seen == PyTuple_GET_SIZE(__pyx_v_child->parents)); + if (__pyx_3) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":334 */ __pyx_v_last_item = (__pyx_v_last_item + 1); - /* "bzrlib/_known_graph_pyx.pyx":335 - * # This child is populated, queue it to be walked - * last_item = last_item + 1 - * if last_item < PyList_GET_SIZE(pending): # <<<<<<<<<<<<<< - * Py_INCREF(child) # SetItem steals a ref - * PyList_SetItem(pending, last_item, child) - */ - __pyx_t_3 = (__pyx_v_last_item < PyList_GET_SIZE(__pyx_v_pending)); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":336 - * last_item = last_item + 1 - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(child) # SetItem steals a ref # <<<<<<<<<<<<<< - * PyList_SetItem(pending, last_item, child) - * else: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":335 */ + __pyx_3 = (__pyx_v_last_item < PyList_GET_SIZE(__pyx_v_pending)); + if (__pyx_3) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":336 */ Py_INCREF(((PyObject *)__pyx_v_child)); - /* "bzrlib/_known_graph_pyx.pyx":337 - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(child) # SetItem steals a ref - * PyList_SetItem(pending, last_item, child) # <<<<<<<<<<<<<< - * else: - * PyList_Append(pending, child) - */ - __pyx_t_5 = PyList_SetItem(__pyx_v_pending, __pyx_v_last_item, ((PyObject *)__pyx_v_child)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L11; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":337 */ + __pyx_3 = PyList_SetItem(__pyx_v_pending,__pyx_v_last_item,((PyObject *)__pyx_v_child)); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} + goto __pyx_L8; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":339 - * PyList_SetItem(pending, last_item, child) - * else: - * PyList_Append(pending, child) # <<<<<<<<<<<<<< - * # We have queued this node, we don't need to track it - * # anymore - */ - __pyx_t_5 = PyList_Append(__pyx_v_pending, ((PyObject *)__pyx_v_child)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = PyList_Append(__pyx_v_pending,((PyObject *)__pyx_v_child)); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;} } - __pyx_L11:; + __pyx_L8:; - /* "bzrlib/_known_graph_pyx.pyx":342 - * # We have queued this node, we don't need to track it - * # anymore - * child.seen = 0 # <<<<<<<<<<<<<< - * - * def add_node(self, key, parent_keys): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":342 */ __pyx_v_child->seen = 0; - goto __pyx_L10; + goto __pyx_L7; } - __pyx_L10:; + __pyx_L7:; } } - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph._find_gdfo"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF((PyObject *)__pyx_v_child); - __Pyx_DECREF(__pyx_v_pending); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_child); + Py_DECREF(__pyx_v_pending); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":344 - * child.seen = 0 - * - * def add_node(self, key, parent_keys): # <<<<<<<<<<<<<< - * """Add a new node to the graph. - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_6add_node[] = "Add a new node to the graph.\n\n If this fills in a ghost, then the gdfos of all children will be\n updated accordingly.\n \n :param key: The node being added. If this is a duplicate, this is a\n no-op.\n :param parent_keys: The parents of the given node.\n :return: None (should we return if this was a ghost, etc?)\n "; -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_add_node[] = "Add a new node to the graph.\n\n If this fills in a ghost, then the gdfos of all children will be\n updated accordingly.\n \n :param key: The node being added. If this is a duplicate, this is a\n no-op.\n :param parent_keys: The parents of the given node.\n :return: None (should we return if this was a ghost, etc?)\n "; +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_parent_keys = 0; PyObject *__pyx_v_maybe_node; @@ -3314,623 +1417,287 @@ long __pyx_v_parent_gdfo; long __pyx_v_next_gdfo; PyObject *__pyx_v_existing_parent_keys; - PyObject *__pyx_v_pending; - PyObject *__pyx_v_pending_popleft; - PyObject *__pyx_v_pending_append; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__parent_keys,0}; - __Pyx_RefNannySetupContext("add_node"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__parent_keys); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("add_node", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_node") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_key = values[0]; - __pyx_v_parent_keys = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_parent_keys = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_node", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.add_node"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __Pyx_INCREF(__pyx_v_parent_keys); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_child_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_existing_parent_keys = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_pending = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_pending_popleft = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_pending_append = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":359 - * cdef long parent_gdfo, next_gdfo - * - * maybe_node = PyDict_GetItem(self._nodes, key) # <<<<<<<<<<<<<< - * if maybe_node != NULL: - * node = <_KnownGraphNode>maybe_node - */ - __pyx_t_1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes; - __Pyx_INCREF(__pyx_t_1); - __pyx_v_maybe_node = PyDict_GetItem(__pyx_t_1, __pyx_v_key); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":360 - * - * maybe_node = PyDict_GetItem(self._nodes, key) - * if maybe_node != NULL: # <<<<<<<<<<<<<< - * node = <_KnownGraphNode>maybe_node - * if node.parents is None: - */ - __pyx_t_2 = (__pyx_v_maybe_node != NULL); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":361 - * maybe_node = PyDict_GetItem(self._nodes, key) - * if maybe_node != NULL: - * node = <_KnownGraphNode>maybe_node # <<<<<<<<<<<<<< - * if node.parents is None: - * # We are filling in a ghost - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_maybe_node))); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); + PyObject *__pyx_v_pending; + PyObject *__pyx_v_pending_popleft; + PyObject *__pyx_v_pending_append; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + static char *__pyx_argnames[] = {"key","parent_keys",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_key, &__pyx_v_parent_keys)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + Py_INCREF(__pyx_v_parent_keys); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_child_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_existing_parent_keys = Py_None; Py_INCREF(Py_None); + __pyx_v_pending = Py_None; Py_INCREF(Py_None); + __pyx_v_pending_popleft = Py_None; Py_INCREF(Py_None); + __pyx_v_pending_append = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":359 */ + __pyx_v_maybe_node = PyDict_GetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes,__pyx_v_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":360 */ + __pyx_1 = (__pyx_v_maybe_node != NULL); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":361 */ + Py_INCREF(((PyObject *)__pyx_v_maybe_node)); + Py_DECREF(((PyObject *)__pyx_v_node)); __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_maybe_node); - /* "bzrlib/_known_graph_pyx.pyx":362 - * if maybe_node != NULL: - * node = <_KnownGraphNode>maybe_node - * if node.parents is None: # <<<<<<<<<<<<<< - * # We are filling in a ghost - * self._populate_parents(node, parent_keys) - */ - __pyx_t_2 = (__pyx_v_node->parents == Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":364 - * if node.parents is None: - * # We are filling in a ghost - * self._populate_parents(node, parent_keys) # <<<<<<<<<<<<<< - * # We can't trust cached heads anymore - * self._known_heads.clear() - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->__pyx_vtab)->_populate_parents(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self), __pyx_v_node, __pyx_v_parent_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":366 - * self._populate_parents(node, parent_keys) - * # We can't trust cached heads anymore - * self._known_heads.clear() # <<<<<<<<<<<<<< - * else: # Ensure that the parent_key list matches - * existing_parent_keys = [] - */ - __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads, __pyx_n_s__clear); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L7; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":362 */ + __pyx_1 = __pyx_v_node->parents == Py_None; + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":364 */ + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->__pyx_vtab)->_populate_parents(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self),__pyx_v_node,__pyx_v_parent_keys); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":366 */ + __pyx_2 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads, __pyx_n_clear); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + goto __pyx_L3; } /*else*/ { - /* "bzrlib/_known_graph_pyx.pyx":368 - * self._known_heads.clear() - * else: # Ensure that the parent_key list matches - * existing_parent_keys = [] # <<<<<<<<<<<<<< - * for parent_node in node.parents: - * existing_parent_keys.append(parent_node.key) - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_v_existing_parent_keys)); - __pyx_v_existing_parent_keys = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":369 - * else: # Ensure that the parent_key list matches - * existing_parent_keys = [] - * for parent_node in node.parents: # <<<<<<<<<<<<<< - * existing_parent_keys.append(parent_node.key) - * # Make sure we use a list for the comparison, in case it was a - */ - if (PyList_CheckExact(__pyx_v_node->parents) || PyTuple_CheckExact(__pyx_v_node->parents)) { - __pyx_t_4 = 0; __pyx_t_3 = __pyx_v_node->parents; __Pyx_INCREF(__pyx_t_3); - } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_node->parents); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":368 */ + __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} + Py_DECREF(__pyx_v_existing_parent_keys); + __pyx_v_existing_parent_keys = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":369 */ + __pyx_3 = PyObject_GetIter(__pyx_v_node->parents); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; - } else { - __pyx_t_1 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_1) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_parent_node)); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":370 - * existing_parent_keys = [] - * for parent_node in node.parents: - * existing_parent_keys.append(parent_node.key) # <<<<<<<<<<<<<< - * # Make sure we use a list for the comparison, in case it was a - * # tuple, etc - */ - if (unlikely(__pyx_v_existing_parent_keys == Py_None)) { - PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_2 = PyIter_Next(__pyx_3); + if (!__pyx_2) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; goto __pyx_L1;} + break; } - __pyx_t_1 = __pyx_v_parent_node->key; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = PyList_Append(__pyx_v_existing_parent_keys, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_parent_node)); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_GetAttr(__pyx_v_existing_parent_keys, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; goto __pyx_L1;} + Py_INCREF(__pyx_v_parent_node->key); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_parent_node->key); + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "bzrlib/_known_graph_pyx.pyx":373 - * # Make sure we use a list for the comparison, in case it was a - * # tuple, etc - * parent_keys = list(parent_keys) # <<<<<<<<<<<<<< - * if existing_parent_keys == parent_keys: - * # Exact match, nothing more to do - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_parent_keys); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_parent_keys); - __Pyx_GIVEREF(__pyx_v_parent_keys); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_v_parent_keys); - __pyx_v_parent_keys = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":374 - * # tuple, etc - * parent_keys = list(parent_keys) - * if existing_parent_keys == parent_keys: # <<<<<<<<<<<<<< - * # Exact match, nothing more to do - * return - */ - __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_existing_parent_keys), __pyx_v_parent_keys, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":376 - * if existing_parent_keys == parent_keys: - * # Exact match, nothing more to do - * return # <<<<<<<<<<<<<< - * else: - * raise ValueError('Parent key mismatch, existing node %s' - */ - __Pyx_XDECREF(__pyx_r); - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":373 */ + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L1;} + Py_INCREF(__pyx_v_parent_keys); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_parent_keys); + __pyx_4 = PyObject_CallObject(((PyObject *)(&PyList_Type)), __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_v_parent_keys); + __pyx_v_parent_keys = __pyx_4; + __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":374 */ + if (PyObject_Cmp(__pyx_v_existing_parent_keys, __pyx_v_parent_keys, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; goto __pyx_L1;} + __pyx_1 = __pyx_1 == 0; + if (__pyx_1) { + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - goto __pyx_L10; + goto __pyx_L6; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":380 - * raise ValueError('Parent key mismatch, existing node %s' - * ' has parents of %s not %s' - * % (key, existing_parent_keys, parent_keys)) # <<<<<<<<<<<<<< - * else: - * node = _KnownGraphNode(key) - */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __Pyx_INCREF(((PyObject *)__pyx_v_existing_parent_keys)); - PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_existing_parent_keys)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_existing_parent_keys)); - __Pyx_INCREF(__pyx_v_parent_keys); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_parent_keys); - __Pyx_GIVEREF(__pyx_v_parent_keys); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;} + Py_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_key); + Py_INCREF(__pyx_v_existing_parent_keys); + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_v_existing_parent_keys); + Py_INCREF(__pyx_v_parent_keys); + PyTuple_SET_ITEM(__pyx_5, 2, __pyx_v_parent_keys); + __pyx_3 = PyNumber_Remainder(__pyx_k15p, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;} } - __pyx_L10:; + __pyx_L6:; } - __pyx_L7:; - goto __pyx_L6; + __pyx_L3:; + goto __pyx_L2; } /*else*/ { - /* "bzrlib/_known_graph_pyx.pyx":382 - * % (key, existing_parent_keys, parent_keys)) - * else: - * node = _KnownGraphNode(key) # <<<<<<<<<<<<<< - * PyDict_SetItem(self._nodes, key, node) - * self._populate_parents(node, parent_keys) - */ - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":383 - * else: - * node = _KnownGraphNode(key) - * PyDict_SetItem(self._nodes, key, node) # <<<<<<<<<<<<<< - * self._populate_parents(node, parent_keys) - * parent_gdfo = 0 - */ - __pyx_t_1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = PyDict_SetItem(__pyx_t_1, __pyx_v_key, ((PyObject *)__pyx_v_node)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":384 - * node = _KnownGraphNode(key) - * PyDict_SetItem(self._nodes, key, node) - * self._populate_parents(node, parent_keys) # <<<<<<<<<<<<<< - * parent_gdfo = 0 - * for parent_node in node.parents: - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->__pyx_vtab)->_populate_parents(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self), __pyx_v_node, __pyx_v_parent_keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":382 */ + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} + Py_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_key); + __pyx_3 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode), __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":383 */ + __pyx_1 = PyDict_SetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes,__pyx_v_key,((PyObject *)__pyx_v_node)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":384 */ + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->__pyx_vtab)->_populate_parents(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self),__pyx_v_node,__pyx_v_parent_keys); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; } - __pyx_L6:; + __pyx_L2:; - /* "bzrlib/_known_graph_pyx.pyx":385 - * PyDict_SetItem(self._nodes, key, node) - * self._populate_parents(node, parent_keys) - * parent_gdfo = 0 # <<<<<<<<<<<<<< - * for parent_node in node.parents: - * if parent_node.gdfo == -1: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":385 */ __pyx_v_parent_gdfo = 0; - /* "bzrlib/_known_graph_pyx.pyx":386 - * self._populate_parents(node, parent_keys) - * parent_gdfo = 0 - * for parent_node in node.parents: # <<<<<<<<<<<<<< - * if parent_node.gdfo == -1: - * # This is a newly introduced ghost, so it gets gdfo of 1 - */ - if (PyList_CheckExact(__pyx_v_node->parents) || PyTuple_CheckExact(__pyx_v_node->parents)) { - __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_node->parents; __Pyx_INCREF(__pyx_t_1); - } else { - __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_node->parents); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":386 */ + __pyx_4 = PyObject_GetIter(__pyx_v_node->parents); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; - } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; - } else { - __pyx_t_3 = PyIter_Next(__pyx_t_1); - if (!__pyx_t_3) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_3); + __pyx_5 = PyIter_Next(__pyx_4); + if (!__pyx_5) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; goto __pyx_L1;} + break; } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_parent_node)); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":387 - * parent_gdfo = 0 - * for parent_node in node.parents: - * if parent_node.gdfo == -1: # <<<<<<<<<<<<<< - * # This is a newly introduced ghost, so it gets gdfo of 1 - * parent_node.gdfo = 1 - */ - __pyx_t_2 = (__pyx_v_parent_node->gdfo == -1); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":389 - * if parent_node.gdfo == -1: - * # This is a newly introduced ghost, so it gets gdfo of 1 - * parent_node.gdfo = 1 # <<<<<<<<<<<<<< - * if parent_gdfo < parent_node.gdfo: - * parent_gdfo = parent_node.gdfo - */ + if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_parent_node)); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_5); + __pyx_5 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":387 */ + __pyx_1 = (__pyx_v_parent_node->gdfo == (-1)); + if (__pyx_1) { __pyx_v_parent_node->gdfo = 1; - goto __pyx_L13; + goto __pyx_L9; } - __pyx_L13:; + __pyx_L9:; - /* "bzrlib/_known_graph_pyx.pyx":390 - * # This is a newly introduced ghost, so it gets gdfo of 1 - * parent_node.gdfo = 1 - * if parent_gdfo < parent_node.gdfo: # <<<<<<<<<<<<<< - * parent_gdfo = parent_node.gdfo - * node.gdfo = parent_gdfo + 1 - */ - __pyx_t_2 = (__pyx_v_parent_gdfo < __pyx_v_parent_node->gdfo); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":391 - * parent_node.gdfo = 1 - * if parent_gdfo < parent_node.gdfo: - * parent_gdfo = parent_node.gdfo # <<<<<<<<<<<<<< - * node.gdfo = parent_gdfo + 1 - * # Now fill the gdfo to all children - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":390 */ + __pyx_1 = (__pyx_v_parent_gdfo < __pyx_v_parent_node->gdfo); + if (__pyx_1) { __pyx_v_parent_gdfo = __pyx_v_parent_node->gdfo; - goto __pyx_L14; + goto __pyx_L10; } - __pyx_L14:; + __pyx_L10:; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "bzrlib/_known_graph_pyx.pyx":392 - * if parent_gdfo < parent_node.gdfo: - * parent_gdfo = parent_node.gdfo - * node.gdfo = parent_gdfo + 1 # <<<<<<<<<<<<<< - * # Now fill the gdfo to all children - * # Note that this loop is slightly inefficient, in that we may visit the - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":392 */ __pyx_v_node->gdfo = (__pyx_v_parent_gdfo + 1); - /* "bzrlib/_known_graph_pyx.pyx":401 - * # than DFD. So that if a longer path is possible, we walk it before we - * # get to the final child - * pending = deque([node]) # <<<<<<<<<<<<<< - * pending_popleft = pending.popleft - * pending_append = pending.append - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__deque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(((PyObject *)__pyx_v_node)); - PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_node)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_node)); - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_v_pending); - __pyx_v_pending = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":402 - * # get to the final child - * pending = deque([node]) - * pending_popleft = pending.popleft # <<<<<<<<<<<<<< - * pending_append = pending.append - * while pending: - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_pending, __pyx_n_s__popleft); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_pending_popleft); - __pyx_v_pending_popleft = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":403 - * pending = deque([node]) - * pending_popleft = pending.popleft - * pending_append = pending.append # <<<<<<<<<<<<<< - * while pending: - * node = pending_popleft() - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_pending, __pyx_n_s__append); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_pending_append); - __pyx_v_pending_append = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":404 - * pending_popleft = pending.popleft - * pending_append = pending.append - * while pending: # <<<<<<<<<<<<<< - * node = pending_popleft() - * next_gdfo = node.gdfo + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":401 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_deque); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_v_node)); + PyList_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_node)); + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2); + __pyx_2 = 0; + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_v_pending); + __pyx_v_pending = __pyx_4; + __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":402 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_pending, __pyx_n_popleft); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;} + Py_DECREF(__pyx_v_pending_popleft); + __pyx_v_pending_popleft = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":403 */ + __pyx_3 = PyObject_GetAttr(__pyx_v_pending, __pyx_n_append); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;} + Py_DECREF(__pyx_v_pending_append); + __pyx_v_pending_append = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":404 */ while (1) { - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pending); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!__pyx_t_2) break; + __pyx_1 = PyObject_IsTrue(__pyx_v_pending); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; goto __pyx_L1;} + if (!__pyx_1) break; - /* "bzrlib/_known_graph_pyx.pyx":405 - * pending_append = pending.append - * while pending: - * node = pending_popleft() # <<<<<<<<<<<<<< - * next_gdfo = node.gdfo + 1 - * for child_node in node.children: - */ - __pyx_t_3 = PyObject_Call(__pyx_v_pending_popleft, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":406 - * while pending: - * node = pending_popleft() - * next_gdfo = node.gdfo + 1 # <<<<<<<<<<<<<< - * for child_node in node.children: - * if child_node.gdfo < next_gdfo: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":405 */ + __pyx_5 = PyObject_CallObject(__pyx_v_pending_popleft, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_5); + __pyx_5 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":406 */ __pyx_v_next_gdfo = (__pyx_v_node->gdfo + 1); - /* "bzrlib/_known_graph_pyx.pyx":407 - * node = pending_popleft() - * next_gdfo = node.gdfo + 1 - * for child_node in node.children: # <<<<<<<<<<<<<< - * if child_node.gdfo < next_gdfo: - * # This child is being updated, we need to check its - */ - if (PyList_CheckExact(__pyx_v_node->children) || PyTuple_CheckExact(__pyx_v_node->children)) { - __pyx_t_4 = 0; __pyx_t_3 = __pyx_v_node->children; __Pyx_INCREF(__pyx_t_3); - } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_node->children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":407 */ + __pyx_4 = PyObject_GetIter(__pyx_v_node->children); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; - } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; - } else { - __pyx_t_6 = PyIter_Next(__pyx_t_3); - if (!__pyx_t_6) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_6); + __pyx_2 = PyIter_Next(__pyx_4); + if (!__pyx_2) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; goto __pyx_L1;} + break; } - if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_child_node)); - __pyx_v_child_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_6); - __pyx_t_6 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":408 - * next_gdfo = node.gdfo + 1 - * for child_node in node.children: - * if child_node.gdfo < next_gdfo: # <<<<<<<<<<<<<< - * # This child is being updated, we need to check its - * # children - */ - __pyx_t_2 = (__pyx_v_child_node->gdfo < __pyx_v_next_gdfo); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":411 - * # This child is being updated, we need to check its - * # children - * child_node.gdfo = next_gdfo # <<<<<<<<<<<<<< - * pending_append(child_node) - * - */ + if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_child_node)); + __pyx_v_child_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_2); + __pyx_2 = 0; + __pyx_1 = (__pyx_v_child_node->gdfo < __pyx_v_next_gdfo); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":411 */ __pyx_v_child_node->gdfo = __pyx_v_next_gdfo; - /* "bzrlib/_known_graph_pyx.pyx":412 - * # children - * child_node.gdfo = next_gdfo - * pending_append(child_node) # <<<<<<<<<<<<<< - * - * def heads(self, keys): - */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(((PyObject *)__pyx_v_child_node)); - PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_child_node)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_child_node)); - __pyx_t_1 = PyObject_Call(__pyx_v_pending_append, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L19; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":412 */ + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_v_child_node)); + PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_child_node)); + __pyx_5 = PyObject_CallObject(__pyx_v_pending_append, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + goto __pyx_L15; } - __pyx_L19:; + __pyx_L15:; } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; } - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.add_node"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF((PyObject *)__pyx_v_parent_node); - __Pyx_DECREF((PyObject *)__pyx_v_child_node); - __Pyx_DECREF(__pyx_v_existing_parent_keys); - __Pyx_DECREF(__pyx_v_pending); - __Pyx_DECREF(__pyx_v_pending_popleft); - __Pyx_DECREF(__pyx_v_pending_append); - __Pyx_DECREF(__pyx_v_parent_keys); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_parent_node); + Py_DECREF(__pyx_v_child_node); + Py_DECREF(__pyx_v_existing_parent_keys); + Py_DECREF(__pyx_v_pending); + Py_DECREF(__pyx_v_pending_popleft); + Py_DECREF(__pyx_v_pending_append); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); + Py_DECREF(__pyx_v_parent_keys); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":414 - * pending_append(child_node) - * - * def heads(self, keys): # <<<<<<<<<<<<<< - * """Return the heads from amongst keys. - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_7heads(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/ -static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_7heads[] = "Return the heads from amongst keys.\n\n This is done by searching the ancestries of each key. Any key that is\n reachable from another key is not returned; all the others are.\n\n This operation scales with the relative depth between any two keys. It\n uses gdfo to avoid walking all ancestry.\n\n :param keys: An iterable of keys.\n :return: A set of the heads. Note that as a set there is no ordering\n information. Callers will need to filter their input to create\n order if they need it.\n "; -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_7heads(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_heads(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_heads[] = "Return the heads from amongst keys.\n\n This is done by searching the ancestries of each key. Any key that is\n reachable from another key is not returned; all the others are.\n\n This operation scales with the relative depth between any two keys. It\n uses gdfo to avoid walking all ancestry.\n\n :param keys: An iterable of keys.\n :return: A set of the heads. Note that as a set there is no ordering\n information. Callers will need to filter their input to create\n order if they need it.\n "; +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_heads(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_maybe_node; PyObject *__pyx_v_maybe_heads; PyObject *__pyx_v_temp_node; @@ -3943,1202 +1710,557 @@ PyObject *__pyx_v_key; PyObject *__pyx_v_cleanup; PyObject *__pyx_v_pending; - struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_parent_node; + PyObject *__pyx_v_parent_node; PyObject *__pyx_v_heads; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - __Pyx_RefNannySetupContext("heads"); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_heads_key = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_candidate_nodes = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_key = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_cleanup = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_pending = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_heads = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":435 - * cdef long min_gdfo - * - * heads_key = frozenset(keys) # <<<<<<<<<<<<<< - * maybe_heads = PyDict_GetItem(self._known_heads, heads_key) - * if maybe_heads != NULL: - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_keys); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_keys); - __Pyx_GIVEREF(__pyx_v_keys); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyFrozenSet_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_heads_key)); - __pyx_v_heads_key = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":436 - * - * heads_key = frozenset(keys) - * maybe_heads = PyDict_GetItem(self._known_heads, heads_key) # <<<<<<<<<<<<<< - * if maybe_heads != NULL: - * return maybe_heads - */ - __pyx_t_2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads; - __Pyx_INCREF(__pyx_t_2); - __pyx_v_maybe_heads = PyDict_GetItem(__pyx_t_2, ((PyObject *)__pyx_v_heads_key)); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":437 - * heads_key = frozenset(keys) - * maybe_heads = PyDict_GetItem(self._known_heads, heads_key) - * if maybe_heads != NULL: # <<<<<<<<<<<<<< - * return maybe_heads - * # Not cached, compute it ourselves - */ - __pyx_t_3 = (__pyx_v_maybe_heads != NULL); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":438 - * maybe_heads = PyDict_GetItem(self._known_heads, heads_key) - * if maybe_heads != NULL: - * return maybe_heads # <<<<<<<<<<<<<< - * # Not cached, compute it ourselves - * candidate_nodes = {} - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_maybe_heads)); + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + int __pyx_4; + int __pyx_5; + Py_ssize_t __pyx_6; + static char *__pyx_argnames[] = {"keys",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_keys)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_keys); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_heads_key = Py_None; Py_INCREF(Py_None); + __pyx_v_candidate_nodes = Py_None; Py_INCREF(Py_None); + __pyx_v_key = Py_None; Py_INCREF(Py_None); + __pyx_v_cleanup = Py_None; Py_INCREF(Py_None); + __pyx_v_pending = Py_None; Py_INCREF(Py_None); + __pyx_v_parent_node = Py_None; Py_INCREF(Py_None); + __pyx_v_heads = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":435 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_frozenset); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; goto __pyx_L1;} + Py_INCREF(__pyx_v_keys); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_keys); + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_v_heads_key); + __pyx_v_heads_key = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":436 */ + __pyx_v_maybe_heads = PyDict_GetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads,__pyx_v_heads_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":437 */ + __pyx_4 = (__pyx_v_maybe_heads != NULL); + if (__pyx_4) { + Py_INCREF(((PyObject *)__pyx_v_maybe_heads)); __pyx_r = ((PyObject *)__pyx_v_maybe_heads); goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_known_graph_pyx.pyx":440 - * return maybe_heads - * # Not cached, compute it ourselves - * candidate_nodes = {} # <<<<<<<<<<<<<< - * for key in keys: - * maybe_node = PyDict_GetItem(self._nodes, key) - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_v_candidate_nodes)); - __pyx_v_candidate_nodes = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":441 - * # Not cached, compute it ourselves - * candidate_nodes = {} - * for key in keys: # <<<<<<<<<<<<<< - * maybe_node = PyDict_GetItem(self._nodes, key) - * if maybe_node == NULL: - */ - if (PyList_CheckExact(__pyx_v_keys) || PyTuple_CheckExact(__pyx_v_keys)) { - __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_2); - } else { - __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":440 */ + __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;} + Py_DECREF(__pyx_v_candidate_nodes); + __pyx_v_candidate_nodes = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":441 */ + __pyx_2 = PyObject_GetIter(__pyx_v_keys); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; - } else if (likely(PyTuple_CheckExact(__pyx_t_2))) { - if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; - } else { - __pyx_t_1 = PyIter_Next(__pyx_t_2); - if (!__pyx_t_1) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_1); + __pyx_3 = PyIter_Next(__pyx_2); + if (!__pyx_3) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;} + break; } - __Pyx_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":442 - * candidate_nodes = {} - * for key in keys: - * maybe_node = PyDict_GetItem(self._nodes, key) # <<<<<<<<<<<<<< - * if maybe_node == NULL: - * raise KeyError('key %s not in nodes' % (key,)) - */ - __pyx_t_1 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes; - __Pyx_INCREF(__pyx_t_1); - __pyx_v_maybe_node = PyDict_GetItem(__pyx_t_1, __pyx_v_key); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":443 - * for key in keys: - * maybe_node = PyDict_GetItem(self._nodes, key) - * if maybe_node == NULL: # <<<<<<<<<<<<<< - * raise KeyError('key %s not in nodes' % (key,)) - * PyDict_SetItem(candidate_nodes, key, maybe_node) - */ - __pyx_t_3 = (__pyx_v_maybe_node == NULL); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":444 - * maybe_node = PyDict_GetItem(self._nodes, key) - * if maybe_node == NULL: - * raise KeyError('key %s not in nodes' % (key,)) # <<<<<<<<<<<<<< - * PyDict_SetItem(candidate_nodes, key, maybe_node) - * maybe_node = PyDict_GetItem(candidate_nodes, NULL_REVISION) - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_key); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_5)); - __pyx_t_5 = 0; - __pyx_t_5 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L8; + Py_DECREF(__pyx_v_key); + __pyx_v_key = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":442 */ + __pyx_v_maybe_node = PyDict_GetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes,__pyx_v_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":443 */ + __pyx_4 = (__pyx_v_maybe_node == NULL); + if (__pyx_4) { + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} + Py_INCREF(__pyx_v_key); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_key); + __pyx_3 = PyNumber_Remainder(__pyx_k19p, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_KeyError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;} + goto __pyx_L5; } - __pyx_L8:; + __pyx_L5:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":445 */ + __pyx_4 = PyDict_SetItem(__pyx_v_candidate_nodes,__pyx_v_key,((PyObject *)__pyx_v_maybe_node)); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;} + } + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":446 */ + __pyx_v_maybe_node = PyDict_GetItem(__pyx_v_candidate_nodes,__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - /* "bzrlib/_known_graph_pyx.pyx":445 - * if maybe_node == NULL: - * raise KeyError('key %s not in nodes' % (key,)) - * PyDict_SetItem(candidate_nodes, key, maybe_node) # <<<<<<<<<<<<<< - * maybe_node = PyDict_GetItem(candidate_nodes, NULL_REVISION) - * if maybe_node != NULL: - */ - __pyx_t_6 = PyDict_SetItem(((PyObject *)__pyx_v_candidate_nodes), __pyx_v_key, ((PyObject *)__pyx_v_maybe_node)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":446 - * raise KeyError('key %s not in nodes' % (key,)) - * PyDict_SetItem(candidate_nodes, key, maybe_node) - * maybe_node = PyDict_GetItem(candidate_nodes, NULL_REVISION) # <<<<<<<<<<<<<< - * if maybe_node != NULL: - * # NULL_REVISION is only a head if it is the only entry - */ - __pyx_v_maybe_node = PyDict_GetItem(((PyObject *)__pyx_v_candidate_nodes), __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - - /* "bzrlib/_known_graph_pyx.pyx":447 - * PyDict_SetItem(candidate_nodes, key, maybe_node) - * maybe_node = PyDict_GetItem(candidate_nodes, NULL_REVISION) - * if maybe_node != NULL: # <<<<<<<<<<<<<< - * # NULL_REVISION is only a head if it is the only entry - * candidate_nodes.pop(NULL_REVISION) - */ - __pyx_t_3 = (__pyx_v_maybe_node != NULL); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":449 - * if maybe_node != NULL: - * # NULL_REVISION is only a head if it is the only entry - * candidate_nodes.pop(NULL_REVISION) # <<<<<<<<<<<<<< - * if not candidate_nodes: - * return frozenset([NULL_REVISION]) - */ - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_candidate_nodes), __pyx_n_s__pop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - __Pyx_GIVEREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":450 - * # NULL_REVISION is only a head if it is the only entry - * candidate_nodes.pop(NULL_REVISION) - * if not candidate_nodes: # <<<<<<<<<<<<<< - * return frozenset([NULL_REVISION]) - * # The keys changed, so recalculate heads_key - */ - __pyx_t_3 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_candidate_nodes)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = (!__pyx_t_3); - if (__pyx_t_7) { - - /* "bzrlib/_known_graph_pyx.pyx":451 - * candidate_nodes.pop(NULL_REVISION) - * if not candidate_nodes: - * return frozenset([NULL_REVISION]) # <<<<<<<<<<<<<< - * # The keys changed, so recalculate heads_key - * heads_key = frozenset(candidate_nodes) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - __Pyx_GIVEREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __pyx_t_1 = 0; - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyFrozenSet_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":447 */ + __pyx_4 = (__pyx_v_maybe_node != NULL); + if (__pyx_4) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":449 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_candidate_nodes, __pyx_n_pop); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;} + Py_INCREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":450 */ + __pyx_4 = PyObject_IsTrue(__pyx_v_candidate_nodes); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;} + __pyx_5 = (!__pyx_4); + if (__pyx_5) { + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_frozenset); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} + __pyx_3 = PyList_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} + Py_INCREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); + PyList_SET_ITEM(__pyx_3, 0, __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; - goto __pyx_L10; + goto __pyx_L7; } - __pyx_L10:; + __pyx_L7:; - /* "bzrlib/_known_graph_pyx.pyx":453 - * return frozenset([NULL_REVISION]) - * # The keys changed, so recalculate heads_key - * heads_key = frozenset(candidate_nodes) # <<<<<<<<<<<<<< - * if PyDict_Size(candidate_nodes) < 2: - * return heads_key - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_v_candidate_nodes)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_candidate_nodes)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_candidate_nodes)); - __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyFrozenSet_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_heads_key)); - __pyx_v_heads_key = ((PyObject*)__pyx_t_5); - __pyx_t_5 = 0; - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":453 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_frozenset); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; goto __pyx_L1;} + Py_INCREF(__pyx_v_candidate_nodes); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_candidate_nodes); + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_v_heads_key); + __pyx_v_heads_key = __pyx_3; + __pyx_3 = 0; + goto __pyx_L6; } - __pyx_L9:; + __pyx_L6:; - /* "bzrlib/_known_graph_pyx.pyx":454 - * # The keys changed, so recalculate heads_key - * heads_key = frozenset(candidate_nodes) - * if PyDict_Size(candidate_nodes) < 2: # <<<<<<<<<<<<<< - * return heads_key - * - */ - __pyx_t_4 = PyDict_Size(((PyObject *)__pyx_v_candidate_nodes)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_7 = (__pyx_t_4 < 2); - if (__pyx_t_7) { - - /* "bzrlib/_known_graph_pyx.pyx":455 - * heads_key = frozenset(candidate_nodes) - * if PyDict_Size(candidate_nodes) < 2: - * return heads_key # <<<<<<<<<<<<<< - * - * cleanup = [] - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_heads_key)); - __pyx_r = ((PyObject *)__pyx_v_heads_key); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":454 */ + __pyx_6 = PyDict_Size(__pyx_v_candidate_nodes); if (__pyx_6 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; goto __pyx_L1;} + __pyx_4 = (__pyx_6 < 2); + if (__pyx_4) { + Py_INCREF(__pyx_v_heads_key); + __pyx_r = __pyx_v_heads_key; goto __pyx_L0; - goto __pyx_L11; + goto __pyx_L8; } - __pyx_L11:; + __pyx_L8:; - /* "bzrlib/_known_graph_pyx.pyx":457 - * return heads_key - * - * cleanup = [] # <<<<<<<<<<<<<< - * pending = [] - * # we know a gdfo cannot be longer than a linear chain of all nodes - */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_v_cleanup)); - __pyx_v_cleanup = __pyx_t_5; - __pyx_t_5 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":458 - * - * cleanup = [] - * pending = [] # <<<<<<<<<<<<<< - * # we know a gdfo cannot be longer than a linear chain of all nodes - * min_gdfo = PyDict_Size(self._nodes) + 1 - */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_DECREF(((PyObject *)__pyx_v_pending)); - __pyx_v_pending = __pyx_t_5; - __pyx_t_5 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":460 - * pending = [] - * # we know a gdfo cannot be longer than a linear chain of all nodes - * min_gdfo = PyDict_Size(self._nodes) + 1 # <<<<<<<<<<<<<< - * # Build up nodes that need to be walked, note that starting nodes are - * # not added to seen() - */ - __pyx_t_5 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes; - __Pyx_INCREF(__pyx_t_5); - __pyx_t_4 = PyDict_Size(__pyx_t_5); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_min_gdfo = (__pyx_t_4 + 1); - - /* "bzrlib/_known_graph_pyx.pyx":463 - * # Build up nodes that need to be walked, note that starting nodes are - * # not added to seen() - * pos = 0 # <<<<<<<<<<<<<< - * while PyDict_Next(candidate_nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":457 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; goto __pyx_L1;} + Py_DECREF(__pyx_v_cleanup); + __pyx_v_cleanup = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":458 */ + __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;} + Py_DECREF(__pyx_v_pending); + __pyx_v_pending = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":460 */ + __pyx_6 = PyDict_Size(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); if (__pyx_6 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; goto __pyx_L1;} + __pyx_v_min_gdfo = (__pyx_6 + 1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":463 */ __pyx_v_pos = 0; - /* "bzrlib/_known_graph_pyx.pyx":464 - * # not added to seen() - * pos = 0 - * while PyDict_Next(candidate_nodes, &pos, NULL, &temp_node): # <<<<<<<<<<<<<< - * node = <_KnownGraphNode>temp_node - * if node.parents is not None: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":464 */ while (1) { - __pyx_t_6 = PyDict_Next(((PyObject *)__pyx_v_candidate_nodes), (&__pyx_v_pos), NULL, (&__pyx_v_temp_node)); - if (!__pyx_t_6) break; + __pyx_5 = PyDict_Next(__pyx_v_candidate_nodes,(&__pyx_v_pos),NULL,(&__pyx_v_temp_node)); + if (!__pyx_5) break; - /* "bzrlib/_known_graph_pyx.pyx":465 - * pos = 0 - * while PyDict_Next(candidate_nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node # <<<<<<<<<<<<<< - * if node.parents is not None: - * pending.extend(node.parents) - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node))); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":465 */ + Py_INCREF(((PyObject *)__pyx_v_temp_node)); + Py_DECREF(((PyObject *)__pyx_v_node)); __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node); - /* "bzrlib/_known_graph_pyx.pyx":466 - * while PyDict_Next(candidate_nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node - * if node.parents is not None: # <<<<<<<<<<<<<< - * pending.extend(node.parents) - * if node.gdfo < min_gdfo: - */ - __pyx_t_7 = (__pyx_v_node->parents != Py_None); - if (__pyx_t_7) { - - /* "bzrlib/_known_graph_pyx.pyx":467 - * node = <_KnownGraphNode>temp_node - * if node.parents is not None: - * pending.extend(node.parents) # <<<<<<<<<<<<<< - * if node.gdfo < min_gdfo: - * min_gdfo = node.gdfo - */ - __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_pending), __pyx_n_s__extend); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_node->parents); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_node->parents); - __Pyx_GIVEREF(__pyx_v_node->parents); - __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L14; - } - __pyx_L14:; - - /* "bzrlib/_known_graph_pyx.pyx":468 - * if node.parents is not None: - * pending.extend(node.parents) - * if node.gdfo < min_gdfo: # <<<<<<<<<<<<<< - * min_gdfo = node.gdfo - * - */ - __pyx_t_7 = (__pyx_v_node->gdfo < __pyx_v_min_gdfo); - if (__pyx_t_7) { - - /* "bzrlib/_known_graph_pyx.pyx":469 - * pending.extend(node.parents) - * if node.gdfo < min_gdfo: - * min_gdfo = node.gdfo # <<<<<<<<<<<<<< - * - * # Now do all the real work - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":466 */ + __pyx_4 = __pyx_v_node->parents != Py_None; + if (__pyx_4) { + __pyx_3 = PyObject_GetAttr(__pyx_v_pending, __pyx_n_extend); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; goto __pyx_L1;} + Py_INCREF(__pyx_v_node->parents); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_node->parents); + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L11; + } + __pyx_L11:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":468 */ + __pyx_5 = (__pyx_v_node->gdfo < __pyx_v_min_gdfo); + if (__pyx_5) { __pyx_v_min_gdfo = __pyx_v_node->gdfo; - goto __pyx_L15; + goto __pyx_L12; } - __pyx_L15:; + __pyx_L12:; } - /* "bzrlib/_known_graph_pyx.pyx":472 - * - * # Now do all the real work - * last_item = PyList_GET_SIZE(pending) - 1 # <<<<<<<<<<<<<< - * while last_item >= 0: - * node = _get_list_node(pending, last_item) - */ - __pyx_v_last_item = (PyList_GET_SIZE(((PyObject *)__pyx_v_pending)) - 1); - - /* "bzrlib/_known_graph_pyx.pyx":473 - * # Now do all the real work - * last_item = PyList_GET_SIZE(pending) - 1 - * while last_item >= 0: # <<<<<<<<<<<<<< - * node = _get_list_node(pending, last_item) - * last_item = last_item - 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":472 */ + __pyx_v_last_item = (PyList_GET_SIZE(__pyx_v_pending) - 1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":473 */ while (1) { - __pyx_t_7 = (__pyx_v_last_item >= 0); - if (!__pyx_t_7) break; + __pyx_4 = (__pyx_v_last_item >= 0); + if (!__pyx_4) break; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":474 */ + __pyx_3 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_pending,__pyx_v_last_item)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_3); + __pyx_3 = 0; - /* "bzrlib/_known_graph_pyx.pyx":474 - * last_item = PyList_GET_SIZE(pending) - 1 - * while last_item >= 0: - * node = _get_list_node(pending, last_item) # <<<<<<<<<<<<<< - * last_item = last_item - 1 - * if node.seen: - */ - __pyx_t_2 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(((PyObject *)__pyx_v_pending), __pyx_v_last_item)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":475 - * while last_item >= 0: - * node = _get_list_node(pending, last_item) - * last_item = last_item - 1 # <<<<<<<<<<<<<< - * if node.seen: - * # node already appears in some ancestry - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":475 */ __pyx_v_last_item = (__pyx_v_last_item - 1); - /* "bzrlib/_known_graph_pyx.pyx":476 - * node = _get_list_node(pending, last_item) - * last_item = last_item - 1 - * if node.seen: # <<<<<<<<<<<<<< - * # node already appears in some ancestry - * continue - */ - if (__pyx_v_node->seen) { - - /* "bzrlib/_known_graph_pyx.pyx":478 - * if node.seen: - * # node already appears in some ancestry - * continue # <<<<<<<<<<<<<< - * PyList_Append(cleanup, node) - * node.seen = 1 - */ - goto __pyx_L16_continue; - goto __pyx_L18; - } - __pyx_L18:; - - /* "bzrlib/_known_graph_pyx.pyx":479 - * # node already appears in some ancestry - * continue - * PyList_Append(cleanup, node) # <<<<<<<<<<<<<< - * node.seen = 1 - * if node.gdfo <= min_gdfo: - */ - __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_cleanup), ((PyObject *)__pyx_v_node)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_known_graph_pyx.pyx":480 - * continue - * PyList_Append(cleanup, node) - * node.seen = 1 # <<<<<<<<<<<<<< - * if node.gdfo <= min_gdfo: - * continue - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":476 */ + __pyx_5 = __pyx_v_node->seen; + if (__pyx_5) { + goto __pyx_L13; + goto __pyx_L15; + } + __pyx_L15:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":479 */ + __pyx_4 = PyList_Append(__pyx_v_cleanup,((PyObject *)__pyx_v_node)); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":480 */ __pyx_v_node->seen = 1; - /* "bzrlib/_known_graph_pyx.pyx":481 - * PyList_Append(cleanup, node) - * node.seen = 1 - * if node.gdfo <= min_gdfo: # <<<<<<<<<<<<<< - * continue - * if node.parents is not None and PyTuple_GET_SIZE(node.parents) > 0: - */ - __pyx_t_7 = (__pyx_v_node->gdfo <= __pyx_v_min_gdfo); - if (__pyx_t_7) { - - /* "bzrlib/_known_graph_pyx.pyx":482 - * node.seen = 1 - * if node.gdfo <= min_gdfo: - * continue # <<<<<<<<<<<<<< - * if node.parents is not None and PyTuple_GET_SIZE(node.parents) > 0: - * for pos from 0 <= pos < PyTuple_GET_SIZE(node.parents): - */ - goto __pyx_L16_continue; - goto __pyx_L19; - } - __pyx_L19:; - - /* "bzrlib/_known_graph_pyx.pyx":483 - * if node.gdfo <= min_gdfo: - * continue - * if node.parents is not None and PyTuple_GET_SIZE(node.parents) > 0: # <<<<<<<<<<<<<< - * for pos from 0 <= pos < PyTuple_GET_SIZE(node.parents): - * parent_node = _get_tuple_node(node.parents, pos) - */ - __pyx_t_7 = (__pyx_v_node->parents != Py_None); - if (__pyx_t_7) { - __pyx_t_2 = __pyx_v_node->parents; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = (PyTuple_GET_SIZE(__pyx_t_2) > 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __pyx_t_3; - } else { - __pyx_t_8 = __pyx_t_7; - } - if (__pyx_t_8) { - - /* "bzrlib/_known_graph_pyx.pyx":484 - * continue - * if node.parents is not None and PyTuple_GET_SIZE(node.parents) > 0: - * for pos from 0 <= pos < PyTuple_GET_SIZE(node.parents): # <<<<<<<<<<<<<< - * parent_node = _get_tuple_node(node.parents, pos) - * last_item = last_item + 1 - */ - __pyx_t_2 = __pyx_v_node->parents; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_4 = PyTuple_GET_SIZE(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_4; __pyx_v_pos++) { - - /* "bzrlib/_known_graph_pyx.pyx":485 - * if node.parents is not None and PyTuple_GET_SIZE(node.parents) > 0: - * for pos from 0 <= pos < PyTuple_GET_SIZE(node.parents): - * parent_node = _get_tuple_node(node.parents, pos) # <<<<<<<<<<<<<< - * last_item = last_item + 1 - * if last_item < PyList_GET_SIZE(pending): - */ - __pyx_t_2 = __pyx_v_node->parents; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_t_2, __pyx_v_pos)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_parent_node)); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":486 - * for pos from 0 <= pos < PyTuple_GET_SIZE(node.parents): - * parent_node = _get_tuple_node(node.parents, pos) - * last_item = last_item + 1 # <<<<<<<<<<<<<< - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(parent_node) # SetItem steals a ref - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":481 */ + __pyx_5 = (__pyx_v_node->gdfo <= __pyx_v_min_gdfo); + if (__pyx_5) { + goto __pyx_L13; + goto __pyx_L16; + } + __pyx_L16:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":483 */ + __pyx_4 = __pyx_v_node->parents != Py_None; + if (__pyx_4) { + __pyx_4 = (PyTuple_GET_SIZE(__pyx_v_node->parents) > 0); + } + if (__pyx_4) { + __pyx_6 = PyTuple_GET_SIZE(__pyx_v_node->parents); + for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_6; ++__pyx_v_pos) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":485 */ + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_v_node->parents,__pyx_v_pos)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; goto __pyx_L1;} + Py_DECREF(__pyx_v_parent_node); + __pyx_v_parent_node = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":486 */ __pyx_v_last_item = (__pyx_v_last_item + 1); - /* "bzrlib/_known_graph_pyx.pyx":487 - * parent_node = _get_tuple_node(node.parents, pos) - * last_item = last_item + 1 - * if last_item < PyList_GET_SIZE(pending): # <<<<<<<<<<<<<< - * Py_INCREF(parent_node) # SetItem steals a ref - * PyList_SetItem(pending, last_item, parent_node) - */ - __pyx_t_8 = (__pyx_v_last_item < PyList_GET_SIZE(((PyObject *)__pyx_v_pending))); - if (__pyx_t_8) { - - /* "bzrlib/_known_graph_pyx.pyx":488 - * last_item = last_item + 1 - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(parent_node) # SetItem steals a ref # <<<<<<<<<<<<<< - * PyList_SetItem(pending, last_item, parent_node) - * else: - */ - Py_INCREF(((PyObject *)__pyx_v_parent_node)); - - /* "bzrlib/_known_graph_pyx.pyx":489 - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(parent_node) # SetItem steals a ref - * PyList_SetItem(pending, last_item, parent_node) # <<<<<<<<<<<<<< - * else: - * PyList_Append(pending, parent_node) - */ - __pyx_t_6 = PyList_SetItem(((PyObject *)__pyx_v_pending), __pyx_v_last_item, ((PyObject *)__pyx_v_parent_node)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L23; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":487 */ + __pyx_5 = (__pyx_v_last_item < PyList_GET_SIZE(__pyx_v_pending)); + if (__pyx_5) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":488 */ + Py_INCREF(__pyx_v_parent_node); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":489 */ + __pyx_4 = PyList_SetItem(__pyx_v_pending,__pyx_v_last_item,__pyx_v_parent_node); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;} + goto __pyx_L20; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":491 - * PyList_SetItem(pending, last_item, parent_node) - * else: - * PyList_Append(pending, parent_node) # <<<<<<<<<<<<<< - * heads = [] - * pos = 0 - */ - __pyx_t_6 = PyList_Append(((PyObject *)__pyx_v_pending), ((PyObject *)__pyx_v_parent_node)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_5 = PyList_Append(__pyx_v_pending,__pyx_v_parent_node); if (__pyx_5 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;} } - __pyx_L23:; + __pyx_L20:; } - goto __pyx_L20; + goto __pyx_L17; } - __pyx_L20:; - __pyx_L16_continue:; + __pyx_L17:; + __pyx_L13:; } - /* "bzrlib/_known_graph_pyx.pyx":492 - * else: - * PyList_Append(pending, parent_node) - * heads = [] # <<<<<<<<<<<<<< - * pos = 0 - * while PyDict_Next(candidate_nodes, &pos, NULL, &temp_node): - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(__pyx_v_heads); - __pyx_v_heads = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":493 - * PyList_Append(pending, parent_node) - * heads = [] - * pos = 0 # <<<<<<<<<<<<<< - * while PyDict_Next(candidate_nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":492 */ + __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} + Py_DECREF(__pyx_v_heads); + __pyx_v_heads = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":493 */ __pyx_v_pos = 0; - /* "bzrlib/_known_graph_pyx.pyx":494 - * heads = [] - * pos = 0 - * while PyDict_Next(candidate_nodes, &pos, NULL, &temp_node): # <<<<<<<<<<<<<< - * node = <_KnownGraphNode>temp_node - * if not node.seen: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":494 */ while (1) { - __pyx_t_6 = PyDict_Next(((PyObject *)__pyx_v_candidate_nodes), (&__pyx_v_pos), NULL, (&__pyx_v_temp_node)); - if (!__pyx_t_6) break; + __pyx_4 = PyDict_Next(__pyx_v_candidate_nodes,(&__pyx_v_pos),NULL,(&__pyx_v_temp_node)); + if (!__pyx_4) break; - /* "bzrlib/_known_graph_pyx.pyx":495 - * pos = 0 - * while PyDict_Next(candidate_nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node # <<<<<<<<<<<<<< - * if not node.seen: - * PyList_Append(heads, node.key) - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node))); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":495 */ + Py_INCREF(((PyObject *)__pyx_v_temp_node)); + Py_DECREF(((PyObject *)__pyx_v_node)); __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_v_temp_node); - /* "bzrlib/_known_graph_pyx.pyx":496 - * while PyDict_Next(candidate_nodes, &pos, NULL, &temp_node): - * node = <_KnownGraphNode>temp_node - * if not node.seen: # <<<<<<<<<<<<<< - * PyList_Append(heads, node.key) - * heads = frozenset(heads) - */ - __pyx_t_8 = (!__pyx_v_node->seen); - if (__pyx_t_8) { - - /* "bzrlib/_known_graph_pyx.pyx":497 - * node = <_KnownGraphNode>temp_node - * if not node.seen: - * PyList_Append(heads, node.key) # <<<<<<<<<<<<<< - * heads = frozenset(heads) - * for pos from 0 <= pos < PyList_GET_SIZE(cleanup): - */ - __pyx_t_1 = __pyx_v_node->key; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = PyList_Append(__pyx_v_heads, __pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L26; - } - __pyx_L26:; - } - - /* "bzrlib/_known_graph_pyx.pyx":498 - * if not node.seen: - * PyList_Append(heads, node.key) - * heads = frozenset(heads) # <<<<<<<<<<<<<< - * for pos from 0 <= pos < PyList_GET_SIZE(cleanup): - * node = _get_list_node(cleanup, pos) - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_heads); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_heads); - __Pyx_GIVEREF(__pyx_v_heads); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyFrozenSet_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_heads); - __pyx_v_heads = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":499 - * PyList_Append(heads, node.key) - * heads = frozenset(heads) - * for pos from 0 <= pos < PyList_GET_SIZE(cleanup): # <<<<<<<<<<<<<< - * node = _get_list_node(cleanup, pos) - * node.seen = 0 - */ - __pyx_t_4 = PyList_GET_SIZE(((PyObject *)__pyx_v_cleanup)); - for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_4; __pyx_v_pos++) { - - /* "bzrlib/_known_graph_pyx.pyx":500 - * heads = frozenset(heads) - * for pos from 0 <= pos < PyList_GET_SIZE(cleanup): - * node = _get_list_node(cleanup, pos) # <<<<<<<<<<<<<< - * node.seen = 0 - * if self.do_cache: - */ - __pyx_t_2 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(((PyObject *)__pyx_v_cleanup), __pyx_v_pos)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":501 - * for pos from 0 <= pos < PyList_GET_SIZE(cleanup): - * node = _get_list_node(cleanup, pos) - * node.seen = 0 # <<<<<<<<<<<<<< - * if self.do_cache: - * PyDict_SetItem(self._known_heads, heads_key, heads) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":496 */ + __pyx_5 = (!__pyx_v_node->seen); + if (__pyx_5) { + __pyx_4 = PyList_Append(__pyx_v_heads,__pyx_v_node->key); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;} + goto __pyx_L23; + } + __pyx_L23:; + } + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":498 */ + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_frozenset); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;} + Py_INCREF(__pyx_v_heads); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_heads); + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_v_heads); + __pyx_v_heads = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":499 */ + __pyx_6 = PyList_GET_SIZE(__pyx_v_cleanup); + for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_6; ++__pyx_v_pos) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":500 */ + __pyx_3 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_cleanup,__pyx_v_pos)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":501 */ __pyx_v_node->seen = 0; } - /* "bzrlib/_known_graph_pyx.pyx":502 - * node = _get_list_node(cleanup, pos) - * node.seen = 0 - * if self.do_cache: # <<<<<<<<<<<<<< - * PyDict_SetItem(self._known_heads, heads_key, heads) - * return heads - */ - if (((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->do_cache) { - - /* "bzrlib/_known_graph_pyx.pyx":503 - * node.seen = 0 - * if self.do_cache: - * PyDict_SetItem(self._known_heads, heads_key, heads) # <<<<<<<<<<<<<< - * return heads - * - */ - __pyx_t_2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_6 = PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_v_heads_key), __pyx_v_heads); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L29; - } - __pyx_L29:; - - /* "bzrlib/_known_graph_pyx.pyx":504 - * if self.do_cache: - * PyDict_SetItem(self._known_heads, heads_key, heads) - * return heads # <<<<<<<<<<<<<< - * - * def topo_sort(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_heads); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":502 */ + __pyx_5 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->do_cache; + if (__pyx_5) { + __pyx_4 = PyDict_SetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads,__pyx_v_heads_key,__pyx_v_heads); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; goto __pyx_L1;} + goto __pyx_L26; + } + __pyx_L26:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":504 */ + Py_INCREF(__pyx_v_heads); __pyx_r = __pyx_v_heads; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.heads"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF(__pyx_v_heads_key); - __Pyx_DECREF(__pyx_v_candidate_nodes); - __Pyx_DECREF(__pyx_v_key); - __Pyx_DECREF(__pyx_v_cleanup); - __Pyx_DECREF(__pyx_v_pending); - __Pyx_DECREF((PyObject *)__pyx_v_parent_node); - __Pyx_DECREF(__pyx_v_heads); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_heads_key); + Py_DECREF(__pyx_v_candidate_nodes); + Py_DECREF(__pyx_v_key); + Py_DECREF(__pyx_v_cleanup); + Py_DECREF(__pyx_v_pending); + Py_DECREF(__pyx_v_parent_node); + Py_DECREF(__pyx_v_heads); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_keys); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":506 - * return heads - * - * def topo_sort(self): # <<<<<<<<<<<<<< - * """Return the nodes in topological order. - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_8topo_sort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_8topo_sort[] = "Return the nodes in topological order.\n\n All parents must occur before all children.\n "; -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_8topo_sort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_topo_sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_topo_sort[] = "Return the nodes in topological order.\n\n All parents must occur before all children.\n "; +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_topo_sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_child; Py_ssize_t __pyx_v_pos; Py_ssize_t __pyx_v_last_item; PyObject *__pyx_v_pending; PyObject *__pyx_v_topo_order; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - __Pyx_RefNannySetupContext("topo_sort"); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_pending = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_topo_order = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":523 - * cdef Py_ssize_t last_item - * - * pending = self._find_tails() # <<<<<<<<<<<<<< - * if PyList_GET_SIZE(pending) == 0 and len(self._nodes) > 0: - * raise errors.GraphCycleError(self._nodes) - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___find_tails); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_pending); - __pyx_v_pending = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":524 - * - * pending = self._find_tails() - * if PyList_GET_SIZE(pending) == 0 and len(self._nodes) > 0: # <<<<<<<<<<<<<< - * raise errors.GraphCycleError(self._nodes) - * - */ - __pyx_t_3 = (PyList_GET_SIZE(__pyx_v_pending) == 0); - if (__pyx_t_3) { - __pyx_t_2 = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_4 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = (__pyx_t_4 > 0); - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = __pyx_t_3; - } - if (__pyx_t_6) { - - /* "bzrlib/_known_graph_pyx.pyx":525 - * pending = self._find_tails() - * if PyList_GET_SIZE(pending) == 0 and len(self._nodes) > 0: - * raise errors.GraphCycleError(self._nodes) # <<<<<<<<<<<<<< - * - * topo_order = [] - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__GraphCycleError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - __Pyx_GIVEREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_7, 0, 0); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + int __pyx_3; + Py_ssize_t __pyx_4; + PyObject *__pyx_5 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_pending = Py_None; Py_INCREF(Py_None); + __pyx_v_topo_order = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":523 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n__find_tails); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_v_pending); + __pyx_v_pending = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":524 */ + __pyx_3 = (PyList_GET_SIZE(__pyx_v_pending) == 0); + if (__pyx_3) { + __pyx_4 = PyObject_Length(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;} + __pyx_3 = (__pyx_4 > 0); + } + if (__pyx_3) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_errors); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_GraphCycleError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} + Py_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); + PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_Raise(__pyx_5, 0, 0); + Py_DECREF(__pyx_5); __pyx_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":527 */ + __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; goto __pyx_L1;} + Py_DECREF(__pyx_v_topo_order); + __pyx_v_topo_order = __pyx_2; + __pyx_2 = 0; - /* "bzrlib/_known_graph_pyx.pyx":527 - * raise errors.GraphCycleError(self._nodes) - * - * topo_order = [] # <<<<<<<<<<<<<< - * - * last_item = PyList_GET_SIZE(pending) - 1 - */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __Pyx_DECREF(((PyObject *)__pyx_v_topo_order)); - __pyx_v_topo_order = __pyx_t_7; - __pyx_t_7 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":529 - * topo_order = [] - * - * last_item = PyList_GET_SIZE(pending) - 1 # <<<<<<<<<<<<<< - * while last_item >= 0: - * # Avoid pop followed by push, instead, peek, and replace - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":529 */ __pyx_v_last_item = (PyList_GET_SIZE(__pyx_v_pending) - 1); - /* "bzrlib/_known_graph_pyx.pyx":530 - * - * last_item = PyList_GET_SIZE(pending) - 1 - * while last_item >= 0: # <<<<<<<<<<<<<< - * # Avoid pop followed by push, instead, peek, and replace - * # timing shows this is 930ms => 770ms for OOo - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":530 */ while (1) { - __pyx_t_6 = (__pyx_v_last_item >= 0); - if (!__pyx_t_6) break; + __pyx_3 = (__pyx_v_last_item >= 0); + if (!__pyx_3) break; - /* "bzrlib/_known_graph_pyx.pyx":533 - * # Avoid pop followed by push, instead, peek, and replace - * # timing shows this is 930ms => 770ms for OOo - * node = _get_list_node(pending, last_item) # <<<<<<<<<<<<<< - * last_item = last_item - 1 - * if node.parents is not None: - */ - __pyx_t_7 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_pending, __pyx_v_last_item)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_7); - __pyx_t_7 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":534 - * # timing shows this is 930ms => 770ms for OOo - * node = _get_list_node(pending, last_item) - * last_item = last_item - 1 # <<<<<<<<<<<<<< - * if node.parents is not None: - * # We don't include ghost parents - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":533 */ + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_pending,__pyx_v_last_item)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_1); + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":534 */ __pyx_v_last_item = (__pyx_v_last_item - 1); - /* "bzrlib/_known_graph_pyx.pyx":535 - * node = _get_list_node(pending, last_item) - * last_item = last_item - 1 - * if node.parents is not None: # <<<<<<<<<<<<<< - * # We don't include ghost parents - * PyList_Append(topo_order, node.key) - */ - __pyx_t_6 = (__pyx_v_node->parents != Py_None); - if (__pyx_t_6) { - - /* "bzrlib/_known_graph_pyx.pyx":537 - * if node.parents is not None: - * # We don't include ghost parents - * PyList_Append(topo_order, node.key) # <<<<<<<<<<<<<< - * for pos from 0 <= pos < PyList_GET_SIZE(node.children): - * child = _get_list_node(node.children, pos) - */ - __pyx_t_7 = __pyx_v_node->key; - __Pyx_INCREF(__pyx_t_7); - __pyx_t_8 = PyList_Append(((PyObject *)__pyx_v_topo_order), __pyx_t_7); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":535 */ + __pyx_3 = __pyx_v_node->parents != Py_None; + if (__pyx_3) { + __pyx_3 = PyList_Append(__pyx_v_topo_order,__pyx_v_node->key); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; goto __pyx_L1;} + goto __pyx_L5; } - __pyx_L8:; + __pyx_L5:; - /* "bzrlib/_known_graph_pyx.pyx":538 - * # We don't include ghost parents - * PyList_Append(topo_order, node.key) - * for pos from 0 <= pos < PyList_GET_SIZE(node.children): # <<<<<<<<<<<<<< - * child = _get_list_node(node.children, pos) - * if child.gdfo == -1: - */ - __pyx_t_7 = __pyx_v_node->children; - __Pyx_INCREF(__pyx_t_7); - __pyx_t_4 = PyList_GET_SIZE(__pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_4; __pyx_v_pos++) { - - /* "bzrlib/_known_graph_pyx.pyx":539 - * PyList_Append(topo_order, node.key) - * for pos from 0 <= pos < PyList_GET_SIZE(node.children): - * child = _get_list_node(node.children, pos) # <<<<<<<<<<<<<< - * if child.gdfo == -1: - * # We know we have a graph cycle because a node has a parent - */ - __pyx_t_7 = __pyx_v_node->children; - __Pyx_INCREF(__pyx_t_7); - __pyx_t_2 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_t_7, __pyx_v_pos)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_child)); - __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":540 - * for pos from 0 <= pos < PyList_GET_SIZE(node.children): - * child = _get_list_node(node.children, pos) - * if child.gdfo == -1: # <<<<<<<<<<<<<< - * # We know we have a graph cycle because a node has a parent - * # which we couldn't find - */ - __pyx_t_6 = (__pyx_v_child->gdfo == -1); - if (__pyx_t_6) { - - /* "bzrlib/_known_graph_pyx.pyx":543 - * # We know we have a graph cycle because a node has a parent - * # which we couldn't find - * raise errors.GraphCycleError(self._nodes) # <<<<<<<<<<<<<< - * child.seen = child.seen + 1 - * if child.seen == PyTuple_GET_SIZE(child.parents): - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__GraphCycleError); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - __Pyx_GIVEREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L11; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":538 */ + __pyx_4 = PyList_GET_SIZE(__pyx_v_node->children); + for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_4; ++__pyx_v_pos) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":539 */ + __pyx_5 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_node->children,__pyx_v_pos)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_child)); + __pyx_v_child = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_5); + __pyx_5 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":540 */ + __pyx_3 = (__pyx_v_child->gdfo == (-1)); + if (__pyx_3) { + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_errors); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_GraphCycleError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} + Py_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); + PyTuple_SET_ITEM(__pyx_5, 0, ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} + goto __pyx_L8; } - __pyx_L11:; + __pyx_L8:; - /* "bzrlib/_known_graph_pyx.pyx":544 - * # which we couldn't find - * raise errors.GraphCycleError(self._nodes) - * child.seen = child.seen + 1 # <<<<<<<<<<<<<< - * if child.seen == PyTuple_GET_SIZE(child.parents): - * # All parents of this child have been yielded, queue this - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":544 */ __pyx_v_child->seen = (__pyx_v_child->seen + 1); - /* "bzrlib/_known_graph_pyx.pyx":545 - * raise errors.GraphCycleError(self._nodes) - * child.seen = child.seen + 1 - * if child.seen == PyTuple_GET_SIZE(child.parents): # <<<<<<<<<<<<<< - * # All parents of this child have been yielded, queue this - * # one to be yielded as well - */ - __pyx_t_1 = __pyx_v_child->parents; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = (__pyx_v_child->seen == PyTuple_GET_SIZE(__pyx_t_1)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { - - /* "bzrlib/_known_graph_pyx.pyx":548 - * # All parents of this child have been yielded, queue this - * # one to be yielded as well - * last_item = last_item + 1 # <<<<<<<<<<<<<< - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(child) # SetItem steals a ref - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":545 */ + __pyx_3 = (__pyx_v_child->seen == PyTuple_GET_SIZE(__pyx_v_child->parents)); + if (__pyx_3) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":548 */ __pyx_v_last_item = (__pyx_v_last_item + 1); - /* "bzrlib/_known_graph_pyx.pyx":549 - * # one to be yielded as well - * last_item = last_item + 1 - * if last_item < PyList_GET_SIZE(pending): # <<<<<<<<<<<<<< - * Py_INCREF(child) # SetItem steals a ref - * PyList_SetItem(pending, last_item, child) - */ - __pyx_t_6 = (__pyx_v_last_item < PyList_GET_SIZE(__pyx_v_pending)); - if (__pyx_t_6) { - - /* "bzrlib/_known_graph_pyx.pyx":550 - * last_item = last_item + 1 - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(child) # SetItem steals a ref # <<<<<<<<<<<<<< - * PyList_SetItem(pending, last_item, child) - * else: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":549 */ + __pyx_3 = (__pyx_v_last_item < PyList_GET_SIZE(__pyx_v_pending)); + if (__pyx_3) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":550 */ Py_INCREF(((PyObject *)__pyx_v_child)); - /* "bzrlib/_known_graph_pyx.pyx":551 - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(child) # SetItem steals a ref - * PyList_SetItem(pending, last_item, child) # <<<<<<<<<<<<<< - * else: - * PyList_Append(pending, child) - */ - __pyx_t_8 = PyList_SetItem(__pyx_v_pending, __pyx_v_last_item, ((PyObject *)__pyx_v_child)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L13; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":551 */ + __pyx_3 = PyList_SetItem(__pyx_v_pending,__pyx_v_last_item,((PyObject *)__pyx_v_child)); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; goto __pyx_L1;} + goto __pyx_L10; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":553 - * PyList_SetItem(pending, last_item, child) - * else: - * PyList_Append(pending, child) # <<<<<<<<<<<<<< - * # We have queued this node, we don't need to track it - * # anymore - */ - __pyx_t_8 = PyList_Append(__pyx_v_pending, ((PyObject *)__pyx_v_child)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_3 = PyList_Append(__pyx_v_pending,((PyObject *)__pyx_v_child)); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} } - __pyx_L13:; + __pyx_L10:; - /* "bzrlib/_known_graph_pyx.pyx":556 - * # We have queued this node, we don't need to track it - * # anymore - * child.seen = 0 # <<<<<<<<<<<<<< - * # We started from the parents, so we don't need to do anymore work - * return topo_order - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":556 */ __pyx_v_child->seen = 0; - goto __pyx_L12; + goto __pyx_L9; } - __pyx_L12:; + __pyx_L9:; } } - /* "bzrlib/_known_graph_pyx.pyx":558 - * child.seen = 0 - * # We started from the parents, so we don't need to do anymore work - * return topo_order # <<<<<<<<<<<<<< - * - * def gc_sort(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_topo_order)); - __pyx_r = ((PyObject *)__pyx_v_topo_order); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":558 */ + Py_INCREF(__pyx_v_topo_order); + __pyx_r = __pyx_v_topo_order; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_7); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_5); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.topo_sort"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF((PyObject *)__pyx_v_child); - __Pyx_DECREF(__pyx_v_pending); - __Pyx_DECREF(__pyx_v_topo_order); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_child); + Py_DECREF(__pyx_v_pending); + Py_DECREF(__pyx_v_topo_order); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":560 - * return topo_order - * - * def gc_sort(self): # <<<<<<<<<<<<<< - * """Return a reverse topological ordering which is 'stable'. - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_9gc_sort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_9gc_sort[] = "Return a reverse topological ordering which is 'stable'.\n\n There are a few constraints:\n 1) Reverse topological (all children before all parents)\n 2) Grouped by prefix\n 3) 'stable' sorting, so that we get the same result, independent of\n machine, or extra data.\n To do this, we use the same basic algorithm as topo_sort, but when we\n aren't sure what node to access next, we sort them lexicographically.\n "; -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_9gc_sort(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_gc_sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_gc_sort[] = "Return a reverse topological ordering which is \'stable\'.\n\n There are a few constraints:\n 1) Reverse topological (all children before all parents)\n 2) Grouped by prefix\n 3) \'stable\' sorting, so that we get the same result, independent of\n machine, or extra data.\n To do this, we use the same basic algorithm as topo_sort, but when we\n aren\'t sure what node to access next, we sort them lexicographically.\n "; +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_gc_sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_temp; Py_ssize_t __pyx_v_pos; Py_ssize_t __pyx_v_last_item; @@ -5151,3401 +2273,1425 @@ PyObject *__pyx_v_result; PyObject *__pyx_v_pending; PyObject *__pyx_v_parents; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("gc_sort"); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_tips = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_prefix_tips = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_prefix = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_tip_nodes = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_pending = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_parents = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":575 - * cdef _KnownGraphNode node, node2, parent_node - * - * tips = self._find_tips() # <<<<<<<<<<<<<< - * # Split the tips based on prefix - * prefix_tips = {} - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___find_tips); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_tips); - __pyx_v_tips = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":577 - * tips = self._find_tips() - * # Split the tips based on prefix - * prefix_tips = {} # <<<<<<<<<<<<<< - * for pos from 0 <= pos < PyList_GET_SIZE(tips): - * node = _get_list_node(tips, pos) - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_v_prefix_tips)); - __pyx_v_prefix_tips = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":578 - * # Split the tips based on prefix - * prefix_tips = {} - * for pos from 0 <= pos < PyList_GET_SIZE(tips): # <<<<<<<<<<<<<< - * node = _get_list_node(tips, pos) - * if PyString_CheckExact(node.key) or len(node.key) == 1: - */ - __pyx_t_3 = PyList_GET_SIZE(__pyx_v_tips); - for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_3; __pyx_v_pos++) { - - /* "bzrlib/_known_graph_pyx.pyx":579 - * prefix_tips = {} - * for pos from 0 <= pos < PyList_GET_SIZE(tips): - * node = _get_list_node(tips, pos) # <<<<<<<<<<<<<< - * if PyString_CheckExact(node.key) or len(node.key) == 1: - * prefix = '' - */ - __pyx_t_2 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_tips, __pyx_v_pos)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":580 - * for pos from 0 <= pos < PyList_GET_SIZE(tips): - * node = _get_list_node(tips, pos) - * if PyString_CheckExact(node.key) or len(node.key) == 1: # <<<<<<<<<<<<<< - * prefix = '' - * else: - */ - __pyx_t_2 = __pyx_v_node->key; - __Pyx_INCREF(__pyx_t_2); - if (!PyString_CheckExact(__pyx_t_2)) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __pyx_v_node->key; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = (__pyx_t_4 == 1); - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = PyString_CheckExact(__pyx_t_2); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - if (__pyx_t_6) { - - /* "bzrlib/_known_graph_pyx.pyx":581 - * node = _get_list_node(tips, pos) - * if PyString_CheckExact(node.key) or len(node.key) == 1: - * prefix = '' # <<<<<<<<<<<<<< - * else: - * prefix = node.key[0] - */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_9)); - __Pyx_DECREF(__pyx_v_prefix); - __pyx_v_prefix = ((PyObject *)__pyx_kp_s_9); - goto __pyx_L7; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + Py_ssize_t __pyx_3; + int __pyx_4; + Py_ssize_t __pyx_5; + PyObject *__pyx_6 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_tips = Py_None; Py_INCREF(Py_None); + __pyx_v_prefix_tips = Py_None; Py_INCREF(Py_None); + __pyx_v_prefix = Py_None; Py_INCREF(Py_None); + __pyx_v_tip_nodes = Py_None; Py_INCREF(Py_None); + __pyx_v_result = Py_None; Py_INCREF(Py_None); + __pyx_v_pending = Py_None; Py_INCREF(Py_None); + __pyx_v_parents = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":575 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n__find_tips); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_v_tips); + __pyx_v_tips = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":577 */ + __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;} + Py_DECREF(__pyx_v_prefix_tips); + __pyx_v_prefix_tips = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":578 */ + __pyx_3 = PyList_GET_SIZE(__pyx_v_tips); + for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_3; ++__pyx_v_pos) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":579 */ + __pyx_2 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_tips,__pyx_v_pos)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_2); + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":580 */ + __pyx_4 = PyString_CheckExact(__pyx_v_node->key); + if (!__pyx_4) { + __pyx_5 = PyObject_Length(__pyx_v_node->key); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; goto __pyx_L1;} + __pyx_4 = (__pyx_5 == 1); + } + if (__pyx_4) { + Py_INCREF(__pyx_k25p); + Py_DECREF(__pyx_v_prefix); + __pyx_v_prefix = __pyx_k25p; + goto __pyx_L4; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":583 - * prefix = '' - * else: - * prefix = node.key[0] # <<<<<<<<<<<<<< - * temp = PyDict_GetItem(prefix_tips, prefix) - * if temp == NULL: - */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_node->key, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_prefix); - __pyx_v_prefix = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_1 = __Pyx_GetItemInt(__pyx_v_node->key, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L1;} + Py_DECREF(__pyx_v_prefix); + __pyx_v_prefix = __pyx_1; + __pyx_1 = 0; } - __pyx_L7:; + __pyx_L4:; - /* "bzrlib/_known_graph_pyx.pyx":584 - * else: - * prefix = node.key[0] - * temp = PyDict_GetItem(prefix_tips, prefix) # <<<<<<<<<<<<<< - * if temp == NULL: - * prefix_tips[prefix] = [node] - */ - __pyx_v_temp = PyDict_GetItem(((PyObject *)__pyx_v_prefix_tips), __pyx_v_prefix); - - /* "bzrlib/_known_graph_pyx.pyx":585 - * prefix = node.key[0] - * temp = PyDict_GetItem(prefix_tips, prefix) - * if temp == NULL: # <<<<<<<<<<<<<< - * prefix_tips[prefix] = [node] - * else: - */ - __pyx_t_6 = (__pyx_v_temp == NULL); - if (__pyx_t_6) { - - /* "bzrlib/_known_graph_pyx.pyx":586 - * temp = PyDict_GetItem(prefix_tips, prefix) - * if temp == NULL: - * prefix_tips[prefix] = [node] # <<<<<<<<<<<<<< - * else: - * tip_nodes = temp - */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)__pyx_v_node)); - PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_node)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_node)); - if (PyDict_SetItem(((PyObject *)__pyx_v_prefix_tips), __pyx_v_prefix, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":584 */ + __pyx_v_temp = PyDict_GetItem(__pyx_v_prefix_tips,__pyx_v_prefix); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":585 */ + __pyx_4 = (__pyx_v_temp == NULL); + if (__pyx_4) { + __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_v_node)); + PyList_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_node)); + if (PyObject_SetItem(__pyx_v_prefix_tips, __pyx_v_prefix, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L5; } /*else*/ { - /* "bzrlib/_known_graph_pyx.pyx":588 - * prefix_tips[prefix] = [node] - * else: - * tip_nodes = temp # <<<<<<<<<<<<<< - * PyList_Append(tip_nodes, node) - * - */ - __Pyx_INCREF(((PyObject *)__pyx_v_temp)); - __Pyx_DECREF(__pyx_v_tip_nodes); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":588 */ + Py_INCREF(((PyObject *)__pyx_v_temp)); + Py_DECREF(__pyx_v_tip_nodes); __pyx_v_tip_nodes = ((PyObject *)__pyx_v_temp); - /* "bzrlib/_known_graph_pyx.pyx":589 - * else: - * tip_nodes = temp - * PyList_Append(tip_nodes, node) # <<<<<<<<<<<<<< - * - * result = [] - */ - __pyx_t_7 = PyList_Append(__pyx_v_tip_nodes, ((PyObject *)__pyx_v_node)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":589 */ + __pyx_4 = PyList_Append(__pyx_v_tip_nodes,((PyObject *)__pyx_v_node)); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; goto __pyx_L1;} } - __pyx_L8:; + __pyx_L5:; } - /* "bzrlib/_known_graph_pyx.pyx":591 - * PyList_Append(tip_nodes, node) - * - * result = [] # <<<<<<<<<<<<<< - * for prefix in sorted(prefix_tips): - * temp = PyDict_GetItem(prefix_tips, prefix) - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_DECREF(((PyObject *)__pyx_v_result)); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":592 - * - * result = [] - * for prefix in sorted(prefix_tips): # <<<<<<<<<<<<<< - * temp = PyDict_GetItem(prefix_tips, prefix) - * assert temp != NULL - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)__pyx_v_prefix_tips)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_prefix_tips)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_prefix_tips)); - __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":591 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;} + Py_DECREF(__pyx_v_result); + __pyx_v_result = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":592 */ + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_sorted); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} + Py_INCREF(__pyx_v_prefix_tips); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_prefix_tips); + __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_2 = PyObject_GetIter(__pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; for (;;) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; - } else if (likely(PyTuple_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; - } else { - __pyx_t_1 = PyIter_Next(__pyx_t_2); - if (!__pyx_t_1) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - break; - } - __Pyx_GOTREF(__pyx_t_1); + __pyx_1 = PyIter_Next(__pyx_2); + if (!__pyx_1) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} + break; } - __Pyx_DECREF(__pyx_v_prefix); - __pyx_v_prefix = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":593 - * result = [] - * for prefix in sorted(prefix_tips): - * temp = PyDict_GetItem(prefix_tips, prefix) # <<<<<<<<<<<<<< - * assert temp != NULL - * tip_nodes = temp - */ - __pyx_v_temp = PyDict_GetItem(((PyObject *)__pyx_v_prefix_tips), __pyx_v_prefix); - - /* "bzrlib/_known_graph_pyx.pyx":594 - * for prefix in sorted(prefix_tips): - * temp = PyDict_GetItem(prefix_tips, prefix) - * assert temp != NULL # <<<<<<<<<<<<<< - * tip_nodes = temp - * pending = _sort_list_nodes(tip_nodes, 1) - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!(__pyx_v_temp != NULL))) { + Py_DECREF(__pyx_v_prefix); + __pyx_v_prefix = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":593 */ + __pyx_v_temp = PyDict_GetItem(__pyx_v_prefix_tips,__pyx_v_prefix); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":594 */ + #ifndef PYREX_WITHOUT_ASSERTIONS + if (!(__pyx_v_temp != NULL)) { PyErr_SetNone(PyExc_AssertionError); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} } #endif - /* "bzrlib/_known_graph_pyx.pyx":595 - * temp = PyDict_GetItem(prefix_tips, prefix) - * assert temp != NULL - * tip_nodes = temp # <<<<<<<<<<<<<< - * pending = _sort_list_nodes(tip_nodes, 1) - * last_item = PyList_GET_SIZE(pending) - 1 - */ - __Pyx_INCREF(((PyObject *)__pyx_v_temp)); - __Pyx_DECREF(__pyx_v_tip_nodes); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":595 */ + Py_INCREF(((PyObject *)__pyx_v_temp)); + Py_DECREF(__pyx_v_tip_nodes); __pyx_v_tip_nodes = ((PyObject *)__pyx_v_temp); - /* "bzrlib/_known_graph_pyx.pyx":596 - * assert temp != NULL - * tip_nodes = temp - * pending = _sort_list_nodes(tip_nodes, 1) # <<<<<<<<<<<<<< - * last_item = PyList_GET_SIZE(pending) - 1 - * while last_item >= 0: - */ - __pyx_t_1 = __pyx_f_6bzrlib_16_known_graph_pyx__sort_list_nodes(__pyx_v_tip_nodes, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_pending); - __pyx_v_pending = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":597 - * tip_nodes = temp - * pending = _sort_list_nodes(tip_nodes, 1) - * last_item = PyList_GET_SIZE(pending) - 1 # <<<<<<<<<<<<<< - * while last_item >= 0: - * node = _get_list_node(pending, last_item) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":596 */ + __pyx_6 = __pyx_f_6bzrlib_16_known_graph_pyx__sort_list_nodes(__pyx_v_tip_nodes,1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;} + Py_DECREF(__pyx_v_pending); + __pyx_v_pending = __pyx_6; + __pyx_6 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":597 */ __pyx_v_last_item = (PyList_GET_SIZE(__pyx_v_pending) - 1); - /* "bzrlib/_known_graph_pyx.pyx":598 - * pending = _sort_list_nodes(tip_nodes, 1) - * last_item = PyList_GET_SIZE(pending) - 1 - * while last_item >= 0: # <<<<<<<<<<<<<< - * node = _get_list_node(pending, last_item) - * last_item = last_item - 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":598 */ while (1) { - __pyx_t_6 = (__pyx_v_last_item >= 0); - if (!__pyx_t_6) break; + __pyx_4 = (__pyx_v_last_item >= 0); + if (!__pyx_4) break; - /* "bzrlib/_known_graph_pyx.pyx":599 - * last_item = PyList_GET_SIZE(pending) - 1 - * while last_item >= 0: - * node = _get_list_node(pending, last_item) # <<<<<<<<<<<<<< - * last_item = last_item - 1 - * if node.parents is None: - */ - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_pending, __pyx_v_last_item)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":600 - * while last_item >= 0: - * node = _get_list_node(pending, last_item) - * last_item = last_item - 1 # <<<<<<<<<<<<<< - * if node.parents is None: - * # Ghost - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":599 */ + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_pending,__pyx_v_last_item)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_1); + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":600 */ __pyx_v_last_item = (__pyx_v_last_item - 1); - /* "bzrlib/_known_graph_pyx.pyx":601 - * node = _get_list_node(pending, last_item) - * last_item = last_item - 1 - * if node.parents is None: # <<<<<<<<<<<<<< - * # Ghost - * continue - */ - __pyx_t_6 = (__pyx_v_node->parents == Py_None); - if (__pyx_t_6) { - - /* "bzrlib/_known_graph_pyx.pyx":603 - * if node.parents is None: - * # Ghost - * continue # <<<<<<<<<<<<<< - * PyList_Append(result, node.key) - * # Sorting the parent keys isn't strictly necessary for stable - */ - goto __pyx_L11_continue; - goto __pyx_L13; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":601 */ + __pyx_4 = __pyx_v_node->parents == Py_None; + if (__pyx_4) { + goto __pyx_L8; + goto __pyx_L10; } - __pyx_L13:; + __pyx_L10:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":604 */ + __pyx_4 = PyList_Append(__pyx_v_result,__pyx_v_node->key); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; goto __pyx_L1;} - /* "bzrlib/_known_graph_pyx.pyx":604 - * # Ghost - * continue - * PyList_Append(result, node.key) # <<<<<<<<<<<<<< - * # Sorting the parent keys isn't strictly necessary for stable - * # sorting of a given graph. But it does help minimize the - */ - __pyx_t_1 = __pyx_v_node->key; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_result), __pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":611 - * # 4.73ms no sort - * # 7.73ms RichCompareBool sort - * parents = _sort_list_nodes(node.parents, 1) # <<<<<<<<<<<<<< - * for pos from 0 <= pos < len(parents): - * if PyTuple_CheckExact(parents): - */ - __pyx_t_1 = __pyx_v_node->parents; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_8 = __pyx_f_6bzrlib_16_known_graph_pyx__sort_list_nodes(__pyx_t_1, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_v_parents); - __pyx_v_parents = __pyx_t_8; - __pyx_t_8 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":612 - * # 7.73ms RichCompareBool sort - * parents = _sort_list_nodes(node.parents, 1) - * for pos from 0 <= pos < len(parents): # <<<<<<<<<<<<<< - * if PyTuple_CheckExact(parents): - * parent_node = _get_tuple_node(parents, pos) - */ - __pyx_t_4 = PyObject_Length(__pyx_v_parents); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_t_4; __pyx_v_pos++) { - - /* "bzrlib/_known_graph_pyx.pyx":613 - * parents = _sort_list_nodes(node.parents, 1) - * for pos from 0 <= pos < len(parents): - * if PyTuple_CheckExact(parents): # <<<<<<<<<<<<<< - * parent_node = _get_tuple_node(parents, pos) - * else: - */ - __pyx_t_7 = PyTuple_CheckExact(__pyx_v_parents); - if (__pyx_t_7) { - - /* "bzrlib/_known_graph_pyx.pyx":614 - * for pos from 0 <= pos < len(parents): - * if PyTuple_CheckExact(parents): - * parent_node = _get_tuple_node(parents, pos) # <<<<<<<<<<<<<< - * else: - * parent_node = _get_list_node(parents, pos) - */ - __pyx_t_8 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_v_parents, __pyx_v_pos)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(((PyObject *)__pyx_v_parent_node)); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_8); - __pyx_t_8 = 0; - goto __pyx_L16; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":611 */ + __pyx_6 = __pyx_f_6bzrlib_16_known_graph_pyx__sort_list_nodes(__pyx_v_node->parents,1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; goto __pyx_L1;} + Py_DECREF(__pyx_v_parents); + __pyx_v_parents = __pyx_6; + __pyx_6 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":612 */ + __pyx_5 = PyObject_Length(__pyx_v_parents); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; goto __pyx_L1;} + for (__pyx_v_pos = 0; __pyx_v_pos < __pyx_5; ++__pyx_v_pos) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":613 */ + __pyx_4 = PyTuple_CheckExact(__pyx_v_parents); + if (__pyx_4) { + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_v_parents,__pyx_v_pos)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_parent_node)); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_1); + __pyx_1 = 0; + goto __pyx_L13; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":616 - * parent_node = _get_tuple_node(parents, pos) - * else: - * parent_node = _get_list_node(parents, pos) # <<<<<<<<<<<<<< - * # TODO: GraphCycle detection - * parent_node.seen = parent_node.seen + 1 - */ - __pyx_t_8 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_parents, __pyx_v_pos)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(((PyObject *)__pyx_v_parent_node)); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_8); - __pyx_t_8 = 0; + __pyx_6 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_parents,__pyx_v_pos)); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_parent_node)); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_6); + __pyx_6 = 0; } - __pyx_L16:; + __pyx_L13:; - /* "bzrlib/_known_graph_pyx.pyx":618 - * parent_node = _get_list_node(parents, pos) - * # TODO: GraphCycle detection - * parent_node.seen = parent_node.seen + 1 # <<<<<<<<<<<<<< - * if (parent_node.seen - * == PyList_GET_SIZE(parent_node.children)): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":618 */ __pyx_v_parent_node->seen = (__pyx_v_parent_node->seen + 1); - /* "bzrlib/_known_graph_pyx.pyx":620 - * parent_node.seen = parent_node.seen + 1 - * if (parent_node.seen - * == PyList_GET_SIZE(parent_node.children)): # <<<<<<<<<<<<<< - * # All children have been processed, queue up this - * # parent - */ - __pyx_t_8 = __pyx_v_parent_node->children; - __Pyx_INCREF(__pyx_t_8); - __pyx_t_6 = (__pyx_v_parent_node->seen == PyList_GET_SIZE(__pyx_t_8)); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_6) { - - /* "bzrlib/_known_graph_pyx.pyx":623 - * # All children have been processed, queue up this - * # parent - * last_item = last_item + 1 # <<<<<<<<<<<<<< - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(parent_node) # SetItem steals a ref - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":619 */ + __pyx_4 = (__pyx_v_parent_node->seen == PyList_GET_SIZE(__pyx_v_parent_node->children)); + if (__pyx_4) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":623 */ __pyx_v_last_item = (__pyx_v_last_item + 1); - /* "bzrlib/_known_graph_pyx.pyx":624 - * # parent - * last_item = last_item + 1 - * if last_item < PyList_GET_SIZE(pending): # <<<<<<<<<<<<<< - * Py_INCREF(parent_node) # SetItem steals a ref - * PyList_SetItem(pending, last_item, parent_node) - */ - __pyx_t_6 = (__pyx_v_last_item < PyList_GET_SIZE(__pyx_v_pending)); - if (__pyx_t_6) { - - /* "bzrlib/_known_graph_pyx.pyx":625 - * last_item = last_item + 1 - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(parent_node) # SetItem steals a ref # <<<<<<<<<<<<<< - * PyList_SetItem(pending, last_item, parent_node) - * else: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":624 */ + __pyx_4 = (__pyx_v_last_item < PyList_GET_SIZE(__pyx_v_pending)); + if (__pyx_4) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":625 */ Py_INCREF(((PyObject *)__pyx_v_parent_node)); - /* "bzrlib/_known_graph_pyx.pyx":626 - * if last_item < PyList_GET_SIZE(pending): - * Py_INCREF(parent_node) # SetItem steals a ref - * PyList_SetItem(pending, last_item, parent_node) # <<<<<<<<<<<<<< - * else: - * PyList_Append(pending, parent_node) - */ - __pyx_t_7 = PyList_SetItem(__pyx_v_pending, __pyx_v_last_item, ((PyObject *)__pyx_v_parent_node)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L18; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":626 */ + __pyx_4 = PyList_SetItem(__pyx_v_pending,__pyx_v_last_item,((PyObject *)__pyx_v_parent_node)); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; goto __pyx_L1;} + goto __pyx_L15; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":628 - * PyList_SetItem(pending, last_item, parent_node) - * else: - * PyList_Append(pending, parent_node) # <<<<<<<<<<<<<< - * parent_node.seen = 0 - * return result - */ - __pyx_t_7 = PyList_Append(__pyx_v_pending, ((PyObject *)__pyx_v_parent_node)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_4 = PyList_Append(__pyx_v_pending,((PyObject *)__pyx_v_parent_node)); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;} } - __pyx_L18:; + __pyx_L15:; - /* "bzrlib/_known_graph_pyx.pyx":629 - * else: - * PyList_Append(pending, parent_node) - * parent_node.seen = 0 # <<<<<<<<<<<<<< - * return result - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":629 */ __pyx_v_parent_node->seen = 0; - goto __pyx_L17; + goto __pyx_L14; } - __pyx_L17:; + __pyx_L14:; } - __pyx_L11_continue:; + __pyx_L8:; } } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "bzrlib/_known_graph_pyx.pyx":630 - * PyList_Append(pending, parent_node) - * parent_node.seen = 0 - * return result # <<<<<<<<<<<<<< - * - * def merge_sort(self, tip_key): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":630 */ + Py_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_8); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_6); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.gc_sort"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF((PyObject *)__pyx_v_parent_node); - __Pyx_DECREF(__pyx_v_tips); - __Pyx_DECREF(__pyx_v_prefix_tips); - __Pyx_DECREF(__pyx_v_prefix); - __Pyx_DECREF(__pyx_v_tip_nodes); - __Pyx_DECREF(__pyx_v_result); - __Pyx_DECREF(__pyx_v_pending); - __Pyx_DECREF(__pyx_v_parents); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_parent_node); + Py_DECREF(__pyx_v_tips); + Py_DECREF(__pyx_v_prefix_tips); + Py_DECREF(__pyx_v_prefix); + Py_DECREF(__pyx_v_tip_nodes); + Py_DECREF(__pyx_v_result); + Py_DECREF(__pyx_v_pending); + Py_DECREF(__pyx_v_parents); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":632 - * return result - * - * def merge_sort(self, tip_key): # <<<<<<<<<<<<<< - * """Compute the merge sorted graph output.""" - * cdef _MergeSorter sorter - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_10merge_sort(PyObject *__pyx_v_self, PyObject *__pyx_v_tip_key); /*proto*/ -static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_10merge_sort[] = "Compute the merge sorted graph output."; -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_10merge_sort(PyObject *__pyx_v_self, PyObject *__pyx_v_tip_key) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_merge_sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_merge_sort[] = "Compute the merge sorted graph output."; +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_merge_sort(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_tip_key = 0; struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_sorter; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("merge_sort"); - __pyx_v_sorter = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":639 - * # that won't be collectable anyway. real world testing has not - * # shown a specific impact, yet. - * sorter = _MergeSorter(self, tip_key) # <<<<<<<<<<<<<< - * return sorter.topo_order() - * - */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __Pyx_INCREF(__pyx_v_tip_key); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_tip_key); - __Pyx_GIVEREF(__pyx_v_tip_key); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_16_known_graph_pyx__MergeSorter)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_sorter)); - __pyx_v_sorter = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":640 - * # shown a specific impact, yet. - * sorter = _MergeSorter(self, tip_key) - * return sorter.topo_order() # <<<<<<<<<<<<<< - * - * def get_parent_keys(self, key): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_sorter->__pyx_vtab)->topo_order(__pyx_v_sorter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {"tip_key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_tip_key)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_tip_key); + __pyx_v_sorter = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)Py_None); Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":639 */ + __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L1;} + Py_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self); + Py_INCREF(__pyx_v_tip_key); + PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_tip_key); + __pyx_2 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_16_known_graph_pyx__MergeSorter), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(((PyObject *)__pyx_v_sorter)); + __pyx_v_sorter = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_2); + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":640 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_sorter->__pyx_vtab)->topo_order(__pyx_v_sorter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.merge_sort"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_sorter); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_known_graph_pyx.pyx":642 - * return sorter.topo_order() - * - * def get_parent_keys(self, key): # <<<<<<<<<<<<<< - * """Get the parents for a key - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_11get_parent_keys(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_11get_parent_keys[] = "Get the parents for a key\n \n Returns a list containg the parents keys. If the key is a ghost,\n None is returned. A KeyError will be raised if the key is not in\n the graph.\n \n :param keys: Key to check (eg revision_id)\n :return: A list of parents\n "; -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_11get_parent_keys(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("get_parent_keys"); - - /* "bzrlib/_known_graph_pyx.pyx":652 - * :return: A list of parents - * """ - * return self._nodes[key].parent_keys # <<<<<<<<<<<<<< - * - * def get_child_keys(self, key): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes, __pyx_v_key); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__parent_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.get_parent_keys"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_known_graph_pyx.pyx":654 - * return self._nodes[key].parent_keys - * - * def get_child_keys(self, key): # <<<<<<<<<<<<<< - * """Get the children for a key - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12get_child_keys(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_12get_child_keys[] = "Get the children for a key\n \n Returns a list containg the children keys. A KeyError will be raised\n if the key is not in the graph.\n \n :param keys: Key to check (eg revision_id)\n :return: A list of children\n "; -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12get_child_keys(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("get_child_keys"); - - /* "bzrlib/_known_graph_pyx.pyx":663 - * :return: A list of children - * """ - * return self._nodes[key].child_keys # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes, __pyx_v_key); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__child_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.get_child_keys"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_known_graph_pyx.pyx":195 - * """This is a class which assumes we already know the full graph.""" - * - * cdef public object _nodes # <<<<<<<<<<<<<< - * cdef public object _known_heads - * cdef public int do_cache - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6_nodes___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6_nodes___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6_nodes_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6_nodes_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannySetupContext("__set__"); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6_nodes_2__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6_nodes_2__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannySetupContext("__del__"); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes = Py_None; - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_known_graph_pyx.pyx":196 - * - * cdef public object _nodes - * cdef public object _known_heads # <<<<<<<<<<<<<< - * cdef public int do_cache - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12_known_heads___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12_known_heads___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads); - __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12_known_heads_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12_known_heads_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannySetupContext("__set__"); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_sorter); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_tip_key); return __pyx_r; } -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12_known_heads_2__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12_known_heads_2__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannySetupContext("__del__"); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_known_heads = Py_None; - +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_get_parent_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_get_parent_keys[] = "Get the parents for a key\n \n Returns a list containg the parents keys. If the key is a ghost,\n None is returned. A KeyError will be raised if the key is not in\n the graph.\n \n :param keys: Key to check (eg revision_id)\n :return: A list of parents\n "; +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_get_parent_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {"key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_1 = PyObject_GetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes, __pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_parent_keys); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.get_parent_keys"); __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_known_graph_pyx.pyx":197 - * cdef public object _nodes - * cdef public object _known_heads - * cdef public int do_cache # <<<<<<<<<<<<<< - * - * def __init__(self, parent_map, do_cache=True): - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_8do_cache___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_8do_cache___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->do_cache); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.do_cache.__get__"); - __pyx_r = NULL; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_8do_cache_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_8do_cache_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->do_cache = __pyx_t_1; - +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_get_child_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_get_child_keys[] = "Get the children for a key\n \n Returns a list containg the children keys. A KeyError will be raised\n if the key is not in the graph.\n \n :param keys: Key to check (eg revision_id)\n :return: A list of children\n "; +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_get_child_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {"key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_1 = PyObject_GetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_self)->_nodes, __pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_child_keys); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 663; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.get_child_keys"); __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("bzrlib._known_graph_pyx.KnownGraph.do_cache.__set__"); - __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":686 - * cdef int completed # Fully Processed - * - * def __init__(self, key): # <<<<<<<<<<<<<< - * self.key = key - * self.merge_depth = -1 - */ - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; int __pyx_r; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_key = values[0]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_key = PyTuple_GET_ITEM(__pyx_args, 0); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSortNode.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "bzrlib/_known_graph_pyx.pyx":687 - * - * def __init__(self, key): - * self.key = key # <<<<<<<<<<<<<< - * self.merge_depth = -1 - * self.left_parent = None - */ - __Pyx_INCREF(__pyx_v_key); - __Pyx_GIVEREF(__pyx_v_key); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); + static char *__pyx_argnames[] = {"key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return -1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":687 */ + Py_INCREF(__pyx_v_key); + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key = __pyx_v_key; - /* "bzrlib/_known_graph_pyx.pyx":688 - * def __init__(self, key): - * self.key = key - * self.merge_depth = -1 # <<<<<<<<<<<<<< - * self.left_parent = None - * self.left_pending_parent = None - */ - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->merge_depth = -1; - - /* "bzrlib/_known_graph_pyx.pyx":689 - * self.key = key - * self.merge_depth = -1 - * self.left_parent = None # <<<<<<<<<<<<<< - * self.left_pending_parent = None - * self.pending_parents = None - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->left_parent); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->left_parent)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":688 */ + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->merge_depth = (-1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":689 */ + Py_INCREF(Py_None); + Py_DECREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->left_parent)); ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->left_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); - /* "bzrlib/_known_graph_pyx.pyx":690 - * self.merge_depth = -1 - * self.left_parent = None - * self.left_pending_parent = None # <<<<<<<<<<<<<< - * self.pending_parents = None - * self._revno_first = -1 - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->left_pending_parent); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->left_pending_parent)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":690 */ + Py_INCREF(Py_None); + Py_DECREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->left_pending_parent)); ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->left_pending_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); - /* "bzrlib/_known_graph_pyx.pyx":691 - * self.left_parent = None - * self.left_pending_parent = None - * self.pending_parents = None # <<<<<<<<<<<<<< - * self._revno_first = -1 - * self._revno_second = -1 - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->pending_parents); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->pending_parents); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":691 */ + Py_INCREF(Py_None); + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->pending_parents); ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->pending_parents = Py_None; - /* "bzrlib/_known_graph_pyx.pyx":692 - * self.left_pending_parent = None - * self.pending_parents = None - * self._revno_first = -1 # <<<<<<<<<<<<<< - * self._revno_second = -1 - * self._revno_last = -1 - */ - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_first = -1; - - /* "bzrlib/_known_graph_pyx.pyx":693 - * self.pending_parents = None - * self._revno_first = -1 - * self._revno_second = -1 # <<<<<<<<<<<<<< - * self._revno_last = -1 - * self.is_first_child = 0 - */ - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_second = -1; - - /* "bzrlib/_known_graph_pyx.pyx":694 - * self._revno_first = -1 - * self._revno_second = -1 - * self._revno_last = -1 # <<<<<<<<<<<<<< - * self.is_first_child = 0 - * self.seen_by_child = 0 - */ - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_last = -1; - - /* "bzrlib/_known_graph_pyx.pyx":695 - * self._revno_second = -1 - * self._revno_last = -1 - * self.is_first_child = 0 # <<<<<<<<<<<<<< - * self.seen_by_child = 0 - * self.completed = 0 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":692 */ + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_first = (-1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":693 */ + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_second = (-1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":694 */ + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_last = (-1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":695 */ ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->is_first_child = 0; - /* "bzrlib/_known_graph_pyx.pyx":696 - * self._revno_last = -1 - * self.is_first_child = 0 - * self.seen_by_child = 0 # <<<<<<<<<<<<<< - * self.completed = 0 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":696 */ ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->seen_by_child = 0; - /* "bzrlib/_known_graph_pyx.pyx":697 - * self.is_first_child = 0 - * self.seen_by_child = 0 - * self.completed = 0 # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":697 */ ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->completed = 0; __pyx_r = 0; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":699 - * self.completed = 0 - * - * def __repr__(self): # <<<<<<<<<<<<<< - * return '%s(%s depth:%s rev:%s,%s,%s first:%s seen:%s)' % ( - * self.__class__.__name__, self.key, - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_1__repr__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_1__repr__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - __Pyx_RefNannySetupContext("__repr__"); - - /* "bzrlib/_known_graph_pyx.pyx":700 - * - * def __repr__(self): - * return '%s(%s depth:%s rev:%s,%s,%s first:%s seen:%s)' % ( # <<<<<<<<<<<<<< - * self.__class__.__name__, self.key, - * self.merge_depth, - */ - __Pyx_XDECREF(__pyx_r); - - /* "bzrlib/_known_graph_pyx.pyx":701 - * def __repr__(self): - * return '%s(%s depth:%s rev:%s,%s,%s first:%s seen:%s)' % ( - * self.__class__.__name__, self.key, # <<<<<<<<<<<<<< - * self.merge_depth, - * self._revno_first, self._revno_second, self._revno_last, - */ - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":702 - * return '%s(%s depth:%s rev:%s,%s,%s first:%s seen:%s)' % ( - * self.__class__.__name__, self.key, - * self.merge_depth, # <<<<<<<<<<<<<< - * self._revno_first, self._revno_second, self._revno_last, - * self.is_first_child, self.seen_by_child) - */ - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->merge_depth); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - - /* "bzrlib/_known_graph_pyx.pyx":703 - * self.__class__.__name__, self.key, - * self.merge_depth, - * self._revno_first, self._revno_second, self._revno_last, # <<<<<<<<<<<<<< - * self.is_first_child, self.seen_by_child) - * - */ - __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_first); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_second); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_last); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - - /* "bzrlib/_known_graph_pyx.pyx":704 - * self.merge_depth, - * self._revno_first, self._revno_second, self._revno_last, - * self.is_first_child, self.seen_by_child) # <<<<<<<<<<<<<< - * - * cdef int has_pending_parents(self): # cannot_raise - */ - __pyx_t_6 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->is_first_child); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->seen_by_child); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); - PyTuple_SET_ITEM(__pyx_t_8, 1, ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); - __Pyx_GIVEREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); - PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - __pyx_t_2 = 0; - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_5 = 0; - __pyx_t_6 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_7)); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_r = ((PyObject *)__pyx_t_7); - __pyx_t_7 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + PyObject *__pyx_6 = 0; + PyObject *__pyx_7 = 0; + PyObject *__pyx_8 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n___name__); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->merge_depth); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_first); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_second); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->_revno_last); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;} + __pyx_6 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->is_first_child); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;} + __pyx_7 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->seen_by_child); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;} + __pyx_8 = PyTuple_New(8); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_8, 0, __pyx_2); + Py_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); + PyTuple_SET_ITEM(__pyx_8, 1, ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); + PyTuple_SET_ITEM(__pyx_8, 2, __pyx_1); + PyTuple_SET_ITEM(__pyx_8, 3, __pyx_3); + PyTuple_SET_ITEM(__pyx_8, 4, __pyx_4); + PyTuple_SET_ITEM(__pyx_8, 5, __pyx_5); + PyTuple_SET_ITEM(__pyx_8, 6, __pyx_6); + PyTuple_SET_ITEM(__pyx_8, 7, __pyx_7); + __pyx_2 = 0; + __pyx_1 = 0; + __pyx_3 = 0; + __pyx_4 = 0; + __pyx_5 = 0; + __pyx_6 = 0; + __pyx_7 = 0; + __pyx_2 = PyNumber_Remainder(__pyx_k29p, __pyx_8); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;} + Py_DECREF(__pyx_8); __pyx_8 = 0; + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); + Py_XDECREF(__pyx_6); + Py_XDECREF(__pyx_7); + Py_XDECREF(__pyx_8); __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSortNode.__repr__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":706 - * self.is_first_child, self.seen_by_child) - * - * cdef int has_pending_parents(self): # cannot_raise # <<<<<<<<<<<<<< - * if self.left_pending_parent is not None or self.pending_parents: - * return 1 - */ - -static int __pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode_has_pending_parents(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_self) { +static int __pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode_has_pending_parents(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_self) { int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - __Pyx_RefNannySetupContext("has_pending_parents"); - - /* "bzrlib/_known_graph_pyx.pyx":707 - * - * cdef int has_pending_parents(self): # cannot_raise - * if self.left_pending_parent is not None or self.pending_parents: # <<<<<<<<<<<<<< - * return 1 - * return 0 - */ - __pyx_t_1 = (((PyObject *)__pyx_v_self->left_pending_parent) != Py_None); - if (!__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->pending_parents); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":708 - * cdef int has_pending_parents(self): # cannot_raise - * if self.left_pending_parent is not None or self.pending_parents: - * return 1 # <<<<<<<<<<<<<< - * return 0 - * - */ + PyObject *__pyx_1 = 0; + int __pyx_2; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":707 */ + __pyx_2 = ((PyObject *)__pyx_v_self->left_pending_parent) != Py_None; + __pyx_1 = PyInt_FromLong(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;} + __pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;} + if (!__pyx_2) { + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = __pyx_v_self->pending_parents; + Py_INCREF(__pyx_1); + } + __pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (__pyx_2) { __pyx_r = 1; goto __pyx_L0; - goto __pyx_L3; + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_known_graph_pyx.pyx":709 - * if self.left_pending_parent is not None or self.pending_parents: - * return 1 - * return 0 # <<<<<<<<<<<<<< - * - * cdef object _revno(self): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":709 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_WriteUnraisable("bzrlib._known_graph_pyx._MergeSortNode.has_pending_parents"); __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":711 - * return 0 - * - * cdef object _revno(self): # <<<<<<<<<<<<<< - * if self._revno_first == -1: - * if self._revno_second != -1: - */ - -static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode__revno(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_self) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("_revno"); - - /* "bzrlib/_known_graph_pyx.pyx":712 - * - * cdef object _revno(self): - * if self._revno_first == -1: # <<<<<<<<<<<<<< - * if self._revno_second != -1: - * raise RuntimeError('Something wrong with: %s' % (self,)) - */ - __pyx_t_1 = (__pyx_v_self->_revno_first == -1); - if (__pyx_t_1) { - - /* "bzrlib/_known_graph_pyx.pyx":713 - * cdef object _revno(self): - * if self._revno_first == -1: - * if self._revno_second != -1: # <<<<<<<<<<<<<< - * raise RuntimeError('Something wrong with: %s' % (self,)) - * return (self._revno_last,) - */ - __pyx_t_1 = (__pyx_v_self->_revno_second != -1); - if (__pyx_t_1) { - - /* "bzrlib/_known_graph_pyx.pyx":714 - * if self._revno_first == -1: - * if self._revno_second != -1: - * raise RuntimeError('Something wrong with: %s' % (self,)) # <<<<<<<<<<<<<< - * return (self._revno_last,) - * else: - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; - } - __pyx_L4:; - - /* "bzrlib/_known_graph_pyx.pyx":715 - * if self._revno_second != -1: - * raise RuntimeError('Something wrong with: %s' % (self,)) - * return (self._revno_last,) # <<<<<<<<<<<<<< - * else: - * return (self._revno_first, self._revno_second, self._revno_last) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyInt_FromLong(__pyx_v_self->_revno_last); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_r = ((PyObject *)__pyx_t_2); - __pyx_t_2 = 0; +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode__revno(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_self) { + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = (__pyx_v_self->_revno_first == (-1)); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":713 */ + __pyx_1 = (__pyx_v_self->_revno_second != (-1)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_v_self)); + PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_self)); + __pyx_3 = PyNumber_Remainder(__pyx_k30p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_RuntimeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; goto __pyx_L1;} + goto __pyx_L3; + } + __pyx_L3:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":715 */ + __pyx_2 = PyInt_FromLong(__pyx_v_self->_revno_last); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; - goto __pyx_L3; + goto __pyx_L2; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":717 - * return (self._revno_last,) - * else: - * return (self._revno_first, self._revno_second, self._revno_last) # <<<<<<<<<<<<<< - * - * property revno: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyInt_FromLong(__pyx_v_self->_revno_first); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyInt_FromLong(__pyx_v_self->_revno_second); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyInt_FromLong(__pyx_v_self->_revno_last); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_r = ((PyObject *)__pyx_t_5); - __pyx_t_5 = 0; + __pyx_2 = PyInt_FromLong(__pyx_v_self->_revno_first); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_self->_revno_second); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_self->_revno_last); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;} + __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2); + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4); + __pyx_2 = 0; + __pyx_3 = 0; + __pyx_4 = 0; + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; } - __pyx_L3:; + __pyx_L2:; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSortNode._revno"); __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":720 - * - * property revno: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._revno() - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_5revno___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_5revno___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "bzrlib/_known_graph_pyx.pyx":721 - * property revno: - * def __get__(self): - * return self._revno() # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSortNode *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->__pyx_vtab)->_revno(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode_5revno___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode_5revno___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSortNode *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->__pyx_vtab)->_revno(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSortNode.revno.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_known_graph_pyx.pyx":670 - * - * # Public api - * cdef public object key # <<<<<<<<<<<<<< - * cdef public long merge_depth - * cdef public object end_of_merge # True/False Is this the end of the current merge - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_3key___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_3key___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); - __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_3key_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_3key_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannySetupContext("__set__"); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_3key_2__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_3key_2__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannySetupContext("__del__"); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->key = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_known_graph_pyx.pyx":671 - * # Public api - * cdef public object key - * cdef public long merge_depth # <<<<<<<<<<<<<< - * cdef public object end_of_merge # True/False Is this the end of the current merge - * - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_11merge_depth___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_11merge_depth___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->merge_depth); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSortNode.merge_depth.__get__"); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_11merge_depth_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_11merge_depth_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - long __pyx_t_1; - __Pyx_RefNannySetupContext("__set__"); - __pyx_t_1 = __Pyx_PyInt_AsLong(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->merge_depth = __pyx_t_1; - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSortNode.merge_depth.__set__"); - __pyx_r = -1; - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "bzrlib/_known_graph_pyx.pyx":672 - * cdef public object key - * cdef public long merge_depth - * cdef public object end_of_merge # True/False Is this the end of the current merge # <<<<<<<<<<<<<< - * - * # Private api, used while computing the information - */ - -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_12end_of_merge___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_12end_of_merge___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__get__"); - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->end_of_merge); - __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->end_of_merge; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_12end_of_merge_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_12end_of_merge_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - int __pyx_r; - __Pyx_RefNannySetupContext("__set__"); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->end_of_merge); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->end_of_merge); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->end_of_merge = __pyx_v_value; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_12end_of_merge_2__del__(PyObject *__pyx_v_self); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_12end_of_merge_2__del__(PyObject *__pyx_v_self) { - int __pyx_r; - __Pyx_RefNannySetupContext("__del__"); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->end_of_merge); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->end_of_merge); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_self)->end_of_merge = Py_None; - - __pyx_r = 0; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":743 - * cdef object _scheduled_nodes # List of nodes ready to be yielded - * - * def __init__(self, known_graph, tip_key): # <<<<<<<<<<<<<< - * cdef _KnownGraphNode node - * - */ - -static int __pyx_pf_6bzrlib_16_known_graph_pyx_12_MergeSorter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6bzrlib_16_known_graph_pyx_12_MergeSorter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_known_graph = 0; - PyObject *__pyx_v_tip_key = 0; - struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; - int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__known_graph,&__pyx_n_s__tip_key,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__known_graph); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tip_key); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_known_graph = values[0]; - __pyx_v_tip_key = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_known_graph = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_tip_key = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSorter.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":746 - * cdef _KnownGraphNode node - * - * self.graph = known_graph # <<<<<<<<<<<<<< - * # self._ms_nodes = {} - * self._revno_to_branch_count = {} - */ - if (!(likely(((__pyx_v_known_graph) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_known_graph, __pyx_ptype_6bzrlib_16_known_graph_pyx_KnownGraph))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_known_graph); - __Pyx_GIVEREF(__pyx_v_known_graph); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->graph); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->graph)); + PyObject *__pyx_v_tip_key = 0; + struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; + int __pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + static char *__pyx_argnames[] = {"known_graph","tip_key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_known_graph, &__pyx_v_tip_key)) return -1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_known_graph); + Py_INCREF(__pyx_v_tip_key); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":746 */ + if (!__Pyx_TypeTest(__pyx_v_known_graph, __pyx_ptype_6bzrlib_16_known_graph_pyx_KnownGraph)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;} + Py_INCREF(__pyx_v_known_graph); + Py_DECREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->graph)); ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->graph = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)__pyx_v_known_graph); - /* "bzrlib/_known_graph_pyx.pyx":748 - * self.graph = known_graph - * # self._ms_nodes = {} - * self._revno_to_branch_count = {} # <<<<<<<<<<<<<< - * self._depth_first_stack = [] - * self._last_stack_item = -1 - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_revno_to_branch_count); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_revno_to_branch_count); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_revno_to_branch_count = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":749 - * # self._ms_nodes = {} - * self._revno_to_branch_count = {} - * self._depth_first_stack = [] # <<<<<<<<<<<<<< - * self._last_stack_item = -1 - * self._scheduled_nodes = [] - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_depth_first_stack); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_depth_first_stack); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_depth_first_stack = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":750 - * self._revno_to_branch_count = {} - * self._depth_first_stack = [] - * self._last_stack_item = -1 # <<<<<<<<<<<<<< - * self._scheduled_nodes = [] - * if (tip_key is not None and tip_key != NULL_REVISION - */ - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_last_stack_item = -1; - - /* "bzrlib/_known_graph_pyx.pyx":751 - * self._depth_first_stack = [] - * self._last_stack_item = -1 - * self._scheduled_nodes = [] # <<<<<<<<<<<<<< - * if (tip_key is not None and tip_key != NULL_REVISION - * and tip_key != (NULL_REVISION,)): - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_scheduled_nodes); - __Pyx_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_scheduled_nodes); - ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_scheduled_nodes = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":752 - * self._last_stack_item = -1 - * self._scheduled_nodes = [] - * if (tip_key is not None and tip_key != NULL_REVISION # <<<<<<<<<<<<<< - * and tip_key != (NULL_REVISION,)): - * node = self.graph._nodes[tip_key] - */ - __pyx_t_2 = (__pyx_v_tip_key != Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":753 - * self._scheduled_nodes = [] - * if (tip_key is not None and tip_key != NULL_REVISION - * and tip_key != (NULL_REVISION,)): # <<<<<<<<<<<<<< - * node = self.graph._nodes[tip_key] - * self._push_node(node, 0) - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_tip_key, __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_3) { - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - __Pyx_GIVEREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_tip_key, ((PyObject *)__pyx_t_1), Py_NE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __pyx_t_5; - } else { - __pyx_t_6 = __pyx_t_3; - } - __pyx_t_3 = __pyx_t_6; - } else { - __pyx_t_3 = __pyx_t_2; - } - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":754 - * if (tip_key is not None and tip_key != NULL_REVISION - * and tip_key != (NULL_REVISION,)): - * node = self.graph._nodes[tip_key] # <<<<<<<<<<<<<< - * self._push_node(node, 0) - * - */ - __pyx_t_4 = PyObject_GetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->graph->_nodes, __pyx_v_tip_key); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":755 - * and tip_key != (NULL_REVISION,)): - * node = self.graph._nodes[tip_key] - * self._push_node(node, 0) # <<<<<<<<<<<<<< - * - * cdef _MergeSortNode _get_ms_node(self, _KnownGraphNode node): - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->__pyx_vtab)->_push_node(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self), __pyx_v_node, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L6; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":748 */ + __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;} + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_revno_to_branch_count); + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_revno_to_branch_count = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":749 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;} + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_depth_first_stack); + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_depth_first_stack = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":750 */ + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_last_stack_item = (-1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":751 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; goto __pyx_L1;} + Py_DECREF(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_scheduled_nodes); + ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->_scheduled_nodes = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":752 */ + __pyx_2 = __pyx_v_tip_key != Py_None; + if (__pyx_2) { + if (PyObject_Cmp(__pyx_v_tip_key, __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; goto __pyx_L1;} + __pyx_2 = __pyx_2 != 0; + if (__pyx_2) { + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;} + Py_INCREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); + if (PyObject_Cmp(__pyx_v_tip_key, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; goto __pyx_L1;} + __pyx_2 = __pyx_2 != 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + } + } + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":754 */ + __pyx_1 = PyObject_GetItem(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->graph->_nodes, __pyx_v_tip_key); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_1); + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":755 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self)->__pyx_vtab)->_push_node(((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self),__pyx_v_node,0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + goto __pyx_L2; } - __pyx_L6:; + __pyx_L2:; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSorter.__init__"); __pyx_r = -1; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_known_graph); + Py_DECREF(__pyx_v_tip_key); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":757 - * self._push_node(node, 0) - * - * cdef _MergeSortNode _get_ms_node(self, _KnownGraphNode node): # <<<<<<<<<<<<<< - * cdef PyObject *temp_node - * cdef _MergeSortNode ms_node - */ - -static struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__get_ms_node(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_self, struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node) { +static struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__get_ms_node(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_self,struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_ms_node; - struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("_get_ms_node"); - __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":761 - * cdef _MergeSortNode ms_node - * - * if node.extra is None: # <<<<<<<<<<<<<< - * ms_node = _MergeSortNode(node.key) - * node.extra = ms_node - */ - __pyx_t_1 = (__pyx_v_node->extra == Py_None); - if (__pyx_t_1) { - - /* "bzrlib/_known_graph_pyx.pyx":762 - * - * if node.extra is None: - * ms_node = _MergeSortNode(node.key) # <<<<<<<<<<<<<< - * node.extra = ms_node - * else: - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_node->key); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node->key); - __Pyx_GIVEREF(__pyx_v_node->key); - __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_16_known_graph_pyx__MergeSortNode)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_ms_node)); - __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":763 - * if node.extra is None: - * ms_node = _MergeSortNode(node.key) - * node.extra = ms_node # <<<<<<<<<<<<<< - * else: - * ms_node = <_MergeSortNode>node.extra - */ - __Pyx_INCREF(((PyObject *)__pyx_v_ms_node)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_ms_node)); - __Pyx_GOTREF(__pyx_v_node->extra); - __Pyx_DECREF(__pyx_v_node->extra); + struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_node); + __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":761 */ + __pyx_1 = __pyx_v_node->extra == Py_None; + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":762 */ + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} + Py_INCREF(__pyx_v_node->key); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_node->key); + __pyx_3 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_16_known_graph_pyx__MergeSortNode), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(((PyObject *)__pyx_v_ms_node)); + __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":763 */ + Py_INCREF(((PyObject *)__pyx_v_ms_node)); + Py_DECREF(__pyx_v_node->extra); __pyx_v_node->extra = ((PyObject *)__pyx_v_ms_node); - goto __pyx_L3; + goto __pyx_L2; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":765 - * node.extra = ms_node - * else: - * ms_node = <_MergeSortNode>node.extra # <<<<<<<<<<<<<< - * return ms_node - * - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_node->extra))); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_node)); + Py_INCREF(__pyx_v_node->extra); + Py_DECREF(((PyObject *)__pyx_v_ms_node)); __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_node->extra); } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_known_graph_pyx.pyx":766 - * else: - * ms_node = <_MergeSortNode>node.extra - * return ms_node # <<<<<<<<<<<<<< - * - * cdef _push_node(self, _KnownGraphNode node, long merge_depth): - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_ms_node)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":766 */ + Py_INCREF(((PyObject *)__pyx_v_ms_node)); __pyx_r = __pyx_v_ms_node; goto __pyx_L0; - __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); __Pyx_INCREF(Py_None); + __pyx_r = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSorter._get_ms_node"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_ms_node); - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_ms_node); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_node); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":768 - * return ms_node - * - * cdef _push_node(self, _KnownGraphNode node, long merge_depth): # <<<<<<<<<<<<<< - * cdef _KnownGraphNode parent_node - * cdef _MergeSortNode ms_node, ms_parent_node - */ - -static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__push_node(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_self, struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node, long __pyx_v_merge_depth) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__push_node(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_self,struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node,long __pyx_v_merge_depth) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_parent_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_ms_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_ms_parent_node; Py_ssize_t __pyx_v_pos; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("_push_node"); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_ms_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":773 - * cdef Py_ssize_t pos - * - * ms_node = self._get_ms_node(node) # <<<<<<<<<<<<<< - * ms_node.merge_depth = merge_depth - * if node.parents is None: - */ - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_get_ms_node(__pyx_v_self, __pyx_v_node)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_node)); - __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":774 - * - * ms_node = self._get_ms_node(node) - * ms_node.merge_depth = merge_depth # <<<<<<<<<<<<<< - * if node.parents is None: - * raise RuntimeError('ghost nodes should not be pushed' - */ + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + Py_ssize_t __pyx_4; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_node); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_ms_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":773 */ + __pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_get_ms_node(__pyx_v_self,__pyx_v_node)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_ms_node)); + __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_1); + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":774 */ __pyx_v_ms_node->merge_depth = __pyx_v_merge_depth; - /* "bzrlib/_known_graph_pyx.pyx":775 - * ms_node = self._get_ms_node(node) - * ms_node.merge_depth = merge_depth - * if node.parents is None: # <<<<<<<<<<<<<< - * raise RuntimeError('ghost nodes should not be pushed' - * ' onto the stack: %s' % (node,)) - */ - __pyx_t_2 = (__pyx_v_node->parents == Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":777 - * if node.parents is None: - * raise RuntimeError('ghost nodes should not be pushed' - * ' onto the stack: %s' % (node,)) # <<<<<<<<<<<<<< - * if PyTuple_GET_SIZE(node.parents) > 0: - * parent_node = _get_tuple_node(node.parents, 0) - */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_v_node)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_node)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_node)); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_13), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":775 */ + __pyx_2 = __pyx_v_node->parents == Py_None; + if (__pyx_2) { + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;} + Py_INCREF(((PyObject *)__pyx_v_node)); + PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)__pyx_v_node)); + __pyx_3 = PyNumber_Remainder(__pyx_k31p, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_RuntimeError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":778 */ + __pyx_2 = (PyTuple_GET_SIZE(__pyx_v_node->parents) > 0); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":779 */ + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_v_node->parents,0)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_parent_node)); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_1); + __pyx_1 = 0; - /* "bzrlib/_known_graph_pyx.pyx":778 - * raise RuntimeError('ghost nodes should not be pushed' - * ' onto the stack: %s' % (node,)) - * if PyTuple_GET_SIZE(node.parents) > 0: # <<<<<<<<<<<<<< - * parent_node = _get_tuple_node(node.parents, 0) - * ms_node.left_parent = parent_node - */ - __pyx_t_3 = __pyx_v_node->parents; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_t_3) > 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":779 - * ' onto the stack: %s' % (node,)) - * if PyTuple_GET_SIZE(node.parents) > 0: - * parent_node = _get_tuple_node(node.parents, 0) # <<<<<<<<<<<<<< - * ms_node.left_parent = parent_node - * if parent_node.parents is None: # left-hand ghost - */ - __pyx_t_3 = __pyx_v_node->parents; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_parent_node)); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":780 - * if PyTuple_GET_SIZE(node.parents) > 0: - * parent_node = _get_tuple_node(node.parents, 0) - * ms_node.left_parent = parent_node # <<<<<<<<<<<<<< - * if parent_node.parents is None: # left-hand ghost - * ms_node.left_pending_parent = None - */ - __Pyx_INCREF(((PyObject *)__pyx_v_parent_node)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_parent_node)); - __Pyx_GOTREF(__pyx_v_ms_node->left_parent); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_node->left_parent)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":780 */ + Py_INCREF(((PyObject *)__pyx_v_parent_node)); + Py_DECREF(((PyObject *)__pyx_v_ms_node->left_parent)); __pyx_v_ms_node->left_parent = __pyx_v_parent_node; - /* "bzrlib/_known_graph_pyx.pyx":781 - * parent_node = _get_tuple_node(node.parents, 0) - * ms_node.left_parent = parent_node - * if parent_node.parents is None: # left-hand ghost # <<<<<<<<<<<<<< - * ms_node.left_pending_parent = None - * ms_node.left_parent = None - */ - __pyx_t_2 = (__pyx_v_parent_node->parents == Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":782 - * ms_node.left_parent = parent_node - * if parent_node.parents is None: # left-hand ghost - * ms_node.left_pending_parent = None # <<<<<<<<<<<<<< - * ms_node.left_parent = None - * else: - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_ms_node->left_pending_parent); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_node->left_pending_parent)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":781 */ + __pyx_2 = __pyx_v_parent_node->parents == Py_None; + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":782 */ + Py_INCREF(Py_None); + Py_DECREF(((PyObject *)__pyx_v_ms_node->left_pending_parent)); __pyx_v_ms_node->left_pending_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); - /* "bzrlib/_known_graph_pyx.pyx":783 - * if parent_node.parents is None: # left-hand ghost - * ms_node.left_pending_parent = None - * ms_node.left_parent = None # <<<<<<<<<<<<<< - * else: - * ms_node.left_pending_parent = parent_node - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_ms_node->left_parent); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_node->left_parent)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":783 */ + Py_INCREF(Py_None); + Py_DECREF(((PyObject *)__pyx_v_ms_node->left_parent)); __pyx_v_ms_node->left_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); - goto __pyx_L5; + goto __pyx_L4; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":785 - * ms_node.left_parent = None - * else: - * ms_node.left_pending_parent = parent_node # <<<<<<<<<<<<<< - * if PyTuple_GET_SIZE(node.parents) > 1: - * ms_node.pending_parents = [] - */ - __Pyx_INCREF(((PyObject *)__pyx_v_parent_node)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_parent_node)); - __Pyx_GOTREF(__pyx_v_ms_node->left_pending_parent); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_node->left_pending_parent)); + Py_INCREF(((PyObject *)__pyx_v_parent_node)); + Py_DECREF(((PyObject *)__pyx_v_ms_node->left_pending_parent)); __pyx_v_ms_node->left_pending_parent = __pyx_v_parent_node; } - __pyx_L5:; - goto __pyx_L4; + __pyx_L4:; + goto __pyx_L3; } - __pyx_L4:; + __pyx_L3:; - /* "bzrlib/_known_graph_pyx.pyx":786 - * else: - * ms_node.left_pending_parent = parent_node - * if PyTuple_GET_SIZE(node.parents) > 1: # <<<<<<<<<<<<<< - * ms_node.pending_parents = [] - * for pos from 1 <= pos < PyTuple_GET_SIZE(node.parents): - */ - __pyx_t_1 = __pyx_v_node->parents; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = (PyTuple_GET_SIZE(__pyx_t_1) > 1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":787 - * ms_node.left_pending_parent = parent_node - * if PyTuple_GET_SIZE(node.parents) > 1: - * ms_node.pending_parents = [] # <<<<<<<<<<<<<< - * for pos from 1 <= pos < PyTuple_GET_SIZE(node.parents): - * parent_node = _get_tuple_node(node.parents, pos) - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_ms_node->pending_parents); - __Pyx_DECREF(__pyx_v_ms_node->pending_parents); - __pyx_v_ms_node->pending_parents = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":788 - * if PyTuple_GET_SIZE(node.parents) > 1: - * ms_node.pending_parents = [] - * for pos from 1 <= pos < PyTuple_GET_SIZE(node.parents): # <<<<<<<<<<<<<< - * parent_node = _get_tuple_node(node.parents, pos) - * if parent_node.parents is None: # ghost - */ - __pyx_t_1 = __pyx_v_node->parents; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_4 = PyTuple_GET_SIZE(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (__pyx_v_pos = 1; __pyx_v_pos < __pyx_t_4; __pyx_v_pos++) { - - /* "bzrlib/_known_graph_pyx.pyx":789 - * ms_node.pending_parents = [] - * for pos from 1 <= pos < PyTuple_GET_SIZE(node.parents): - * parent_node = _get_tuple_node(node.parents, pos) # <<<<<<<<<<<<<< - * if parent_node.parents is None: # ghost - * continue - */ - __pyx_t_1 = __pyx_v_node->parents; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_t_1, __pyx_v_pos)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_parent_node)); - __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":790 - * for pos from 1 <= pos < PyTuple_GET_SIZE(node.parents): - * parent_node = _get_tuple_node(node.parents, pos) - * if parent_node.parents is None: # ghost # <<<<<<<<<<<<<< - * continue - * PyList_Append(ms_node.pending_parents, parent_node) - */ - __pyx_t_2 = (__pyx_v_parent_node->parents == Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":791 - * parent_node = _get_tuple_node(node.parents, pos) - * if parent_node.parents is None: # ghost - * continue # <<<<<<<<<<<<<< - * PyList_Append(ms_node.pending_parents, parent_node) - * - */ - goto __pyx_L7_continue; - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":786 */ + __pyx_2 = (PyTuple_GET_SIZE(__pyx_v_node->parents) > 1); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":787 */ + __pyx_3 = PyList_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; goto __pyx_L1;} + Py_DECREF(__pyx_v_ms_node->pending_parents); + __pyx_v_ms_node->pending_parents = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":788 */ + __pyx_4 = PyTuple_GET_SIZE(__pyx_v_node->parents); + for (__pyx_v_pos = 1; __pyx_v_pos < __pyx_4; ++__pyx_v_pos) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":789 */ + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_tuple_node(__pyx_v_node->parents,__pyx_v_pos)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_parent_node)); + __pyx_v_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_1); + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":790 */ + __pyx_2 = __pyx_v_parent_node->parents == Py_None; + if (__pyx_2) { + goto __pyx_L6; + goto __pyx_L8; } - __pyx_L9:; + __pyx_L8:; - /* "bzrlib/_known_graph_pyx.pyx":792 - * if parent_node.parents is None: # ghost - * continue - * PyList_Append(ms_node.pending_parents, parent_node) # <<<<<<<<<<<<<< - * - * ms_node.is_first_child = 1 - */ - __pyx_t_3 = __pyx_v_ms_node->pending_parents; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_5 = PyList_Append(__pyx_t_3, ((PyObject *)__pyx_v_parent_node)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_L7_continue:; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":792 */ + __pyx_2 = PyList_Append(__pyx_v_ms_node->pending_parents,((PyObject *)__pyx_v_parent_node)); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; goto __pyx_L1;} + __pyx_L6:; } - goto __pyx_L6; + goto __pyx_L5; } - __pyx_L6:; + __pyx_L5:; - /* "bzrlib/_known_graph_pyx.pyx":794 - * PyList_Append(ms_node.pending_parents, parent_node) - * - * ms_node.is_first_child = 1 # <<<<<<<<<<<<<< - * if ms_node.left_parent is not None: - * ms_parent_node = self._get_ms_node(ms_node.left_parent) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":794 */ __pyx_v_ms_node->is_first_child = 1; - /* "bzrlib/_known_graph_pyx.pyx":795 - * - * ms_node.is_first_child = 1 - * if ms_node.left_parent is not None: # <<<<<<<<<<<<<< - * ms_parent_node = self._get_ms_node(ms_node.left_parent) - * if ms_parent_node.seen_by_child: - */ - __pyx_t_2 = (((PyObject *)__pyx_v_ms_node->left_parent) != Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":796 - * ms_node.is_first_child = 1 - * if ms_node.left_parent is not None: - * ms_parent_node = self._get_ms_node(ms_node.left_parent) # <<<<<<<<<<<<<< - * if ms_parent_node.seen_by_child: - * ms_node.is_first_child = 0 - */ - __pyx_t_3 = ((PyObject *)__pyx_v_ms_node->left_parent); - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_get_ms_node(__pyx_v_self, ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_3))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_ms_parent_node)); - __pyx_v_ms_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":797 - * if ms_node.left_parent is not None: - * ms_parent_node = self._get_ms_node(ms_node.left_parent) - * if ms_parent_node.seen_by_child: # <<<<<<<<<<<<<< - * ms_node.is_first_child = 0 - * ms_parent_node.seen_by_child = 1 - */ - if (__pyx_v_ms_parent_node->seen_by_child) { - - /* "bzrlib/_known_graph_pyx.pyx":798 - * ms_parent_node = self._get_ms_node(ms_node.left_parent) - * if ms_parent_node.seen_by_child: - * ms_node.is_first_child = 0 # <<<<<<<<<<<<<< - * ms_parent_node.seen_by_child = 1 - * self._last_stack_item = self._last_stack_item + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":795 */ + __pyx_2 = ((PyObject *)__pyx_v_ms_node->left_parent) != Py_None; + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":796 */ + __pyx_3 = ((PyObject *)((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_get_ms_node(__pyx_v_self,__pyx_v_ms_node->left_parent)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_ms_parent_node)); + __pyx_v_ms_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":797 */ + __pyx_2 = __pyx_v_ms_parent_node->seen_by_child; + if (__pyx_2) { __pyx_v_ms_node->is_first_child = 0; - goto __pyx_L11; + goto __pyx_L10; } - __pyx_L11:; + __pyx_L10:; - /* "bzrlib/_known_graph_pyx.pyx":799 - * if ms_parent_node.seen_by_child: - * ms_node.is_first_child = 0 - * ms_parent_node.seen_by_child = 1 # <<<<<<<<<<<<<< - * self._last_stack_item = self._last_stack_item + 1 - * if self._last_stack_item < PyList_GET_SIZE(self._depth_first_stack): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":799 */ __pyx_v_ms_parent_node->seen_by_child = 1; - goto __pyx_L10; + goto __pyx_L9; } - __pyx_L10:; + __pyx_L9:; - /* "bzrlib/_known_graph_pyx.pyx":800 - * ms_node.is_first_child = 0 - * ms_parent_node.seen_by_child = 1 - * self._last_stack_item = self._last_stack_item + 1 # <<<<<<<<<<<<<< - * if self._last_stack_item < PyList_GET_SIZE(self._depth_first_stack): - * Py_INCREF(node) # SetItem steals a ref - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":800 */ __pyx_v_self->_last_stack_item = (__pyx_v_self->_last_stack_item + 1); - /* "bzrlib/_known_graph_pyx.pyx":801 - * ms_parent_node.seen_by_child = 1 - * self._last_stack_item = self._last_stack_item + 1 - * if self._last_stack_item < PyList_GET_SIZE(self._depth_first_stack): # <<<<<<<<<<<<<< - * Py_INCREF(node) # SetItem steals a ref - * PyList_SetItem(self._depth_first_stack, self._last_stack_item, - */ - __pyx_t_1 = __pyx_v_self->_depth_first_stack; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = (__pyx_v_self->_last_stack_item < PyList_GET_SIZE(__pyx_t_1)); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":802 - * self._last_stack_item = self._last_stack_item + 1 - * if self._last_stack_item < PyList_GET_SIZE(self._depth_first_stack): - * Py_INCREF(node) # SetItem steals a ref # <<<<<<<<<<<<<< - * PyList_SetItem(self._depth_first_stack, self._last_stack_item, - * node) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":801 */ + __pyx_2 = (__pyx_v_self->_last_stack_item < PyList_GET_SIZE(__pyx_v_self->_depth_first_stack)); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":802 */ Py_INCREF(((PyObject *)__pyx_v_node)); - /* "bzrlib/_known_graph_pyx.pyx":803 - * if self._last_stack_item < PyList_GET_SIZE(self._depth_first_stack): - * Py_INCREF(node) # SetItem steals a ref - * PyList_SetItem(self._depth_first_stack, self._last_stack_item, # <<<<<<<<<<<<<< - * node) - * else: - */ - __pyx_t_1 = __pyx_v_self->_depth_first_stack; - __Pyx_INCREF(__pyx_t_1); - - /* "bzrlib/_known_graph_pyx.pyx":804 - * Py_INCREF(node) # SetItem steals a ref - * PyList_SetItem(self._depth_first_stack, self._last_stack_item, - * node) # <<<<<<<<<<<<<< - * else: - * PyList_Append(self._depth_first_stack, node) - */ - __pyx_t_5 = PyList_SetItem(__pyx_t_1, __pyx_v_self->_last_stack_item, ((PyObject *)__pyx_v_node)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L12; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":803 */ + __pyx_2 = PyList_SetItem(__pyx_v_self->_depth_first_stack,__pyx_v_self->_last_stack_item,((PyObject *)__pyx_v_node)); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;} + goto __pyx_L11; } /*else*/ { + __pyx_2 = PyList_Append(__pyx_v_self->_depth_first_stack,((PyObject *)__pyx_v_node)); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;} + } + __pyx_L11:; - /* "bzrlib/_known_graph_pyx.pyx":806 - * node) - * else: - * PyList_Append(self._depth_first_stack, node) # <<<<<<<<<<<<<< - * - * cdef _pop_node(self): - */ - __pyx_t_1 = __pyx_v_self->_depth_first_stack; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = PyList_Append(__pyx_t_1, ((PyObject *)__pyx_v_node)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L12:; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSorter._push_node"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_parent_node); - __Pyx_DECREF((PyObject *)__pyx_v_ms_node); - __Pyx_DECREF((PyObject *)__pyx_v_ms_parent_node); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_parent_node); + Py_DECREF(__pyx_v_ms_node); + Py_DECREF(__pyx_v_ms_parent_node); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_node); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":808 - * PyList_Append(self._depth_first_stack, node) - * - * cdef _pop_node(self): # <<<<<<<<<<<<<< - * cdef PyObject *temp - * cdef _MergeSortNode ms_node, ms_parent_node, ms_prev_node - */ - -static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__pop_node(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__pop_node(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_self) { PyObject *__pyx_v_temp; struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_ms_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_ms_parent_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_ms_prev_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_prev_node; - long __pyx_v_base_revno; + PyObject *__pyx_v_base_revno; PyObject *__pyx_v_branch_count; PyObject *__pyx_v_root_count; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_t_4; - long __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - int __pyx_t_7; - int __pyx_t_8; - __Pyx_RefNannySetupContext("_pop_node"); - __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_ms_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_ms_prev_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_prev_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_branch_count = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_root_count = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":813 - * cdef _KnownGraphNode node, parent_node, prev_node - * - * node = _get_list_node(self._depth_first_stack, self._last_stack_item) # <<<<<<<<<<<<<< - * ms_node = <_MergeSortNode>node.extra - * self._last_stack_item = self._last_stack_item - 1 - */ - __pyx_t_1 = __pyx_v_self->_depth_first_stack; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_t_1, __pyx_v_self->_last_stack_item)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":814 - * - * node = _get_list_node(self._depth_first_stack, self._last_stack_item) - * ms_node = <_MergeSortNode>node.extra # <<<<<<<<<<<<<< - * self._last_stack_item = self._last_stack_item - 1 - * if ms_node.left_parent is not None: - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_node->extra))); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_node)); + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + long __pyx_4; + Py_INCREF(__pyx_v_self); + __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_ms_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_ms_prev_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_prev_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_base_revno = Py_None; Py_INCREF(Py_None); + __pyx_v_branch_count = Py_None; Py_INCREF(Py_None); + __pyx_v_root_count = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":813 */ + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_self->_depth_first_stack,__pyx_v_self->_last_stack_item)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_1); + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":814 */ + Py_INCREF(__pyx_v_node->extra); + Py_DECREF(((PyObject *)__pyx_v_ms_node)); __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_node->extra); - /* "bzrlib/_known_graph_pyx.pyx":815 - * node = _get_list_node(self._depth_first_stack, self._last_stack_item) - * ms_node = <_MergeSortNode>node.extra - * self._last_stack_item = self._last_stack_item - 1 # <<<<<<<<<<<<<< - * if ms_node.left_parent is not None: - * # Assign the revision number from the left-hand parent - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":815 */ __pyx_v_self->_last_stack_item = (__pyx_v_self->_last_stack_item - 1); - /* "bzrlib/_known_graph_pyx.pyx":816 - * ms_node = <_MergeSortNode>node.extra - * self._last_stack_item = self._last_stack_item - 1 - * if ms_node.left_parent is not None: # <<<<<<<<<<<<<< - * # Assign the revision number from the left-hand parent - * ms_parent_node = <_MergeSortNode>ms_node.left_parent.extra - */ - __pyx_t_3 = (((PyObject *)__pyx_v_ms_node->left_parent) != Py_None); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":818 - * if ms_node.left_parent is not None: - * # Assign the revision number from the left-hand parent - * ms_parent_node = <_MergeSortNode>ms_node.left_parent.extra # <<<<<<<<<<<<<< - * if ms_node.is_first_child: - * # First child just increments the final digit - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_ms_node->left_parent->extra))); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_parent_node)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":816 */ + __pyx_2 = ((PyObject *)__pyx_v_ms_node->left_parent) != Py_None; + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":818 */ + Py_INCREF(__pyx_v_ms_node->left_parent->extra); + Py_DECREF(((PyObject *)__pyx_v_ms_parent_node)); __pyx_v_ms_parent_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_ms_node->left_parent->extra); - /* "bzrlib/_known_graph_pyx.pyx":819 - * # Assign the revision number from the left-hand parent - * ms_parent_node = <_MergeSortNode>ms_node.left_parent.extra - * if ms_node.is_first_child: # <<<<<<<<<<<<<< - * # First child just increments the final digit - * ms_node._revno_first = ms_parent_node._revno_first - */ - if (__pyx_v_ms_node->is_first_child) { - - /* "bzrlib/_known_graph_pyx.pyx":821 - * if ms_node.is_first_child: - * # First child just increments the final digit - * ms_node._revno_first = ms_parent_node._revno_first # <<<<<<<<<<<<<< - * ms_node._revno_second = ms_parent_node._revno_second - * ms_node._revno_last = ms_parent_node._revno_last + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":819 */ + __pyx_2 = __pyx_v_ms_node->is_first_child; + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":821 */ __pyx_v_ms_node->_revno_first = __pyx_v_ms_parent_node->_revno_first; - /* "bzrlib/_known_graph_pyx.pyx":822 - * # First child just increments the final digit - * ms_node._revno_first = ms_parent_node._revno_first - * ms_node._revno_second = ms_parent_node._revno_second # <<<<<<<<<<<<<< - * ms_node._revno_last = ms_parent_node._revno_last + 1 - * else: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":822 */ __pyx_v_ms_node->_revno_second = __pyx_v_ms_parent_node->_revno_second; - /* "bzrlib/_known_graph_pyx.pyx":823 - * ms_node._revno_first = ms_parent_node._revno_first - * ms_node._revno_second = ms_parent_node._revno_second - * ms_node._revno_last = ms_parent_node._revno_last + 1 # <<<<<<<<<<<<<< - * else: - * # Not the first child, make a new branch - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":823 */ __pyx_v_ms_node->_revno_last = (__pyx_v_ms_parent_node->_revno_last + 1); - goto __pyx_L4; + goto __pyx_L3; } /*else*/ { - /* "bzrlib/_known_graph_pyx.pyx":827 - * # Not the first child, make a new branch - * # (mainline_revno, branch_count, 1) - * if ms_parent_node._revno_first == -1: # <<<<<<<<<<<<<< - * # Mainline ancestor, the increment is on the last digit - * base_revno = ms_parent_node._revno_last - */ - __pyx_t_3 = (__pyx_v_ms_parent_node->_revno_first == -1); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":829 - * if ms_parent_node._revno_first == -1: - * # Mainline ancestor, the increment is on the last digit - * base_revno = ms_parent_node._revno_last # <<<<<<<<<<<<<< - * else: - * base_revno = ms_parent_node._revno_first - */ - __pyx_v_base_revno = __pyx_v_ms_parent_node->_revno_last; - goto __pyx_L5; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":827 */ + __pyx_2 = (__pyx_v_ms_parent_node->_revno_first == (-1)); + if (__pyx_2) { + __pyx_1 = PyInt_FromLong(__pyx_v_ms_parent_node->_revno_last); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;} + Py_DECREF(__pyx_v_base_revno); + __pyx_v_base_revno = __pyx_1; + __pyx_1 = 0; + goto __pyx_L4; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":831 - * base_revno = ms_parent_node._revno_last - * else: - * base_revno = ms_parent_node._revno_first # <<<<<<<<<<<<<< - * temp = PyDict_GetItem(self._revno_to_branch_count, - * base_revno) - */ - __pyx_v_base_revno = __pyx_v_ms_parent_node->_revno_first; + __pyx_1 = PyInt_FromLong(__pyx_v_ms_parent_node->_revno_first); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;} + Py_DECREF(__pyx_v_base_revno); + __pyx_v_base_revno = __pyx_1; + __pyx_1 = 0; } - __pyx_L5:; + __pyx_L4:; - /* "bzrlib/_known_graph_pyx.pyx":832 - * else: - * base_revno = ms_parent_node._revno_first - * temp = PyDict_GetItem(self._revno_to_branch_count, # <<<<<<<<<<<<<< - * base_revno) - * if temp == NULL: - */ - __pyx_t_2 = __pyx_v_self->_revno_to_branch_count; - __Pyx_INCREF(__pyx_t_2); - - /* "bzrlib/_known_graph_pyx.pyx":833 - * base_revno = ms_parent_node._revno_first - * temp = PyDict_GetItem(self._revno_to_branch_count, - * base_revno) # <<<<<<<<<<<<<< - * if temp == NULL: - * branch_count = 1 - */ - __pyx_t_1 = PyInt_FromLong(__pyx_v_base_revno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_temp = PyDict_GetItem(__pyx_t_2, __pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":834 - * temp = PyDict_GetItem(self._revno_to_branch_count, - * base_revno) - * if temp == NULL: # <<<<<<<<<<<<<< - * branch_count = 1 - * else: - */ - __pyx_t_3 = (__pyx_v_temp == NULL); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":835 - * base_revno) - * if temp == NULL: - * branch_count = 1 # <<<<<<<<<<<<<< - * else: - * branch_count = (temp) + 1 - */ - __Pyx_INCREF(__pyx_int_1); - __Pyx_DECREF(__pyx_v_branch_count); - __pyx_v_branch_count = __pyx_int_1; - goto __pyx_L6; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":832 */ + __pyx_v_temp = PyDict_GetItem(__pyx_v_self->_revno_to_branch_count,__pyx_v_base_revno); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":834 */ + __pyx_2 = (__pyx_v_temp == NULL); + if (__pyx_2) { + __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} + Py_DECREF(__pyx_v_branch_count); + __pyx_v_branch_count = __pyx_1; + __pyx_1 = 0; + goto __pyx_L5; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":837 - * branch_count = 1 - * else: - * branch_count = (temp) + 1 # <<<<<<<<<<<<<< - * PyDict_SetItem(self._revno_to_branch_count, base_revno, - * branch_count) - */ - __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_temp), __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_v_branch_count); - __pyx_v_branch_count = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(((PyObject *)__pyx_v_temp), __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_v_branch_count); + __pyx_v_branch_count = __pyx_3; + __pyx_3 = 0; } - __pyx_L6:; + __pyx_L5:; - /* "bzrlib/_known_graph_pyx.pyx":838 - * else: - * branch_count = (temp) + 1 - * PyDict_SetItem(self._revno_to_branch_count, base_revno, # <<<<<<<<<<<<<< - * branch_count) - * ms_node._revno_first = base_revno - */ - __pyx_t_1 = __pyx_v_self->_revno_to_branch_count; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = PyInt_FromLong(__pyx_v_base_revno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - - /* "bzrlib/_known_graph_pyx.pyx":839 - * branch_count = (temp) + 1 - * PyDict_SetItem(self._revno_to_branch_count, base_revno, - * branch_count) # <<<<<<<<<<<<<< - * ms_node._revno_first = base_revno - * ms_node._revno_second = branch_count - */ - __pyx_t_4 = PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_v_branch_count); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":840 - * PyDict_SetItem(self._revno_to_branch_count, base_revno, - * branch_count) - * ms_node._revno_first = base_revno # <<<<<<<<<<<<<< - * ms_node._revno_second = branch_count - * ms_node._revno_last = 1 - */ - __pyx_v_ms_node->_revno_first = __pyx_v_base_revno; - - /* "bzrlib/_known_graph_pyx.pyx":841 - * branch_count) - * ms_node._revno_first = base_revno - * ms_node._revno_second = branch_count # <<<<<<<<<<<<<< - * ms_node._revno_last = 1 - * else: - */ - __pyx_t_5 = __Pyx_PyInt_AsLong(__pyx_v_branch_count); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ms_node->_revno_second = __pyx_t_5; - - /* "bzrlib/_known_graph_pyx.pyx":842 - * ms_node._revno_first = base_revno - * ms_node._revno_second = branch_count - * ms_node._revno_last = 1 # <<<<<<<<<<<<<< - * else: - * temp = PyDict_GetItem(self._revno_to_branch_count, 0) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":838 */ + __pyx_2 = PyDict_SetItem(__pyx_v_self->_revno_to_branch_count,__pyx_v_base_revno,__pyx_v_branch_count); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":840 */ + __pyx_4 = PyInt_AsLong(__pyx_v_base_revno); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; goto __pyx_L1;} + __pyx_v_ms_node->_revno_first = __pyx_4; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":841 */ + __pyx_4 = PyInt_AsLong(__pyx_v_branch_count); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; goto __pyx_L1;} + __pyx_v_ms_node->_revno_second = __pyx_4; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":842 */ __pyx_v_ms_node->_revno_last = 1; } - __pyx_L4:; - goto __pyx_L3; + __pyx_L3:; + goto __pyx_L2; } /*else*/ { - /* "bzrlib/_known_graph_pyx.pyx":844 - * ms_node._revno_last = 1 - * else: - * temp = PyDict_GetItem(self._revno_to_branch_count, 0) # <<<<<<<<<<<<<< - * if temp == NULL: - * # The first root node doesn't have a 3-digit revno - */ - __pyx_t_2 = __pyx_v_self->_revno_to_branch_count; - __Pyx_INCREF(__pyx_t_2); - __pyx_v_temp = PyDict_GetItem(__pyx_t_2, __pyx_int_0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":845 - * else: - * temp = PyDict_GetItem(self._revno_to_branch_count, 0) - * if temp == NULL: # <<<<<<<<<<<<<< - * # The first root node doesn't have a 3-digit revno - * root_count = 0 - */ - __pyx_t_3 = (__pyx_v_temp == NULL); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":847 - * if temp == NULL: - * # The first root node doesn't have a 3-digit revno - * root_count = 0 # <<<<<<<<<<<<<< - * ms_node._revno_first = -1 - * ms_node._revno_second = -1 - */ - __Pyx_INCREF(__pyx_int_0); - __Pyx_DECREF(__pyx_v_root_count); - __pyx_v_root_count = __pyx_int_0; - - /* "bzrlib/_known_graph_pyx.pyx":848 - * # The first root node doesn't have a 3-digit revno - * root_count = 0 - * ms_node._revno_first = -1 # <<<<<<<<<<<<<< - * ms_node._revno_second = -1 - * ms_node._revno_last = 1 - */ - __pyx_v_ms_node->_revno_first = -1; - - /* "bzrlib/_known_graph_pyx.pyx":849 - * root_count = 0 - * ms_node._revno_first = -1 - * ms_node._revno_second = -1 # <<<<<<<<<<<<<< - * ms_node._revno_last = 1 - * else: - */ - __pyx_v_ms_node->_revno_second = -1; - - /* "bzrlib/_known_graph_pyx.pyx":850 - * ms_node._revno_first = -1 - * ms_node._revno_second = -1 - * ms_node._revno_last = 1 # <<<<<<<<<<<<<< - * else: - * root_count = (temp) + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":844 */ + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} + __pyx_v_temp = PyDict_GetItem(__pyx_v_self->_revno_to_branch_count,__pyx_1); + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":845 */ + __pyx_2 = (__pyx_v_temp == NULL); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":847 */ + __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} + Py_DECREF(__pyx_v_root_count); + __pyx_v_root_count = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":848 */ + __pyx_v_ms_node->_revno_first = (-1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":849 */ + __pyx_v_ms_node->_revno_second = (-1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":850 */ __pyx_v_ms_node->_revno_last = 1; - goto __pyx_L7; + goto __pyx_L6; } /*else*/ { - /* "bzrlib/_known_graph_pyx.pyx":852 - * ms_node._revno_last = 1 - * else: - * root_count = (temp) + 1 # <<<<<<<<<<<<<< - * ms_node._revno_first = 0 - * ms_node._revno_second = root_count - */ - __pyx_t_2 = PyNumber_Add(((PyObject *)__pyx_v_temp), __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_root_count); - __pyx_v_root_count = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":853 - * else: - * root_count = (temp) + 1 - * ms_node._revno_first = 0 # <<<<<<<<<<<<<< - * ms_node._revno_second = root_count - * ms_node._revno_last = 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":852 */ + __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; goto __pyx_L1;} + __pyx_3 = PyNumber_Add(((PyObject *)__pyx_v_temp), __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_v_root_count); + __pyx_v_root_count = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":853 */ __pyx_v_ms_node->_revno_first = 0; - /* "bzrlib/_known_graph_pyx.pyx":854 - * root_count = (temp) + 1 - * ms_node._revno_first = 0 - * ms_node._revno_second = root_count # <<<<<<<<<<<<<< - * ms_node._revno_last = 1 - * PyDict_SetItem(self._revno_to_branch_count, 0, root_count) - */ - __pyx_t_5 = __Pyx_PyInt_AsLong(__pyx_v_root_count); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_ms_node->_revno_second = __pyx_t_5; - - /* "bzrlib/_known_graph_pyx.pyx":855 - * ms_node._revno_first = 0 - * ms_node._revno_second = root_count - * ms_node._revno_last = 1 # <<<<<<<<<<<<<< - * PyDict_SetItem(self._revno_to_branch_count, 0, root_count) - * ms_node.completed = 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":854 */ + __pyx_4 = PyInt_AsLong(__pyx_v_root_count); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; goto __pyx_L1;} + __pyx_v_ms_node->_revno_second = __pyx_4; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":855 */ __pyx_v_ms_node->_revno_last = 1; } - __pyx_L7:; + __pyx_L6:; - /* "bzrlib/_known_graph_pyx.pyx":856 - * ms_node._revno_second = root_count - * ms_node._revno_last = 1 - * PyDict_SetItem(self._revno_to_branch_count, 0, root_count) # <<<<<<<<<<<<<< - * ms_node.completed = 1 - * if PyList_GET_SIZE(self._scheduled_nodes) == 0: - */ - __pyx_t_2 = __pyx_v_self->_revno_to_branch_count; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_4 = PyDict_SetItem(__pyx_t_2, __pyx_int_0, __pyx_v_root_count); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":856 */ + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; goto __pyx_L1;} + __pyx_2 = PyDict_SetItem(__pyx_v_self->_revno_to_branch_count,__pyx_1,__pyx_v_root_count); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_known_graph_pyx.pyx":857 - * ms_node._revno_last = 1 - * PyDict_SetItem(self._revno_to_branch_count, 0, root_count) - * ms_node.completed = 1 # <<<<<<<<<<<<<< - * if PyList_GET_SIZE(self._scheduled_nodes) == 0: - * # The first scheduled node is always the end of merge - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":857 */ __pyx_v_ms_node->completed = 1; - /* "bzrlib/_known_graph_pyx.pyx":858 - * PyDict_SetItem(self._revno_to_branch_count, 0, root_count) - * ms_node.completed = 1 - * if PyList_GET_SIZE(self._scheduled_nodes) == 0: # <<<<<<<<<<<<<< - * # The first scheduled node is always the end of merge - * ms_node.end_of_merge = True - */ - __pyx_t_2 = __pyx_v_self->_scheduled_nodes; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = (PyList_GET_SIZE(__pyx_t_2) == 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":860 - * if PyList_GET_SIZE(self._scheduled_nodes) == 0: - * # The first scheduled node is always the end of merge - * ms_node.end_of_merge = True # <<<<<<<<<<<<<< - * else: - * prev_node = _get_list_node(self._scheduled_nodes, - */ - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_GOTREF(__pyx_v_ms_node->end_of_merge); - __Pyx_DECREF(__pyx_v_ms_node->end_of_merge); - __pyx_v_ms_node->end_of_merge = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L8; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":858 */ + __pyx_2 = (PyList_GET_SIZE(__pyx_v_self->_scheduled_nodes) == 0); + if (__pyx_2) { + Py_INCREF(Py_True); + Py_DECREF(__pyx_v_ms_node->end_of_merge); + __pyx_v_ms_node->end_of_merge = Py_True; + goto __pyx_L7; } /*else*/ { - /* "bzrlib/_known_graph_pyx.pyx":862 - * ms_node.end_of_merge = True - * else: - * prev_node = _get_list_node(self._scheduled_nodes, # <<<<<<<<<<<<<< - * PyList_GET_SIZE(self._scheduled_nodes) - 1) - * ms_prev_node = <_MergeSortNode>prev_node.extra - */ - __pyx_t_2 = __pyx_v_self->_scheduled_nodes; - __Pyx_INCREF(__pyx_t_2); - - /* "bzrlib/_known_graph_pyx.pyx":863 - * else: - * prev_node = _get_list_node(self._scheduled_nodes, - * PyList_GET_SIZE(self._scheduled_nodes) - 1) # <<<<<<<<<<<<<< - * ms_prev_node = <_MergeSortNode>prev_node.extra - * if ms_prev_node.merge_depth < ms_node.merge_depth: - */ - __pyx_t_1 = __pyx_v_self->_scheduled_nodes; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_6 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_t_2, (PyList_GET_SIZE(__pyx_t_1) - 1))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_prev_node)); - __pyx_v_prev_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_6); - __pyx_t_6 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":864 - * prev_node = _get_list_node(self._scheduled_nodes, - * PyList_GET_SIZE(self._scheduled_nodes) - 1) - * ms_prev_node = <_MergeSortNode>prev_node.extra # <<<<<<<<<<<<<< - * if ms_prev_node.merge_depth < ms_node.merge_depth: - * # The previously pushed node is to our left, so this is the end - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_prev_node->extra))); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_prev_node)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":862 */ + __pyx_3 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_self->_scheduled_nodes,(PyList_GET_SIZE(__pyx_v_self->_scheduled_nodes) - 1))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_prev_node)); + __pyx_v_prev_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":864 */ + Py_INCREF(__pyx_v_prev_node->extra); + Py_DECREF(((PyObject *)__pyx_v_ms_prev_node)); __pyx_v_ms_prev_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_prev_node->extra); - /* "bzrlib/_known_graph_pyx.pyx":865 - * PyList_GET_SIZE(self._scheduled_nodes) - 1) - * ms_prev_node = <_MergeSortNode>prev_node.extra - * if ms_prev_node.merge_depth < ms_node.merge_depth: # <<<<<<<<<<<<<< - * # The previously pushed node is to our left, so this is the end - * # of this right-hand chain - */ - __pyx_t_3 = (__pyx_v_ms_prev_node->merge_depth < __pyx_v_ms_node->merge_depth); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":868 - * # The previously pushed node is to our left, so this is the end - * # of this right-hand chain - * ms_node.end_of_merge = True # <<<<<<<<<<<<<< - * elif (ms_prev_node.merge_depth == ms_node.merge_depth - * and prev_node not in node.parents): - */ - __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 868; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_v_ms_node->end_of_merge); - __Pyx_DECREF(__pyx_v_ms_node->end_of_merge); - __pyx_v_ms_node->end_of_merge = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":865 */ + __pyx_2 = (__pyx_v_ms_prev_node->merge_depth < __pyx_v_ms_node->merge_depth); + if (__pyx_2) { + Py_INCREF(Py_True); + Py_DECREF(__pyx_v_ms_node->end_of_merge); + __pyx_v_ms_node->end_of_merge = Py_True; + goto __pyx_L8; } - - /* "bzrlib/_known_graph_pyx.pyx":869 - * # of this right-hand chain - * ms_node.end_of_merge = True - * elif (ms_prev_node.merge_depth == ms_node.merge_depth # <<<<<<<<<<<<<< - * and prev_node not in node.parents): - * # The next node is not a direct parent of this node - */ - __pyx_t_3 = (__pyx_v_ms_prev_node->merge_depth == __pyx_v_ms_node->merge_depth); - if (__pyx_t_3) { - - /* "bzrlib/_known_graph_pyx.pyx":870 - * ms_node.end_of_merge = True - * elif (ms_prev_node.merge_depth == ms_node.merge_depth - * and prev_node not in node.parents): # <<<<<<<<<<<<<< - * # The next node is not a direct parent of this node - * ms_node.end_of_merge = True - */ - __pyx_t_7 = (__Pyx_NegateNonNeg(PySequence_Contains(__pyx_v_node->parents, ((PyObject *)__pyx_v_prev_node)))); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_8 = __pyx_t_7; - } else { - __pyx_t_8 = __pyx_t_3; - } - if (__pyx_t_8) { - - /* "bzrlib/_known_graph_pyx.pyx":872 - * and prev_node not in node.parents): - * # The next node is not a direct parent of this node - * ms_node.end_of_merge = True # <<<<<<<<<<<<<< - * else: - * ms_node.end_of_merge = False - */ - __pyx_t_6 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_v_ms_node->end_of_merge); - __Pyx_DECREF(__pyx_v_ms_node->end_of_merge); - __pyx_v_ms_node->end_of_merge = __pyx_t_6; - __pyx_t_6 = 0; - goto __pyx_L9; + __pyx_2 = (__pyx_v_ms_prev_node->merge_depth == __pyx_v_ms_node->merge_depth); + if (__pyx_2) { + __pyx_2 = PySequence_Contains(__pyx_v_node->parents, ((PyObject *)__pyx_v_prev_node)); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; goto __pyx_L1;} + __pyx_2 = !__pyx_2; + } + if (__pyx_2) { + Py_INCREF(Py_True); + Py_DECREF(__pyx_v_ms_node->end_of_merge); + __pyx_v_ms_node->end_of_merge = Py_True; + goto __pyx_L8; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":874 - * ms_node.end_of_merge = True - * else: - * ms_node.end_of_merge = False # <<<<<<<<<<<<<< - * PyList_Append(self._scheduled_nodes, node) - * - */ - __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_6); - __Pyx_GOTREF(__pyx_v_ms_node->end_of_merge); - __Pyx_DECREF(__pyx_v_ms_node->end_of_merge); - __pyx_v_ms_node->end_of_merge = __pyx_t_6; - __pyx_t_6 = 0; + Py_INCREF(Py_False); + Py_DECREF(__pyx_v_ms_node->end_of_merge); + __pyx_v_ms_node->end_of_merge = Py_False; } - __pyx_L9:; + __pyx_L8:; } - __pyx_L8:; + __pyx_L7:; - /* "bzrlib/_known_graph_pyx.pyx":875 - * else: - * ms_node.end_of_merge = False - * PyList_Append(self._scheduled_nodes, node) # <<<<<<<<<<<<<< - * - * cdef _schedule_stack(self): - */ - __pyx_t_6 = __pyx_v_self->_scheduled_nodes; - __Pyx_INCREF(__pyx_t_6); - __pyx_t_4 = PyList_Append(__pyx_t_6, ((PyObject *)__pyx_v_node)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":875 */ + __pyx_2 = PyList_Append(__pyx_v_self->_scheduled_nodes,((PyObject *)__pyx_v_node)); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; goto __pyx_L1;} + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSorter._pop_node"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_ms_node); - __Pyx_DECREF((PyObject *)__pyx_v_ms_parent_node); - __Pyx_DECREF((PyObject *)__pyx_v_ms_prev_node); - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF((PyObject *)__pyx_v_prev_node); - __Pyx_DECREF(__pyx_v_branch_count); - __Pyx_DECREF(__pyx_v_root_count); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_ms_node); + Py_DECREF(__pyx_v_ms_parent_node); + Py_DECREF(__pyx_v_ms_prev_node); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_prev_node); + Py_DECREF(__pyx_v_base_revno); + Py_DECREF(__pyx_v_branch_count); + Py_DECREF(__pyx_v_root_count); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":877 - * PyList_Append(self._scheduled_nodes, node) - * - * cdef _schedule_stack(self): # <<<<<<<<<<<<<< - * cdef _KnownGraphNode last_node, next_node - * cdef _MergeSortNode ms_node, ms_last_node, ms_next_node - */ - -static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__schedule_stack(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__schedule_stack(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_self) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_last_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_next_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_ms_last_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_ms_next_node; long __pyx_v_next_merge_depth; PyObject *__pyx_v_ordered; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - __Pyx_RefNannySetupContext("_schedule_stack"); - __pyx_v_last_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_next_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_ms_last_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_ms_next_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_ordered = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":881 - * cdef _MergeSortNode ms_node, ms_last_node, ms_next_node - * cdef long next_merge_depth - * ordered = [] # <<<<<<<<<<<<<< - * while self._last_stack_item >= 0: - * # Peek at the last item on the stack - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_ordered)); - __pyx_v_ordered = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":882 - * cdef long next_merge_depth - * ordered = [] - * while self._last_stack_item >= 0: # <<<<<<<<<<<<<< - * # Peek at the last item on the stack - * last_node = _get_list_node(self._depth_first_stack, - */ + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_last_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_next_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_ms_last_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_ms_next_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_ordered = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":881 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + Py_DECREF(__pyx_v_ordered); + __pyx_v_ordered = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":882 */ while (1) { - __pyx_t_2 = (__pyx_v_self->_last_stack_item >= 0); - if (!__pyx_t_2) break; + __pyx_2 = (__pyx_v_self->_last_stack_item >= 0); + if (!__pyx_2) break; - /* "bzrlib/_known_graph_pyx.pyx":884 - * while self._last_stack_item >= 0: - * # Peek at the last item on the stack - * last_node = _get_list_node(self._depth_first_stack, # <<<<<<<<<<<<<< - * self._last_stack_item) - * if last_node.gdfo == -1: - */ - __pyx_t_1 = __pyx_v_self->_depth_first_stack; - __Pyx_INCREF(__pyx_t_1); - - /* "bzrlib/_known_graph_pyx.pyx":885 - * # Peek at the last item on the stack - * last_node = _get_list_node(self._depth_first_stack, - * self._last_stack_item) # <<<<<<<<<<<<<< - * if last_node.gdfo == -1: - * # if _find_gdfo skipped a node, that means there is a graph - */ - __pyx_t_3 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_t_1, __pyx_v_self->_last_stack_item)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_last_node)); - __pyx_v_last_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":886 - * last_node = _get_list_node(self._depth_first_stack, - * self._last_stack_item) - * if last_node.gdfo == -1: # <<<<<<<<<<<<<< - * # if _find_gdfo skipped a node, that means there is a graph - * # cycle, error out now - */ - __pyx_t_2 = (__pyx_v_last_node->gdfo == -1); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":889 - * # if _find_gdfo skipped a node, that means there is a graph - * # cycle, error out now - * raise errors.GraphCycleError(self.graph._nodes) # <<<<<<<<<<<<<< - * ms_last_node = <_MergeSortNode>last_node.extra - * if not ms_last_node.has_pending_parents(): - */ - __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__GraphCycleError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_INCREF(__pyx_v_self->graph->_nodes); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->graph->_nodes); - __Pyx_GIVEREF(__pyx_v_self->graph->_nodes); - __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":884 */ + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_self->_depth_first_stack,__pyx_v_self->_last_stack_item)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_last_node)); + __pyx_v_last_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_1); + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":886 */ + __pyx_2 = (__pyx_v_last_node->gdfo == (-1)); + if (__pyx_2) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_errors); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_GraphCycleError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; goto __pyx_L1;} + Py_INCREF(__pyx_v_self->graph->_nodes); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self->graph->_nodes); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; - /* "bzrlib/_known_graph_pyx.pyx":890 - * # cycle, error out now - * raise errors.GraphCycleError(self.graph._nodes) - * ms_last_node = <_MergeSortNode>last_node.extra # <<<<<<<<<<<<<< - * if not ms_last_node.has_pending_parents(): - * # Processed all parents, pop this node - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_last_node->extra))); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_last_node)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":890 */ + Py_INCREF(__pyx_v_last_node->extra); + Py_DECREF(((PyObject *)__pyx_v_ms_last_node)); __pyx_v_ms_last_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_last_node->extra); - /* "bzrlib/_known_graph_pyx.pyx":891 - * raise errors.GraphCycleError(self.graph._nodes) - * ms_last_node = <_MergeSortNode>last_node.extra - * if not ms_last_node.has_pending_parents(): # <<<<<<<<<<<<<< - * # Processed all parents, pop this node - * self._pop_node() - */ - __pyx_t_2 = (!((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_ms_last_node->__pyx_vtab)->has_pending_parents(__pyx_v_ms_last_node)); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":893 - * if not ms_last_node.has_pending_parents(): - * # Processed all parents, pop this node - * self._pop_node() # <<<<<<<<<<<<<< - * continue - * while ms_last_node.has_pending_parents(): - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_pop_node(__pyx_v_self); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":894 - * # Processed all parents, pop this node - * self._pop_node() - * continue # <<<<<<<<<<<<<< - * while ms_last_node.has_pending_parents(): - * if ms_last_node.left_pending_parent is not None: - */ - goto __pyx_L3_continue; - goto __pyx_L6; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":891 */ + __pyx_2 = (!((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_ms_last_node->__pyx_vtab)->has_pending_parents(__pyx_v_ms_last_node)); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":893 */ + __pyx_3 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_pop_node(__pyx_v_self); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":894 */ + goto __pyx_L2; + goto __pyx_L5; } - __pyx_L6:; + __pyx_L5:; - /* "bzrlib/_known_graph_pyx.pyx":895 - * self._pop_node() - * continue - * while ms_last_node.has_pending_parents(): # <<<<<<<<<<<<<< - * if ms_last_node.left_pending_parent is not None: - * # recurse depth first into the primary parent - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":895 */ while (1) { - __pyx_t_5 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_ms_last_node->__pyx_vtab)->has_pending_parents(__pyx_v_ms_last_node); - if (!__pyx_t_5) break; + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_ms_last_node->__pyx_vtab)->has_pending_parents(__pyx_v_ms_last_node); + if (!__pyx_2) break; - /* "bzrlib/_known_graph_pyx.pyx":896 - * continue - * while ms_last_node.has_pending_parents(): - * if ms_last_node.left_pending_parent is not None: # <<<<<<<<<<<<<< - * # recurse depth first into the primary parent - * next_node = ms_last_node.left_pending_parent - */ - __pyx_t_2 = (((PyObject *)__pyx_v_ms_last_node->left_pending_parent) != Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":898 - * if ms_last_node.left_pending_parent is not None: - * # recurse depth first into the primary parent - * next_node = ms_last_node.left_pending_parent # <<<<<<<<<<<<<< - * ms_last_node.left_pending_parent = None - * else: - */ - __Pyx_INCREF(((PyObject *)__pyx_v_ms_last_node->left_pending_parent)); - __Pyx_DECREF(((PyObject *)__pyx_v_next_node)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":896 */ + __pyx_2 = ((PyObject *)__pyx_v_ms_last_node->left_pending_parent) != Py_None; + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":898 */ + Py_INCREF(((PyObject *)__pyx_v_ms_last_node->left_pending_parent)); + Py_DECREF(((PyObject *)__pyx_v_next_node)); __pyx_v_next_node = __pyx_v_ms_last_node->left_pending_parent; - /* "bzrlib/_known_graph_pyx.pyx":899 - * # recurse depth first into the primary parent - * next_node = ms_last_node.left_pending_parent - * ms_last_node.left_pending_parent = None # <<<<<<<<<<<<<< - * else: - * # place any merges in right-to-left order for scheduling - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_ms_last_node->left_pending_parent); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_last_node->left_pending_parent)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":899 */ + Py_INCREF(Py_None); + Py_DECREF(((PyObject *)__pyx_v_ms_last_node->left_pending_parent)); __pyx_v_ms_last_node->left_pending_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); - goto __pyx_L9; + goto __pyx_L8; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":908 - * # left most, which will display nicely (you get - * # smaller trees at the top of the combined merge). - * next_node = ms_last_node.pending_parents.pop() # <<<<<<<<<<<<<< - * ms_next_node = self._get_ms_node(next_node) - * if ms_next_node.completed: - */ - __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_v_ms_last_node->pending_parents); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_v_next_node)); - __pyx_v_next_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_v_ms_last_node->pending_parents, __pyx_n_pop); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_next_node)); + __pyx_v_next_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_4); + __pyx_4 = 0; } - __pyx_L9:; + __pyx_L8:; - /* "bzrlib/_known_graph_pyx.pyx":909 - * # smaller trees at the top of the combined merge). - * next_node = ms_last_node.pending_parents.pop() - * ms_next_node = self._get_ms_node(next_node) # <<<<<<<<<<<<<< - * if ms_next_node.completed: - * # this parent was completed by a child on the - */ - __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_get_ms_node(__pyx_v_self, __pyx_v_next_node)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_next_node)); - __pyx_v_ms_next_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_t_4); - __pyx_t_4 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":910 - * next_node = ms_last_node.pending_parents.pop() - * ms_next_node = self._get_ms_node(next_node) - * if ms_next_node.completed: # <<<<<<<<<<<<<< - * # this parent was completed by a child on the - * # call stack. skip it. - */ - if (__pyx_v_ms_next_node->completed) { - - /* "bzrlib/_known_graph_pyx.pyx":913 - * # this parent was completed by a child on the - * # call stack. skip it. - * continue # <<<<<<<<<<<<<< - * # otherwise transfer it from the source graph into the - * # top of the current depth first search stack. - */ - goto __pyx_L7_continue; - goto __pyx_L10; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":909 */ + __pyx_3 = ((PyObject *)((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_get_ms_node(__pyx_v_self,__pyx_v_next_node)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_ms_next_node)); + __pyx_v_ms_next_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_3); + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":910 */ + __pyx_2 = __pyx_v_ms_next_node->completed; + if (__pyx_2) { + goto __pyx_L6; + goto __pyx_L9; } - __pyx_L10:; + __pyx_L9:; - /* "bzrlib/_known_graph_pyx.pyx":917 - * # top of the current depth first search stack. - * - * if next_node is ms_last_node.left_parent: # <<<<<<<<<<<<<< - * next_merge_depth = ms_last_node.merge_depth - * else: - */ - __pyx_t_2 = (__pyx_v_next_node == __pyx_v_ms_last_node->left_parent); - if (__pyx_t_2) { - - /* "bzrlib/_known_graph_pyx.pyx":918 - * - * if next_node is ms_last_node.left_parent: - * next_merge_depth = ms_last_node.merge_depth # <<<<<<<<<<<<<< - * else: - * next_merge_depth = ms_last_node.merge_depth + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":917 */ + __pyx_2 = __pyx_v_next_node == __pyx_v_ms_last_node->left_parent; + if (__pyx_2) { __pyx_v_next_merge_depth = __pyx_v_ms_last_node->merge_depth; - goto __pyx_L11; + goto __pyx_L10; } /*else*/ { - - /* "bzrlib/_known_graph_pyx.pyx":920 - * next_merge_depth = ms_last_node.merge_depth - * else: - * next_merge_depth = ms_last_node.merge_depth + 1 # <<<<<<<<<<<<<< - * self._push_node(next_node, next_merge_depth) - * # and do not continue processing parents until this 'call' - */ __pyx_v_next_merge_depth = (__pyx_v_ms_last_node->merge_depth + 1); } - __pyx_L11:; + __pyx_L10:; - /* "bzrlib/_known_graph_pyx.pyx":921 - * else: - * next_merge_depth = ms_last_node.merge_depth + 1 - * self._push_node(next_node, next_merge_depth) # <<<<<<<<<<<<<< - * # and do not continue processing parents until this 'call' - * # has recursed. - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_push_node(__pyx_v_self, __pyx_v_next_node, __pyx_v_next_merge_depth); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":924 - * # and do not continue processing parents until this 'call' - * # has recursed. - * break # <<<<<<<<<<<<<< - * - * cdef topo_order(self): - */ - goto __pyx_L8_break; - __pyx_L7_continue:; - } - __pyx_L8_break:; - __pyx_L3_continue:; - } - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":921 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_push_node(__pyx_v_self,__pyx_v_next_node,__pyx_v_next_merge_depth); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":924 */ + goto __pyx_L7; + __pyx_L6:; + } + __pyx_L7:; + __pyx_L2:; + } + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSorter._schedule_stack"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_last_node); - __Pyx_DECREF((PyObject *)__pyx_v_next_node); - __Pyx_DECREF((PyObject *)__pyx_v_ms_last_node); - __Pyx_DECREF((PyObject *)__pyx_v_ms_next_node); - __Pyx_DECREF(__pyx_v_ordered); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_last_node); + Py_DECREF(__pyx_v_next_node); + Py_DECREF(__pyx_v_ms_last_node); + Py_DECREF(__pyx_v_ms_next_node); + Py_DECREF(__pyx_v_ordered); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_known_graph_pyx.pyx":926 - * break - * - * cdef topo_order(self): # <<<<<<<<<<<<<< - * cdef _MergeSortNode ms_node - * cdef _KnownGraphNode node - */ - -static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter_topo_order(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter_topo_order(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *__pyx_v_self) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *__pyx_v_ms_node; struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *__pyx_v_node; Py_ssize_t __pyx_v_pos; PyObject *__pyx_v_ordered; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - __Pyx_RefNannySetupContext("topo_order"); - __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_ordered = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_known_graph_pyx.pyx":936 - * # We might consider moving the attributes into the base - * # KnownGraph object. - * self._schedule_stack() # <<<<<<<<<<<<<< - * - * # We've set up the basic schedule, now we can continue processing the - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_schedule_stack(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":946 - * # 7ms is computing the return tuple - * # 4ms is PyList_Append() - * ordered = [] # <<<<<<<<<<<<<< - * # output the result in reverse order, and separate the generated info - * for pos from PyList_GET_SIZE(self._scheduled_nodes) > pos >= 0: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_ordered)); - __pyx_v_ordered = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":948 - * ordered = [] - * # output the result in reverse order, and separate the generated info - * for pos from PyList_GET_SIZE(self._scheduled_nodes) > pos >= 0: # <<<<<<<<<<<<<< - * node = _get_list_node(self._scheduled_nodes, pos) - * ms_node = <_MergeSortNode>node.extra - */ - __pyx_t_1 = __pyx_v_self->_scheduled_nodes; - __Pyx_INCREF(__pyx_t_1); - for (__pyx_v_pos = PyList_GET_SIZE(__pyx_t_1)-1; __pyx_v_pos >= 0; __pyx_v_pos--) { - - /* "bzrlib/_known_graph_pyx.pyx":949 - * # output the result in reverse order, and separate the generated info - * for pos from PyList_GET_SIZE(self._scheduled_nodes) > pos >= 0: - * node = _get_list_node(self._scheduled_nodes, pos) # <<<<<<<<<<<<<< - * ms_node = <_MergeSortNode>node.extra - * PyList_Append(ordered, ms_node) - */ - __pyx_t_2 = __pyx_v_self->_scheduled_nodes; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_t_2, __pyx_v_pos)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(((PyObject *)__pyx_v_node)); - __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":950 - * for pos from PyList_GET_SIZE(self._scheduled_nodes) > pos >= 0: - * node = _get_list_node(self._scheduled_nodes, pos) - * ms_node = <_MergeSortNode>node.extra # <<<<<<<<<<<<<< - * PyList_Append(ordered, ms_node) - * node.extra = None - */ - __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_node->extra))); - __Pyx_DECREF(((PyObject *)__pyx_v_ms_node)); + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + Py_INCREF(__pyx_v_self); + __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); + __pyx_v_ordered = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":936 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter *)__pyx_v_self->__pyx_vtab)->_schedule_stack(__pyx_v_self); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":946 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;} + Py_DECREF(__pyx_v_ordered); + __pyx_v_ordered = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":948 */ + for (__pyx_v_pos = PyList_GET_SIZE(__pyx_v_self->_scheduled_nodes)-1; __pyx_v_pos >= 0; --__pyx_v_pos) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":949 */ + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_16_known_graph_pyx__get_list_node(__pyx_v_self->_scheduled_nodes,__pyx_v_pos)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_node)); + __pyx_v_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)__pyx_1); + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":950 */ + Py_INCREF(__pyx_v_node->extra); + Py_DECREF(((PyObject *)__pyx_v_ms_node)); __pyx_v_ms_node = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)__pyx_v_node->extra); - /* "bzrlib/_known_graph_pyx.pyx":951 - * node = _get_list_node(self._scheduled_nodes, pos) - * ms_node = <_MergeSortNode>node.extra - * PyList_Append(ordered, ms_node) # <<<<<<<<<<<<<< - * node.extra = None - * # Clear out the scheduled nodes now that we're done - */ - __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_ordered), ((PyObject *)__pyx_v_ms_node)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_known_graph_pyx.pyx":952 - * ms_node = <_MergeSortNode>node.extra - * PyList_Append(ordered, ms_node) - * node.extra = None # <<<<<<<<<<<<<< - * # Clear out the scheduled nodes now that we're done - * self._scheduled_nodes = [] - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_node->extra); - __Pyx_DECREF(__pyx_v_node->extra); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":951 */ + __pyx_2 = PyList_Append(__pyx_v_ordered,((PyObject *)__pyx_v_ms_node)); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":952 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_node->extra); __pyx_v_node->extra = Py_None; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "bzrlib/_known_graph_pyx.pyx":954 - * node.extra = None - * # Clear out the scheduled nodes now that we're done - * self._scheduled_nodes = [] # <<<<<<<<<<<<<< - * return ordered - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); - __Pyx_GOTREF(__pyx_v_self->_scheduled_nodes); - __Pyx_DECREF(__pyx_v_self->_scheduled_nodes); - __pyx_v_self->_scheduled_nodes = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":955 - * # Clear out the scheduled nodes now that we're done - * self._scheduled_nodes = [] - * return ordered # <<<<<<<<<<<<<< - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_ordered)); - __pyx_r = ((PyObject *)__pyx_v_ordered); - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":954 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; goto __pyx_L1;} + Py_DECREF(__pyx_v_self->_scheduled_nodes); + __pyx_v_self->_scheduled_nodes = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":955 */ + Py_INCREF(__pyx_v_ordered); + __pyx_r = __pyx_v_ordered; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._known_graph_pyx._MergeSorter.topo_order"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_ms_node); - __Pyx_DECREF((PyObject *)__pyx_v_node); - __Pyx_DECREF(__pyx_v_ordered); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_ms_node); + Py_DECREF(__pyx_v_node); + Py_DECREF(__pyx_v_ordered); + Py_DECREF(__pyx_v_self); return __pyx_r; } static struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__KnownGraphNode __pyx_vtable_6bzrlib_16_known_graph_pyx__KnownGraphNode; @@ -8555,7 +3701,7 @@ PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)o); - p->__pyx_vtab = __pyx_vtabptr_6bzrlib_16_known_graph_pyx__KnownGraphNode; + *(struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__KnownGraphNode **)&p->__pyx_vtab = __pyx_vtabptr_6bzrlib_16_known_graph_pyx__KnownGraphNode; p->key = Py_None; Py_INCREF(Py_None); p->parents = Py_None; Py_INCREF(Py_None); p->children = Py_None; Py_INCREF(Py_None); @@ -8569,7 +3715,7 @@ Py_XDECREF(p->parents); Py_XDECREF(p->children); Py_XDECREF(p->extra); - (*Py_TYPE(o)->tp_free)(o); + (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_6bzrlib_16_known_graph_pyx__KnownGraphNode(PyObject *o, visitproc v, void *a) { @@ -8592,52 +3738,42 @@ static int __pyx_tp_clear_6bzrlib_16_known_graph_pyx__KnownGraphNode(PyObject *o) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *p = (struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)o; - PyObject* tmp; - tmp = ((PyObject*)p->key); + PyObject *t; + t = p->key; p->key = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->parents); + Py_XDECREF(t); + t = p->parents; p->parents = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->children); + Py_XDECREF(t); + t = p->children; p->children = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->extra); + Py_XDECREF(t); + t = p->extra; p->extra = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); + Py_XDECREF(t); return 0; } static PyObject *__pyx_getprop_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_child_keys(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_10child_keys___get__(o); + return __pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_10child_keys___get__(o); } static PyObject *__pyx_getprop_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_parent_keys(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_11parent_keys___get__(o); -} - -static PyObject *__pyx_getprop_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_gdfo(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_4gdfo___get__(o); + return __pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_11parent_keys___get__(o); } -static int __pyx_setprop_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_gdfo(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_4gdfo_1__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_6bzrlib_16_known_graph_pyx__KnownGraphNode[] = { +static struct PyMethodDef __pyx_methods_6bzrlib_16_known_graph_pyx__KnownGraphNode[] = { {0, 0, 0, 0} }; +static struct PyMemberDef __pyx_members_6bzrlib_16_known_graph_pyx__KnownGraphNode[] = { + {"gdfo", T_LONG, offsetof(struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode, gdfo), 0, 0}, + {0, 0, 0, 0, 0} +}; + static struct PyGetSetDef __pyx_getsets_6bzrlib_16_known_graph_pyx__KnownGraphNode[] = { - {(char *)"child_keys", __pyx_getprop_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_child_keys, 0, 0, 0}, - {(char *)"parent_keys", __pyx_getprop_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_parent_keys, 0, 0, 0}, - {(char *)"gdfo", __pyx_getprop_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_gdfo, __pyx_setprop_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_gdfo, 0, 0}, + {"child_keys", __pyx_getprop_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_child_keys, 0, 0, 0}, + {"parent_keys", __pyx_getprop_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_parent_keys, 0, 0, 0}, {0, 0, 0, 0, 0} }; @@ -8645,9 +3781,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -8661,28 +3795,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -8694,7 +3816,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; @@ -8719,41 +3841,24 @@ }; static PyBufferProcs __pyx_tp_as_buffer__KnownGraphNode = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; -static PyTypeObject __pyx_type_6bzrlib_16_known_graph_pyx__KnownGraphNode = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._known_graph_pyx._KnownGraphNode"), /*tp_name*/ +PyTypeObject __pyx_type_6bzrlib_16_known_graph_pyx__KnownGraphNode = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._known_graph_pyx._KnownGraphNode", /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_16_known_graph_pyx__KnownGraphNode, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - __pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_1__repr__, /*tp_repr*/ + __pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode___repr__, /*tp_repr*/ &__pyx_tp_as_number__KnownGraphNode, /*tp_as_number*/ &__pyx_tp_as_sequence__KnownGraphNode, /*tp_as_sequence*/ &__pyx_tp_as_mapping__KnownGraphNode, /*tp_as_mapping*/ @@ -8763,8 +3868,8 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__KnownGraphNode, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("Represents a single object in the known graph."), /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Represents a single object in the known graph.", /*tp_doc*/ __pyx_tp_traverse_6bzrlib_16_known_graph_pyx__KnownGraphNode, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_16_known_graph_pyx__KnownGraphNode, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -8772,14 +3877,14 @@ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6bzrlib_16_known_graph_pyx__KnownGraphNode, /*tp_methods*/ - 0, /*tp_members*/ + __pyx_members_6bzrlib_16_known_graph_pyx__KnownGraphNode, /*tp_members*/ __pyx_getsets_6bzrlib_16_known_graph_pyx__KnownGraphNode, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_6bzrlib_16_known_graph_pyx_15_KnownGraphNode___init__, /*tp_init*/ + __pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6bzrlib_16_known_graph_pyx__KnownGraphNode, /*tp_new*/ 0, /*tp_free*/ @@ -8789,10 +3894,6 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif }; static struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter __pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter; @@ -8801,7 +3902,7 @@ PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)o); - p->__pyx_vtab = __pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSorter; + *(struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSorter **)&p->__pyx_vtab = __pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSorter; p->graph = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)Py_None); Py_INCREF(Py_None); p->_depth_first_stack = Py_None; Py_INCREF(Py_None); p->_revno_to_branch_count = Py_None; Py_INCREF(Py_None); @@ -8815,7 +3916,7 @@ Py_XDECREF(p->_depth_first_stack); Py_XDECREF(p->_revno_to_branch_count); Py_XDECREF(p->_scheduled_nodes); - (*Py_TYPE(o)->tp_free)(o); + (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_6bzrlib_16_known_graph_pyx__MergeSorter(PyObject *o, visitproc v, void *a) { @@ -8838,23 +3939,23 @@ static int __pyx_tp_clear_6bzrlib_16_known_graph_pyx__MergeSorter(PyObject *o) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *p = (struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *)o; - PyObject* tmp; - tmp = ((PyObject*)p->graph); + PyObject *t; + t = ((PyObject *)p->graph); p->graph = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_depth_first_stack); + Py_XDECREF(t); + t = p->_depth_first_stack; p->_depth_first_stack = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_revno_to_branch_count); + Py_XDECREF(t); + t = p->_revno_to_branch_count; p->_revno_to_branch_count = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_scheduled_nodes); + Py_XDECREF(t); + t = p->_scheduled_nodes; p->_scheduled_nodes = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); + Py_XDECREF(t); return 0; } -static PyMethodDef __pyx_methods_6bzrlib_16_known_graph_pyx__MergeSorter[] = { +static struct PyMethodDef __pyx_methods_6bzrlib_16_known_graph_pyx__MergeSorter[] = { {0, 0, 0, 0} }; @@ -8862,9 +3963,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -8878,28 +3977,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -8911,7 +3998,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; @@ -8936,40 +4023,23 @@ }; static PyBufferProcs __pyx_tp_as_buffer__MergeSorter = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; -static PyTypeObject __pyx_type_6bzrlib_16_known_graph_pyx__MergeSorter = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._known_graph_pyx._MergeSorter"), /*tp_name*/ +PyTypeObject __pyx_type_6bzrlib_16_known_graph_pyx__MergeSorter = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._known_graph_pyx._MergeSorter", /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_16_known_graph_pyx__MergeSorter, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif 0, /*tp_repr*/ &__pyx_tp_as_number__MergeSorter, /*tp_as_number*/ &__pyx_tp_as_sequence__MergeSorter, /*tp_as_sequence*/ @@ -8980,8 +4050,8 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__MergeSorter, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("This class does the work of computing the merge_sort ordering.\n\n We have some small advantages, in that we get all the extra information\n that KnownGraph knows, like knowing the child lists, etc.\n "), /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "This class does the work of computing the merge_sort ordering.\n\n We have some small advantages, in that we get all the extra information\n that KnownGraph knows, like knowing the child lists, etc.\n ", /*tp_doc*/ __pyx_tp_traverse_6bzrlib_16_known_graph_pyx__MergeSorter, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_16_known_graph_pyx__MergeSorter, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -8996,7 +4066,7 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_6bzrlib_16_known_graph_pyx_12_MergeSorter___init__, /*tp_init*/ + __pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6bzrlib_16_known_graph_pyx__MergeSorter, /*tp_new*/ 0, /*tp_free*/ @@ -9006,10 +4076,6 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif }; static struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph __pyx_vtable_6bzrlib_16_known_graph_pyx_KnownGraph; @@ -9018,7 +4084,7 @@ PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)o); - p->__pyx_vtab = __pyx_vtabptr_6bzrlib_16_known_graph_pyx_KnownGraph; + *(struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx_KnownGraph **)&p->__pyx_vtab = __pyx_vtabptr_6bzrlib_16_known_graph_pyx_KnownGraph; p->_nodes = Py_None; Py_INCREF(Py_None); p->_known_heads = Py_None; Py_INCREF(Py_None); return o; @@ -9029,15 +4095,15 @@ { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_1__dealloc__(o); + ++o->ob_refcnt; + __pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); + --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } Py_XDECREF(p->_nodes); Py_XDECREF(p->_known_heads); - (*Py_TYPE(o)->tp_free)(o); + (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_6bzrlib_16_known_graph_pyx_KnownGraph(PyObject *o, visitproc v, void *a) { @@ -9054,75 +4120,35 @@ static int __pyx_tp_clear_6bzrlib_16_known_graph_pyx_KnownGraph(PyObject *o) { struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *p = (struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *)o; - PyObject* tmp; - tmp = ((PyObject*)p->_nodes); + PyObject *t; + t = p->_nodes; p->_nodes = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->_known_heads); + Py_XDECREF(t); + t = p->_known_heads; p->_known_heads = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); + Py_XDECREF(t); return 0; } -static PyObject *__pyx_getprop_6bzrlib_16_known_graph_pyx_10KnownGraph__nodes(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6_nodes___get__(o); -} - -static int __pyx_setprop_6bzrlib_16_known_graph_pyx_10KnownGraph__nodes(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6_nodes_1__set__(o, v); - } - else { - return __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6_nodes_2__del__(o); - } -} - -static PyObject *__pyx_getprop_6bzrlib_16_known_graph_pyx_10KnownGraph__known_heads(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12_known_heads___get__(o); -} - -static int __pyx_setprop_6bzrlib_16_known_graph_pyx_10KnownGraph__known_heads(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12_known_heads_1__set__(o, v); - } - else { - return __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12_known_heads_2__del__(o); - } -} - -static PyObject *__pyx_getprop_6bzrlib_16_known_graph_pyx_10KnownGraph_do_cache(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_8do_cache___get__(o); -} - -static int __pyx_setprop_6bzrlib_16_known_graph_pyx_10KnownGraph_do_cache(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_8do_cache_1__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyMethodDef __pyx_methods_6bzrlib_16_known_graph_pyx_KnownGraph[] = { - {__Pyx_NAMESTR("_initialize_nodes"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_2_initialize_nodes, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_2_initialize_nodes)}, - {__Pyx_NAMESTR("_find_tails"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_3_find_tails, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("_find_tips"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_4_find_tips, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("_find_gdfo"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_5_find_gdfo, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("add_node"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_6add_node, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_6add_node)}, - {__Pyx_NAMESTR("heads"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_7heads, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_7heads)}, - {__Pyx_NAMESTR("topo_sort"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_8topo_sort, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_8topo_sort)}, - {__Pyx_NAMESTR("gc_sort"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_9gc_sort, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_9gc_sort)}, - {__Pyx_NAMESTR("merge_sort"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_10merge_sort, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_10merge_sort)}, - {__Pyx_NAMESTR("get_parent_keys"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_11get_parent_keys, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_11get_parent_keys)}, - {__Pyx_NAMESTR("get_child_keys"), (PyCFunction)__pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph_12get_child_keys, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_12get_child_keys)}, +static struct PyMethodDef __pyx_methods_6bzrlib_16_known_graph_pyx_KnownGraph[] = { + {"_initialize_nodes", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__initialize_nodes, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph__initialize_nodes}, + {"_find_tails", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__find_tails, METH_VARARGS|METH_KEYWORDS, 0}, + {"_find_tips", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__find_tips, METH_VARARGS|METH_KEYWORDS, 0}, + {"_find_gdfo", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__find_gdfo, METH_VARARGS|METH_KEYWORDS, 0}, + {"add_node", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_add_node, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_add_node}, + {"heads", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_heads, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_heads}, + {"topo_sort", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_topo_sort, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_topo_sort}, + {"gc_sort", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_gc_sort, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_gc_sort}, + {"merge_sort", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_merge_sort, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_merge_sort}, + {"get_parent_keys", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_get_parent_keys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_get_parent_keys}, + {"get_child_keys", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph_get_child_keys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph_get_child_keys}, {0, 0, 0, 0} }; -static struct PyGetSetDef __pyx_getsets_6bzrlib_16_known_graph_pyx_KnownGraph[] = { - {(char *)"_nodes", __pyx_getprop_6bzrlib_16_known_graph_pyx_10KnownGraph__nodes, __pyx_setprop_6bzrlib_16_known_graph_pyx_10KnownGraph__nodes, 0, 0}, - {(char *)"_known_heads", __pyx_getprop_6bzrlib_16_known_graph_pyx_10KnownGraph__known_heads, __pyx_setprop_6bzrlib_16_known_graph_pyx_10KnownGraph__known_heads, 0, 0}, - {(char *)"do_cache", __pyx_getprop_6bzrlib_16_known_graph_pyx_10KnownGraph_do_cache, __pyx_setprop_6bzrlib_16_known_graph_pyx_10KnownGraph_do_cache, 0, 0}, +static struct PyMemberDef __pyx_members_6bzrlib_16_known_graph_pyx_KnownGraph[] = { + {"_nodes", T_OBJECT, offsetof(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph, _nodes), 0, 0}, + {"_known_heads", T_OBJECT, offsetof(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph, _known_heads), 0, 0}, + {"do_cache", T_INT, offsetof(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph, do_cache), 0, 0}, {0, 0, 0, 0, 0} }; @@ -9130,9 +4156,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -9146,28 +4170,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -9179,7 +4191,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; @@ -9204,40 +4216,23 @@ }; static PyBufferProcs __pyx_tp_as_buffer_KnownGraph = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; -static PyTypeObject __pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._known_graph_pyx.KnownGraph"), /*tp_name*/ +PyTypeObject __pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._known_graph_pyx.KnownGraph", /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_16_known_graph_pyx_KnownGraph, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif 0, /*tp_repr*/ &__pyx_tp_as_number_KnownGraph, /*tp_as_number*/ &__pyx_tp_as_sequence_KnownGraph, /*tp_as_sequence*/ @@ -9248,8 +4243,8 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_KnownGraph, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("This is a class which assumes we already know the full graph."), /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "This is a class which assumes we already know the full graph.", /*tp_doc*/ __pyx_tp_traverse_6bzrlib_16_known_graph_pyx_KnownGraph, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_16_known_graph_pyx_KnownGraph, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -9257,14 +4252,14 @@ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6bzrlib_16_known_graph_pyx_KnownGraph, /*tp_methods*/ - 0, /*tp_members*/ - __pyx_getsets_6bzrlib_16_known_graph_pyx_KnownGraph, /*tp_getset*/ + __pyx_members_6bzrlib_16_known_graph_pyx_KnownGraph, /*tp_members*/ + 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_6bzrlib_16_known_graph_pyx_10KnownGraph___init__, /*tp_init*/ + __pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6bzrlib_16_known_graph_pyx_KnownGraph, /*tp_new*/ 0, /*tp_free*/ @@ -9274,10 +4269,6 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif }; static struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSortNode __pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSortNode; @@ -9286,7 +4277,7 @@ PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)o); - p->__pyx_vtab = __pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSortNode; + *(struct __pyx_vtabstruct_6bzrlib_16_known_graph_pyx__MergeSortNode **)&p->__pyx_vtab = __pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSortNode; p->key = Py_None; Py_INCREF(Py_None); p->end_of_merge = Py_None; Py_INCREF(Py_None); p->left_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); @@ -9302,7 +4293,7 @@ Py_XDECREF(((PyObject *)p->left_parent)); Py_XDECREF(((PyObject *)p->left_pending_parent)); Py_XDECREF(p->pending_parents); - (*Py_TYPE(o)->tp_free)(o); + (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_6bzrlib_16_known_graph_pyx__MergeSortNode(PyObject *o, visitproc v, void *a) { @@ -9328,78 +4319,42 @@ static int __pyx_tp_clear_6bzrlib_16_known_graph_pyx__MergeSortNode(PyObject *o) { struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *p = (struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *)o; - PyObject* tmp; - tmp = ((PyObject*)p->key); + PyObject *t; + t = p->key; p->key = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->end_of_merge); + Py_XDECREF(t); + t = p->end_of_merge; p->end_of_merge = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->left_parent); + Py_XDECREF(t); + t = ((PyObject *)p->left_parent); p->left_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->left_pending_parent); + Py_XDECREF(t); + t = ((PyObject *)p->left_pending_parent); p->left_pending_parent = ((struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); - tmp = ((PyObject*)p->pending_parents); + Py_XDECREF(t); + t = p->pending_parents; p->pending_parents = Py_None; Py_INCREF(Py_None); - Py_XDECREF(tmp); + Py_XDECREF(t); return 0; } static PyObject *__pyx_getprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_revno(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_5revno___get__(o); -} - -static PyObject *__pyx_getprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_key(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_3key___get__(o); + return __pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode_5revno___get__(o); } -static int __pyx_setprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_key(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_3key_1__set__(o, v); - } - else { - return __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_3key_2__del__(o); - } -} - -static PyObject *__pyx_getprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_merge_depth(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_11merge_depth___get__(o); -} - -static int __pyx_setprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_merge_depth(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_11merge_depth_1__set__(o, v); - } - else { - PyErr_SetString(PyExc_NotImplementedError, "__del__"); - return -1; - } -} - -static PyObject *__pyx_getprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_end_of_merge(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_12end_of_merge___get__(o); -} - -static int __pyx_setprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_end_of_merge(PyObject *o, PyObject *v, void *x) { - if (v) { - return __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_12end_of_merge_1__set__(o, v); - } - else { - return __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_12end_of_merge_2__del__(o); - } -} - -static PyMethodDef __pyx_methods_6bzrlib_16_known_graph_pyx__MergeSortNode[] = { +static struct PyMethodDef __pyx_methods_6bzrlib_16_known_graph_pyx__MergeSortNode[] = { {0, 0, 0, 0} }; +static struct PyMemberDef __pyx_members_6bzrlib_16_known_graph_pyx__MergeSortNode[] = { + {"key", T_OBJECT, offsetof(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode, key), 0, 0}, + {"merge_depth", T_LONG, offsetof(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode, merge_depth), 0, 0}, + {"end_of_merge", T_OBJECT, offsetof(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode, end_of_merge), 0, 0}, + {0, 0, 0, 0, 0} +}; + static struct PyGetSetDef __pyx_getsets_6bzrlib_16_known_graph_pyx__MergeSortNode[] = { - {(char *)"revno", __pyx_getprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_revno, 0, 0, 0}, - {(char *)"key", __pyx_getprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_key, __pyx_setprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_key, 0, 0}, - {(char *)"merge_depth", __pyx_getprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_merge_depth, __pyx_setprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_merge_depth, 0, 0}, - {(char *)"end_of_merge", __pyx_getprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_end_of_merge, __pyx_setprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_end_of_merge, 0, 0}, + {"revno", __pyx_getprop_6bzrlib_16_known_graph_pyx_14_MergeSortNode_revno, 0, 0, 0}, {0, 0, 0, 0, 0} }; @@ -9407,9 +4362,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -9423,28 +4376,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -9456,7 +4397,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; @@ -9481,41 +4422,24 @@ }; static PyBufferProcs __pyx_tp_as_buffer__MergeSortNode = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; -static PyTypeObject __pyx_type_6bzrlib_16_known_graph_pyx__MergeSortNode = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._known_graph_pyx._MergeSortNode"), /*tp_name*/ +PyTypeObject __pyx_type_6bzrlib_16_known_graph_pyx__MergeSortNode = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._known_graph_pyx._MergeSortNode", /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_16_known_graph_pyx__MergeSortNode, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode_1__repr__, /*tp_repr*/ + __pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode___repr__, /*tp_repr*/ &__pyx_tp_as_number__MergeSortNode, /*tp_as_number*/ &__pyx_tp_as_sequence__MergeSortNode, /*tp_as_sequence*/ &__pyx_tp_as_mapping__MergeSortNode, /*tp_as_mapping*/ @@ -9525,8 +4449,8 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__MergeSortNode, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("Tracks information about a node during the merge_sort operation."), /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Tracks information about a node during the merge_sort operation.", /*tp_doc*/ __pyx_tp_traverse_6bzrlib_16_known_graph_pyx__MergeSortNode, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_16_known_graph_pyx__MergeSortNode, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -9534,14 +4458,14 @@ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6bzrlib_16_known_graph_pyx__MergeSortNode, /*tp_methods*/ - 0, /*tp_members*/ + __pyx_members_6bzrlib_16_known_graph_pyx__MergeSortNode, /*tp_members*/ __pyx_getsets_6bzrlib_16_known_graph_pyx__MergeSortNode, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_6bzrlib_16_known_graph_pyx_14_MergeSortNode___init__, /*tp_init*/ + __pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6bzrlib_16_known_graph_pyx__MergeSortNode, /*tp_new*/ 0, /*tp_free*/ @@ -9551,577 +4475,137 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif -}; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("_known_graph_pyx"), - __Pyx_DOCSTR(__pyx_k_14), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, - {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, - {&__pyx_n_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 1}, - {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, - {&__pyx_n_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 1}, - {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, - {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, - {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0}, - {&__pyx_n_s__GraphCycleError, __pyx_k__GraphCycleError, sizeof(__pyx_k__GraphCycleError), 0, 0, 1, 1}, - {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1}, - {&__pyx_n_s__NULL_REVISION, __pyx_k__NULL_REVISION, sizeof(__pyx_k__NULL_REVISION), 0, 0, 1, 1}, - {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___depth_first_stack, __pyx_k___depth_first_stack, sizeof(__pyx_k___depth_first_stack), 0, 0, 1, 1}, - {&__pyx_n_s___find_gdfo, __pyx_k___find_gdfo, sizeof(__pyx_k___find_gdfo), 0, 0, 1, 1}, - {&__pyx_n_s___find_tails, __pyx_k___find_tails, sizeof(__pyx_k___find_tails), 0, 0, 1, 1}, - {&__pyx_n_s___find_tips, __pyx_k___find_tips, sizeof(__pyx_k___find_tips), 0, 0, 1, 1}, - {&__pyx_n_s___get_ms_node, __pyx_k___get_ms_node, sizeof(__pyx_k___get_ms_node), 0, 0, 1, 1}, - {&__pyx_n_s___get_or_create_node, __pyx_k___get_or_create_node, sizeof(__pyx_k___get_or_create_node), 0, 0, 1, 1}, - {&__pyx_n_s___initialize_nodes, __pyx_k___initialize_nodes, sizeof(__pyx_k___initialize_nodes), 0, 0, 1, 1}, - {&__pyx_n_s___known_heads, __pyx_k___known_heads, sizeof(__pyx_k___known_heads), 0, 0, 1, 1}, - {&__pyx_n_s___last_stack_item, __pyx_k___last_stack_item, sizeof(__pyx_k___last_stack_item), 0, 0, 1, 1}, - {&__pyx_n_s___nodes, __pyx_k___nodes, sizeof(__pyx_k___nodes), 0, 0, 1, 1}, - {&__pyx_n_s___pop_node, __pyx_k___pop_node, sizeof(__pyx_k___pop_node), 0, 0, 1, 1}, - {&__pyx_n_s___populate_parents, __pyx_k___populate_parents, sizeof(__pyx_k___populate_parents), 0, 0, 1, 1}, - {&__pyx_n_s___push_node, __pyx_k___push_node, sizeof(__pyx_k___push_node), 0, 0, 1, 1}, - {&__pyx_n_s___revno, __pyx_k___revno, sizeof(__pyx_k___revno), 0, 0, 1, 1}, - {&__pyx_n_s___revno_first, __pyx_k___revno_first, sizeof(__pyx_k___revno_first), 0, 0, 1, 1}, - {&__pyx_n_s___revno_last, __pyx_k___revno_last, sizeof(__pyx_k___revno_last), 0, 0, 1, 1}, - {&__pyx_n_s___revno_second, __pyx_k___revno_second, sizeof(__pyx_k___revno_second), 0, 0, 1, 1}, - {&__pyx_n_s___schedule_stack, __pyx_k___schedule_stack, sizeof(__pyx_k___schedule_stack), 0, 0, 1, 1}, - {&__pyx_n_s___scheduled_nodes, __pyx_k___scheduled_nodes, sizeof(__pyx_k___scheduled_nodes), 0, 0, 1, 1}, - {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, - {&__pyx_n_s__bzrlib, __pyx_k__bzrlib, sizeof(__pyx_k__bzrlib), 0, 0, 1, 1}, - {&__pyx_n_s__child_keys, __pyx_k__child_keys, sizeof(__pyx_k__child_keys), 0, 0, 1, 1}, - {&__pyx_n_s__children, __pyx_k__children, sizeof(__pyx_k__children), 0, 0, 1, 1}, - {&__pyx_n_s__clear, __pyx_k__clear, sizeof(__pyx_k__clear), 0, 0, 1, 1}, - {&__pyx_n_s__clear_references, __pyx_k__clear_references, sizeof(__pyx_k__clear_references), 0, 0, 1, 1}, - {&__pyx_n_s__collections, __pyx_k__collections, sizeof(__pyx_k__collections), 0, 0, 1, 1}, - {&__pyx_n_s__completed, __pyx_k__completed, sizeof(__pyx_k__completed), 0, 0, 1, 1}, - {&__pyx_n_s__deque, __pyx_k__deque, sizeof(__pyx_k__deque), 0, 0, 1, 1}, - {&__pyx_n_s__do_cache, __pyx_k__do_cache, sizeof(__pyx_k__do_cache), 0, 0, 1, 1}, - {&__pyx_n_s__end_of_merge, __pyx_k__end_of_merge, sizeof(__pyx_k__end_of_merge), 0, 0, 1, 1}, - {&__pyx_n_s__errors, __pyx_k__errors, sizeof(__pyx_k__errors), 0, 0, 1, 1}, - {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1}, - {&__pyx_n_s__extra, __pyx_k__extra, sizeof(__pyx_k__extra), 0, 0, 1, 1}, - {&__pyx_n_s__gc, __pyx_k__gc, sizeof(__pyx_k__gc), 0, 0, 1, 1}, - {&__pyx_n_s__gdfo, __pyx_k__gdfo, sizeof(__pyx_k__gdfo), 0, 0, 1, 1}, - {&__pyx_n_s__get_key, __pyx_k__get_key, sizeof(__pyx_k__get_key), 0, 0, 1, 1}, - {&__pyx_n_s__graph, __pyx_k__graph, sizeof(__pyx_k__graph), 0, 0, 1, 1}, - {&__pyx_n_s__has_pending_parents, __pyx_k__has_pending_parents, sizeof(__pyx_k__has_pending_parents), 0, 0, 1, 1}, - {&__pyx_n_s__is_first_child, __pyx_k__is_first_child, sizeof(__pyx_k__is_first_child), 0, 0, 1, 1}, - {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1}, - {&__pyx_n_s__known_graph, __pyx_k__known_graph, sizeof(__pyx_k__known_graph), 0, 0, 1, 1}, - {&__pyx_n_s__left_parent, __pyx_k__left_parent, sizeof(__pyx_k__left_parent), 0, 0, 1, 1}, - {&__pyx_n_s__left_pending_parent, __pyx_k__left_pending_parent, sizeof(__pyx_k__left_pending_parent), 0, 0, 1, 1}, - {&__pyx_n_s__merge_depth, __pyx_k__merge_depth, sizeof(__pyx_k__merge_depth), 0, 0, 1, 1}, - {&__pyx_n_s__parent_keys, __pyx_k__parent_keys, sizeof(__pyx_k__parent_keys), 0, 0, 1, 1}, - {&__pyx_n_s__parent_map, __pyx_k__parent_map, sizeof(__pyx_k__parent_map), 0, 0, 1, 1}, - {&__pyx_n_s__parents, __pyx_k__parents, sizeof(__pyx_k__parents), 0, 0, 1, 1}, - {&__pyx_n_s__pending_parents, __pyx_k__pending_parents, sizeof(__pyx_k__pending_parents), 0, 0, 1, 1}, - {&__pyx_n_s__pop, __pyx_k__pop, sizeof(__pyx_k__pop), 0, 0, 1, 1}, - {&__pyx_n_s__popleft, __pyx_k__popleft, sizeof(__pyx_k__popleft), 0, 0, 1, 1}, - {&__pyx_n_s__reverse, __pyx_k__reverse, sizeof(__pyx_k__reverse), 0, 0, 1, 1}, - {&__pyx_n_s__revision, __pyx_k__revision, sizeof(__pyx_k__revision), 0, 0, 1, 1}, - {&__pyx_n_s__seen, __pyx_k__seen, sizeof(__pyx_k__seen), 0, 0, 1, 1}, - {&__pyx_n_s__seen_by_child, __pyx_k__seen_by_child, sizeof(__pyx_k__seen_by_child), 0, 0, 1, 1}, - {&__pyx_n_s__sort, __pyx_k__sort, sizeof(__pyx_k__sort), 0, 0, 1, 1}, - {&__pyx_n_s__sorted, __pyx_k__sorted, sizeof(__pyx_k__sorted), 0, 0, 1, 1}, - {&__pyx_n_s__tip_key, __pyx_k__tip_key, sizeof(__pyx_k__tip_key), 0, 0, 1, 1}, - {&__pyx_n_s__topo_order, __pyx_k__topo_order, sizeof(__pyx_k__topo_order), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "bzrlib/_known_graph_pyx.pyx":156 - * is_tuple = PyTuple_CheckExact(lst_or_tpl) - * if not (is_tuple or PyList_CheckExact(lst_or_tpl)): - * raise TypeError('lst_or_tpl must be a list or tuple.') # <<<<<<<<<<<<<< - * length = len(lst_or_tpl) - * if length == 0 or length == 1: - */ - __pyx_k_tuple_3 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_3)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); - PyTuple_SET_ITEM(__pyx_k_tuple_3, 0, ((PyObject *)__pyx_kp_s_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3)); - - /* "bzrlib/_known_graph_pyx.pyx":273 - * - * if not PyDict_CheckExact(parent_map): - * raise TypeError('parent_map should be a dict of {key:parent_keys}') # <<<<<<<<<<<<<< - * # for key, parent_keys in parent_map.iteritems(): - * pos = 0 - */ - __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_6)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); - PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, ((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - #if PY_VERSION_HEX < 0x02040000 - if (unlikely(__Pyx_Py23SetsImport() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC init_known_graph_pyx(void); /*proto*/ -PyMODINIT_FUNC init_known_graph_pyx(void) -#else -PyMODINIT_FUNC PyInit__known_graph_pyx(void); /*proto*/ -PyMODINIT_FUNC PyInit__known_graph_pyx(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__known_graph_pyx(void)", __LINE__, __FILE__); - #endif - __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;} - __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;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_known_graph_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_14), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 +}; + +static struct PyMethodDef __pyx_methods[] = { + {"get_key", (PyCFunction)__pyx_f_6bzrlib_16_known_graph_pyx_get_key, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static void __pyx_init_filenames(void); /*proto*/ + +PyMODINIT_FUNC init_known_graph_pyx(void); /*proto*/ +PyMODINIT_FUNC init_known_graph_pyx(void) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + __pyx_init_filenames(); + __pyx_m = Py_InitModule4("_known_graph_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_bzrlib___known_graph_pyx) { - 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;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ + __pyx_b = PyImport_AddModule("__builtin__"); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION = Py_None; Py_INCREF(Py_None); - /*--- Function export code ---*/ - /*--- Type init code ---*/ __pyx_vtabptr_6bzrlib_16_known_graph_pyx__KnownGraphNode = &__pyx_vtable_6bzrlib_16_known_graph_pyx__KnownGraphNode; - __pyx_vtable_6bzrlib_16_known_graph_pyx__KnownGraphNode.clear_references = (PyObject *(*)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *))__pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_clear_references; - if (PyType_Ready(&__pyx_type_6bzrlib_16_known_graph_pyx__KnownGraphNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6bzrlib_16_known_graph_pyx__KnownGraphNode.tp_dict, __pyx_vtabptr_6bzrlib_16_known_graph_pyx__KnownGraphNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "_KnownGraphNode", (PyObject *)&__pyx_type_6bzrlib_16_known_graph_pyx__KnownGraphNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(void(**)(void))&__pyx_vtable_6bzrlib_16_known_graph_pyx__KnownGraphNode.clear_references = (void(*)(void))__pyx_f_6bzrlib_16_known_graph_pyx_15_KnownGraphNode_clear_references; + __pyx_type_6bzrlib_16_known_graph_pyx__KnownGraphNode.tp_free = _PyObject_GC_Del; + if (PyType_Ready(&__pyx_type_6bzrlib_16_known_graph_pyx__KnownGraphNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} + if (__Pyx_SetVtable(__pyx_type_6bzrlib_16_known_graph_pyx__KnownGraphNode.tp_dict, __pyx_vtabptr_6bzrlib_16_known_graph_pyx__KnownGraphNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "_KnownGraphNode", (PyObject *)&__pyx_type_6bzrlib_16_known_graph_pyx__KnownGraphNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;} __pyx_ptype_6bzrlib_16_known_graph_pyx__KnownGraphNode = &__pyx_type_6bzrlib_16_known_graph_pyx__KnownGraphNode; __pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSorter = &__pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter; - __pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter._get_ms_node = (struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *(*)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *, struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *))__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__get_ms_node; - __pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter._push_node = (PyObject *(*)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *, struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *, long))__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__push_node; - __pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter._pop_node = (PyObject *(*)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *))__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__pop_node; - __pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter._schedule_stack = (PyObject *(*)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *))__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__schedule_stack; - __pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter.topo_order = (PyObject *(*)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSorter *))__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter_topo_order; - if (PyType_Ready(&__pyx_type_6bzrlib_16_known_graph_pyx__MergeSorter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6bzrlib_16_known_graph_pyx__MergeSorter.tp_dict, __pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSorter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "_MergeSorter", (PyObject *)&__pyx_type_6bzrlib_16_known_graph_pyx__MergeSorter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(void(**)(void))&__pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter._get_ms_node = (void(*)(void))__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__get_ms_node; + *(void(**)(void))&__pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter._push_node = (void(*)(void))__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__push_node; + *(void(**)(void))&__pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter._pop_node = (void(*)(void))__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__pop_node; + *(void(**)(void))&__pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter._schedule_stack = (void(*)(void))__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter__schedule_stack; + *(void(**)(void))&__pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSorter.topo_order = (void(*)(void))__pyx_f_6bzrlib_16_known_graph_pyx_12_MergeSorter_topo_order; + __pyx_type_6bzrlib_16_known_graph_pyx__MergeSorter.tp_free = _PyObject_GC_Del; + if (PyType_Ready(&__pyx_type_6bzrlib_16_known_graph_pyx__MergeSorter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; goto __pyx_L1;} + if (__Pyx_SetVtable(__pyx_type_6bzrlib_16_known_graph_pyx__MergeSorter.tp_dict, __pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSorter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "_MergeSorter", (PyObject *)&__pyx_type_6bzrlib_16_known_graph_pyx__MergeSorter) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; goto __pyx_L1;} __pyx_ptype_6bzrlib_16_known_graph_pyx__MergeSorter = &__pyx_type_6bzrlib_16_known_graph_pyx__MergeSorter; __pyx_vtabptr_6bzrlib_16_known_graph_pyx_KnownGraph = &__pyx_vtable_6bzrlib_16_known_graph_pyx_KnownGraph; - __pyx_vtable_6bzrlib_16_known_graph_pyx_KnownGraph._get_or_create_node = (struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *(*)(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *, PyObject *))__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__get_or_create_node; - __pyx_vtable_6bzrlib_16_known_graph_pyx_KnownGraph._populate_parents = (PyObject *(*)(struct __pyx_obj_6bzrlib_16_known_graph_pyx_KnownGraph *, struct __pyx_obj_6bzrlib_16_known_graph_pyx__KnownGraphNode *, PyObject *))__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__populate_parents; - if (PyType_Ready(&__pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - { - PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_6bzrlib_16_known_graph_pyx_10KnownGraph___init__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_6bzrlib_16_known_graph_pyx_10KnownGraph___init__.doc = __pyx_doc_6bzrlib_16_known_graph_pyx_10KnownGraph___init__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6bzrlib_16_known_graph_pyx_10KnownGraph___init__; - } - } - if (__Pyx_SetVtable(__pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph.tp_dict, __pyx_vtabptr_6bzrlib_16_known_graph_pyx_KnownGraph) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "KnownGraph", (PyObject *)&__pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(void(**)(void))&__pyx_vtable_6bzrlib_16_known_graph_pyx_KnownGraph._get_or_create_node = (void(*)(void))__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__get_or_create_node; + *(void(**)(void))&__pyx_vtable_6bzrlib_16_known_graph_pyx_KnownGraph._populate_parents = (void(*)(void))__pyx_f_6bzrlib_16_known_graph_pyx_10KnownGraph__populate_parents; + __pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph.tp_free = _PyObject_GC_Del; + if (PyType_Ready(&__pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + if (__Pyx_SetVtable(__pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph.tp_dict, __pyx_vtabptr_6bzrlib_16_known_graph_pyx_KnownGraph) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "KnownGraph", (PyObject *)&__pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} __pyx_ptype_6bzrlib_16_known_graph_pyx_KnownGraph = &__pyx_type_6bzrlib_16_known_graph_pyx_KnownGraph; __pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSortNode = &__pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSortNode; - __pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSortNode.has_pending_parents = (int (*)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *))__pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode_has_pending_parents; - __pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSortNode._revno = (PyObject *(*)(struct __pyx_obj_6bzrlib_16_known_graph_pyx__MergeSortNode *))__pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode__revno; - if (PyType_Ready(&__pyx_type_6bzrlib_16_known_graph_pyx__MergeSortNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6bzrlib_16_known_graph_pyx__MergeSortNode.tp_dict, __pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSortNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "_MergeSortNode", (PyObject *)&__pyx_type_6bzrlib_16_known_graph_pyx__MergeSortNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(void(**)(void))&__pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSortNode.has_pending_parents = (void(*)(void))__pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode_has_pending_parents; + *(void(**)(void))&__pyx_vtable_6bzrlib_16_known_graph_pyx__MergeSortNode._revno = (void(*)(void))__pyx_f_6bzrlib_16_known_graph_pyx_14_MergeSortNode__revno; + __pyx_type_6bzrlib_16_known_graph_pyx__MergeSortNode.tp_free = _PyObject_GC_Del; + if (PyType_Ready(&__pyx_type_6bzrlib_16_known_graph_pyx__MergeSortNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; goto __pyx_L1;} + if (__Pyx_SetVtable(__pyx_type_6bzrlib_16_known_graph_pyx__MergeSortNode.tp_dict, __pyx_vtabptr_6bzrlib_16_known_graph_pyx__MergeSortNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "_MergeSortNode", (PyObject *)&__pyx_type_6bzrlib_16_known_graph_pyx__MergeSortNode) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; goto __pyx_L1;} __pyx_ptype_6bzrlib_16_known_graph_pyx__MergeSortNode = &__pyx_type_6bzrlib_16_known_graph_pyx__MergeSortNode; - /*--- Type import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "bzrlib/_known_graph_pyx.pyx":54 - * void Py_INCREF(object) - * - * from collections import deque # <<<<<<<<<<<<<< - * import gc - * - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__deque)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__deque)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__deque)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__collections), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__deque); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__deque, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":55 - * - * from collections import deque - * import gc # <<<<<<<<<<<<<< - * - * from bzrlib import errors, revision - */ - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__gc), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gc, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":57 - * import gc - * - * from bzrlib import errors, revision # <<<<<<<<<<<<<< - * - * cdef object NULL_REVISION - */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__errors)); - PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__errors)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__errors)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__revision)); - PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__revision)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__revision)); - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__bzrlib), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__errors); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__errors, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__revision); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__revision, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":60 - * - * cdef object NULL_REVISION - * NULL_REVISION = revision.NULL_REVISION # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__revision); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__NULL_REVISION); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - __Pyx_DECREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); - __Pyx_GIVEREF(__pyx_t_2); - __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":138 - * - * - * def get_key(node): # <<<<<<<<<<<<<< - * cdef _KnownGraphNode real_node - * real_node = node - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_16_known_graph_pyx_get_key, NULL, __pyx_n_s_15); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_key, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":199 - * cdef public int do_cache - * - * def __init__(self, parent_map, do_cache=True): # <<<<<<<<<<<<<< - * """Create a new KnownGraph instance. - * - */ - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_k_4 = __pyx_t_2; - __Pyx_GIVEREF(__pyx_t_2); - __pyx_t_2 = 0; - - /* "bzrlib/_known_graph_pyx.pyx":1 - * # Copyright (C) 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<< - * # - * # This program is free software; you can redistribute it and/or modify - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - 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;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - __Pyx_AddTraceback("init bzrlib._known_graph_pyx"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init bzrlib._known_graph_pyx"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} -/* Runtime support code */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":54 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} + Py_INCREF(__pyx_n_deque); + PyList_SET_ITEM(__pyx_1, 0, __pyx_n_deque); + __pyx_2 = __Pyx_Import(__pyx_n_collections, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_deque); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_deque, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":55 */ + __pyx_2 = __Pyx_Import(__pyx_n_gc, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_gc, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":57 */ + __pyx_1 = PyList_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + Py_INCREF(__pyx_n_errors); + PyList_SET_ITEM(__pyx_1, 0, __pyx_n_errors); + Py_INCREF(__pyx_n_revision); + PyList_SET_ITEM(__pyx_1, 1, __pyx_n_revision); + __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_errors); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_errors, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_revision); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_revision, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":60 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_revision); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_NULL_REVISION); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION); + __pyx_v_6bzrlib_16_known_graph_pyx_NULL_REVISION = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":199 */ + Py_INCREF(Py_True); + __pyx_d1 = Py_True; -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_known_graph_pyx.pyx":926 */ + return; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("bzrlib._known_graph_pyx"); } -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} +static char *__pyx_filenames[] = { + "_known_graph_pyx.pyx", +}; -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} +/* Runtime support code */ -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (!type) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } - if (likely(PyObject_TypeCheck(obj, type))) + if (obj == Py_None || PyObject_TypeCheck(obj, type)) return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); + PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", + obj->ob_type->tp_name, type->tp_name); return 0; } -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} - - -#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); @@ -10162,13 +4646,12 @@ Py_INCREF(type); } else { - type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else - type = (PyObject*) Py_TYPE(type); + type = (PyObject*) type->ob_type; Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, @@ -10177,8 +4660,7 @@ } #endif } - - __Pyx_ErrRestore(type, value, tb); + PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); @@ -10187,60 +4669,80 @@ return; } -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; +} - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; +static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i) { + PyTypeObject *t = o->ob_type; + PyObject *r; + if (t->tp_as_sequence && t->tp_as_sequence->sq_item) + r = PySequence_GetItem(o, i); + else { + PyObject *j = PyInt_FromLong(i); + if (!j) + return 0; + r = PyObject_GetItem(o, j); + Py_DECREF(j); } + return r; +} - PyErr_SetObject(type, value); +static void __Pyx_WriteUnraisable(char *name) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; + PyErr_Fetch(&old_exc, &old_val, &old_tb); + ctx = PyString_FromString(name); + PyErr_Restore(old_exc, old_val, old_tb); + if (!ctx) + ctx = Py_None; + PyErr_WriteUnraisable(ctx); +} - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + if (!*t->p) + return -1; + if (t->i) + PyString_InternInPlace(t->p); + ++t; } + return 0; +} + +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + PyObject *pycobj = 0; + int result; + + pycobj = PyCObject_FromVoidPtr(vtable, 0); + if (!pycobj) + goto bad; + if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0) + goto bad; + result = 0; + goto done; bad: - return; + result = -1; +done: + Py_XDECREF(pycobj); + return result; } -#endif - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; + PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) + __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); + if (!__import__) goto bad; if (from_list) list = from_list; @@ -10256,506 +4758,57 @@ empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); + module = PyObject_CallFunction(__import__, "OOOO", + name, global_dict, empty_dict, list); bad: Py_XDECREF(empty_list); - Py_XDECREF(py_import); + Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static void __Pyx_WriteUnraisable(const char *name) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -} - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; -} - #include "compile.h" #include "frameobject.h" #include "traceback.h" -static void __Pyx_AddTraceback(const char *funcname) { +static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; + PyObject *empty_tuple = 0; + PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } + py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; + empty_tuple = PyTuple_New(0); + if (!empty_tuple) goto bad; + empty_string = PyString_FromString(""); + if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + empty_string, /*PyObject *code,*/ + empty_tuple, /*PyObject *consts,*/ + empty_tuple, /*PyObject *names,*/ + empty_tuple, /*PyObject *varnames,*/ + empty_tuple, /*PyObject *freevars,*/ + empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ + empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ + PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ @@ -10766,128 +4819,8 @@ bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); + Py_XDECREF(empty_tuple); + Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} - -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff -Nru bzr-2.5.0/bzrlib/log.py bzr-2.6.0~beta1/bzrlib/log.py --- bzr-2.5.0/bzrlib/log.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/log.py 2012-03-15 10:00:24.000000000 +0000 @@ -138,15 +138,6 @@ revno += 1 -def _enumerate_history(branch): - rh = [] - revno = 1 - for rev_id in branch.revision_history(): - rh.append((revno, rev_id)) - revno += 1 - return rh - - def show_log(branch, lf, specific_fileid=None, diff -Nru bzr-2.5.0/bzrlib/mail_client.py bzr-2.6.0~beta1/bzrlib/mail_client.py --- bzr-2.5.0/bzrlib/mail_client.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/mail_client.py 2012-03-15 10:00:24.000000000 +0000 @@ -24,6 +24,7 @@ import bzrlib from bzrlib import ( + config as _mod_config, email_message, errors, msgeditor, @@ -111,7 +112,7 @@ if body == '': raise errors.NoMessageSupplied() email_message.EmailMessage.send(self.config, - self.config.username(), + self.config.get('email'), to, subject, body, @@ -378,7 +379,7 @@ extension, body=None, from_=None): """See ExternalMailClient._compose""" if from_ is None: - from_ = self.config.get_user_option('email') + from_ = self.config.get('email') super(Claws, self)._compose(prompt, to, subject, attach_path, mime_subtype, extension, body, from_) @@ -617,11 +618,11 @@ """See MailClient.compose""" try: return self._mail_client().compose(prompt, to, subject, - attachment, mimie_subtype, + attachment, mime_subtype, extension, basename, body) except errors.MailClientNotFound: return Editor(self.config).compose(prompt, to, subject, - attachment, mimie_subtype, extension, body) + attachment, mime_subtype, extension, body) def compose_merge_request(self, to, subject, directive, basename=None, body=None): @@ -636,4 +637,5 @@ help=DefaultMail.__doc__) mail_client_registry.default_key = 'default' - +opt_mail_client = _mod_config.RegistryOption('mail_client', + mail_client_registry, help='E-mail client to use.', invalid='error') diff -Nru bzr-2.5.0/bzrlib/memorytree.py bzr-2.6.0~beta1/bzrlib/memorytree.py --- bzr-2.5.0/bzrlib/memorytree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/memorytree.py 2012-03-15 10:00:24.000000000 +0000 @@ -51,6 +51,9 @@ self._locks = 0 self._lock_mode = None + def get_config_stack(self): + return self.branch.get_config_stack() + def is_control_filename(self, filename): # Memory tree doesn't have any control filenames return False diff -Nru bzr-2.5.0/bzrlib/merge_directive.py bzr-2.6.0~beta1/bzrlib/merge_directive.py --- bzr-2.5.0/bzrlib/merge_directive.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/merge_directive.py 2012-03-15 10:00:24.000000000 +0000 @@ -260,7 +260,7 @@ :param sign: If True, gpg-sign the email :return: an email message """ - mail_from = branch.get_config().username() + mail_from = branch.get_config_stack().get('email') if self.message is not None: subject = self.message else: diff -Nru bzr-2.5.0/bzrlib/merge.py bzr-2.6.0~beta1/bzrlib/merge.py --- bzr-2.5.0/bzrlib/merge.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/merge.py 2012-03-15 10:00:24.000000000 +0000 @@ -940,8 +940,8 @@ result = [] walker = _mod_tree.MultiWalker(self.other_tree, self._lca_trees) - base_inventory = self.base_tree.inventory - this_inventory = self.this_tree.inventory + base_inventory = self.base_tree.root_inventory + this_inventory = self.this_tree.root_inventory for path, file_id, other_ie, lca_values in walker.iter_all(): # Is this modified at all from any of the other trees? if other_ie is None: @@ -1078,51 +1078,6 @@ )) return result - @deprecated_method(deprecated_in((2, 4, 0))) - def fix_root(self): - if self.tt.final_kind(self.tt.root) is None: - self.tt.cancel_deletion(self.tt.root) - if self.tt.final_file_id(self.tt.root) is None: - self.tt.version_file(self.tt.tree_file_id(self.tt.root), - self.tt.root) - other_root_file_id = self.other_tree.get_root_id() - if other_root_file_id is None: - return - other_root = self.tt.trans_id_file_id(other_root_file_id) - if other_root == self.tt.root: - return - if self.this_tree.inventory.has_id( - self.other_tree.inventory.root.file_id): - # the other tree's root is a non-root in the current tree (as - # when a previously unrelated branch is merged into another) - return - if self.tt.final_kind(other_root) is not None: - other_root_is_present = True - else: - # other_root doesn't have a physical representation. We still need - # to move any references to the actual root of the tree. - other_root_is_present = False - # 'other_tree.inventory.root' is not present in this tree. We are - # calling adjust_path for children which *want* to be present with a - # correct place to go. - for _, child in self.other_tree.inventory.root.children.iteritems(): - trans_id = self.tt.trans_id_file_id(child.file_id) - if not other_root_is_present: - if self.tt.final_kind(trans_id) is not None: - # The item exist in the final tree and has a defined place - # to go already. - continue - # Move the item into the root - try: - final_name = self.tt.final_name(trans_id) - except errors.NoFinalPath: - # This file is not present anymore, ignore it. - continue - self.tt.adjust_path(final_name, self.tt.root, trans_id) - if other_root_is_present: - self.tt.cancel_creation(other_root) - self.tt.cancel_versioning(other_root) - def write_modified(self, results): modified_hashes = {} for path in results.modified_paths: @@ -1238,31 +1193,11 @@ # At this point, the lcas disagree, and the tip disagree return 'conflict' - @staticmethod - @deprecated_method(deprecated_in((2, 2, 0))) - def scalar_three_way(this_tree, base_tree, other_tree, file_id, key): - """Do a three-way test on a scalar. - Return "this", "other" or "conflict", depending whether a value wins. - """ - key_base = key(base_tree, file_id) - key_other = key(other_tree, file_id) - #if base == other, either they all agree, or only THIS has changed. - if key_base == key_other: - return "this" - key_this = key(this_tree, file_id) - # "Ambiguous clean merge" - if key_this == key_other: - return "this" - elif key_this == key_base: - return "other" - else: - return "conflict" - def merge_names(self, file_id): def get_entry(tree): - if tree.has_id(file_id): - return tree.inventory[file_id] - else: + try: + return tree.root_inventory[file_id] + except errors.NoSuchId: return None this_entry = get_entry(self.this_tree) other_entry = get_entry(self.other_tree) @@ -1940,7 +1875,7 @@ def _entries_to_incorporate(self): """Yields pairs of (inventory_entry, new_parent).""" - other_inv = self.other_tree.inventory + other_inv = self.other_tree.root_inventory subdir_id = other_inv.path2id(self._source_subpath) if subdir_id is None: # XXX: The error would be clearer if it gave the URL of the source @@ -1948,13 +1883,13 @@ raise PathNotInTree(self._source_subpath, "Source tree") subdir = other_inv[subdir_id] parent_in_target = osutils.dirname(self._target_subdir) - target_id = self.this_tree.inventory.path2id(parent_in_target) + target_id = self.this_tree.path2id(parent_in_target) if target_id is None: raise PathNotInTree(self._target_subdir, "Target tree") name_in_target = osutils.basename(self._target_subdir) merge_into_root = subdir.copy() merge_into_root.name = name_in_target - if self.this_tree.inventory.has_id(merge_into_root.file_id): + if self.this_tree.has_id(merge_into_root.file_id): # Give the root a new file-id. # This can happen fairly easily if the directory we are # incorporating is the root, and both trees have 'TREE_ROOT' as diff -Nru bzr-2.5.0/bzrlib/mergetools.py bzr-2.6.0~beta1/bzrlib/mergetools.py --- bzr-2.5.0/bzrlib/mergetools.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/mergetools.py 2012-03-15 10:00:24.000000000 +0000 @@ -48,13 +48,13 @@ cmd_list = cmdline.split(command_line) exe = cmd_list[0] if sys.platform == 'win32': - if os.path.isabs(exe): - base, ext = os.path.splitext(exe) - path_ext = [unicode(s.lower()) - for s in os.getenv('PATHEXT', '').split(os.pathsep)] - return os.path.exists(exe) and ext in path_ext - else: - return osutils.find_executable_on_path(exe) is not None + exe = _get_executable_path(exe) + if exe is None: + return False + base, ext = os.path.splitext(exe) + path_ext = [unicode(s.lower()) + for s in os.getenv('PATHEXT', '').split(os.pathsep)] + return os.path.exists(exe) and ext in path_ext else: return (os.access(exe, os.X_OK) or osutils.find_executable_on_path(exe) is not None) @@ -69,6 +69,9 @@ if invoker is None: invoker = subprocess_invoker cmd_list = cmdline.split(command_line) + exe = _get_executable_path(cmd_list[0]) + if exe is not None: + cmd_list[0] = exe args, tmp_file = _subst_filename(cmd_list, filename) def cleanup(retcode): if tmp_file is not None: @@ -79,6 +82,12 @@ return invoker(args[0], args[1:], cleanup) +def _get_executable_path(exe): + if os.path.isabs(exe): + return exe + return osutils.find_executable_on_path(exe) + + def _subst_filename(args, filename): subst_names = { 'base': filename + u'.BASE', diff -Nru bzr-2.5.0/bzrlib/mutabletree.py bzr-2.6.0~beta1/bzrlib/mutabletree.py --- bzr-2.5.0/bzrlib/mutabletree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/mutabletree.py 2012-03-15 10:00:24.000000000 +0000 @@ -408,7 +408,7 @@ :seealso Inventory.apply_delta: For details on the changes parameter. """ self.flush() - inv = self.inventory + inv = self.root_inventory inv.apply_delta(changes) self._write_inventory(inv) @@ -623,7 +623,7 @@ # nb: this relies on someone else checking that the path we're using # doesn't contain symlinks. parent_ie = self._convert_to_directory(parent_ie, inv_dirname) - file_id = self.action(self.tree.inventory, parent_ie, path, kind) + file_id = self.action(self.tree, parent_ie, path, kind) entry = _mod_inventory.make_entry(kind, basename, parent_ie.file_id, file_id=file_id) self._invdelta[inv_path] = (None, inv_path, entry.file_id, entry) diff -Nru bzr-2.5.0/bzrlib/osutils.py bzr-2.6.0~beta1/bzrlib/osutils.py --- bzr-2.5.0/bzrlib/osutils.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/osutils.py 2012-03-15 10:00:24.000000000 +0000 @@ -450,6 +450,29 @@ return unicodedata.normalize('NFC', os.getcwdu()) +def _rename_wrap_exception(rename_func): + """Adds extra information to any exceptions that come from rename(). + + The exception has an updated message and 'old_filename' and 'new_filename' + attributes. + """ + + def _rename_wrapper(old, new): + try: + rename_func(old, new) + except OSError, e: + detailed_error = OSError(e.errno, e.strerror + + " [occurred when renaming '%s' to '%s']" % + (old, new)) + detailed_error.old_filename = old + detailed_error.new_filename = new + raise detailed_error + + return _rename_wrapper + +# Default rename wraps os.rename() +rename = _rename_wrap_exception(os.rename) + # Default is to just use the python builtins, but these can be rebound on # particular platforms. abspath = _posix_abspath @@ -460,7 +483,6 @@ _get_home_dir = _posix_get_home_dir getuser_unicode = _posix_getuser_unicode getcwd = os.getcwdu -rename = os.rename dirname = os.path.dirname basename = os.path.basename split = os.path.split @@ -488,7 +510,7 @@ normpath = _win32_normpath getcwd = _win32_getcwd mkdtemp = _win32_mkdtemp - rename = _win32_rename + rename = _rename_wrap_exception(_win32_rename) try: from bzrlib import _walkdirs_win32 except ImportError: @@ -2473,10 +2495,6 @@ :param name: The base name of the executable. :return: The path to the executable found or None. """ - path = os.environ.get('PATH') - if path is None: - return None - path = path.split(os.pathsep) if sys.platform == 'win32': exts = os.environ.get('PATHEXT', '').split(os.pathsep) exts = [ext.lower() for ext in exts] @@ -2488,11 +2506,18 @@ exts = [ext] else: exts = [''] - for ext in exts: - for d in path: - f = os.path.join(d, name) + ext - if os.access(f, os.X_OK): - return f + path = os.environ.get('PATH') + if path is not None: + path = path.split(os.pathsep) + for ext in exts: + for d in path: + f = os.path.join(d, name) + ext + if os.access(f, os.X_OK): + return f + if sys.platform == 'win32': + app_path = win32utils.get_app_path(name) + if app_path != name: + return app_path return None diff -Nru bzr-2.5.0/bzrlib/plugins/changelog_merge/changelog_merge.py bzr-2.6.0~beta1/bzrlib/plugins/changelog_merge/changelog_merge.py --- bzr-2.5.0/bzrlib/plugins/changelog_merge/changelog_merge.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/changelog_merge/changelog_merge.py 2012-03-15 10:00:24.000000000 +0000 @@ -20,8 +20,11 @@ import difflib -from bzrlib import merge -from bzrlib import debug +from bzrlib import ( + debug, + merge, + urlutils, + ) from bzrlib.merge3 import Merge3 from bzrlib.trace import mutter @@ -71,7 +74,7 @@ :param params: A MergeHookParams describing the file to merge :param tree: a Tree, e.g. self.merger.this_tree. """ - return tree.inventory[params.file_id].name + return urlutils.basename(tree.id2path(params.file_id)) def merge_text(self, params): """Merge changelog changes. diff -Nru bzr-2.5.0/bzrlib/plugins/changelog_merge/tests/test_changelog_merge.py bzr-2.6.0~beta1/bzrlib/plugins/changelog_merge/tests/test_changelog_merge.py --- bzr-2.5.0/bzrlib/plugins/changelog_merge/tests/test_changelog_merge.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/changelog_merge/tests/test_changelog_merge.py 2012-03-15 10:00:24.000000000 +0000 @@ -186,7 +186,7 @@ base_text, True) builder.change_contents('clog-id', other=other_text, this=this_text) merger = builder.make_merger(merge.Merge3Merger, ['clog-id']) - merger.this_branch.get_config().set_user_option( + merger.this_branch.get_config_stack().set( 'changelog_merge_files', 'ChangeLog') merge_hook_params = merge.MergeFileHookParams(merger, 'clog-id', None, 'file', 'file', 'conflict') diff -Nru bzr-2.5.0/bzrlib/plugins/launchpad/account.py bzr-2.6.0~beta1/bzrlib/plugins/launchpad/account.py --- bzr-2.5.0/bzrlib/plugins/launchpad/account.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/launchpad/account.py 2012-03-15 10:00:24.000000000 +0000 @@ -27,7 +27,7 @@ trace, transport, ) -from bzrlib.config import AuthenticationConfig, GlobalConfig +from bzrlib.config import AuthenticationConfig, GlobalStack from bzrlib.i18n import gettext LAUNCHPAD_BASE = 'https://launchpad.net/' @@ -55,9 +55,9 @@ disagree about username. """ if _config is None: - _config = GlobalConfig() + _config = GlobalStack() - username = _config.get_user_option('launchpad_username') + username = _config.get('launchpad_username') if username is not None: auth = AuthenticationConfig() auth_username = _get_auth_user(auth) @@ -72,8 +72,8 @@ def _set_global_option(username, _config=None): if _config is None: - _config = GlobalConfig() - _config.set_user_option('launchpad_username', username) + _config = GlobalStack() + _config.set('launchpad_username', username) def set_lp_login(username, _config=None): diff -Nru bzr-2.5.0/bzrlib/plugins/launchpad/cmds.py bzr-2.6.0~beta1/bzrlib/plugins/launchpad/cmds.py --- bzr-2.5.0/bzrlib/plugins/launchpad/cmds.py 1970-01-01 00:00:00.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/launchpad/cmds.py 2012-03-15 10:00:24.000000000 +0000 @@ -0,0 +1,410 @@ +# Copyright (C) 2006-2012 Canonical Ltd +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +"""Launchpad plugin commands.""" + +from __future__ import absolute_import + +from bzrlib import ( + branch as _mod_branch, + controldir, + trace, + ) +from bzrlib.commands import ( + Command, + ) +from bzrlib.errors import ( + BzrCommandError, + InvalidRevisionSpec, + InvalidURL, + NoPublicBranch, + NotBranchError, + ) +from bzrlib.i18n import gettext +from bzrlib.option import ( + Option, + ListOption, + ) + + +class cmd_register_branch(Command): + __doc__ = """Register a branch with launchpad.net. + + This command lists a bzr branch in the directory of branches on + launchpad.net. Registration allows the branch to be associated with + bugs or specifications. + + Before using this command you must register the project to which the + branch belongs, and create an account for yourself on launchpad.net. + + arguments: + public_url: The publicly visible url for the branch to register. + This must be an http or https url (which Launchpad can read + from to access the branch). Local file urls, SFTP urls, and + bzr+ssh urls will not work. + If no public_url is provided, bzr will use the configured + public_url if there is one for the current branch, and + otherwise error. + + example: + bzr register-branch http://foo.com/bzr/fooproject.mine \\ + --project fooproject + """ + takes_args = ['public_url?'] + takes_options = [ + Option('project', + 'Launchpad project short name to associate with the branch.', + unicode), + Option('product', + 'Launchpad product short name to associate with the branch.', + unicode, + hidden=True), + Option('branch-name', + 'Short name for the branch; ' + 'by default taken from the last component of the url.', + unicode), + Option('branch-title', + 'One-sentence description of the branch.', + unicode), + Option('branch-description', + 'Longer description of the purpose or contents of the branch.', + unicode), + Option('author', + "Branch author's email address, if not yourself.", + unicode), + Option('link-bug', + 'The bug this branch fixes.', + int), + Option('dry-run', + 'Prepare the request but don\'t actually send it.') + ] + + + def run(self, + public_url=None, + project='', + product=None, + branch_name='', + branch_title='', + branch_description='', + author='', + link_bug=None, + dry_run=False): + from bzrlib.plugins.launchpad.lp_registration import ( + BranchRegistrationRequest, BranchBugLinkRequest, + DryRunLaunchpadService, LaunchpadService) + if public_url is None: + try: + b = _mod_branch.Branch.open_containing('.')[0] + except NotBranchError: + raise BzrCommandError(gettext( + 'register-branch requires a public ' + 'branch url - see bzr help register-branch.')) + public_url = b.get_public_branch() + if public_url is None: + raise NoPublicBranch(b) + if product is not None: + project = product + trace.note(gettext( + '--product is deprecated; please use --project.')) + + + rego = BranchRegistrationRequest(branch_url=public_url, + branch_name=branch_name, + branch_title=branch_title, + branch_description=branch_description, + product_name=project, + author_email=author, + ) + linko = BranchBugLinkRequest(branch_url=public_url, + bug_id=link_bug) + if not dry_run: + service = LaunchpadService() + # This gives back the xmlrpc url that can be used for future + # operations on the branch. It's not so useful to print to the + # user since they can't do anything with it from a web browser; it + # might be nice for the server to tell us about an html url as + # well. + else: + # Run on service entirely in memory + service = DryRunLaunchpadService() + service.gather_user_credentials() + rego.submit(service) + if link_bug: + linko.submit(service) + self.outf.write('Branch registered.\n') + + +class cmd_launchpad_open(Command): + __doc__ = """Open a Launchpad branch page in your web browser.""" + + aliases = ['lp-open'] + takes_options = [ + Option('dry-run', + 'Do not actually open the browser. Just say the URL we would ' + 'use.'), + ] + takes_args = ['location?'] + + def _possible_locations(self, location): + """Yield possible external locations for the branch at 'location'.""" + yield location + try: + branch = _mod_branch.Branch.open_containing(location)[0] + except NotBranchError: + return + branch_url = branch.get_public_branch() + if branch_url is not None: + yield branch_url + branch_url = branch.get_push_location() + if branch_url is not None: + yield branch_url + + def _get_web_url(self, service, location): + from bzrlib.plugins.launchpad.lp_registration import ( + NotLaunchpadBranch) + for branch_url in self._possible_locations(location): + try: + return service.get_web_url_from_branch_url(branch_url) + except (NotLaunchpadBranch, InvalidURL): + pass + raise NotLaunchpadBranch(branch_url) + + def run(self, location=None, dry_run=False): + from bzrlib.plugins.launchpad.lp_registration import ( + LaunchpadService) + if location is None: + location = u'.' + web_url = self._get_web_url(LaunchpadService(), location) + trace.note(gettext('Opening %s in web browser') % web_url) + if not dry_run: + import webbrowser # this import should not be lazy + # otherwise bzr.exe lacks this module + webbrowser.open(web_url) + + +class cmd_launchpad_login(Command): + __doc__ = """Show or set the Launchpad user ID. + + When communicating with Launchpad, some commands need to know your + Launchpad user ID. This command can be used to set or show the + user ID that Bazaar will use for such communication. + + :Examples: + Show the Launchpad ID of the current user:: + + bzr launchpad-login + + Set the Launchpad ID of the current user to 'bob':: + + bzr launchpad-login bob + """ + aliases = ['lp-login'] + takes_args = ['name?'] + takes_options = [ + 'verbose', + Option('no-check', + "Don't check that the user name is valid."), + ] + + def run(self, name=None, no_check=False, verbose=False): + # This is totally separate from any launchpadlib login system. + from bzrlib.plugins.launchpad import account + check_account = not no_check + + if name is None: + username = account.get_lp_login() + if username: + if check_account: + account.check_lp_login(username) + if verbose: + self.outf.write(gettext( + "Launchpad user ID exists and has SSH keys.\n")) + self.outf.write(username + '\n') + else: + self.outf.write(gettext('No Launchpad user ID configured.\n')) + return 1 + else: + name = name.lower() + if check_account: + account.check_lp_login(name) + if verbose: + self.outf.write(gettext( + "Launchpad user ID exists and has SSH keys.\n")) + account.set_lp_login(name) + if verbose: + self.outf.write(gettext("Launchpad user ID set to '%s'.\n") % + (name,)) + + +# XXX: cmd_launchpad_mirror is untested +class cmd_launchpad_mirror(Command): + __doc__ = """Ask Launchpad to mirror a branch now.""" + + aliases = ['lp-mirror'] + takes_args = ['location?'] + + def run(self, location='.'): + from bzrlib.plugins.launchpad import lp_api + from bzrlib.plugins.launchpad.lp_registration import LaunchpadService + branch, _ = _mod_branch.Branch.open_containing(location) + service = LaunchpadService() + launchpad = lp_api.login(service) + lp_branch = lp_api.LaunchpadBranch.from_bzr(launchpad, branch, + create_missing=False) + lp_branch.lp.requestMirror() + + +class cmd_lp_propose_merge(Command): + __doc__ = """Propose merging a branch on Launchpad. + + This will open your usual editor to provide the initial comment. When it + has created the proposal, it will open it in your default web browser. + + The branch will be proposed to merge into SUBMIT_BRANCH. If SUBMIT_BRANCH + is not supplied, the remembered submit branch will be used. If no submit + branch is remembered, the development focus will be used. + + By default, the SUBMIT_BRANCH's review team will be requested to review + the merge proposal. This can be overriden by specifying --review (-R). + The parameter the launchpad account name of the desired reviewer. This + may optionally be followed by '=' and the review type. For example: + + bzr lp-propose-merge --review jrandom --review review-team=qa + + This will propose a merge, request "jrandom" to perform a review of + unspecified type, and request "review-team" to perform a "qa" review. + """ + + takes_options = [Option('staging', + help='Propose the merge on staging.'), + Option('message', short_name='m', type=unicode, + help='Commit message.'), + Option('approve', + help='Mark the proposal as approved immediately.'), + Option('fixes', 'The bug this proposal fixes.', str), + ListOption('review', short_name='R', type=unicode, + help='Requested reviewer and optional type.')] + + takes_args = ['submit_branch?'] + + aliases = ['lp-submit', 'lp-propose'] + + def run(self, submit_branch=None, review=None, staging=False, + message=None, approve=False, fixes=None): + from bzrlib.plugins.launchpad import lp_propose + tree, branch, relpath = controldir.ControlDir.open_containing_tree_or_branch( + '.') + if review is None: + reviews = None + else: + reviews = [] + for review in review: + if '=' in review: + reviews.append(review.split('=', 2)) + else: + reviews.append((review, '')) + if submit_branch is None: + submit_branch = branch.get_submit_branch() + if submit_branch is None: + target = None + else: + target = _mod_branch.Branch.open(submit_branch) + proposer = lp_propose.Proposer(tree, branch, target, message, + reviews, staging, approve=approve, + fixes=fixes) + proposer.check_proposal() + proposer.create_proposal() + + +class cmd_lp_find_proposal(Command): + + __doc__ = """Find the proposal to merge this revision. + + Finds the merge proposal(s) that discussed landing the specified revision. + This works only if the selected branch was the merge proposal target, and + if the merged_revno is recorded for the merge proposal. The proposal(s) + are opened in a web browser. + + Any revision involved in the merge may be specified-- the revision in + which the merge was performed, or one of the revisions that was merged. + + So, to find the merge proposal that reviewed line 1 of README:: + + bzr lp-find-proposal -r annotate:README:1 + """ + + takes_options = ['revision'] + + def run(self, revision=None): + from bzrlib import ui + from bzrlib.plugins.launchpad import lp_api + import webbrowser + b = _mod_branch.Branch.open_containing('.')[0] + pb = ui.ui_factory.nested_progress_bar() + b.lock_read() + try: + revno = self._find_merged_revno(revision, b, pb) + merged = self._find_proposals(revno, b, pb) + if len(merged) == 0: + raise BzrCommandError(gettext('No review found.')) + trace.note(gettext('%d proposals(s) found.') % len(merged)) + for mp in merged: + webbrowser.open(lp_api.canonical_url(mp)) + finally: + b.unlock() + pb.finished() + + def _find_merged_revno(self, revision, b, pb): + if revision is None: + return b.revno() + pb.update(gettext('Finding revision-id')) + revision_id = revision[0].as_revision_id(b) + # a revno spec is necessarily on the mainline. + if self._is_revno_spec(revision[0]): + merging_revision = revision_id + else: + graph = b.repository.get_graph() + pb.update(gettext('Finding merge')) + merging_revision = graph.find_lefthand_merger( + revision_id, b.last_revision()) + if merging_revision is None: + raise InvalidRevisionSpec(revision[0].user_spec, b) + pb.update(gettext('Finding revno')) + return b.revision_id_to_revno(merging_revision) + + def _find_proposals(self, revno, b, pb): + from bzrlib.plugins.launchpad import (lp_api, lp_registration) + launchpad = lp_api.login(lp_registration.LaunchpadService()) + pb.update(gettext('Finding Launchpad branch')) + lpb = lp_api.LaunchpadBranch.from_bzr(launchpad, b, + create_missing=False) + pb.update(gettext('Finding proposals')) + return list(lpb.lp.getMergeProposals(status=['Merged'], + merged_revnos=[revno])) + + + @staticmethod + def _is_revno_spec(spec): + try: + int(spec.user_spec) + except ValueError: + return False + else: + return True + + + diff -Nru bzr-2.5.0/bzrlib/plugins/launchpad/__init__.py bzr-2.6.0~beta1/bzrlib/plugins/launchpad/__init__.py --- bzr-2.5.0/bzrlib/plugins/launchpad/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/launchpad/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -42,417 +42,29 @@ # see http://wiki.bazaar.canonical.com/Specs/BranchRegistrationTool -from bzrlib.lazy_import import lazy_import -lazy_import(globals(), """ -from bzrlib import ( - ui, - trace, - ) -from bzrlib.i18n import gettext -""") - from bzrlib import ( branch as _mod_branch, - bzrdir, + config as _mod_config, lazy_regex, # Since we are a built-in plugin we share the bzrlib version + trace, version_info, ) from bzrlib.commands import ( - Command, - register_command, + plugin_cmds, ) from bzrlib.directory_service import directories -from bzrlib.errors import ( - BzrCommandError, - InvalidRevisionSpec, - InvalidURL, - NoPublicBranch, - NotBranchError, - ) from bzrlib.help_topics import topic_registry -from bzrlib.option import ( - Option, - ListOption, -) - - -class cmd_register_branch(Command): - __doc__ = """Register a branch with launchpad.net. - - This command lists a bzr branch in the directory of branches on - launchpad.net. Registration allows the branch to be associated with - bugs or specifications. - - Before using this command you must register the project to which the - branch belongs, and create an account for yourself on launchpad.net. - - arguments: - public_url: The publicly visible url for the branch to register. - This must be an http or https url (which Launchpad can read - from to access the branch). Local file urls, SFTP urls, and - bzr+ssh urls will not work. - If no public_url is provided, bzr will use the configured - public_url if there is one for the current branch, and - otherwise error. - - example: - bzr register-branch http://foo.com/bzr/fooproject.mine \\ - --project fooproject - """ - takes_args = ['public_url?'] - takes_options = [ - Option('project', - 'Launchpad project short name to associate with the branch.', - unicode), - Option('product', - 'Launchpad product short name to associate with the branch.', - unicode, - hidden=True), - Option('branch-name', - 'Short name for the branch; ' - 'by default taken from the last component of the url.', - unicode), - Option('branch-title', - 'One-sentence description of the branch.', - unicode), - Option('branch-description', - 'Longer description of the purpose or contents of the branch.', - unicode), - Option('author', - "Branch author's email address, if not yourself.", - unicode), - Option('link-bug', - 'The bug this branch fixes.', - int), - Option('dry-run', - 'Prepare the request but don\'t actually send it.') - ] - - def run(self, - public_url=None, - project='', - product=None, - branch_name='', - branch_title='', - branch_description='', - author='', - link_bug=None, - dry_run=False): - from bzrlib.plugins.launchpad.lp_registration import ( - BranchRegistrationRequest, BranchBugLinkRequest, - DryRunLaunchpadService, LaunchpadService) - if public_url is None: - try: - b = _mod_branch.Branch.open_containing('.')[0] - except NotBranchError: - raise BzrCommandError(gettext( - 'register-branch requires a public ' - 'branch url - see bzr help register-branch.')) - public_url = b.get_public_branch() - if public_url is None: - raise NoPublicBranch(b) - if product is not None: - project = product - trace.note(gettext( - '--product is deprecated; please use --project.')) - - - rego = BranchRegistrationRequest(branch_url=public_url, - branch_name=branch_name, - branch_title=branch_title, - branch_description=branch_description, - product_name=project, - author_email=author, - ) - linko = BranchBugLinkRequest(branch_url=public_url, - bug_id=link_bug) - if not dry_run: - service = LaunchpadService() - # This gives back the xmlrpc url that can be used for future - # operations on the branch. It's not so useful to print to the - # user since they can't do anything with it from a web browser; it - # might be nice for the server to tell us about an html url as - # well. - else: - # Run on service entirely in memory - service = DryRunLaunchpadService() - service.gather_user_credentials() - rego.submit(service) - if link_bug: - linko.submit(service) - print 'Branch registered.' - -register_command(cmd_register_branch) - - -class cmd_launchpad_open(Command): - __doc__ = """Open a Launchpad branch page in your web browser.""" - - aliases = ['lp-open'] - takes_options = [ - Option('dry-run', - 'Do not actually open the browser. Just say the URL we would ' - 'use.'), - ] - takes_args = ['location?'] - - def _possible_locations(self, location): - """Yield possible external locations for the branch at 'location'.""" - yield location - try: - branch = _mod_branch.Branch.open_containing(location)[0] - except NotBranchError: - return - branch_url = branch.get_public_branch() - if branch_url is not None: - yield branch_url - branch_url = branch.get_push_location() - if branch_url is not None: - yield branch_url - - def _get_web_url(self, service, location): - from bzrlib.plugins.launchpad.lp_registration import ( - NotLaunchpadBranch) - for branch_url in self._possible_locations(location): - try: - return service.get_web_url_from_branch_url(branch_url) - except (NotLaunchpadBranch, InvalidURL): - pass - raise NotLaunchpadBranch(branch_url) - - def run(self, location=None, dry_run=False): - from bzrlib.plugins.launchpad.lp_registration import ( - LaunchpadService) - if location is None: - location = u'.' - web_url = self._get_web_url(LaunchpadService(), location) - trace.note(gettext('Opening %s in web browser') % web_url) - if not dry_run: - import webbrowser # this import should not be lazy - # otherwise bzr.exe lacks this module - webbrowser.open(web_url) - -register_command(cmd_launchpad_open) - - -class cmd_launchpad_login(Command): - __doc__ = """Show or set the Launchpad user ID. - - When communicating with Launchpad, some commands need to know your - Launchpad user ID. This command can be used to set or show the - user ID that Bazaar will use for such communication. - - :Examples: - Show the Launchpad ID of the current user:: - - bzr launchpad-login - - Set the Launchpad ID of the current user to 'bob':: - - bzr launchpad-login bob - """ - aliases = ['lp-login'] - takes_args = ['name?'] - takes_options = [ - 'verbose', - Option('no-check', - "Don't check that the user name is valid."), - ] - - def run(self, name=None, no_check=False, verbose=False): - # This is totally separate from any launchpadlib login system. - from bzrlib.plugins.launchpad import account - check_account = not no_check - - if name is None: - username = account.get_lp_login() - if username: - if check_account: - account.check_lp_login(username) - if verbose: - self.outf.write(gettext( - "Launchpad user ID exists and has SSH keys.\n")) - self.outf.write(username + '\n') - else: - self.outf.write(gettext('No Launchpad user ID configured.\n')) - return 1 - else: - name = name.lower() - if check_account: - account.check_lp_login(name) - if verbose: - self.outf.write(gettext( - "Launchpad user ID exists and has SSH keys.\n")) - account.set_lp_login(name) - if verbose: - self.outf.write(gettext("Launchpad user ID set to '%s'.\n") % - (name,)) - -register_command(cmd_launchpad_login) - - -# XXX: cmd_launchpad_mirror is untested -class cmd_launchpad_mirror(Command): - __doc__ = """Ask Launchpad to mirror a branch now.""" - - aliases = ['lp-mirror'] - takes_args = ['location?'] - - def run(self, location='.'): - from bzrlib.plugins.launchpad import lp_api - from bzrlib.plugins.launchpad.lp_registration import LaunchpadService - branch, _ = _mod_branch.Branch.open_containing(location) - service = LaunchpadService() - launchpad = lp_api.login(service) - lp_branch = lp_api.LaunchpadBranch.from_bzr(launchpad, branch, - create_missing=False) - lp_branch.lp.requestMirror() - - -register_command(cmd_launchpad_mirror) - - -class cmd_lp_propose_merge(Command): - __doc__ = """Propose merging a branch on Launchpad. - - This will open your usual editor to provide the initial comment. When it - has created the proposal, it will open it in your default web browser. - - The branch will be proposed to merge into SUBMIT_BRANCH. If SUBMIT_BRANCH - is not supplied, the remembered submit branch will be used. If no submit - branch is remembered, the development focus will be used. - - By default, the SUBMIT_BRANCH's review team will be requested to review - the merge proposal. This can be overriden by specifying --review (-R). - The parameter the launchpad account name of the desired reviewer. This - may optionally be followed by '=' and the review type. For example: - - bzr lp-propose-merge --review jrandom --review review-team=qa - - This will propose a merge, request "jrandom" to perform a review of - unspecified type, and request "review-team" to perform a "qa" review. - """ - - takes_options = [Option('staging', - help='Propose the merge on staging.'), - Option('message', short_name='m', type=unicode, - help='Commit message.'), - Option('approve', - help='Mark the proposal as approved immediately.'), - ListOption('review', short_name='R', type=unicode, - help='Requested reviewer and optional type.')] - - takes_args = ['submit_branch?'] - - aliases = ['lp-submit', 'lp-propose'] - - def run(self, submit_branch=None, review=None, staging=False, - message=None, approve=False): - from bzrlib.plugins.launchpad import lp_propose - tree, branch, relpath = bzrdir.BzrDir.open_containing_tree_or_branch( - '.') - if review is None: - reviews = None - else: - reviews = [] - for review in review: - if '=' in review: - reviews.append(review.split('=', 2)) - else: - reviews.append((review, '')) - if submit_branch is None: - submit_branch = branch.get_submit_branch() - if submit_branch is None: - target = None - else: - target = _mod_branch.Branch.open(submit_branch) - proposer = lp_propose.Proposer(tree, branch, target, message, - reviews, staging, approve=approve) - proposer.check_proposal() - proposer.create_proposal() - - -register_command(cmd_lp_propose_merge) - - -class cmd_lp_find_proposal(Command): - - __doc__ = """Find the proposal to merge this revision. - - Finds the merge proposal(s) that discussed landing the specified revision. - This works only if the selected branch was the merge proposal target, and - if the merged_revno is recorded for the merge proposal. The proposal(s) - are opened in a web browser. - - Any revision involved in the merge may be specified-- the revision in - which the merge was performed, or one of the revisions that was merged. - - So, to find the merge proposal that reviewed line 1 of README:: - - bzr lp-find-proposal -r annotate:README:1 - """ - - takes_options = ['revision'] - - def run(self, revision=None): - from bzrlib.plugins.launchpad import lp_api - import webbrowser - b = _mod_branch.Branch.open_containing('.')[0] - pb = ui.ui_factory.nested_progress_bar() - b.lock_read() - try: - revno = self._find_merged_revno(revision, b, pb) - merged = self._find_proposals(revno, b, pb) - if len(merged) == 0: - raise BzrCommandError(gettext('No review found.')) - trace.note(gettext('%d proposals(s) found.') % len(merged)) - for mp in merged: - webbrowser.open(lp_api.canonical_url(mp)) - finally: - b.unlock() - pb.finished() - - def _find_merged_revno(self, revision, b, pb): - if revision is None: - return b.revno() - pb.update(gettext('Finding revision-id')) - revision_id = revision[0].as_revision_id(b) - # a revno spec is necessarily on the mainline. - if self._is_revno_spec(revision[0]): - merging_revision = revision_id - else: - graph = b.repository.get_graph() - pb.update(gettext('Finding merge')) - merging_revision = graph.find_lefthand_merger( - revision_id, b.last_revision()) - if merging_revision is None: - raise InvalidRevisionSpec(revision[0].user_spec, b) - pb.update(gettext('Finding revno')) - return b.revision_id_to_revno(merging_revision) - - def _find_proposals(self, revno, b, pb): - launchpad = lp_api.login(lp_registration.LaunchpadService()) - pb.update(gettext('Finding Launchpad branch')) - lpb = lp_api.LaunchpadBranch.from_bzr(launchpad, b, - create_missing=False) - pb.update(gettext('Finding proposals')) - return list(lpb.lp.getMergeProposals(status=['Merged'], - merged_revnos=[revno])) - - - @staticmethod - def _is_revno_spec(spec): - try: - int(spec.user_spec) - except ValueError: - return False - else: - return True - - -register_command(cmd_lp_find_proposal) +for klsname, aliases in [ + ("cmd_register_branch", []), + ("cmd_launchpad_open", ["lp-open"]), + ("cmd_launchpad_login", ["lp-login"]), + ("cmd_launchpad_mirror", ["lp-mirror"]), + ("cmd_lp_propose_merge", ["lp-submit", "lp-propose"]), + ("cmd_lp_find_proposal", [])]: + plugin_cmds.register_lazy(klsname, aliases, + "bzrlib.plugins.launchpad.cmds") def _register_directory(): @@ -507,11 +119,9 @@ info = _get_package_branch_info(the_branch.base) if info is None: return - c = the_branch.get_config() - verbosity = c.get_user_option('launchpad.packaging_verbosity') - if verbosity is not None: - verbosity = verbosity.lower() - if verbosity == 'off': + c = the_branch.get_config_stack() + verbosity = c.get('launchpad.packaging_verbosity') + if not verbosity: trace.mutter('not checking %s because verbosity is turned off' % (the_branch.base,)) return @@ -577,3 +187,15 @@ topic_registry.register('launchpad', _launchpad_help, 'Using Bazaar with Launchpad.net') + +_mod_config.option_registry.register( + _mod_config.Option('launchpad.packaging_verbosity', default=True, + from_unicode=_mod_config.bool_from_store, + help="""\ +Whether to warn if a UDD package import branch is accessed that is out of date. + +Setting this option to 'off' will disable verbosity. +""")) +_mod_config.option_registry.register( + _mod_config.Option('launchpad_username', default=None, + help="The username to login with when conneting to Launchpad.")) diff -Nru bzr-2.5.0/bzrlib/plugins/launchpad/lp_propose.py bzr-2.6.0~beta1/bzrlib/plugins/launchpad/lp_propose.py --- bzr-2.5.0/bzrlib/plugins/launchpad/lp_propose.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/launchpad/lp_propose.py 2012-03-15 10:00:24.000000000 +0000 @@ -52,7 +52,7 @@ hooks = ProposeMergeHooks() def __init__(self, tree, source_branch, target_branch, message, reviews, - staging=False, approve=False): + staging=False, approve=False, fixes=None): """Constructor. :param tree: The working tree for the source branch. @@ -90,6 +90,7 @@ for reviewer, review_type in reviews] self.approve = approve + self.fixes = fixes def get_comment(self, prerequisite_branch): """Determine the initial comment for the merge proposal.""" @@ -203,6 +204,12 @@ review_types=review_types) if self.approve: self.call_webservice(mp.setStatus, status='Approved') + if self.fixes: + if self.fixes.startswith('lp:'): + self.fixes = self.fixes[3:] + self.call_webservice( + self.source_branch.lp.linkBug, + bug=self.launchpad.bugs[int(self.fixes)]) webbrowser.open(lp_api.canonical_url(mp)) diff -Nru bzr-2.5.0/bzrlib/plugins/launchpad/test_account.py bzr-2.6.0~beta1/bzrlib/plugins/launchpad/test_account.py --- bzr-2.5.0/bzrlib/plugins/launchpad/test_account.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/launchpad/test_account.py 2012-03-15 10:00:24.000000000 +0000 @@ -16,8 +16,6 @@ """Tests for Launchpad user ID management functions.""" -from cStringIO import StringIO - from bzrlib import config from bzrlib.tests import TestCaseInTempDir, TestCaseWithMemoryTransport from bzrlib.plugins.launchpad import account @@ -25,29 +23,25 @@ class LaunchpadAccountTests(TestCaseInTempDir): - def setup_config(self, text): - my_config = config.GlobalConfig.from_string(text) - return my_config - def test_get_lp_login_unconfigured(self): # Test that get_lp_login() returns None if no username has # been configured. - my_config = self.setup_config('') + my_config = config.MemoryStack('') self.assertEqual(None, account.get_lp_login(my_config)) def test_get_lp_login(self): # Test that get_lp_login() returns the configured username - my_config = self.setup_config( + my_config = config.MemoryStack( '[DEFAULT]\nlaunchpad_username=test-user\n') self.assertEqual('test-user', account.get_lp_login(my_config)) def test_set_lp_login(self): # Test that set_lp_login() updates the config file. - my_config = self.setup_config('') - self.assertEqual(None, my_config.get_user_option('launchpad_username')) + my_config = config.MemoryStack('') + self.assertEqual(None, my_config.get('launchpad_username')) account.set_lp_login('test-user', my_config) self.assertEqual( - 'test-user', my_config.get_user_option('launchpad_username')) + 'test-user', my_config.get('launchpad_username')) def test_unknown_launchpad_username(self): # Test formatting of UnknownLaunchpadUsername exception diff -Nru bzr-2.5.0/bzrlib/plugins/launchpad/test_lp_api_lite.py bzr-2.6.0~beta1/bzrlib/plugins/launchpad/test_lp_api_lite.py --- bzr-2.5.0/bzrlib/plugins/launchpad/test_lp_api_lite.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/launchpad/test_lp_api_lite.py 2012-03-15 10:00:24.000000000 +0000 @@ -425,8 +425,8 @@ lambda x: ('ubuntu', 'natty', 'bzr')) self.overrideAttr(lp_api_lite, 'LatestPublication', lambda *args: self.fail('Tried to query launchpad')) - c = self.branch.get_config() - c.set_user_option('launchpad.packaging_verbosity', 'off') + c = self.branch.get_config_stack() + c.set('launchpad.packaging_verbosity', 'off') orig_log_len = len(self.get_log()) launchpad._check_is_up_to_date(self.branch) new_content = self.get_log()[orig_log_len:] diff -Nru bzr-2.5.0/bzrlib/plugins/launchpad/test_lp_open.py bzr-2.6.0~beta1/bzrlib/plugins/launchpad/test_lp_open.py --- bzr-2.5.0/bzrlib/plugins/launchpad/test_lp_open.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/launchpad/test_lp_open.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Canonical Ltd +# Copyright (C) 2009, 2010, 2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,8 +51,7 @@ def test_launchpad_branch_with_public_location(self): branch = self.make_branch('lp') - branch.set_public_branch( - 'bzr+ssh://bazaar.launchpad.net/~foo/bar/baz') + branch.set_public_branch('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz') self.assertEqual( ['Opening https://code.launchpad.net/~foo/bar/baz in web ' 'browser'], @@ -60,10 +59,14 @@ def test_launchpad_branch_with_public_and_push_location(self): branch = self.make_branch('lp') - branch.set_public_branch( - 'bzr+ssh://bazaar.launchpad.net/~foo/bar/public') - branch.set_push_location( - 'bzr+ssh://bazaar.launchpad.net/~foo/bar/push') + branch.lock_write() + try: + branch.set_public_branch( + 'bzr+ssh://bazaar.launchpad.net/~foo/bar/public') + branch.set_push_location( + 'bzr+ssh://bazaar.launchpad.net/~foo/bar/push') + finally: + branch.unlock() self.assertEqual( ['Opening https://code.launchpad.net/~foo/bar/public in web ' 'browser'], @@ -73,8 +76,7 @@ # lp-open falls back to the push location if it cannot find a public # location. branch = self.make_branch('lp') - branch.set_push_location( - 'bzr+ssh://bazaar.launchpad.net/~foo/bar/baz') + branch.set_push_location('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz') self.assertEqual( ['Opening https://code.launchpad.net/~foo/bar/baz in web ' 'browser'], diff -Nru bzr-2.5.0/bzrlib/plugins/launchpad/test_register.py bzr-2.6.0~beta1/bzrlib/plugins/launchpad/test_register.py --- bzr-2.5.0/bzrlib/plugins/launchpad/test_register.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/launchpad/test_register.py 2012-03-15 10:00:24.000000000 +0000 @@ -329,8 +329,8 @@ def test_gather_user_credentials_from_auth_conf(self): auth_path = config.authentication_config_filename() service = LaunchpadService() - g_conf = config.GlobalConfig() - g_conf.set_user_option('email', 'Test User ') + g_conf = config.GlobalStack() + g_conf.set('email', 'Test User ') f = open(auth_path, 'wb') try: scheme, hostinfo = urlparse.urlsplit(service.service_url)[:2] @@ -350,8 +350,8 @@ def test_gather_user_credentials_prompts(self): service = LaunchpadService() self.assertIs(None, service.registrant_password) - g_conf = config.GlobalConfig() - g_conf.set_user_option('email', 'Test User ') + g_conf = config.GlobalStack() + g_conf.set('email', 'Test User ') stdout = tests.StringIOWrapper() stderr = tests.StringIOWrapper() ui.ui_factory = tests.TestUIFactory(stdin='userpass\n', diff -Nru bzr-2.5.0/bzrlib/plugins/weave_fmt/bzrdir.py bzr-2.6.0~beta1/bzrlib/plugins/weave_fmt/bzrdir.py --- bzr-2.5.0/bzrlib/plugins/weave_fmt/bzrdir.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/weave_fmt/bzrdir.py 2012-03-15 10:00:24.000000000 +0000 @@ -24,6 +24,7 @@ BzrDirMetaFormat1, ) from bzrlib.controldir import ( + ControlDir, Converter, format_registry, ) @@ -66,7 +67,7 @@ create_prefix=False, force_new_repo=False, stacked_on=None, stack_on_pwd=None, repo_format_name=None, make_working_trees=None, shared_repo=False): - """See BzrDirFormat.initialize_on_transport_ex.""" + """See ControlDir.initialize_on_transport_ex.""" require_stacking = (stacked_on is not None) # Format 5 cannot stack, but we've been asked to - actually init # a Meta1Dir @@ -116,11 +117,11 @@ return BzrBranchFormat4() def get_format_description(self): - """See BzrDirFormat.get_format_description().""" + """See ControlDirFormat.get_format_description().""" return "All-in-one format 5" def get_converter(self, format=None): - """See BzrDirFormat.get_converter().""" + """See ControlDirFormat.get_converter().""" # there is one and only one upgrade path here. return ConvertBzrDir5To6() @@ -176,7 +177,7 @@ return "Bazaar-NG branch, format 6\n" def get_format_description(self): - """See BzrDirFormat.get_format_description().""" + """See ControlDirFormat.get_format_description().""" return "All-in-one format 6" def get_branch_format(self): @@ -184,7 +185,7 @@ return BzrBranchFormat4() def get_converter(self, format=None): - """See BzrDirFormat.get_converter().""" + """See ControlDirFormat.get_converter().""" # there is one and only one upgrade path here. return ConvertBzrDir6ToMeta() @@ -240,7 +241,7 @@ if isinstance(self.bzrdir.transport, local.LocalTransport): self.bzrdir.get_workingtree_transport(None).delete('stat-cache') self._convert_to_weaves() - return BzrDir.open(self.bzrdir.user_url) + return ControlDir.open(self.bzrdir.user_url) finally: self.pb.finished() @@ -505,7 +506,7 @@ try: ui.ui_factory.note(gettext('starting upgrade from format 5 to 6')) self._convert_to_prefixed() - return BzrDir.open(self.bzrdir.user_url) + return ControlDir.open(self.bzrdir.user_url) finally: pb.finished() @@ -633,7 +634,7 @@ BzrDirMetaFormat1().get_format_string(), mode=self.file_mode) self.pb.finished() - return BzrDir.open(self.bzrdir.user_url) + return ControlDir.open(self.bzrdir.user_url) def make_lock(self, name): """Make a lock for the new control dir name.""" @@ -685,11 +686,11 @@ return "Bazaar-NG branch, format 0.0.4\n" def get_format_description(self): - """See BzrDirFormat.get_format_description().""" + """See ControlDirFormat.get_format_description().""" return "All-in-one format 4" def get_converter(self, format=None): - """See BzrDirFormat.get_converter().""" + """See ControlDirFormat.get_converter().""" # there is one and only one upgrade path here. return ConvertBzrDir4To5() @@ -730,7 +731,7 @@ """A common class for the all-in-one formats.""" def __init__(self, _transport, _format): - """See BzrDir.__init__.""" + """See ControlDir.__init__.""" super(BzrDirPreSplitOut, self).__init__(_transport, _format) self._control_files = lockable_files.LockableFiles( self.get_branch_transport(None), @@ -749,7 +750,7 @@ def clone(self, url, revision_id=None, force_new_repo=False, preserve_stacking=False): - """See BzrDir.clone(). + """See ControlDir.clone(). force_new_repo has no effect, since this family of formats always require a new repository. @@ -772,7 +773,7 @@ def create_branch(self, name=None, repository=None, append_revisions_only=None): - """See BzrDir.create_branch.""" + """See ControlDir.create_branch.""" if repository is not None: raise NotImplementedError( "create_branch(repository=) on %r" % (self,)) @@ -780,22 +781,22 @@ append_revisions_only=append_revisions_only) def destroy_branch(self, name=None): - """See BzrDir.destroy_branch.""" + """See ControlDir.destroy_branch.""" raise errors.UnsupportedOperation(self.destroy_branch, self) def create_repository(self, shared=False): - """See BzrDir.create_repository.""" + """See ControlDir.create_repository.""" if shared: raise errors.IncompatibleFormat('shared repository', self._format) return self.open_repository() def destroy_repository(self): - """See BzrDir.destroy_repository.""" + """See ControlDir.destroy_repository.""" raise errors.UnsupportedOperation(self.destroy_repository, self) def create_workingtree(self, revision_id=None, from_branch=None, accelerator_tree=None, hardlink=False): - """See BzrDir.create_workingtree.""" + """See ControlDir.create_workingtree.""" # The workingtree is sometimes created when the bzrdir is created, # but not when cloning. @@ -833,11 +834,11 @@ self.transport, self._control_files._file_mode) def destroy_workingtree(self): - """See BzrDir.destroy_workingtree.""" + """See ControlDir.destroy_workingtree.""" raise errors.UnsupportedOperation(self.destroy_workingtree, self) def destroy_workingtree_metadata(self): - """See BzrDir.destroy_workingtree_metadata.""" + """See ControlDir.destroy_workingtree_metadata.""" raise errors.UnsupportedOperation(self.destroy_workingtree_metadata, self) @@ -874,7 +875,7 @@ raise errors.IncompatibleFormat(workingtree_format, self._format) def needs_format_conversion(self, format=None): - """See BzrDir.needs_format_conversion().""" + """See ControlDir.needs_format_conversion().""" # if the format is not the same as the system default, # an upgrade is needed. if format is None: @@ -885,7 +886,7 @@ def open_branch(self, name=None, unsupported=False, ignore_fallbacks=False, possible_transports=None): - """See BzrDir.open_branch.""" + """See ControlDir.open_branch.""" from bzrlib.plugins.weave_fmt.branch import BzrBranchFormat4 format = BzrBranchFormat4() format.check_support_status(unsupported) @@ -896,7 +897,7 @@ possible_transports=None, accelerator_tree=None, hardlink=False, stacked=False, create_tree_if_local=True, source_branch=None): - """See BzrDir.sprout().""" + """See ControlDir.sprout().""" if source_branch is not None: my_branch = self.open_branch() if source_branch.base != my_branch.base: @@ -941,7 +942,7 @@ """ def create_repository(self, shared=False): - """See BzrDir.create_repository.""" + """See ControlDir.create_repository.""" return self._format.repository_format.initialize(self, shared) def needs_format_conversion(self, format=None): @@ -952,7 +953,7 @@ return True def open_repository(self): - """See BzrDir.open_repository.""" + """See ControlDir.open_repository.""" from bzrlib.plugins.weave_fmt.repository import RepositoryFormat4 return RepositoryFormat4().open(self, _found=True) @@ -964,17 +965,17 @@ """ def has_workingtree(self): - """See BzrDir.has_workingtree.""" + """See ControlDir.has_workingtree.""" return True def open_repository(self): - """See BzrDir.open_repository.""" + """See ControlDir.open_repository.""" from bzrlib.plugins.weave_fmt.repository import RepositoryFormat5 return RepositoryFormat5().open(self, _found=True) def open_workingtree(self, unsupported=False, recommend_upgrade=True): - """See BzrDir.create_workingtree.""" + """See ControlDir.create_workingtree.""" from bzrlib.plugins.weave_fmt.workingtree import WorkingTreeFormat2 wt_format = WorkingTreeFormat2() # we don't warn here about upgrades; that ought to be handled for the @@ -989,16 +990,16 @@ """ def has_workingtree(self): - """See BzrDir.has_workingtree.""" + """See ControlDir.has_workingtree.""" return True def open_repository(self): - """See BzrDir.open_repository.""" + """See ControlDir.open_repository.""" from bzrlib.plugins.weave_fmt.repository import RepositoryFormat6 return RepositoryFormat6().open(self, _found=True) def open_workingtree(self, unsupported=False, recommend_upgrade=True): - """See BzrDir.create_workingtree.""" + """See ControlDir.create_workingtree.""" # we don't warn here about upgrades; that ought to be handled for the # bzrdir as a whole from bzrlib.plugins.weave_fmt.workingtree import WorkingTreeFormat2 diff -Nru bzr-2.5.0/bzrlib/plugins/weave_fmt/test_bzrdir.py bzr-2.6.0~beta1/bzrlib/plugins/weave_fmt/test_bzrdir.py --- bzr-2.5.0/bzrlib/plugins/weave_fmt/test_bzrdir.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/weave_fmt/test_bzrdir.py 2012-03-15 10:00:24.000000000 +0000 @@ -27,6 +27,7 @@ from bzrlib import ( branch, bzrdir, + controldir, errors, repository, upgrade, @@ -66,7 +67,7 @@ self.assertTrue(ctrl_2 is ctrl_3) check_dir_components_use_same_lock(dir) # and if we open it normally. - dir = bzrdir.BzrDir.open(self.get_url()) + dir = controldir.ControlDir.open(self.get_url()) check_dir_components_use_same_lock(dir) def test_can_convert(self): @@ -100,7 +101,7 @@ self.assertTrue(ctrl_2 is ctrl_3) check_dir_components_use_same_lock(dir) # and if we open it normally. - dir = bzrdir.BzrDir.open(self.get_url()) + dir = controldir.ControlDir.open(self.get_url()) check_dir_components_use_same_lock(dir) def test_can_convert(self): @@ -302,7 +303,7 @@ # At this point, we have a format6 branch without checkout files. upgrade.upgrade('.', bzrdir.BzrDirMetaFormat1()) # The upgrade should not have set up a working tree. - control = bzrdir.BzrDir.open('.') + control = controldir.ControlDir.open('.') self.assertFalse(control.has_workingtree()) # We have covered the scope of this test, we may as well check that # upgrade has not eaten our data, even if it's a bit redundant with @@ -319,7 +320,7 @@ eq = self.assertEquals self.build_tree_contents(_upgrade1_template) upgrade.upgrade(u'.') - control = bzrdir.BzrDir.open('.') + control = controldir.ControlDir.open('.') b = control.open_branch() # tsk, peeking under the covers. self.assertIsInstance( @@ -389,7 +390,7 @@ def test_upgrade_makes_dir_weaves(self): self.build_tree_contents(_upgrade_dir_template) - old_repodir = bzrdir.BzrDir.open_unsupported('.') + old_repodir = controldir.ControlDir.open_unsupported('.') old_repo_format = old_repodir.open_repository()._format upgrade.upgrade('.') # this is the path to the literal file. As format changes @@ -544,7 +545,7 @@ self.build_tree(['master/', 'child/']) self.make_branch_and_tree('master') self.make_branch_and_tree('child', - format=bzrdir.format_registry.make_bzrdir('weave')) + format=controldir.format_registry.make_bzrdir('weave')) os.chdir('child') def test_bind_format_6_bzrdir(self): diff -Nru bzr-2.5.0/bzrlib/plugins/weave_fmt/workingtree.py bzr-2.6.0~beta1/bzrlib/plugins/weave_fmt/workingtree.py --- bzr-2.5.0/bzrlib/plugins/weave_fmt/workingtree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/plugins/weave_fmt/workingtree.py 2012-03-15 10:00:24.000000000 +0000 @@ -105,7 +105,7 @@ _bzrdir=a_bzrdir, _control_files=branch.control_files) basis_tree = branch.repository.revision_tree(revision_id) - if basis_tree.inventory.root is not None: + if basis_tree.get_root_id() is not None: wt.set_root_id(basis_tree.get_root_id()) # set the parent list and cache the basis tree. if _mod_revision.is_null(revision_id): diff -Nru bzr-2.5.0/bzrlib/push.py bzr-2.6.0~beta1/bzrlib/push.py --- bzr-2.5.0/bzrlib/push.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/push.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2008, 2009, 2010 Canonical Ltd +# Copyright (C) 2008-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -135,6 +135,7 @@ # Remembers if asked explicitly or no previous location is set if (remember or (remember is None and br_from.get_push_location() is None)): + # FIXME: Should be done only if we succeed ? -- vila 2012-01-18 br_from.set_push_location(br_to.base) else: if stacked_on is not None: diff -Nru bzr-2.5.0/bzrlib/_readdir_pyx.c bzr-2.6.0~beta1/bzrlib/_readdir_pyx.c --- bzr-2.5.0/bzrlib/_readdir_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_readdir_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,225 +1,32 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:38 2012 */ +/* Generated by Pyrex 0.9.8.5 on Fri Oct 8 14:01:04 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif - -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif - -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif - +#include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif - -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include -#define __PYX_HAVE_API__bzrlib___readdir_pyx #include "python-compat.h" #include "errno.h" #include "unistd.h" @@ -230,1061 +37,512 @@ #include "dirent.h" #include "readdir.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif +typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ -/* inline attribute */ -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif +static PyObject *__pyx_m; +static PyObject *__pyx_b; +static int __pyx_lineno; +static char *__pyx_filename; +static char **__pyx_f; -/* unused attribute */ -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif +static char __pyx_mdoc[] = "Wrapper for readdir which returns files ordered by inode."; -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*/ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Type Conversion Predeclarations */ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ +static void __Pyx_AddTraceback(char *funcname); /*proto*/ -static const char *__pyx_f[] = { - "_readdir_pyx.pyx", -}; +/* Declarations from bzrlib._readdir_pyx */ -/* Type declarations */ -/* "bzrlib/_readdir_pyx.pyx":174 - * _safe_utf8 = osutils.safe_utf8 - * - * cdef class UTF8DirReader: # <<<<<<<<<<<<<< - * """A dir reader for utf8 file systems.""" - * - */ +/* Declarations from implementation of bzrlib._readdir_pyx */ -struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader { +struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat { PyObject_HEAD - struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *__pyx_vtab; + struct stat _st; }; -/* "bzrlib/_readdir_pyx.pyx":131 - * - * - * cdef class _Stat: # <<<<<<<<<<<<<< - * """Represent a 'stat' result.""" - * - */ - -struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat { +struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader { PyObject_HEAD - struct stat _st; + struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *__pyx_vtab; }; -/* "bzrlib/_readdir_pyx.pyx":174 - * _safe_utf8 = osutils.safe_utf8 - * - * cdef class UTF8DirReader: # <<<<<<<<<<<<<< - * """A dir reader for utf8 file systems.""" - * - */ struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader { - PyObject *(*_kind_from_mode)(struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *, int); + PyObject *(*_kind_from_mode)(struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *,int); }; static struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *__pyx_vtabptr_6bzrlib_12_readdir_pyx_UTF8DirReader; -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif - -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); - end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ - -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_ino_t(ino_t); - -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_off_t(off_t); - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +static PyTypeObject *__pyx_ptype_6bzrlib_12_readdir_pyx__Stat = 0; +static PyTypeObject *__pyx_ptype_6bzrlib_12_readdir_pyx_UTF8DirReader = 0; +static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__directory; +static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__chardev; +static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__block; +static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__file; +static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__fifo; +static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__symlink; +static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__socket; +static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__unknown; +static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8; +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(int,char *,PyObject *); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx__read_dir(PyObject *); /*proto*/ -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ +static char __pyx_k1[] = "st_mode"; +static char __pyx_k2[] = "st_size"; +static char __pyx_k3[] = "st_mtime"; +static char __pyx_k4[] = "st_ctime"; +static char __pyx_k5[] = "/"; +static char __pyx_k6[] = ""; +static char __pyx_k7[] = "failed to strcat"; +static char __pyx_k8[] = "."; +static char __pyx_k9[] = "open: "; +static char __pyx_k10[] = "chdir: "; +static char __pyx_k11[] = "opendir: "; +static char __pyx_k12[] = "readdir: "; +static char __pyx_k13[] = "lstat: "; +static char __pyx_k14[] = "closedir: "; +static char __pyx_k15[] = "return to orig_dir: "; +static char __pyx_k16[] = "os"; +static char __pyx_k17[] = "sys"; +static char __pyx_k18[] = "directory"; +static char __pyx_k19[] = "chardev"; +static char __pyx_k20[] = "block"; +static char __pyx_k21[] = "file"; +static char __pyx_k22[] = "fifo"; +static char __pyx_k23[] = "symlink"; +static char __pyx_k24[] = "socket"; +static char __pyx_k25[] = "unknown"; +static char __pyx_k26[] = "bzrlib"; +static char __pyx_k27[] = "osutils"; +static char __pyx_k28[] = "safe_utf8"; + +static PyObject *__pyx_n_block; +static PyObject *__pyx_n_bzrlib; +static PyObject *__pyx_n_chardev; +static PyObject *__pyx_n_directory; +static PyObject *__pyx_n_fifo; +static PyObject *__pyx_n_file; +static PyObject *__pyx_n_os; +static PyObject *__pyx_n_osutils; +static PyObject *__pyx_n_safe_utf8; +static PyObject *__pyx_n_socket; +static PyObject *__pyx_n_st_ctime; +static PyObject *__pyx_n_st_mode; +static PyObject *__pyx_n_st_mtime; +static PyObject *__pyx_n_st_size; +static PyObject *__pyx_n_symlink; +static PyObject *__pyx_n_sys; +static PyObject *__pyx_n_unknown; + +static PyObject *__pyx_k5p; +static PyObject *__pyx_k6p; +static PyObject *__pyx_k7p; +static PyObject *__pyx_k8p; -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_block, 1, __pyx_k20, sizeof(__pyx_k20)}, + {&__pyx_n_bzrlib, 1, __pyx_k26, sizeof(__pyx_k26)}, + {&__pyx_n_chardev, 1, __pyx_k19, sizeof(__pyx_k19)}, + {&__pyx_n_directory, 1, __pyx_k18, sizeof(__pyx_k18)}, + {&__pyx_n_fifo, 1, __pyx_k22, sizeof(__pyx_k22)}, + {&__pyx_n_file, 1, __pyx_k21, sizeof(__pyx_k21)}, + {&__pyx_n_os, 1, __pyx_k16, sizeof(__pyx_k16)}, + {&__pyx_n_osutils, 1, __pyx_k27, sizeof(__pyx_k27)}, + {&__pyx_n_safe_utf8, 1, __pyx_k28, sizeof(__pyx_k28)}, + {&__pyx_n_socket, 1, __pyx_k24, sizeof(__pyx_k24)}, + {&__pyx_n_st_ctime, 1, __pyx_k4, sizeof(__pyx_k4)}, + {&__pyx_n_st_mode, 1, __pyx_k1, sizeof(__pyx_k1)}, + {&__pyx_n_st_mtime, 1, __pyx_k3, sizeof(__pyx_k3)}, + {&__pyx_n_st_size, 1, __pyx_k2, sizeof(__pyx_k2)}, + {&__pyx_n_symlink, 1, __pyx_k23, sizeof(__pyx_k23)}, + {&__pyx_n_sys, 1, __pyx_k17, sizeof(__pyx_k17)}, + {&__pyx_n_unknown, 1, __pyx_k25, sizeof(__pyx_k25)}, + {&__pyx_k5p, 0, __pyx_k5, sizeof(__pyx_k5)}, + {&__pyx_k6p, 0, __pyx_k6, sizeof(__pyx_k6)}, + {&__pyx_k7p, 0, __pyx_k7, sizeof(__pyx_k7)}, + {&__pyx_k8p, 0, __pyx_k8, sizeof(__pyx_k8)}, + {0, 0, 0, 0} +}; -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from bzrlib._readdir_pyx */ +static PyObject *__pyx_d1; -static PyTypeObject *__pyx_ptype_6bzrlib_12_readdir_pyx__Stat = 0; -static PyTypeObject *__pyx_ptype_6bzrlib_12_readdir_pyx_UTF8DirReader = 0; -static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__directory = 0; -static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__chardev = 0; -static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__block = 0; -static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__file = 0; -static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__fifo = 0; -static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__symlink = 0; -static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__socket = 0; -static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__unknown = 0; -static PyObject *__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8 = 0; -static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(int, char *, PyObject *); /*proto*/ -static PyObject *__pyx_f_6bzrlib_12_readdir_pyx__read_dir(PyObject *); /*proto*/ -#define __Pyx_MODULE_NAME "bzrlib._readdir_pyx" -static int __pyx_module_is_main_bzrlib___readdir_pyx = 0; /* Implementation of bzrlib._readdir_pyx */ -static PyObject *__pyx_builtin_Exception; -static PyObject *__pyx_builtin_OSError; -static char __pyx_k_1[] = ""; -static char __pyx_k_2[] = "/"; -static char __pyx_k_3[] = "failed to strcat"; -static char __pyx_k_6[] = "."; -static char __pyx_k_7[] = "open: "; -static char __pyx_k_8[] = "chdir: "; -static char __pyx_k_9[] = "opendir: "; -static char __pyx_k_10[] = "readdir: "; -static char __pyx_k_11[] = "lstat: "; -static char __pyx_k_12[] = "closedir: "; -static char __pyx_k_13[] = "return to orig_dir: "; -static char __pyx_k_14[] = "Wrapper for readdir which returns files ordered by inode."; -static char __pyx_k__os[] = "os"; -static char __pyx_k___st[] = "_st"; -static char __pyx_k__sys[] = "sys"; -static char __pyx_k__top[] = "top"; -static char __pyx_k__fifo[] = "fifo"; -static char __pyx_k__file[] = "file"; -static char __pyx_k__block[] = "block"; -static char __pyx_k__d_ino[] = "d_ino"; -static char __pyx_k__bzrlib[] = "bzrlib"; -static char __pyx_k__d_name[] = "d_name"; -static char __pyx_k__prefix[] = "prefix"; -static char __pyx_k__socket[] = "socket"; -static char __pyx_k__st_dev[] = "st_dev"; -static char __pyx_k__st_ino[] = "st_ino"; -static char __pyx_k__OSError[] = "OSError"; -static char __pyx_k__chardev[] = "chardev"; -static char __pyx_k__osutils[] = "osutils"; -static char __pyx_k__st_mode[] = "st_mode"; -static char __pyx_k__st_size[] = "st_size"; -static char __pyx_k__symlink[] = "symlink"; -static char __pyx_k__unknown[] = "unknown"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__st_ctime[] = "st_ctime"; -static char __pyx_k__st_mtime[] = "st_mtime"; -static char __pyx_k__Exception[] = "Exception"; -static char __pyx_k__directory[] = "directory"; -static char __pyx_k__safe_utf8[] = "safe_utf8"; -static char __pyx_k___kind_from_mode[] = "_kind_from_mode"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_6; -static PyObject *__pyx_n_s__Exception; -static PyObject *__pyx_n_s__OSError; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___kind_from_mode; -static PyObject *__pyx_n_s___st; -static PyObject *__pyx_n_s__block; -static PyObject *__pyx_n_s__bzrlib; -static PyObject *__pyx_n_s__chardev; -static PyObject *__pyx_n_s__d_ino; -static PyObject *__pyx_n_s__d_name; -static PyObject *__pyx_n_s__directory; -static PyObject *__pyx_n_s__fifo; -static PyObject *__pyx_n_s__file; -static PyObject *__pyx_n_s__os; -static PyObject *__pyx_n_s__osutils; -static PyObject *__pyx_n_s__prefix; -static PyObject *__pyx_n_s__safe_utf8; -static PyObject *__pyx_n_s__socket; -static PyObject *__pyx_n_s__st_ctime; -static PyObject *__pyx_n_s__st_dev; -static PyObject *__pyx_n_s__st_ino; -static PyObject *__pyx_n_s__st_mode; -static PyObject *__pyx_n_s__st_mtime; -static PyObject *__pyx_n_s__st_size; -static PyObject *__pyx_n_s__symlink; -static PyObject *__pyx_n_s__sys; -static PyObject *__pyx_n_s__top; -static PyObject *__pyx_n_s__unknown; -static PyObject *__pyx_int_0; -static PyObject *__pyx_k_tuple_4; -static PyObject *__pyx_k_tuple_5; - -/* "bzrlib/_readdir_pyx.pyx":137 - * - * property st_dev: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._st.st_dev - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_6st_dev___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_6st_dev___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "bzrlib/_readdir_pyx.pyx":138 - * property st_dev: - * def __get__(self): - * return self._st.st_dev # <<<<<<<<<<<<<< - * - * property st_ino: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_dev); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_dev___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_dev___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_dev); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_dev.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":141 - * - * property st_ino: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._st.st_ino - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_6st_ino___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_6st_ino___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "bzrlib/_readdir_pyx.pyx":142 - * property st_ino: - * def __get__(self): - * return self._st.st_ino # <<<<<<<<<<<<<< - * - * property st_mode: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_to_py_ino_t(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_ino); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_ino___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_ino___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyLong_FromUnsignedLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_ino); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_ino.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":145 - * - * property st_mode: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._st.st_mode - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_7st_mode___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_7st_mode___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "bzrlib/_readdir_pyx.pyx":146 - * property st_mode: - * def __get__(self): - * return self._st.st_mode # <<<<<<<<<<<<<< - * - * property st_ctime: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_mode___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_mode___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_mode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_mode.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":149 - * - * property st_ctime: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._st.st_ctime - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_8st_ctime___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_8st_ctime___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "bzrlib/_readdir_pyx.pyx":150 - * property st_ctime: - * def __get__(self): - * return self._st.st_ctime # <<<<<<<<<<<<<< - * - * property st_mtime: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_ctime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_ctime___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_ctime___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_ctime); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_ctime.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":153 - * - * property st_mtime: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._st.st_mtime - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_8st_mtime___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_8st_mtime___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "bzrlib/_readdir_pyx.pyx":154 - * property st_mtime: - * def __get__(self): - * return self._st.st_mtime # <<<<<<<<<<<<<< - * - * property st_size: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_mtime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_mtime___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_mtime___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_mtime); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_mtime.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":157 - * - * property st_size: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._st.st_size - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_7st_size___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_7st_size___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "bzrlib/_readdir_pyx.pyx":158 - * property st_size: - * def __get__(self): - * return self._st.st_size # <<<<<<<<<<<<<< - * - * def __repr__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_to_py_off_t(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_size___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_size___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyLong_FromUnsignedLongLong(((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_v_self)->_st.st_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.st_size.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":160 - * return self._st.st_size - * - * def __repr__(self): # <<<<<<<<<<<<<< - * """Repr is the same as a Stat object. - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat___repr__(PyObject *__pyx_v_self); /*proto*/ -static char __pyx_doc_6bzrlib_12_readdir_pyx_5_Stat___repr__[] = "Repr is the same as a Stat object.\n\n (mode, ino, dev, nlink, uid, gid, size, None(atime), mtime, ctime)\n "; -struct wrapperbase __pyx_wrapperbase_6bzrlib_12_readdir_pyx_5_Stat___repr__; -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_5_Stat___repr__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("__repr__"); - - /* "bzrlib/_readdir_pyx.pyx":165 - * (mode, ino, dev, nlink, uid, gid, size, None(atime), mtime, ctime) - * """ - * return repr((self.st_mode, 0, 0, 0, 0, 0, self.st_size, None, # <<<<<<<<<<<<<< - * self.st_mtime, self.st_ctime)) - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__st_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__st_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - - /* "bzrlib/_readdir_pyx.pyx":166 - * """ - * return repr((self.st_mode, 0, 0, 0, 0, 0, self.st_size, None, - * self.st_mtime, self.st_ctime)) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__st_mtime); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__st_ctime); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - __Pyx_INCREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_5, 7, Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_5, 8, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Repr(((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_5_Stat___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + PyObject *__pyx_6 = 0; + PyObject *__pyx_7 = 0; + PyObject *__pyx_8 = 0; + PyObject *__pyx_9 = 0; + PyObject *__pyx_10 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_st_mode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} + __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} + __pyx_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_st_size); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} + __pyx_8 = PyObject_GetAttr(__pyx_v_self, __pyx_n_st_mtime); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} + __pyx_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_st_ctime); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} + __pyx_10 = PyTuple_New(10); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_10, 0, __pyx_1); + PyTuple_SET_ITEM(__pyx_10, 1, __pyx_2); + PyTuple_SET_ITEM(__pyx_10, 2, __pyx_3); + PyTuple_SET_ITEM(__pyx_10, 3, __pyx_4); + PyTuple_SET_ITEM(__pyx_10, 4, __pyx_5); + PyTuple_SET_ITEM(__pyx_10, 5, __pyx_6); + PyTuple_SET_ITEM(__pyx_10, 6, __pyx_7); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_10, 7, Py_None); + PyTuple_SET_ITEM(__pyx_10, 8, __pyx_8); + PyTuple_SET_ITEM(__pyx_10, 9, __pyx_9); + __pyx_1 = 0; + __pyx_2 = 0; + __pyx_3 = 0; + __pyx_4 = 0; + __pyx_5 = 0; + __pyx_6 = 0; + __pyx_7 = 0; + __pyx_8 = 0; + __pyx_9 = 0; + __pyx_1 = PyObject_Repr(__pyx_10); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} + Py_DECREF(__pyx_10); __pyx_10 = 0; + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); + Py_XDECREF(__pyx_6); + Py_XDECREF(__pyx_7); + Py_XDECREF(__pyx_8); + Py_XDECREF(__pyx_9); + Py_XDECREF(__pyx_10); __Pyx_AddTraceback("bzrlib._readdir_pyx._Stat.__repr__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":177 - * """A dir reader for utf8 file systems.""" - * - * def kind_from_mode(self, int mode): # <<<<<<<<<<<<<< - * """Get the kind of a path from a mode status.""" - * return self._kind_from_mode(mode) - */ - -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode(PyObject *__pyx_v_self, PyObject *__pyx_arg_mode); /*proto*/ +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode[] = "Get the kind of a path from a mode status."; -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode(PyObject *__pyx_v_self, PyObject *__pyx_arg_mode) { +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { int __pyx_v_mode; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("kind_from_mode"); - assert(__pyx_arg_mode); { - __pyx_v_mode = __Pyx_PyInt_AsInt(__pyx_arg_mode); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._readdir_pyx.UTF8DirReader.kind_from_mode"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - - /* "bzrlib/_readdir_pyx.pyx":179 - * def kind_from_mode(self, int mode): - * """Get the kind of a path from a mode status.""" - * return self._kind_from_mode(mode) # <<<<<<<<<<<<<< - * - * cdef _kind_from_mode(self, int mode): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *)((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self)->__pyx_vtab)->_kind_from_mode(((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self), __pyx_v_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {"mode",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_mode)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *)((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self)->__pyx_vtab)->_kind_from_mode(((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self),__pyx_v_mode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._readdir_pyx.UTF8DirReader.kind_from_mode"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":181 - * return self._kind_from_mode(mode) - * - * cdef _kind_from_mode(self, int mode): # <<<<<<<<<<<<<< - * # Files and directories are the most common - check them first. - * if S_ISREG(mode): - */ - -static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader__kind_from_mode(struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *__pyx_v_self, int __pyx_v_mode) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - __Pyx_RefNannySetupContext("_kind_from_mode"); - - /* "bzrlib/_readdir_pyx.pyx":183 - * cdef _kind_from_mode(self, int mode): - * # Files and directories are the most common - check them first. - * if S_ISREG(mode): # <<<<<<<<<<<<<< - * return _file - * if S_ISDIR(mode): - */ - __pyx_t_1 = S_ISREG(__pyx_v_mode); - if (__pyx_t_1) { - - /* "bzrlib/_readdir_pyx.pyx":184 - * # Files and directories are the most common - check them first. - * if S_ISREG(mode): - * return _file # <<<<<<<<<<<<<< - * if S_ISDIR(mode): - * return _directory - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__file); +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader__kind_from_mode(struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *__pyx_v_self,int __pyx_v_mode) { + PyObject *__pyx_r; + int __pyx_1; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":183 */ + __pyx_1 = S_ISREG(__pyx_v_mode); + if (__pyx_1) { + Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__file); __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__file; goto __pyx_L0; + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":185 */ + __pyx_1 = S_ISDIR(__pyx_v_mode); + if (__pyx_1) { + Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__directory); + __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__directory; + goto __pyx_L0; goto __pyx_L3; } __pyx_L3:; - /* "bzrlib/_readdir_pyx.pyx":185 - * if S_ISREG(mode): - * return _file - * if S_ISDIR(mode): # <<<<<<<<<<<<<< - * return _directory - * if S_ISCHR(mode): - */ - __pyx_t_1 = S_ISDIR(__pyx_v_mode); - if (__pyx_t_1) { - - /* "bzrlib/_readdir_pyx.pyx":186 - * return _file - * if S_ISDIR(mode): - * return _directory # <<<<<<<<<<<<<< - * if S_ISCHR(mode): - * return _chardev - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__directory); - __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__directory; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":187 */ + __pyx_1 = S_ISCHR(__pyx_v_mode); + if (__pyx_1) { + Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__chardev); + __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__chardev; goto __pyx_L0; goto __pyx_L4; } __pyx_L4:; - /* "bzrlib/_readdir_pyx.pyx":187 - * if S_ISDIR(mode): - * return _directory - * if S_ISCHR(mode): # <<<<<<<<<<<<<< - * return _chardev - * if S_ISBLK(mode): - */ - __pyx_t_1 = S_ISCHR(__pyx_v_mode); - if (__pyx_t_1) { - - /* "bzrlib/_readdir_pyx.pyx":188 - * return _directory - * if S_ISCHR(mode): - * return _chardev # <<<<<<<<<<<<<< - * if S_ISBLK(mode): - * return _block - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__chardev); - __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__chardev; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":189 */ + __pyx_1 = S_ISBLK(__pyx_v_mode); + if (__pyx_1) { + Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__block); + __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__block; goto __pyx_L0; goto __pyx_L5; } __pyx_L5:; - /* "bzrlib/_readdir_pyx.pyx":189 - * if S_ISCHR(mode): - * return _chardev - * if S_ISBLK(mode): # <<<<<<<<<<<<<< - * return _block - * if S_ISLNK(mode): - */ - __pyx_t_1 = S_ISBLK(__pyx_v_mode); - if (__pyx_t_1) { - - /* "bzrlib/_readdir_pyx.pyx":190 - * return _chardev - * if S_ISBLK(mode): - * return _block # <<<<<<<<<<<<<< - * if S_ISLNK(mode): - * return _symlink - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__block); - __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__block; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":191 */ + __pyx_1 = S_ISLNK(__pyx_v_mode); + if (__pyx_1) { + Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__symlink); + __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__symlink; goto __pyx_L0; goto __pyx_L6; } __pyx_L6:; - /* "bzrlib/_readdir_pyx.pyx":191 - * if S_ISBLK(mode): - * return _block - * if S_ISLNK(mode): # <<<<<<<<<<<<<< - * return _symlink - * if S_ISFIFO(mode): - */ - __pyx_t_1 = S_ISLNK(__pyx_v_mode); - if (__pyx_t_1) { - - /* "bzrlib/_readdir_pyx.pyx":192 - * return _block - * if S_ISLNK(mode): - * return _symlink # <<<<<<<<<<<<<< - * if S_ISFIFO(mode): - * return _fifo - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__symlink); - __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__symlink; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":193 */ + __pyx_1 = S_ISFIFO(__pyx_v_mode); + if (__pyx_1) { + Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__fifo); + __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__fifo; goto __pyx_L0; goto __pyx_L7; } __pyx_L7:; - /* "bzrlib/_readdir_pyx.pyx":193 - * if S_ISLNK(mode): - * return _symlink - * if S_ISFIFO(mode): # <<<<<<<<<<<<<< - * return _fifo - * if S_ISSOCK(mode): - */ - __pyx_t_1 = S_ISFIFO(__pyx_v_mode); - if (__pyx_t_1) { - - /* "bzrlib/_readdir_pyx.pyx":194 - * return _symlink - * if S_ISFIFO(mode): - * return _fifo # <<<<<<<<<<<<<< - * if S_ISSOCK(mode): - * return _socket - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__fifo); - __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__fifo; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":195 */ + __pyx_1 = S_ISSOCK(__pyx_v_mode); + if (__pyx_1) { + Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__socket); + __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__socket; goto __pyx_L0; goto __pyx_L8; } __pyx_L8:; - /* "bzrlib/_readdir_pyx.pyx":195 - * if S_ISFIFO(mode): - * return _fifo - * if S_ISSOCK(mode): # <<<<<<<<<<<<<< - * return _socket - * return _unknown - */ - __pyx_t_1 = S_ISSOCK(__pyx_v_mode); - if (__pyx_t_1) { - - /* "bzrlib/_readdir_pyx.pyx":196 - * return _fifo - * if S_ISSOCK(mode): - * return _socket # <<<<<<<<<<<<<< - * return _unknown - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__socket); - __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__socket; - goto __pyx_L0; - goto __pyx_L9; - } - __pyx_L9:; - - /* "bzrlib/_readdir_pyx.pyx":197 - * if S_ISSOCK(mode): - * return _socket - * return _unknown # <<<<<<<<<<<<<< - * - * def top_prefix_to_starting_dir(self, top, prefix=""): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__unknown); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":197 */ + Py_INCREF(__pyx_v_6bzrlib_12_readdir_pyx__unknown); __pyx_r = __pyx_v_6bzrlib_12_readdir_pyx__unknown; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":199 - * return _unknown - * - * def top_prefix_to_starting_dir(self, top, prefix=""): # <<<<<<<<<<<<<< - * """See DirReader.top_prefix_to_starting_dir.""" - * return (_safe_utf8(prefix), None, None, None, _safe_utf8(top)) - */ - -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_13UTF8DirReader_1top_prefix_to_starting_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_1top_prefix_to_starting_dir[] = "See DirReader.top_prefix_to_starting_dir."; -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_13UTF8DirReader_1top_prefix_to_starting_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_top_prefix_to_starting_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_top_prefix_to_starting_dir[] = "See DirReader.top_prefix_to_starting_dir."; +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_top_prefix_to_starting_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_top = 0; PyObject *__pyx_v_prefix = 0; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__top,&__pyx_n_s__prefix,0}; - __Pyx_RefNannySetupContext("top_prefix_to_starting_dir"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - values[1] = ((PyObject *)__pyx_kp_s_1); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__top); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - if (kw_args > 0) { - PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__prefix); - if (value) { values[1] = value; kw_args--; } - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "top_prefix_to_starting_dir") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_top = values[0]; - __pyx_v_prefix = values[1]; - } else { - __pyx_v_prefix = ((PyObject *)__pyx_kp_s_1); - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: __pyx_v_prefix = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: __pyx_v_top = PyTuple_GET_ITEM(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("top_prefix_to_starting_dir", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._readdir_pyx.UTF8DirReader.top_prefix_to_starting_dir"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - - /* "bzrlib/_readdir_pyx.pyx":201 - * def top_prefix_to_starting_dir(self, top, prefix=""): - * """See DirReader.top_prefix_to_starting_dir.""" - * return (_safe_utf8(prefix), None, None, None, _safe_utf8(top)) # <<<<<<<<<<<<<< - * - * def read_dir(self, prefix, top): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_prefix); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_prefix); - __Pyx_GIVEREF(__pyx_v_prefix); - __pyx_t_2 = PyObject_Call(__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_top); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_top); - __Pyx_GIVEREF(__pyx_v_top); - __pyx_t_3 = PyObject_Call(__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_1, 3, Py_None); - __Pyx_GIVEREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_r = ((PyObject *)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + static char *__pyx_argnames[] = {"top","prefix",0}; + __pyx_v_prefix = __pyx_d1; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_top, &__pyx_v_prefix)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_top); + Py_INCREF(__pyx_v_prefix); + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;} + Py_INCREF(__pyx_v_prefix); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_prefix); + __pyx_2 = PyObject_CallObject(__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;} + Py_INCREF(__pyx_v_top); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_top); + __pyx_3 = PyObject_CallObject(__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyTuple_New(5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_1, 1, Py_None); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_1, 2, Py_None); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_1, 3, Py_None); + PyTuple_SET_ITEM(__pyx_1, 4, __pyx_3); + __pyx_2 = 0; + __pyx_3 = 0; + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._readdir_pyx.UTF8DirReader.top_prefix_to_starting_dir"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_top); + Py_DECREF(__pyx_v_prefix); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":203 - * return (_safe_utf8(prefix), None, None, None, _safe_utf8(top)) - * - * def read_dir(self, prefix, top): # <<<<<<<<<<<<<< - * """Read a single directory from a utf8 file system. - * - */ - -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_13UTF8DirReader_2read_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_2read_dir[] = "Read a single directory from a utf8 file system.\n\n All paths in and out are utf8.\n\n This sub-function is called when we know the filesystem is already in utf8\n encoding. So we don't need to transcode filenames.\n\n See DirReader.read_dir for details.\n "; -static PyObject *__pyx_pf_6bzrlib_12_readdir_pyx_13UTF8DirReader_2read_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_read_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_read_dir[] = "Read a single directory from a utf8 file system.\n\n All paths in and out are utf8.\n\n This sub-function is called when we know the filesystem is already in utf8\n encoding. So we don\'t need to transcode filenames.\n\n See DirReader.read_dir for details.\n "; +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_read_dir(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prefix = 0; PyObject *__pyx_v_top = 0; PyObject *__pyx_v_newval; @@ -1296,456 +554,211 @@ PyObject *__pyx_v_relprefix; PyObject *__pyx_v_top_slash; PyObject *__pyx_v_result; - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - void *__pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__prefix,&__pyx_n_s__top,0}; - __Pyx_RefNannySetupContext("read_dir"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[2] = {0,0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__prefix); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - case 1: - values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__top); - if (likely(values[1])) kw_args--; - else { - __Pyx_RaiseArgtupleInvalid("read_dir", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "read_dir") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_prefix = values[0]; - __pyx_v_top = values[1]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_prefix = PyTuple_GET_ITEM(__pyx_args, 0); - __pyx_v_top = PyTuple_GET_ITEM(__pyx_args, 1); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("read_dir", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._readdir_pyx.UTF8DirReader.read_dir"); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_v_newval = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_name = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_relprefix = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_top_slash = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_result = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_readdir_pyx.pyx":223 - * cdef PyObject * new_val_obj - * - * if PyString_Size(prefix): # <<<<<<<<<<<<<< - * relprefix = prefix + '/' - * else: - */ - __pyx_t_1 = PyString_Size(__pyx_v_prefix); - if (__pyx_t_1) { - - /* "bzrlib/_readdir_pyx.pyx":224 - * - * if PyString_Size(prefix): - * relprefix = prefix + '/' # <<<<<<<<<<<<<< - * else: - * relprefix = '' - */ - __pyx_t_2 = PyNumber_Add(__pyx_v_prefix, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_relprefix); - __pyx_v_relprefix = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L6; + PyObject *__pyx_r; + Py_ssize_t __pyx_1; + PyObject *__pyx_2 = 0; + int __pyx_3; + PyObject *__pyx_4 = 0; + static char *__pyx_argnames[] = {"prefix","top",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_prefix, &__pyx_v_top)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_prefix); + Py_INCREF(__pyx_v_top); + __pyx_v_newval = Py_None; Py_INCREF(Py_None); + __pyx_v_name = Py_None; Py_INCREF(Py_None); + __pyx_v_relprefix = Py_None; Py_INCREF(Py_None); + __pyx_v_top_slash = Py_None; Py_INCREF(Py_None); + __pyx_v_result = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":223 */ + __pyx_1 = PyString_Size(__pyx_v_prefix); + if (__pyx_1) { + __pyx_2 = PyNumber_Add(__pyx_v_prefix, __pyx_k5p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} + Py_DECREF(__pyx_v_relprefix); + __pyx_v_relprefix = __pyx_2; + __pyx_2 = 0; + goto __pyx_L2; } /*else*/ { + Py_INCREF(__pyx_k6p); + Py_DECREF(__pyx_v_relprefix); + __pyx_v_relprefix = __pyx_k6p; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":227 */ + __pyx_2 = PyNumber_Add(__pyx_v_top, __pyx_k5p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} + Py_DECREF(__pyx_v_top_slash); + __pyx_v_top_slash = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":231 */ + __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx__read_dir(__pyx_v_top); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} + Py_DECREF(__pyx_v_result); + __pyx_v_result = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":232 */ + __pyx_1 = PyObject_Length(__pyx_v_result); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; goto __pyx_L1;} + __pyx_v_length = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":234 */ + for (__pyx_v_index = 0; __pyx_v_index < __pyx_v_length; ++__pyx_v_index) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":235 */ + __pyx_v_atuple = PyList_GET_ITEM(__pyx_v_result,__pyx_v_index); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":236 */ + Py_INCREF(((PyObject *)PyTuple_GET_ITEM(__pyx_v_atuple,1))); + Py_DECREF(__pyx_v_name); + __pyx_v_name = ((PyObject *)PyTuple_GET_ITEM(__pyx_v_atuple,1)); - /* "bzrlib/_readdir_pyx.pyx":226 - * relprefix = prefix + '/' - * else: - * relprefix = '' # <<<<<<<<<<<<<< - * top_slash = top + '/' - * - */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); - __Pyx_DECREF(__pyx_v_relprefix); - __pyx_v_relprefix = ((PyObject *)__pyx_kp_s_1); - } - __pyx_L6:; - - /* "bzrlib/_readdir_pyx.pyx":227 - * else: - * relprefix = '' - * top_slash = top + '/' # <<<<<<<<<<<<<< - * - * # read_dir supplies in should-stat order. - */ - __pyx_t_2 = PyNumber_Add(__pyx_v_top, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_top_slash); - __pyx_v_top_slash = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_readdir_pyx.pyx":231 - * # read_dir supplies in should-stat order. - * # for _, name in sorted(_listdir(top)): - * result = _read_dir(top) # <<<<<<<<<<<<<< - * length = len(result) - * # result.sort() - */ - __pyx_t_2 = __pyx_f_6bzrlib_12_readdir_pyx__read_dir(__pyx_v_top); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_result); - __pyx_v_result = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_readdir_pyx.pyx":232 - * # for _, name in sorted(_listdir(top)): - * result = _read_dir(top) - * length = len(result) # <<<<<<<<<<<<<< - * # result.sort() - * for index from 0 <= index < length: - */ - __pyx_t_1 = PyObject_Length(__pyx_v_result); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_length = __pyx_t_1; - - /* "bzrlib/_readdir_pyx.pyx":234 - * length = len(result) - * # result.sort() - * for index from 0 <= index < length: # <<<<<<<<<<<<<< - * atuple = PyList_GetItem_object_void(result, index) - * name = PyTuple_GetItem_void_void(atuple, 1) - */ - __pyx_t_3 = __pyx_v_length; - for (__pyx_v_index = 0; __pyx_v_index < __pyx_t_3; __pyx_v_index++) { - - /* "bzrlib/_readdir_pyx.pyx":235 - * # result.sort() - * for index from 0 <= index < length: - * atuple = PyList_GetItem_object_void(result, index) # <<<<<<<<<<<<<< - * name = PyTuple_GetItem_void_void(atuple, 1) - * # We have a tuple with (inode, name, None, statvalue, None) - */ - __pyx_v_atuple = PyList_GET_ITEM(__pyx_v_result, __pyx_v_index); - - /* "bzrlib/_readdir_pyx.pyx":236 - * for index from 0 <= index < length: - * atuple = PyList_GetItem_object_void(result, index) - * name = PyTuple_GetItem_void_void(atuple, 1) # <<<<<<<<<<<<<< - * # We have a tuple with (inode, name, None, statvalue, None) - * # Now edit it: - */ - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_atuple, 1); - __Pyx_INCREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(__pyx_v_name); - __pyx_v_name = ((PyObject *)__pyx_t_4); - - /* "bzrlib/_readdir_pyx.pyx":241 - * # inode -> path_from_top - * # direct concat - faster than operator +. - * new_val_obj = relprefix # <<<<<<<<<<<<<< - * Py_INCREF(relprefix) - * PyString_Concat(&new_val_obj, name) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":241 */ __pyx_v_new_val_obj = ((PyObject *)__pyx_v_relprefix); - /* "bzrlib/_readdir_pyx.pyx":242 - * # direct concat - faster than operator +. - * new_val_obj = relprefix - * Py_INCREF(relprefix) # <<<<<<<<<<<<<< - * PyString_Concat(&new_val_obj, name) - * if NULL == new_val_obj: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":242 */ Py_INCREF(__pyx_v_relprefix); - /* "bzrlib/_readdir_pyx.pyx":243 - * new_val_obj = relprefix - * Py_INCREF(relprefix) - * PyString_Concat(&new_val_obj, name) # <<<<<<<<<<<<<< - * if NULL == new_val_obj: - * # PyString_Concat will have setup an exception, but how to get - */ - PyString_Concat((&__pyx_v_new_val_obj), __pyx_v_name); - - /* "bzrlib/_readdir_pyx.pyx":244 - * Py_INCREF(relprefix) - * PyString_Concat(&new_val_obj, name) - * if NULL == new_val_obj: # <<<<<<<<<<<<<< - * # PyString_Concat will have setup an exception, but how to get - * # at it? - */ - __pyx_t_5 = (NULL == __pyx_v_new_val_obj); - if (__pyx_t_5) { - - /* "bzrlib/_readdir_pyx.pyx":247 - * # PyString_Concat will have setup an exception, but how to get - * # at it? - * raise Exception("failed to strcat") # <<<<<<<<<<<<<< - * PyTuple_SetItem_obj(atuple, 0, new_val_obj) - * # 1st None -> kind - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":243 */ + PyString_Concat((&__pyx_v_new_val_obj),__pyx_v_name); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":244 */ + __pyx_3 = (NULL == __pyx_v_new_val_obj); + if (__pyx_3) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;} + Py_INCREF(__pyx_k7p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k7p); + __pyx_4 = PyObject_CallObject(PyExc_Exception, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;} + goto __pyx_L5; } - __pyx_L9:; + __pyx_L5:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":248 */ + __pyx_3 = PyTuple_SetItem(__pyx_v_atuple,0,__pyx_v_new_val_obj); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} - /* "bzrlib/_readdir_pyx.pyx":248 - * # at it? - * raise Exception("failed to strcat") - * PyTuple_SetItem_obj(atuple, 0, new_val_obj) # <<<<<<<<<<<<<< - * # 1st None -> kind - * newval = self._kind_from_mode( - */ - __pyx_t_6 = PyTuple_SetItem(__pyx_v_atuple, 0, __pyx_v_new_val_obj); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_readdir_pyx.pyx":251 - * # 1st None -> kind - * newval = self._kind_from_mode( - * (<_Stat>PyTuple_GetItem_void_void(atuple, 3)).st_mode) # <<<<<<<<<<<<<< - * Py_INCREF(newval) - * PyTuple_SetItem(atuple, 2, newval) - */ - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_v_atuple, 3); - __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_t_4), __pyx_n_s__st_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *)((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self)->__pyx_vtab)->_kind_from_mode(((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self), __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_v_newval); - __pyx_v_newval = __pyx_t_2; - __pyx_t_2 = 0; - - /* "bzrlib/_readdir_pyx.pyx":252 - * newval = self._kind_from_mode( - * (<_Stat>PyTuple_GetItem_void_void(atuple, 3)).st_mode) - * Py_INCREF(newval) # <<<<<<<<<<<<<< - * PyTuple_SetItem(atuple, 2, newval) - * # 2nd None -> abspath # for all - the caller may need to stat files - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":250 */ + __pyx_2 = PyObject_GetAttr(((PyObject *)PyTuple_GET_ITEM(__pyx_v_atuple,3)), __pyx_n_st_mode); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} + __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = ((struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader *)((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self)->__pyx_vtab)->_kind_from_mode(((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)__pyx_v_self),__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} + Py_DECREF(__pyx_v_newval); + __pyx_v_newval = __pyx_4; + __pyx_4 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":252 */ Py_INCREF(__pyx_v_newval); - /* "bzrlib/_readdir_pyx.pyx":253 - * (<_Stat>PyTuple_GetItem_void_void(atuple, 3)).st_mode) - * Py_INCREF(newval) - * PyTuple_SetItem(atuple, 2, newval) # <<<<<<<<<<<<<< - * # 2nd None -> abspath # for all - the caller may need to stat files - * # etc. - */ - __pyx_t_6 = PyTuple_SetItem(__pyx_v_atuple, 2, __pyx_v_newval); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - /* "bzrlib/_readdir_pyx.pyx":257 - * # etc. - * # direct concat - faster than operator +. - * new_val_obj = top_slash # <<<<<<<<<<<<<< - * Py_INCREF(top_slash) - * PyString_Concat(&new_val_obj, name) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":253 */ + __pyx_3 = PyTuple_SetItem(__pyx_v_atuple,2,__pyx_v_newval); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; goto __pyx_L1;} + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":257 */ __pyx_v_new_val_obj = ((PyObject *)__pyx_v_top_slash); - /* "bzrlib/_readdir_pyx.pyx":258 - * # direct concat - faster than operator +. - * new_val_obj = top_slash - * Py_INCREF(top_slash) # <<<<<<<<<<<<<< - * PyString_Concat(&new_val_obj, name) - * if NULL == new_val_obj: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":258 */ Py_INCREF(__pyx_v_top_slash); - /* "bzrlib/_readdir_pyx.pyx":259 - * new_val_obj = top_slash - * Py_INCREF(top_slash) - * PyString_Concat(&new_val_obj, name) # <<<<<<<<<<<<<< - * if NULL == new_val_obj: - * # PyString_Concat will have setup an exception, but how to get - */ - PyString_Concat((&__pyx_v_new_val_obj), __pyx_v_name); - - /* "bzrlib/_readdir_pyx.pyx":260 - * Py_INCREF(top_slash) - * PyString_Concat(&new_val_obj, name) - * if NULL == new_val_obj: # <<<<<<<<<<<<<< - * # PyString_Concat will have setup an exception, but how to get - * # at it? - */ - __pyx_t_5 = (NULL == __pyx_v_new_val_obj); - if (__pyx_t_5) { - - /* "bzrlib/_readdir_pyx.pyx":263 - * # PyString_Concat will have setup an exception, but how to get - * # at it? - * raise Exception("failed to strcat") # <<<<<<<<<<<<<< - * PyTuple_SetItem_obj(atuple, 4, new_val_obj) - * return result - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L10; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":259 */ + PyString_Concat((&__pyx_v_new_val_obj),__pyx_v_name); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":260 */ + __pyx_3 = (NULL == __pyx_v_new_val_obj); + if (__pyx_3) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;} + Py_INCREF(__pyx_k7p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k7p); + __pyx_4 = PyObject_CallObject(PyExc_Exception, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;} + goto __pyx_L6; } - __pyx_L10:; + __pyx_L6:; - /* "bzrlib/_readdir_pyx.pyx":264 - * # at it? - * raise Exception("failed to strcat") - * PyTuple_SetItem_obj(atuple, 4, new_val_obj) # <<<<<<<<<<<<<< - * return result - * - */ - __pyx_t_6 = PyTuple_SetItem(__pyx_v_atuple, 4, __pyx_v_new_val_obj); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":264 */ + __pyx_3 = PyTuple_SetItem(__pyx_v_atuple,4,__pyx_v_new_val_obj); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;} } - /* "bzrlib/_readdir_pyx.pyx":265 - * raise Exception("failed to strcat") - * PyTuple_SetItem_obj(atuple, 4, new_val_obj) - * return result # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_result); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":265 */ + Py_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._readdir_pyx.UTF8DirReader.read_dir"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_newval); - __Pyx_DECREF(__pyx_v_name); - __Pyx_DECREF(__pyx_v_relprefix); - __Pyx_DECREF(__pyx_v_top_slash); - __Pyx_DECREF(__pyx_v_result); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_newval); + Py_DECREF(__pyx_v_name); + Py_DECREF(__pyx_v_relprefix); + Py_DECREF(__pyx_v_top_slash); + Py_DECREF(__pyx_v_result); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_prefix); + Py_DECREF(__pyx_v_top); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":268 - * - * - * cdef raise_os_error(int errnum, char *msg_prefix, path): # <<<<<<<<<<<<<< - * if errnum == EINTR: - * PyErr_CheckSignals() - */ - -static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(int __pyx_v_errnum, char *__pyx_v_msg_prefix, PyObject *__pyx_v_path) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - __Pyx_RefNannySetupContext("raise_os_error"); - - /* "bzrlib/_readdir_pyx.pyx":269 - * - * cdef raise_os_error(int errnum, char *msg_prefix, path): - * if errnum == EINTR: # <<<<<<<<<<<<<< - * PyErr_CheckSignals() - * raise OSError(errnum, msg_prefix + strerror(errnum), path) - */ - __pyx_t_1 = (__pyx_v_errnum == EINTR); - if (__pyx_t_1) { - - /* "bzrlib/_readdir_pyx.pyx":270 - * cdef raise_os_error(int errnum, char *msg_prefix, path): - * if errnum == EINTR: - * PyErr_CheckSignals() # <<<<<<<<<<<<<< - * raise OSError(errnum, msg_prefix + strerror(errnum), path) - * - */ - __pyx_t_2 = PyErr_CheckSignals(); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "bzrlib/_readdir_pyx.pyx":271 - * if errnum == EINTR: - * PyErr_CheckSignals() - * raise OSError(errnum, msg_prefix + strerror(errnum), path) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_3 = PyInt_FromLong(__pyx_v_errnum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyBytes_FromString(__pyx_v_msg_prefix); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyBytes_FromString(strerror(__pyx_v_errnum)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_6)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_6)); - __Pyx_INCREF(__pyx_v_path); - PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_path); - __Pyx_GIVEREF(__pyx_v_path); - __pyx_t_3 = 0; - __pyx_t_6 = 0; - __pyx_t_6 = PyObject_Call(__pyx_builtin_OSError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(int __pyx_v_errnum,char *__pyx_v_msg_prefix,PyObject *__pyx_v_path) { + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + Py_INCREF(__pyx_v_path); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":269 */ + __pyx_1 = (__pyx_v_errnum == EINTR); + if (__pyx_1) { + __pyx_1 = PyErr_CheckSignals(); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":271 */ + __pyx_2 = PyInt_FromLong(__pyx_v_errnum); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;} + __pyx_3 = PyString_FromString(__pyx_v_msg_prefix); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;} + __pyx_4 = PyString_FromString(strerror(__pyx_v_errnum)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;} + __pyx_5 = PyNumber_Add(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5); + Py_INCREF(__pyx_v_path); + PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_path); + __pyx_2 = 0; + __pyx_5 = 0; + __pyx_4 = PyObject_CallObject(PyExc_OSError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;} + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); __Pyx_AddTraceback("bzrlib._readdir_pyx.raise_os_error"); __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_path); return __pyx_r; } -/* "bzrlib/_readdir_pyx.pyx":274 - * - * - * cdef _read_dir(path): # <<<<<<<<<<<<<< - * """Like os.listdir, this reads the contents of a directory. - * - */ - -static PyObject *__pyx_f_6bzrlib_12_readdir_pyx__read_dir(PyObject *__pyx_v_path) { +static PyObject *__pyx_f_6bzrlib_12_readdir_pyx__read_dir(PyObject *__pyx_v_path) { DIR *__pyx_v_the_dir; dirent *__pyx_v_entry; dirent __pyx_v_sentinel; @@ -1754,734 +767,359 @@ struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *__pyx_v_statvalue; int __pyx_v_orig_dir_fd; PyObject *__pyx_v_result; - int __pyx_v_failed; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - char *__pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - __Pyx_RefNannySetupContext("_read_dir"); - __pyx_v_statvalue = ((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_readdir_pyx.pyx":295 - * # Avoid chdir('') because it causes problems on Sun OS, and avoid this if - * # staying in . - * if path != "" and path != '.': # <<<<<<<<<<<<<< - * # we change into the requested directory before reading, and back at the - * # end, because that turns out to make the stat calls measurably faster than - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_path, ((PyObject *)__pyx_kp_s_1), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { - __pyx_t_1 = PyObject_RichCompare(__pyx_v_path, ((PyObject *)__pyx_kp_s_6), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = __pyx_t_2; - } - if (__pyx_t_4) { + PyObject *__pyx_v_failed; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + char *__pyx_3; + int __pyx_4; + PyObject *__pyx_5 = 0; + PyObject *__pyx_6 = 0; + Py_INCREF(__pyx_v_path); + __pyx_v_statvalue = ((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)Py_None); Py_INCREF(Py_None); + __pyx_v_result = Py_None; Py_INCREF(Py_None); + __pyx_v_failed = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":295 */ + if (PyObject_Cmp(__pyx_v_path, __pyx_k6p, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_1 = __pyx_1 != 0; + if (__pyx_1) { + if (PyObject_Cmp(__pyx_v_path, __pyx_k8p, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;} + __pyx_1 = __pyx_1 != 0; + } + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":299 */ + __pyx_v_orig_dir_fd = open(__pyx_k8,O_RDONLY,0); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":300 */ + __pyx_1 = (__pyx_v_orig_dir_fd == (-1)); + if (__pyx_1) { + __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k9,__pyx_k8p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L3; + } + __pyx_L3:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":302 */ + __pyx_3 = PyString_AsString(__pyx_v_path); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} + __pyx_1 = ((-1) == chdir(__pyx_3)); + if (__pyx_1) { - /* "bzrlib/_readdir_pyx.pyx":299 - * # end, because that turns out to make the stat calls measurably faster than - * # passing full paths every time. - * orig_dir_fd = open(".", O_RDONLY, 0) # <<<<<<<<<<<<<< - * if orig_dir_fd == -1: - * raise_os_error(errno, "open: ", ".") - */ - __pyx_v_orig_dir_fd = open(__pyx_k_6, O_RDONLY, 0); - - /* "bzrlib/_readdir_pyx.pyx":300 - * # passing full paths every time. - * orig_dir_fd = open(".", O_RDONLY, 0) - * if orig_dir_fd == -1: # <<<<<<<<<<<<<< - * raise_os_error(errno, "open: ", ".") - * if -1 == chdir(path): - */ - __pyx_t_4 = (__pyx_v_orig_dir_fd == -1); - if (__pyx_t_4) { - - /* "bzrlib/_readdir_pyx.pyx":301 - * orig_dir_fd = open(".", O_RDONLY, 0) - * if orig_dir_fd == -1: - * raise_os_error(errno, "open: ", ".") # <<<<<<<<<<<<<< - * if -1 == chdir(path): - * # Ignore the return value, because we are already raising an - */ - __pyx_t_1 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno, __pyx_k_7, ((PyObject *)__pyx_kp_s_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L4; - } - __pyx_L4:; - - /* "bzrlib/_readdir_pyx.pyx":302 - * if orig_dir_fd == -1: - * raise_os_error(errno, "open: ", ".") - * if -1 == chdir(path): # <<<<<<<<<<<<<< - * # Ignore the return value, because we are already raising an - * # exception - */ - __pyx_t_5 = PyBytes_AsString(__pyx_v_path); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_4 = (-1 == chdir(__pyx_t_5)); - if (__pyx_t_4) { - - /* "bzrlib/_readdir_pyx.pyx":305 - * # Ignore the return value, because we are already raising an - * # exception - * close(orig_dir_fd) # <<<<<<<<<<<<<< - * raise_os_error(errno, "chdir: ", path) - * else: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":305 */ close(__pyx_v_orig_dir_fd); - /* "bzrlib/_readdir_pyx.pyx":306 - * # exception - * close(orig_dir_fd) - * raise_os_error(errno, "chdir: ", path) # <<<<<<<<<<<<<< - * else: - * orig_dir_fd = -1 - */ - __pyx_t_1 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno, __pyx_k_8, __pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L5; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":306 */ + __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k10,__pyx_v_path); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L4; } - __pyx_L5:; - goto __pyx_L3; + __pyx_L4:; + goto __pyx_L2; } /*else*/ { - - /* "bzrlib/_readdir_pyx.pyx":308 - * raise_os_error(errno, "chdir: ", path) - * else: - * orig_dir_fd = -1 # <<<<<<<<<<<<<< - * - * try: - */ - __pyx_v_orig_dir_fd = -1; + __pyx_v_orig_dir_fd = (-1); } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_readdir_pyx.pyx":310 - * orig_dir_fd = -1 - * - * try: # <<<<<<<<<<<<<< - * the_dir = opendir(".") - * if NULL == the_dir: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":310 */ /*try:*/ { - /* "bzrlib/_readdir_pyx.pyx":311 - * - * try: - * the_dir = opendir(".") # <<<<<<<<<<<<<< - * if NULL == the_dir: - * raise_os_error(errno, "opendir: ", path) - */ - __pyx_v_the_dir = opendir(__pyx_k_6); - - /* "bzrlib/_readdir_pyx.pyx":312 - * try: - * the_dir = opendir(".") - * if NULL == the_dir: # <<<<<<<<<<<<<< - * raise_os_error(errno, "opendir: ", path) - * try: - */ - __pyx_t_4 = (NULL == __pyx_v_the_dir); - if (__pyx_t_4) { - - /* "bzrlib/_readdir_pyx.pyx":313 - * the_dir = opendir(".") - * if NULL == the_dir: - * raise_os_error(errno, "opendir: ", path) # <<<<<<<<<<<<<< - * try: - * result = [] - */ - __pyx_t_1 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno, __pyx_k_9, __pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":311 */ + __pyx_v_the_dir = opendir(__pyx_k8); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":312 */ + __pyx_1 = (NULL == __pyx_v_the_dir); + if (__pyx_1) { + __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k11,__pyx_v_path); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; goto __pyx_L6;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L8; } - __pyx_L9:; + __pyx_L8:; - /* "bzrlib/_readdir_pyx.pyx":314 - * if NULL == the_dir: - * raise_os_error(errno, "opendir: ", path) - * try: # <<<<<<<<<<<<<< - * result = [] - * entry = &sentinel - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":314 */ /*try:*/ { - /* "bzrlib/_readdir_pyx.pyx":315 - * raise_os_error(errno, "opendir: ", path) - * try: - * result = [] # <<<<<<<<<<<<<< - * entry = &sentinel - * while entry != NULL: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_result)); - __pyx_v_result = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_readdir_pyx.pyx":316 - * try: - * result = [] - * entry = &sentinel # <<<<<<<<<<<<<< - * while entry != NULL: - * # Unlike most libc functions, readdir needs errno set to 0 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":315 */ + __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L10;} + Py_DECREF(__pyx_v_result); + __pyx_v_result = __pyx_2; + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":316 */ __pyx_v_entry = (&__pyx_v_sentinel); - /* "bzrlib/_readdir_pyx.pyx":317 - * result = [] - * entry = &sentinel - * while entry != NULL: # <<<<<<<<<<<<<< - * # Unlike most libc functions, readdir needs errno set to 0 - * # beforehand so that eof can be distinguished from errors. See - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":317 */ while (1) { - __pyx_t_4 = (__pyx_v_entry != NULL); - if (!__pyx_t_4) break; + __pyx_1 = (__pyx_v_entry != NULL); + if (!__pyx_1) break; - /* "bzrlib/_readdir_pyx.pyx":321 - * # beforehand so that eof can be distinguished from errors. See - * # - * while True: # <<<<<<<<<<<<<< - * errno = 0 - * entry = readdir(the_dir) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":321 */ while (1) { - if (!1) break; + __pyx_1 = PyObject_IsTrue(Py_True); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; goto __pyx_L10;} + if (!__pyx_1) break; - /* "bzrlib/_readdir_pyx.pyx":322 - * # - * while True: - * errno = 0 # <<<<<<<<<<<<<< - * entry = readdir(the_dir) - * if entry == NULL and (errno == EAGAIN or errno == EINTR): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":322 */ errno = 0; - /* "bzrlib/_readdir_pyx.pyx":323 - * while True: - * errno = 0 - * entry = readdir(the_dir) # <<<<<<<<<<<<<< - * if entry == NULL and (errno == EAGAIN or errno == EINTR): - * if errno == EINTR: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":323 */ __pyx_v_entry = readdir(__pyx_v_the_dir); - /* "bzrlib/_readdir_pyx.pyx":324 - * errno = 0 - * entry = readdir(the_dir) - * if entry == NULL and (errno == EAGAIN or errno == EINTR): # <<<<<<<<<<<<<< - * if errno == EINTR: - * PyErr_CheckSignals() - */ - __pyx_t_4 = (__pyx_v_entry == NULL); - if (__pyx_t_4) { - __pyx_t_2 = (errno == EAGAIN); - if (!__pyx_t_2) { - __pyx_t_3 = (errno == EINTR); - __pyx_t_6 = __pyx_t_3; - } else { - __pyx_t_6 = __pyx_t_2; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":324 */ + __pyx_1 = (__pyx_v_entry == NULL); + if (__pyx_1) { + __pyx_1 = (errno == EAGAIN); + if (!__pyx_1) { + __pyx_1 = (errno == EINTR); } - __pyx_t_2 = __pyx_t_6; - } else { - __pyx_t_2 = __pyx_t_4; } - if (__pyx_t_2) { - - /* "bzrlib/_readdir_pyx.pyx":325 - * entry = readdir(the_dir) - * if entry == NULL and (errno == EAGAIN or errno == EINTR): - * if errno == EINTR: # <<<<<<<<<<<<<< - * PyErr_CheckSignals() - * # try again - */ - __pyx_t_2 = (errno == EINTR); - if (__pyx_t_2) { - - /* "bzrlib/_readdir_pyx.pyx":326 - * if entry == NULL and (errno == EAGAIN or errno == EINTR): - * if errno == EINTR: - * PyErr_CheckSignals() # <<<<<<<<<<<<<< - * # try again - * continue - */ - __pyx_t_7 = PyErr_CheckSignals(); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L11;} - goto __pyx_L18; - } - __pyx_L18:; + if (__pyx_1) { - /* "bzrlib/_readdir_pyx.pyx":328 - * PyErr_CheckSignals() - * # try again - * continue # <<<<<<<<<<<<<< - * else: - * break - */ - goto __pyx_L15_continue; - goto __pyx_L17; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":325 */ + __pyx_1 = (errno == EINTR); + if (__pyx_1) { + __pyx_1 = PyErr_CheckSignals(); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L10;} + goto __pyx_L17; + } + __pyx_L17:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":328 */ + goto __pyx_L14; + goto __pyx_L16; } /*else*/ { - - /* "bzrlib/_readdir_pyx.pyx":330 - * continue - * else: - * break # <<<<<<<<<<<<<< - * if entry == NULL: - * if errno == ENOTDIR or errno == 0: - */ - goto __pyx_L16_break; + goto __pyx_L15; } - __pyx_L17:; - __pyx_L15_continue:; + __pyx_L16:; + __pyx_L14:; } - __pyx_L16_break:; + __pyx_L15:; - /* "bzrlib/_readdir_pyx.pyx":331 - * else: - * break - * if entry == NULL: # <<<<<<<<<<<<<< - * if errno == ENOTDIR or errno == 0: - * # We see ENOTDIR at the end of a normal directory. - */ - __pyx_t_2 = (__pyx_v_entry == NULL); - if (__pyx_t_2) { - - /* "bzrlib/_readdir_pyx.pyx":332 - * break - * if entry == NULL: - * if errno == ENOTDIR or errno == 0: # <<<<<<<<<<<<<< - * # We see ENOTDIR at the end of a normal directory. - * # As ENOTDIR for read_dir(file) is triggered on opendir, - */ - __pyx_t_2 = (errno == ENOTDIR); - if (!__pyx_t_2) { - __pyx_t_4 = (errno == 0); - __pyx_t_6 = __pyx_t_4; - } else { - __pyx_t_6 = __pyx_t_2; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":331 */ + __pyx_1 = (__pyx_v_entry == NULL); + if (__pyx_1) { + __pyx_1 = (errno == ENOTDIR); + if (!__pyx_1) { + __pyx_1 = (errno == 0); } - if (__pyx_t_6) { - - /* "bzrlib/_readdir_pyx.pyx":336 - * # As ENOTDIR for read_dir(file) is triggered on opendir, - * # we consider ENOTDIR to be 'no error'. - * continue # <<<<<<<<<<<<<< - * else: - * raise_os_error(errno, "readdir: ", path) - */ - goto __pyx_L13_continue; - goto __pyx_L20; + if (__pyx_1) { + goto __pyx_L12; + goto __pyx_L19; } /*else*/ { - - /* "bzrlib/_readdir_pyx.pyx":338 - * continue - * else: - * raise_os_error(errno, "readdir: ", path) # <<<<<<<<<<<<<< - * name = entry.d_name - * if not (name[0] == c"." and ( - */ - __pyx_t_1 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno, __pyx_k_10, __pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k12,__pyx_v_path); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; goto __pyx_L10;} + Py_DECREF(__pyx_2); __pyx_2 = 0; } - __pyx_L20:; - goto __pyx_L19; + __pyx_L19:; + goto __pyx_L18; } - __pyx_L19:; + __pyx_L18:; - /* "bzrlib/_readdir_pyx.pyx":339 - * else: - * raise_os_error(errno, "readdir: ", path) - * name = entry.d_name # <<<<<<<<<<<<<< - * if not (name[0] == c"." and ( - * (name[1] == 0) or - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":339 */ __pyx_v_name = __pyx_v_entry->d_name; - /* "bzrlib/_readdir_pyx.pyx":340 - * raise_os_error(errno, "readdir: ", path) - * name = entry.d_name - * if not (name[0] == c"." and ( # <<<<<<<<<<<<<< - * (name[1] == 0) or - * (name[1] == c"." and name[2] == 0)) - */ - __pyx_t_6 = ((__pyx_v_name[0]) == '.'); - if (__pyx_t_6) { - - /* "bzrlib/_readdir_pyx.pyx":341 - * name = entry.d_name - * if not (name[0] == c"." and ( - * (name[1] == 0) or # <<<<<<<<<<<<<< - * (name[1] == c"." and name[2] == 0)) - * ): - */ - __pyx_t_2 = ((__pyx_v_name[1]) == 0); - if (!__pyx_t_2) { - - /* "bzrlib/_readdir_pyx.pyx":342 - * if not (name[0] == c"." and ( - * (name[1] == 0) or - * (name[1] == c"." and name[2] == 0)) # <<<<<<<<<<<<<< - * ): - * statvalue = _Stat() - */ - __pyx_t_4 = ((__pyx_v_name[1]) == '.'); - if (__pyx_t_4) { - __pyx_t_3 = ((__pyx_v_name[2]) == 0); - __pyx_t_8 = __pyx_t_3; - } else { - __pyx_t_8 = __pyx_t_4; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":340 */ + __pyx_1 = ((__pyx_v_name[0]) == '.'); + if (__pyx_1) { + __pyx_1 = ((__pyx_v_name[1]) == 0); + if (!__pyx_1) { + __pyx_1 = ((__pyx_v_name[1]) == '.'); + if (__pyx_1) { + __pyx_1 = ((__pyx_v_name[2]) == 0); } - __pyx_t_4 = __pyx_t_8; - } else { - __pyx_t_4 = __pyx_t_2; } - __pyx_t_2 = __pyx_t_4; - } else { - __pyx_t_2 = __pyx_t_6; } - __pyx_t_6 = (!__pyx_t_2); - if (__pyx_t_6) { + __pyx_4 = (!__pyx_1); + if (__pyx_4) { - /* "bzrlib/_readdir_pyx.pyx":344 - * (name[1] == c"." and name[2] == 0)) - * ): - * statvalue = _Stat() # <<<<<<<<<<<<<< - * stat_result = lstat(entry.d_name, &statvalue._st) - * if stat_result != 0: - */ - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_12_readdir_pyx__Stat)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_v_statvalue)); - __pyx_v_statvalue = ((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_readdir_pyx.pyx":345 - * ): - * statvalue = _Stat() - * stat_result = lstat(entry.d_name, &statvalue._st) # <<<<<<<<<<<<<< - * if stat_result != 0: - * if errno != ENOENT: - */ - __pyx_v_stat_result = lstat(__pyx_v_entry->d_name, (&__pyx_v_statvalue->_st)); - - /* "bzrlib/_readdir_pyx.pyx":346 - * statvalue = _Stat() - * stat_result = lstat(entry.d_name, &statvalue._st) - * if stat_result != 0: # <<<<<<<<<<<<<< - * if errno != ENOENT: - * raise_os_error(errno, "lstat: ", - */ - __pyx_t_6 = (__pyx_v_stat_result != 0); - if (__pyx_t_6) { - - /* "bzrlib/_readdir_pyx.pyx":347 - * stat_result = lstat(entry.d_name, &statvalue._st) - * if stat_result != 0: - * if errno != ENOENT: # <<<<<<<<<<<<<< - * raise_os_error(errno, "lstat: ", - * path + "/" + entry.d_name) - */ - __pyx_t_6 = (errno != ENOENT); - if (__pyx_t_6) { - - /* "bzrlib/_readdir_pyx.pyx":349 - * if errno != ENOENT: - * raise_os_error(errno, "lstat: ", - * path + "/" + entry.d_name) # <<<<<<<<<<<<<< - * else: - * # the file seems to have disappeared after being - */ - __pyx_t_1 = PyNumber_Add(__pyx_v_path, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyBytes_FromString(__pyx_v_entry->d_name); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(((PyObject *)__pyx_t_9)); - __pyx_t_10 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; - __pyx_t_9 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno, __pyx_k_11, __pyx_t_10); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - goto __pyx_L23; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":344 */ + __pyx_2 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_12_readdir_pyx__Stat), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L10;} + Py_DECREF(((PyObject *)__pyx_v_statvalue)); + __pyx_v_statvalue = ((struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat *)__pyx_2); + __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":345 */ + __pyx_v_stat_result = lstat(__pyx_v_entry->d_name,(&__pyx_v_statvalue->_st)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":346 */ + __pyx_1 = (__pyx_v_stat_result != 0); + if (__pyx_1) { + __pyx_4 = (errno != ENOENT); + if (__pyx_4) { + __pyx_2 = PyNumber_Add(__pyx_v_path, __pyx_k5p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L10;} + __pyx_5 = PyString_FromString(__pyx_v_entry->d_name); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L10;} + __pyx_6 = PyNumber_Add(__pyx_2, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L10;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k13,__pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L10;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L22; } /*else*/ { - - /* "bzrlib/_readdir_pyx.pyx":354 - * # seen by readdir - perhaps a transient temporary - * # file. there's no point returning it. - * continue # <<<<<<<<<<<<<< - * # We append a 5-tuple that can be modified in-place by the C - * # api: - */ - goto __pyx_L13_continue; + goto __pyx_L12; } - __pyx_L23:; - goto __pyx_L22; + __pyx_L22:; + goto __pyx_L21; } - __pyx_L22:; + __pyx_L21:; - /* "bzrlib/_readdir_pyx.pyx":362 - * # statvalue (to keep) - * # abspath (None, to set) - * PyList_Append(result, (entry.d_ino, entry.d_name, None, # <<<<<<<<<<<<<< - * statvalue, None)) - * finally: - */ - __pyx_t_9 = __Pyx_PyInt_to_py_ino_t(__pyx_v_entry->d_ino); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyBytes_FromString(__pyx_v_entry->d_name); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - - /* "bzrlib/_readdir_pyx.pyx":363 - * # abspath (None, to set) - * PyList_Append(result, (entry.d_ino, entry.d_name, None, - * statvalue, None)) # <<<<<<<<<<<<<< - * finally: - * if -1 == closedir(the_dir): - */ - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); - __Pyx_GIVEREF(__pyx_t_9); - PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_10)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_INCREF(((PyObject *)__pyx_v_statvalue)); - PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_statvalue)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_statvalue)); - __Pyx_INCREF(Py_None); - PyTuple_SET_ITEM(__pyx_t_1, 4, Py_None); - __Pyx_GIVEREF(Py_None); - __pyx_t_9 = 0; - __pyx_t_10 = 0; - __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L11;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - goto __pyx_L21; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":362 */ + __pyx_5 = PyLong_FromUnsignedLong(__pyx_v_entry->d_ino); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L10;} + __pyx_6 = PyString_FromString(__pyx_v_entry->d_name); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L10;} + __pyx_2 = PyTuple_New(5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L10;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_6); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_2, 2, Py_None); + Py_INCREF(((PyObject *)__pyx_v_statvalue)); + PyTuple_SET_ITEM(__pyx_2, 3, ((PyObject *)__pyx_v_statvalue)); + Py_INCREF(Py_None); + PyTuple_SET_ITEM(__pyx_2, 4, Py_None); + __pyx_5 = 0; + __pyx_6 = 0; + __pyx_1 = PyList_Append(__pyx_v_result,__pyx_2); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; goto __pyx_L10;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L20; } - __pyx_L21:; - __pyx_L13_continue:; + __pyx_L20:; + __pyx_L12:; } } - - /* "bzrlib/_readdir_pyx.pyx":365 - * statvalue, None)) - * finally: - * if -1 == closedir(the_dir): # <<<<<<<<<<<<<< - * raise_os_error(errno, "closedir: ", path) - * finally: - */ /*finally:*/ { int __pyx_why; PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L12; - __pyx_L11: { + __pyx_why = 0; goto __pyx_L11; + __pyx_L10: { __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + Py_XDECREF(__pyx_5); __pyx_5 = 0; + Py_XDECREF(__pyx_6); __pyx_6 = 0; + Py_XDECREF(__pyx_2); __pyx_2 = 0; + PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L12; + goto __pyx_L11; } - __pyx_L12:; - __pyx_t_6 = (-1 == closedir(__pyx_v_the_dir)); - if (__pyx_t_6) { - - /* "bzrlib/_readdir_pyx.pyx":366 - * finally: - * if -1 == closedir(the_dir): - * raise_os_error(errno, "closedir: ", path) # <<<<<<<<<<<<<< - * finally: - * if -1 != orig_dir_fd: - */ - __pyx_t_1 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno, __pyx_k_12, __pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L24_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L25; + __pyx_L11:; + __pyx_4 = ((-1) == closedir(__pyx_v_the_dir)); + if (__pyx_4) { + __pyx_5 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k14,__pyx_v_path); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L23;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + goto __pyx_L24; } - __pyx_L25:; - goto __pyx_L26; - __pyx_L24_error:; + __pyx_L24:; + goto __pyx_L25; + __pyx_L23:; if (__pyx_why == 4) { Py_XDECREF(__pyx_exc_type); Py_XDECREF(__pyx_exc_value); Py_XDECREF(__pyx_exc_tb); } - goto __pyx_L7; - __pyx_L26:; + goto __pyx_L6; + __pyx_L25:; switch (__pyx_why) { case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); __pyx_lineno = __pyx_exc_lineno; __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; - goto __pyx_L7; + goto __pyx_L6; } } } } - - /* "bzrlib/_readdir_pyx.pyx":368 - * raise_os_error(errno, "closedir: ", path) - * finally: - * if -1 != orig_dir_fd: # <<<<<<<<<<<<<< - * failed = False - * if -1 == fchdir(orig_dir_fd): - */ /*finally:*/ { int __pyx_why; PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L8; - __pyx_L7: { + __pyx_why = 0; goto __pyx_L7; + __pyx_L6: { __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + Py_XDECREF(__pyx_6); __pyx_6 = 0; + Py_XDECREF(__pyx_2); __pyx_2 = 0; + Py_XDECREF(__pyx_5); __pyx_5 = 0; + PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L8; + goto __pyx_L7; } - __pyx_L8:; - __pyx_t_6 = (-1 != __pyx_v_orig_dir_fd); - if (__pyx_t_6) { - - /* "bzrlib/_readdir_pyx.pyx":369 - * finally: - * if -1 != orig_dir_fd: - * failed = False # <<<<<<<<<<<<<< - * if -1 == fchdir(orig_dir_fd): - * # try to close the original directory anyhow - */ - __pyx_v_failed = 0; - - /* "bzrlib/_readdir_pyx.pyx":370 - * if -1 != orig_dir_fd: - * failed = False - * if -1 == fchdir(orig_dir_fd): # <<<<<<<<<<<<<< - * # try to close the original directory anyhow - * failed = True - */ - __pyx_t_6 = (-1 == fchdir(__pyx_v_orig_dir_fd)); - if (__pyx_t_6) { - - /* "bzrlib/_readdir_pyx.pyx":372 - * if -1 == fchdir(orig_dir_fd): - * # try to close the original directory anyhow - * failed = True # <<<<<<<<<<<<<< - * if -1 == close(orig_dir_fd) or failed: - * raise_os_error(errno, "return to orig_dir: ", "") - */ - __pyx_v_failed = 1; - goto __pyx_L29; + __pyx_L7:; + __pyx_1 = ((-1) != __pyx_v_orig_dir_fd); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":369 */ + Py_INCREF(Py_False); + Py_DECREF(__pyx_v_failed); + __pyx_v_failed = Py_False; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":370 */ + __pyx_4 = ((-1) == fchdir(__pyx_v_orig_dir_fd)); + if (__pyx_4) { + Py_INCREF(Py_True); + Py_DECREF(__pyx_v_failed); + __pyx_v_failed = Py_True; + goto __pyx_L28; } - __pyx_L29:; + __pyx_L28:; - /* "bzrlib/_readdir_pyx.pyx":373 - * # try to close the original directory anyhow - * failed = True - * if -1 == close(orig_dir_fd) or failed: # <<<<<<<<<<<<<< - * raise_os_error(errno, "return to orig_dir: ", "") - * - */ - __pyx_t_6 = (-1 == close(__pyx_v_orig_dir_fd)); - if (!__pyx_t_6) { - __pyx_t_2 = __pyx_v_failed; - } else { - __pyx_t_2 = __pyx_t_6; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":373 */ + __pyx_6 = PyInt_FromLong(((-1) == close(__pyx_v_orig_dir_fd))); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L26;} + __pyx_1 = PyObject_IsTrue(__pyx_6); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L26;} + if (!__pyx_1) { + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_6 = __pyx_v_failed; + Py_INCREF(__pyx_6); } - if (__pyx_t_2) { - - /* "bzrlib/_readdir_pyx.pyx":374 - * failed = True - * if -1 == close(orig_dir_fd) or failed: - * raise_os_error(errno, "return to orig_dir: ", "") # <<<<<<<<<<<<<< - * - * return result - */ - __pyx_t_1 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno, __pyx_k_13, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L27_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L30; + __pyx_4 = PyObject_IsTrue(__pyx_6); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L26;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + if (__pyx_4) { + __pyx_2 = __pyx_f_6bzrlib_12_readdir_pyx_raise_os_error(errno,__pyx_k15,__pyx_k6p); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; goto __pyx_L26;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L29; } - __pyx_L30:; - goto __pyx_L28; + __pyx_L29:; + goto __pyx_L27; } - __pyx_L28:; - goto __pyx_L31; - __pyx_L27_error:; + __pyx_L27:; + goto __pyx_L30; + __pyx_L26:; if (__pyx_why == 4) { Py_XDECREF(__pyx_exc_type); Py_XDECREF(__pyx_exc_value); Py_XDECREF(__pyx_exc_tb); } - goto __pyx_L1_error; - __pyx_L31:; + goto __pyx_L1; + __pyx_L30:; switch (__pyx_why) { case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); __pyx_lineno = __pyx_exc_lineno; __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; - goto __pyx_L1_error; + goto __pyx_L1; } } } - /* "bzrlib/_readdir_pyx.pyx":376 - * raise_os_error(errno, "return to orig_dir: ", "") - * - * return result # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_result)); - __pyx_r = ((PyObject *)__pyx_v_result); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":376 */ + Py_INCREF(__pyx_v_result); + __pyx_r = __pyx_v_result; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_5); + Py_XDECREF(__pyx_6); __Pyx_AddTraceback("bzrlib._readdir_pyx._read_dir"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_statvalue); - __Pyx_DECREF(__pyx_v_result); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_statvalue); + Py_DECREF(__pyx_v_result); + Py_DECREF(__pyx_v_failed); + Py_DECREF(__pyx_v_path); return __pyx_r; } @@ -2492,44 +1130,44 @@ } static void __pyx_tp_dealloc_6bzrlib_12_readdir_pyx__Stat(PyObject *o) { - (*Py_TYPE(o)->tp_free)(o); + (*o->ob_type->tp_free)(o); } static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_dev(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_6st_dev___get__(o); + return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_dev___get__(o); } static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_ino(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_6st_ino___get__(o); + return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_6st_ino___get__(o); } static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_mode(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_7st_mode___get__(o); + return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_mode___get__(o); } static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_ctime(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_8st_ctime___get__(o); + return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_ctime___get__(o); } static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_mtime(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_8st_mtime___get__(o); + return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_8st_mtime___get__(o); } static PyObject *__pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_size(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_12_readdir_pyx_5_Stat_7st_size___get__(o); + return __pyx_f_6bzrlib_12_readdir_pyx_5_Stat_7st_size___get__(o); } -static PyMethodDef __pyx_methods_6bzrlib_12_readdir_pyx__Stat[] = { +static struct PyMethodDef __pyx_methods_6bzrlib_12_readdir_pyx__Stat[] = { {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6bzrlib_12_readdir_pyx__Stat[] = { - {(char *)"st_dev", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_dev, 0, 0, 0}, - {(char *)"st_ino", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_ino, 0, 0, 0}, - {(char *)"st_mode", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_mode, 0, 0, 0}, - {(char *)"st_ctime", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_ctime, 0, 0, 0}, - {(char *)"st_mtime", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_mtime, 0, 0, 0}, - {(char *)"st_size", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_size, 0, 0, 0}, + {"st_dev", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_dev, 0, 0, 0}, + {"st_ino", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_ino, 0, 0, 0}, + {"st_mode", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_mode, 0, 0, 0}, + {"st_ctime", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_ctime, 0, 0, 0}, + {"st_mtime", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_mtime, 0, 0, 0}, + {"st_size", __pyx_getprop_6bzrlib_12_readdir_pyx_5_Stat_st_size, 0, 0, 0}, {0, 0, 0, 0, 0} }; @@ -2537,9 +1175,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -2553,28 +1189,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -2586,7 +1210,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; @@ -2611,41 +1235,24 @@ }; static PyBufferProcs __pyx_tp_as_buffer__Stat = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; -static PyTypeObject __pyx_type_6bzrlib_12_readdir_pyx__Stat = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._readdir_pyx._Stat"), /*tp_name*/ +PyTypeObject __pyx_type_6bzrlib_12_readdir_pyx__Stat = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._readdir_pyx._Stat", /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_12_readdir_pyx__Stat), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_12_readdir_pyx__Stat, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif - __pyx_pf_6bzrlib_12_readdir_pyx_5_Stat___repr__, /*tp_repr*/ + __pyx_f_6bzrlib_12_readdir_pyx_5_Stat___repr__, /*tp_repr*/ &__pyx_tp_as_number__Stat, /*tp_as_number*/ &__pyx_tp_as_sequence__Stat, /*tp_as_sequence*/ &__pyx_tp_as_mapping__Stat, /*tp_as_mapping*/ @@ -2655,8 +1262,8 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__Stat, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - __Pyx_DOCSTR("Represent a 'stat' result."), /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "Represent a \'stat\' result.", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -2681,10 +1288,6 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif }; static struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader __pyx_vtable_6bzrlib_12_readdir_pyx_UTF8DirReader; @@ -2693,18 +1296,18 @@ PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *)o); - p->__pyx_vtab = __pyx_vtabptr_6bzrlib_12_readdir_pyx_UTF8DirReader; + *(struct __pyx_vtabstruct_6bzrlib_12_readdir_pyx_UTF8DirReader **)&p->__pyx_vtab = __pyx_vtabptr_6bzrlib_12_readdir_pyx_UTF8DirReader; return o; } static void __pyx_tp_dealloc_6bzrlib_12_readdir_pyx_UTF8DirReader(PyObject *o) { - (*Py_TYPE(o)->tp_free)(o); + (*o->ob_type->tp_free)(o); } -static PyMethodDef __pyx_methods_6bzrlib_12_readdir_pyx_UTF8DirReader[] = { - {__Pyx_NAMESTR("kind_from_mode"), (PyCFunction)__pyx_pf_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode)}, - {__Pyx_NAMESTR("top_prefix_to_starting_dir"), (PyCFunction)__pyx_pf_6bzrlib_12_readdir_pyx_13UTF8DirReader_1top_prefix_to_starting_dir, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_1top_prefix_to_starting_dir)}, - {__Pyx_NAMESTR("read_dir"), (PyCFunction)__pyx_pf_6bzrlib_12_readdir_pyx_13UTF8DirReader_2read_dir, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_2read_dir)}, +static struct PyMethodDef __pyx_methods_6bzrlib_12_readdir_pyx_UTF8DirReader[] = { + {"kind_from_mode", (PyCFunction)__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_kind_from_mode}, + {"top_prefix_to_starting_dir", (PyCFunction)__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_top_prefix_to_starting_dir, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_top_prefix_to_starting_dir}, + {"read_dir", (PyCFunction)__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader_read_dir, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_12_readdir_pyx_13UTF8DirReader_read_dir}, {0, 0, 0, 0} }; @@ -2712,9 +1315,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -2728,28 +1329,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -2761,7 +1350,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; @@ -2786,40 +1375,23 @@ }; static PyBufferProcs __pyx_tp_as_buffer_UTF8DirReader = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; -static PyTypeObject __pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._readdir_pyx.UTF8DirReader"), /*tp_name*/ +PyTypeObject __pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._readdir_pyx.UTF8DirReader", /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_12_readdir_pyx_UTF8DirReader, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif 0, /*tp_repr*/ &__pyx_tp_as_number_UTF8DirReader, /*tp_as_number*/ &__pyx_tp_as_sequence_UTF8DirReader, /*tp_as_sequence*/ @@ -2830,8 +1402,8 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_UTF8DirReader, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - __Pyx_DOCSTR("A dir reader for utf8 file systems."), /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "A dir reader for utf8 file systems.", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ @@ -2856,175 +1428,26 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif }; -static PyMethodDef __pyx_methods[] = { +static struct PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("_readdir_pyx"), - __Pyx_DOCSTR(__pyx_k_14), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif +static void __pyx_init_filenames(void); /*proto*/ -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, - {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1}, - {&__pyx_n_s__OSError, __pyx_k__OSError, sizeof(__pyx_k__OSError), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___kind_from_mode, __pyx_k___kind_from_mode, sizeof(__pyx_k___kind_from_mode), 0, 0, 1, 1}, - {&__pyx_n_s___st, __pyx_k___st, sizeof(__pyx_k___st), 0, 0, 1, 1}, - {&__pyx_n_s__block, __pyx_k__block, sizeof(__pyx_k__block), 0, 0, 1, 1}, - {&__pyx_n_s__bzrlib, __pyx_k__bzrlib, sizeof(__pyx_k__bzrlib), 0, 0, 1, 1}, - {&__pyx_n_s__chardev, __pyx_k__chardev, sizeof(__pyx_k__chardev), 0, 0, 1, 1}, - {&__pyx_n_s__d_ino, __pyx_k__d_ino, sizeof(__pyx_k__d_ino), 0, 0, 1, 1}, - {&__pyx_n_s__d_name, __pyx_k__d_name, sizeof(__pyx_k__d_name), 0, 0, 1, 1}, - {&__pyx_n_s__directory, __pyx_k__directory, sizeof(__pyx_k__directory), 0, 0, 1, 1}, - {&__pyx_n_s__fifo, __pyx_k__fifo, sizeof(__pyx_k__fifo), 0, 0, 1, 1}, - {&__pyx_n_s__file, __pyx_k__file, sizeof(__pyx_k__file), 0, 0, 1, 1}, - {&__pyx_n_s__os, __pyx_k__os, sizeof(__pyx_k__os), 0, 0, 1, 1}, - {&__pyx_n_s__osutils, __pyx_k__osutils, sizeof(__pyx_k__osutils), 0, 0, 1, 1}, - {&__pyx_n_s__prefix, __pyx_k__prefix, sizeof(__pyx_k__prefix), 0, 0, 1, 1}, - {&__pyx_n_s__safe_utf8, __pyx_k__safe_utf8, sizeof(__pyx_k__safe_utf8), 0, 0, 1, 1}, - {&__pyx_n_s__socket, __pyx_k__socket, sizeof(__pyx_k__socket), 0, 0, 1, 1}, - {&__pyx_n_s__st_ctime, __pyx_k__st_ctime, sizeof(__pyx_k__st_ctime), 0, 0, 1, 1}, - {&__pyx_n_s__st_dev, __pyx_k__st_dev, sizeof(__pyx_k__st_dev), 0, 0, 1, 1}, - {&__pyx_n_s__st_ino, __pyx_k__st_ino, sizeof(__pyx_k__st_ino), 0, 0, 1, 1}, - {&__pyx_n_s__st_mode, __pyx_k__st_mode, sizeof(__pyx_k__st_mode), 0, 0, 1, 1}, - {&__pyx_n_s__st_mtime, __pyx_k__st_mtime, sizeof(__pyx_k__st_mtime), 0, 0, 1, 1}, - {&__pyx_n_s__st_size, __pyx_k__st_size, sizeof(__pyx_k__st_size), 0, 0, 1, 1}, - {&__pyx_n_s__symlink, __pyx_k__symlink, sizeof(__pyx_k__symlink), 0, 0, 1, 1}, - {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1}, - {&__pyx_n_s__top, __pyx_k__top, sizeof(__pyx_k__top), 0, 0, 1, 1}, - {&__pyx_n_s__unknown, __pyx_k__unknown, sizeof(__pyx_k__unknown), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_OSError = __Pyx_GetName(__pyx_b, __pyx_n_s__OSError); if (!__pyx_builtin_OSError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "bzrlib/_readdir_pyx.pyx":247 - * # PyString_Concat will have setup an exception, but how to get - * # at it? - * raise Exception("failed to strcat") # <<<<<<<<<<<<<< - * PyTuple_SetItem_obj(atuple, 0, new_val_obj) - * # 1st None -> kind - */ - __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_4)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4)); - - /* "bzrlib/_readdir_pyx.pyx":263 - * # PyString_Concat will have setup an exception, but how to get - * # at it? - * raise Exception("failed to strcat") # <<<<<<<<<<<<<< - * PyTuple_SetItem_obj(atuple, 4, new_val_obj) - * return result - */ - __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_3)); - PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC init_readdir_pyx(void); /*proto*/ -PyMODINIT_FUNC init_readdir_pyx(void) -#else -PyMODINIT_FUNC PyInit__readdir_pyx(void); /*proto*/ -PyMODINIT_FUNC PyInit__readdir_pyx(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__readdir_pyx(void)", __LINE__, __FILE__); - #endif - __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;} - __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;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_readdir_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_14), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_readdir_pyx(void) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + __pyx_init_filenames(); + __pyx_m = Py_InitModule4("_readdir_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_bzrlib___readdir_pyx) { - 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;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ + __pyx_b = PyImport_AddModule("__builtin__"); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; __pyx_v_6bzrlib_12_readdir_pyx__directory = Py_None; Py_INCREF(Py_None); __pyx_v_6bzrlib_12_readdir_pyx__chardev = Py_None; Py_INCREF(Py_None); __pyx_v_6bzrlib_12_readdir_pyx__block = Py_None; Py_INCREF(Py_None); @@ -3034,384 +1457,107 @@ __pyx_v_6bzrlib_12_readdir_pyx__socket = Py_None; Py_INCREF(Py_None); __pyx_v_6bzrlib_12_readdir_pyx__unknown = Py_None; Py_INCREF(Py_None); __pyx_v_6bzrlib_12_readdir_pyx__safe_utf8 = Py_None; Py_INCREF(Py_None); - /*--- Function export code ---*/ - /*--- Type init code ---*/ - if (PyType_Ready(&__pyx_type_6bzrlib_12_readdir_pyx__Stat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - { - PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6bzrlib_12_readdir_pyx__Stat, "__repr__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_6bzrlib_12_readdir_pyx_5_Stat___repr__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_6bzrlib_12_readdir_pyx_5_Stat___repr__.doc = __pyx_doc_6bzrlib_12_readdir_pyx_5_Stat___repr__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6bzrlib_12_readdir_pyx_5_Stat___repr__; - } - } - if (__Pyx_SetAttrString(__pyx_m, "_Stat", (PyObject *)&__pyx_type_6bzrlib_12_readdir_pyx__Stat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + if (PyType_Ready(&__pyx_type_6bzrlib_12_readdir_pyx__Stat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "_Stat", (PyObject *)&__pyx_type_6bzrlib_12_readdir_pyx__Stat) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;} __pyx_ptype_6bzrlib_12_readdir_pyx__Stat = &__pyx_type_6bzrlib_12_readdir_pyx__Stat; __pyx_vtabptr_6bzrlib_12_readdir_pyx_UTF8DirReader = &__pyx_vtable_6bzrlib_12_readdir_pyx_UTF8DirReader; - __pyx_vtable_6bzrlib_12_readdir_pyx_UTF8DirReader._kind_from_mode = (PyObject *(*)(struct __pyx_obj_6bzrlib_12_readdir_pyx_UTF8DirReader *, int))__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader__kind_from_mode; - if (PyType_Ready(&__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetVtable(__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader.tp_dict, __pyx_vtabptr_6bzrlib_12_readdir_pyx_UTF8DirReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "UTF8DirReader", (PyObject *)&__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(void(**)(void))&__pyx_vtable_6bzrlib_12_readdir_pyx_UTF8DirReader._kind_from_mode = (void(*)(void))__pyx_f_6bzrlib_12_readdir_pyx_13UTF8DirReader__kind_from_mode; + if (PyType_Ready(&__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + if (__Pyx_SetVtable(__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader.tp_dict, __pyx_vtabptr_6bzrlib_12_readdir_pyx_UTF8DirReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "UTF8DirReader", (PyObject *)&__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} __pyx_ptype_6bzrlib_12_readdir_pyx_UTF8DirReader = &__pyx_type_6bzrlib_12_readdir_pyx_UTF8DirReader; - /*--- Type import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "bzrlib/_readdir_pyx.pyx":20 - * - * - * import os # <<<<<<<<<<<<<< - * import sys - * - */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__os), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_readdir_pyx.pyx":21 - * - * import os - * import sys # <<<<<<<<<<<<<< - * - * #python2.4 support - */ - __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "bzrlib/_readdir_pyx.pyx":110 - * - * cdef object _directory - * _directory = 'directory' # <<<<<<<<<<<<<< - * cdef object _chardev - * _chardev = 'chardev' - */ - __Pyx_INCREF(((PyObject *)__pyx_n_s__directory)); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_readdir_pyx__directory); - __Pyx_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__directory); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__directory)); - __pyx_v_6bzrlib_12_readdir_pyx__directory = ((PyObject *)__pyx_n_s__directory); - - /* "bzrlib/_readdir_pyx.pyx":112 - * _directory = 'directory' - * cdef object _chardev - * _chardev = 'chardev' # <<<<<<<<<<<<<< - * cdef object _block - * _block = 'block' - */ - __Pyx_INCREF(((PyObject *)__pyx_n_s__chardev)); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_readdir_pyx__chardev); - __Pyx_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__chardev); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__chardev)); - __pyx_v_6bzrlib_12_readdir_pyx__chardev = ((PyObject *)__pyx_n_s__chardev); - - /* "bzrlib/_readdir_pyx.pyx":114 - * _chardev = 'chardev' - * cdef object _block - * _block = 'block' # <<<<<<<<<<<<<< - * cdef object _file - * _file = 'file' - */ - __Pyx_INCREF(((PyObject *)__pyx_n_s__block)); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_readdir_pyx__block); - __Pyx_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__block); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__block)); - __pyx_v_6bzrlib_12_readdir_pyx__block = ((PyObject *)__pyx_n_s__block); - - /* "bzrlib/_readdir_pyx.pyx":116 - * _block = 'block' - * cdef object _file - * _file = 'file' # <<<<<<<<<<<<<< - * cdef object _fifo - * _fifo = 'fifo' - */ - __Pyx_INCREF(((PyObject *)__pyx_n_s__file)); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_readdir_pyx__file); - __Pyx_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__file); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__file)); - __pyx_v_6bzrlib_12_readdir_pyx__file = ((PyObject *)__pyx_n_s__file); - - /* "bzrlib/_readdir_pyx.pyx":118 - * _file = 'file' - * cdef object _fifo - * _fifo = 'fifo' # <<<<<<<<<<<<<< - * cdef object _symlink - * _symlink = 'symlink' - */ - __Pyx_INCREF(((PyObject *)__pyx_n_s__fifo)); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_readdir_pyx__fifo); - __Pyx_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__fifo); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__fifo)); - __pyx_v_6bzrlib_12_readdir_pyx__fifo = ((PyObject *)__pyx_n_s__fifo); - - /* "bzrlib/_readdir_pyx.pyx":120 - * _fifo = 'fifo' - * cdef object _symlink - * _symlink = 'symlink' # <<<<<<<<<<<<<< - * cdef object _socket - * _socket = 'socket' - */ - __Pyx_INCREF(((PyObject *)__pyx_n_s__symlink)); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_readdir_pyx__symlink); - __Pyx_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__symlink); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__symlink)); - __pyx_v_6bzrlib_12_readdir_pyx__symlink = ((PyObject *)__pyx_n_s__symlink); - - /* "bzrlib/_readdir_pyx.pyx":122 - * _symlink = 'symlink' - * cdef object _socket - * _socket = 'socket' # <<<<<<<<<<<<<< - * cdef object _unknown - * _unknown = 'unknown' - */ - __Pyx_INCREF(((PyObject *)__pyx_n_s__socket)); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_readdir_pyx__socket); - __Pyx_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__socket); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__socket)); - __pyx_v_6bzrlib_12_readdir_pyx__socket = ((PyObject *)__pyx_n_s__socket); - - /* "bzrlib/_readdir_pyx.pyx":124 - * _socket = 'socket' - * cdef object _unknown - * _unknown = 'unknown' # <<<<<<<<<<<<<< - * - * # add a typedef struct dirent dirent to workaround pyrex - */ - __Pyx_INCREF(((PyObject *)__pyx_n_s__unknown)); - __Pyx_GOTREF(__pyx_v_6bzrlib_12_readdir_pyx__unknown); - __Pyx_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__unknown); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__unknown)); - __pyx_v_6bzrlib_12_readdir_pyx__unknown = ((PyObject *)__pyx_n_s__unknown); - - /* "bzrlib/_readdir_pyx.pyx":169 - * - * - * from bzrlib import osutils # <<<<<<<<<<<<<< - * - * cdef object _safe_utf8 - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__osutils)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__osutils)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__osutils)); - __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 = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__osutils); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__osutils, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_readdir_pyx.pyx":172 - * - * cdef object _safe_utf8 - * _safe_utf8 = osutils.safe_utf8 # <<<<<<<<<<<<<< - * - * cdef class UTF8DirReader: - */ - __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__safe_utf8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GOTREF(__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8); - __Pyx_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6bzrlib_12_readdir_pyx__safe_utf8 = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_readdir_pyx.pyx":1 - * # Copyright (C) 2006, 2008, 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<< - * # - * # This program is free software; you can redistribute it and/or modify - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - __Pyx_AddTraceback("init bzrlib._readdir_pyx"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init bzrlib._readdir_pyx"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* Runtime support code */ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":20 */ + __pyx_1 = __Pyx_Import(__pyx_n_os, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_os, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":21 */ + __pyx_1 = __Pyx_Import(__pyx_n_sys, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_sys, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":110 */ + Py_INCREF(__pyx_n_directory); + Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__directory); + __pyx_v_6bzrlib_12_readdir_pyx__directory = __pyx_n_directory; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":112 */ + Py_INCREF(__pyx_n_chardev); + Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__chardev); + __pyx_v_6bzrlib_12_readdir_pyx__chardev = __pyx_n_chardev; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":114 */ + Py_INCREF(__pyx_n_block); + Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__block); + __pyx_v_6bzrlib_12_readdir_pyx__block = __pyx_n_block; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":116 */ + Py_INCREF(__pyx_n_file); + Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__file); + __pyx_v_6bzrlib_12_readdir_pyx__file = __pyx_n_file; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":118 */ + Py_INCREF(__pyx_n_fifo); + Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__fifo); + __pyx_v_6bzrlib_12_readdir_pyx__fifo = __pyx_n_fifo; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":120 */ + Py_INCREF(__pyx_n_symlink); + Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__symlink); + __pyx_v_6bzrlib_12_readdir_pyx__symlink = __pyx_n_symlink; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":122 */ + Py_INCREF(__pyx_n_socket); + Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__socket); + __pyx_v_6bzrlib_12_readdir_pyx__socket = __pyx_n_socket; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":124 */ + Py_INCREF(__pyx_n_unknown); + Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__unknown); + __pyx_v_6bzrlib_12_readdir_pyx__unknown = __pyx_n_unknown; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":169 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + Py_INCREF(__pyx_n_osutils); + PyList_SET_ITEM(__pyx_1, 0, __pyx_n_osutils); + __pyx_2 = __Pyx_Import(__pyx_n_bzrlib, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_osutils); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_osutils, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":172 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_osutils); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_safe_utf8); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_v_6bzrlib_12_readdir_pyx__safe_utf8); + __pyx_v_6bzrlib_12_readdir_pyx__safe_utf8 = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":199 */ + Py_INCREF(__pyx_k6p); + __pyx_d1 = __pyx_k6p; -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_readdir_pyx.pyx":274 */ + return; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("bzrlib._readdir_pyx"); } -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); -} +static char *__pyx_filenames[] = { + "_readdir_pyx.pyx", +}; -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} +/* Runtime support code */ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } - -#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); @@ -3452,13 +1598,12 @@ Py_INCREF(type); } else { - type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else - type = (PyObject*) Py_TYPE(type); + type = (PyObject*) type->ob_type; Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, @@ -3467,8 +1612,7 @@ } #endif } - - __Pyx_ErrRestore(type, value, tb); + PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); @@ -3477,59 +1621,46 @@ return; } -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + if (!*t->p) + return -1; + if (t->i) + PyString_InternInPlace(t->p); + ++t; } - if (value == Py_None) - value = 0; + return 0; +} - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); +static int __Pyx_SetVtable(PyObject *dict, void *vtable) { + PyObject *pycobj = 0; + int result; + + pycobj = PyCObject_FromVoidPtr(vtable, 0); + if (!pycobj) goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } + if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0) + goto bad; + result = 0; + goto done; bad: - return; + result = -1; +done: + Py_XDECREF(pycobj); + return result; } -#endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; + PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) + __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); + if (!__import__) goto bad; if (from_list) list = from_list; @@ -3545,538 +1676,65 @@ empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); + module = PyObject_CallFunction(__import__, "OOOO", + name, global_dict, empty_dict, list); bad: Py_XDECREF(empty_list); - Py_XDECREF(py_import); + Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_ino_t(ino_t val) { - const ino_t neg_one = (ino_t)-1, const_zero = (ino_t)0; - const int is_unsigned = const_zero < neg_one; - if ((sizeof(ino_t) == sizeof(char)) || - (sizeof(ino_t) == sizeof(short))) { - return PyInt_FromLong((long)val); - } else if ((sizeof(ino_t) == sizeof(int)) || - (sizeof(ino_t) == sizeof(long))) { - if (is_unsigned) - return PyLong_FromUnsignedLong((unsigned long)val); - else - return PyInt_FromLong((long)val); - } else if (sizeof(ino_t) == sizeof(PY_LONG_LONG)) { - if (is_unsigned) - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); - else - return PyLong_FromLongLong((PY_LONG_LONG)val); - } else { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - return _PyLong_FromByteArray(bytes, sizeof(ino_t), - little, !is_unsigned); - } -} - -static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_off_t(off_t val) { - const off_t neg_one = (off_t)-1, const_zero = (off_t)0; - const int is_unsigned = const_zero < neg_one; - if ((sizeof(off_t) == sizeof(char)) || - (sizeof(off_t) == sizeof(short))) { - return PyInt_FromLong((long)val); - } else if ((sizeof(off_t) == sizeof(int)) || - (sizeof(off_t) == sizeof(long))) { - if (is_unsigned) - return PyLong_FromUnsignedLong((unsigned long)val); - else - return PyInt_FromLong((long)val); - } else if (sizeof(off_t) == sizeof(PY_LONG_LONG)) { - if (is_unsigned) - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); - else - return PyLong_FromLongLong((PY_LONG_LONG)val); - } else { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - return _PyLong_FromByteArray(bytes, sizeof(off_t), - little, !is_unsigned); - } -} - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) - goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) - goto bad; - Py_DECREF(ob); - return 0; -bad: - Py_XDECREF(ob); - return -1; +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } #include "compile.h" #include "frameobject.h" #include "traceback.h" -static void __Pyx_AddTraceback(const char *funcname) { +static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; + PyObject *empty_tuple = 0; + PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } + py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; + empty_tuple = PyTuple_New(0); + if (!empty_tuple) goto bad; + empty_string = PyString_FromString(""); + if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + empty_string, /*PyObject *code,*/ + empty_tuple, /*PyObject *consts,*/ + empty_tuple, /*PyObject *names,*/ + empty_tuple, /*PyObject *varnames,*/ + empty_tuple, /*PyObject *freevars,*/ + empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ + empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ + PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ @@ -4087,128 +1745,8 @@ bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); + Py_XDECREF(empty_tuple); + Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} - -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff -Nru bzr-2.5.0/bzrlib/remote.py bzr-2.6.0~beta1/bzrlib/remote.py --- bzr-2.5.0/bzrlib/remote.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/remote.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2011 Canonical Ltd +# Copyright (C) 2006-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1051,7 +1051,7 @@ network_name = self._network_name else: # Select the current bzrlib default and ask for that. - reference_bzrdir_format = _mod_bzrdir.format_registry.get('default')() + reference_bzrdir_format = controldir.format_registry.get('default')() reference_format = reference_bzrdir_format.repository_format network_name = reference_format.network_name() # 2) try direct creation via RPC @@ -3157,7 +3157,7 @@ network_name = self._custom_format.network_name() else: # Select the current bzrlib default and ask for that. - reference_bzrdir_format = _mod_bzrdir.format_registry.get('default')() + reference_bzrdir_format = controldir.format_registry.get('default')() reference_format = reference_bzrdir_format.get_branch_format() self._custom_format = reference_format network_name = reference_format.network_name() @@ -3262,20 +3262,6 @@ self.id = "branch" self._real_store = None - def lock_write(self, token=None): - return self.branch.lock_write(token) - - def unlock(self): - return self.branch.unlock() - - @needs_write_lock - def save(self): - # We need to be able to override the undecorated implementation - self.save_without_locking() - - def save_without_locking(self): - super(RemoteBranchStore, self).save() - def external_url(self): return self.branch.user_url @@ -3366,6 +3352,7 @@ self._repo_lock_token = None self._lock_count = 0 self._leave_lock = False + self.conf_store = None # Setup a format: note that we cannot call _ensure_real until all the # attributes above are set: This code cannot be moved higher up in this # function. @@ -3414,7 +3401,9 @@ return RemoteBranchConfig(self) def _get_config_store(self): - return RemoteBranchStore(self) + if self.conf_store is None: + self.conf_store = RemoteBranchStore(self) + return self.conf_store def _get_real_transport(self): # if we try vfs access, return the real branch's vfs transport @@ -3440,6 +3429,10 @@ self.bzrdir._ensure_real() self._real_branch = self.bzrdir._real_bzrdir.open_branch( ignore_fallbacks=self._real_ignore_fallbacks, name=self._name) + # The remote branch and the real branch shares the same store. If + # we don't, there will always be cases where one of the stores + # doesn't see an update made on the other. + self._real_branch.conf_store = self.conf_store if self.repository._real_repository is None: # Give the remote repository the matching real repo. real_repo = self._real_branch.repository @@ -3523,6 +3516,13 @@ def set_stacked_on_url(self, url): branch.Branch.set_stacked_on_url(self, url) + # We need the stacked_on_url to be visible both locally (to not query + # it repeatedly) and remotely (so smart verbs can get it server side) + # Without the following line, + # bzrlib.tests.per_branch.test_create_clone.TestCreateClone + # .test_create_clone_on_transport_stacked_hooks_get_stacked_branch + # fails for remote branches -- vila 2012-01-04 + self.conf_store.save_changes() if not url: self._is_stacked = False else: @@ -3656,6 +3656,8 @@ try: self._lock_count -= 1 if not self._lock_count: + if self.conf_store is not None: + self.conf_store.save_changes() self._clear_cached_state() mode = self._lock_mode self._lock_mode = None @@ -3790,26 +3792,6 @@ raise errors.UnexpectedSmartServerResponse(response) self._run_post_change_branch_tip_hooks(old_revno, old_revid) - @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0))) - @needs_write_lock - def set_revision_history(self, rev_history): - """See Branch.set_revision_history.""" - self._set_revision_history(rev_history) - - @needs_write_lock - def _set_revision_history(self, rev_history): - # Send just the tip revision of the history; the server will generate - # the full history from that. If the revision doesn't exist in this - # branch, NoSuchRevision will be raised. - if rev_history == []: - rev_id = 'null:' - else: - rev_id = rev_history[-1] - self._set_last_revision(rev_id) - for hook in branch.Branch.hooks['set_rh']: - hook(self, rev_history) - self._cache_revision_history(rev_history) - def _get_parent_location(self): medium = self._client._medium if medium._is_remote_before((1, 13)): @@ -3947,12 +3929,21 @@ except errors.UnknownSmartMethod: medium._remember_remote_is_before((1, 6)) self._clear_cached_state_of_remote_branch_only() - self._set_revision_history(self._lefthand_history(revision_id, - last_rev=last_rev,other_branch=other_branch)) + graph = self.repository.get_graph() + (last_revno, last_revid) = self.last_revision_info() + known_revision_ids = [ + (last_revid, last_revno), + (_mod_revision.NULL_REVISION, 0), + ] + if last_rev is not None: + if not graph.is_ancestor(last_rev, revision_id): + # our previous tip is not merged into stop_revision + raise errors.DivergedBranches(self, other_branch) + revno = graph.find_distance_to_null(revision_id, known_revision_ids) + self.set_last_revision_info(revno, revision_id) def set_push_location(self, location): - self._ensure_real() - return self._real_branch.set_push_location(location) + self._set_config_location('push_location', location) def heads_to_fetch(self): if self._format._use_default_local_heads_to_fetch(): diff -Nru bzr-2.5.0/bzrlib/repofmt/groupcompress_repo.py bzr-2.6.0~beta1/bzrlib/repofmt/groupcompress_repo.py --- bzr-2.5.0/bzrlib/repofmt/groupcompress_repo.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/repofmt/groupcompress_repo.py 2012-03-15 10:00:24.000000000 +0000 @@ -21,7 +21,7 @@ import time from bzrlib import ( - bzrdir, + controldir, chk_map, chk_serializer, debug, @@ -954,7 +954,7 @@ else: basis_tree = self.revision_tree(basis_revision_id) basis_tree.lock_read() - basis_inv = basis_tree.inventory + basis_inv = basis_tree.root_inventory try: result = basis_inv.create_by_apply_delta(delta, new_revision_id, propagate_caches=propagate_caches) @@ -1383,7 +1383,7 @@ pack_compresses = True def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir('2a') + return controldir.format_registry.make_bzrdir('2a') def _ignore_setting_bzrdir(self, format): pass @@ -1406,7 +1406,7 @@ """ def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir('development-subtree') + return controldir.format_registry.make_bzrdir('development-subtree') def _ignore_setting_bzrdir(self, format): pass diff -Nru bzr-2.5.0/bzrlib/repofmt/knitpack_repo.py bzr-2.6.0~beta1/bzrlib/repofmt/knitpack_repo.py --- bzr-2.5.0/bzrlib/repofmt/knitpack_repo.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/repofmt/knitpack_repo.py 2012-03-15 10:00:24.000000000 +0000 @@ -24,7 +24,7 @@ import time from bzrlib import ( - bzrdir, + controldir, debug, errors, knit, @@ -155,7 +155,7 @@ index_class = GraphIndex def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir('pack-0.92') + return controldir.format_registry.make_bzrdir('pack-0.92') def _ignore_setting_bzrdir(self, format): pass @@ -195,7 +195,7 @@ index_class = GraphIndex def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir( + return controldir.format_registry.make_bzrdir( 'pack-0.92-subtree') def _ignore_setting_bzrdir(self, format): @@ -234,7 +234,7 @@ index_class = GraphIndex def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir( + return controldir.format_registry.make_bzrdir( 'rich-root-pack') def _ignore_setting_bzrdir(self, format): @@ -274,7 +274,7 @@ return xml5.serializer_v5 def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir('1.6') + return controldir.format_registry.make_bzrdir('1.6') def _ignore_setting_bzrdir(self, format): pass @@ -314,7 +314,7 @@ return xml6.serializer_v6 def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir( + return controldir.format_registry.make_bzrdir( '1.6.1-rich-root') def _ignore_setting_bzrdir(self, format): @@ -359,7 +359,7 @@ return xml7.serializer_v7 def _get_matching_bzrdir(self): - matching = bzrdir.format_registry.make_bzrdir( + matching = controldir.format_registry.make_bzrdir( '1.6.1-rich-root') matching.repository_format = self return matching @@ -401,7 +401,7 @@ return xml5.serializer_v5 def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir('1.9') + return controldir.format_registry.make_bzrdir('1.9') def _ignore_setting_bzrdir(self, format): pass @@ -438,7 +438,7 @@ return xml6.serializer_v6 def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir( + return controldir.format_registry.make_bzrdir( '1.9-rich-root') def _ignore_setting_bzrdir(self, format): @@ -479,7 +479,7 @@ return xml7.serializer_v7 def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir( + return controldir.format_registry.make_bzrdir( 'development5-subtree') def _ignore_setting_bzrdir(self, format): diff -Nru bzr-2.5.0/bzrlib/repofmt/knitrepo.py bzr-2.6.0~beta1/bzrlib/repofmt/knitrepo.py --- bzr-2.5.0/bzrlib/repofmt/knitrepo.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/repofmt/knitrepo.py 2012-03-15 10:00:24.000000000 +0000 @@ -21,7 +21,7 @@ import itertools from bzrlib import ( - bzrdir, + controldir, errors, knit as _mod_knit, lockable_files, @@ -405,7 +405,7 @@ return xml7.serializer_v7 def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir('dirstate-with-subtree') + return controldir.format_registry.make_bzrdir('dirstate-with-subtree') def _ignore_setting_bzrdir(self, format): pass @@ -447,7 +447,7 @@ return xml6.serializer_v6 def _get_matching_bzrdir(self): - return bzrdir.format_registry.make_bzrdir('rich-root') + return controldir.format_registry.make_bzrdir('rich-root') def _ignore_setting_bzrdir(self, format): pass @@ -488,21 +488,9 @@ @needs_read_lock def search_missing_revision_ids(self, - revision_id=symbol_versioning.DEPRECATED_PARAMETER, find_ghosts=True, revision_ids=None, if_present_ids=None, limit=None): """See InterRepository.search_missing_revision_ids().""" - if symbol_versioning.deprecated_passed(revision_id): - symbol_versioning.warn( - 'search_missing_revision_ids(revision_id=...) was ' - 'deprecated in 2.4. Use revision_ids=[...] instead.', - DeprecationWarning, stacklevel=2) - if revision_ids is not None: - raise AssertionError( - 'revision_ids is mutually exclusive with revision_id') - if revision_id is not None: - revision_ids = [revision_id] - del revision_id source_ids_set = self._present_source_revisions_for( revision_ids, if_present_ids) # source_ids is the worst possible case we may need to pull. diff -Nru bzr-2.5.0/bzrlib/repository.py bzr-2.6.0~beta1/bzrlib/repository.py --- bzr-2.5.0/bzrlib/repository.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/repository.py 2012-03-15 10:00:24.000000000 +0000 @@ -1174,10 +1174,10 @@ @needs_read_lock def verify_revision_signature(self, revision_id, gpg_strategy): """Verify the signature on a revision. - + :param revision_id: the revision to verify :gpg_strategy: the GPGStrategy object to used - + :return: gpg.SIGNATURE_VALID or a failed SIGNATURE_ value """ if not self.has_signature_for_revision_id(revision_id): @@ -1189,6 +1189,18 @@ return gpg_strategy.verify(signature, plaintext) + @needs_read_lock + def verify_revision_signatures(self, revision_ids, gpg_strategy): + """Verify revision signatures for a number of revisions. + + :param revision_id: the revision to verify + :gpg_strategy: the GPGStrategy object to used + :return: Iterator over tuples with revision id, result and keys + """ + for revid in revision_ids: + (result, key) = self.verify_revision_signature(revid, gpg_strategy) + yield revid, result, key + def has_signature_for_revision_id(self, revision_id): """Query for a revision signature for revision_id in the repository.""" raise NotImplementedError(self.has_signature_for_revision_id) @@ -1224,10 +1236,10 @@ return try: if branch is None: - conf = config.GlobalConfig() + conf = config.GlobalStack() else: - conf = branch.get_config() - if conf.suppress_warning('format_deprecation'): + conf = branch.get_config_stack() + if 'format_deprecation' in conf.get('suppress_warnings'): return warning("Format %s for %s is deprecated -" " please use 'bzr upgrade' to get better performance" diff -Nru bzr-2.5.0/bzrlib/revisiontree.py bzr-2.6.0~beta1/bzrlib/revisiontree.py --- bzr-2.5.0/bzrlib/revisiontree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/revisiontree.py 2012-03-15 10:00:24.000000000 +0000 @@ -103,7 +103,8 @@ self._inventory = inv def get_file_mtime(self, file_id, path=None): - ie = self._inventory[file_id] + inv, inv_file_id = self._unpack_file_id(file_id) + ie = inv[inv_file_id] try: revision = self._repository.get_revision(ie.revision) except errors.NoSuchRevision: @@ -111,34 +112,38 @@ return revision.timestamp def get_file_size(self, file_id): - return self._inventory[file_id].text_size + inv, inv_file_id = self._unpack_file_id(file_id) + return inv[inv_file_id].text_size def get_file_sha1(self, file_id, path=None, stat_value=None): - ie = self._inventory[file_id] + inv, inv_file_id = self._unpack_file_id(file_id) + ie = inv[inv_file_id] if ie.kind == "file": return ie.text_sha1 return None def get_file_revision(self, file_id, path=None): - ie = self._inventory[file_id] + inv, inv_file_id = self._unpack_file_id(file_id) + ie = inv[inv_file_id] return ie.revision def is_executable(self, file_id, path=None): - ie = self._inventory[file_id] + inv, inv_file_id = self._unpack_file_id(file_id) + ie = inv[inv_file_id] if ie.kind != "file": return False return ie.executable def has_filename(self, filename): - return bool(self.inventory.path2id(filename)) + return bool(self.path2id(filename)) def list_files(self, include_root=False, from_dir=None, recursive=True): # The only files returned by this are those from the version - inv = self.inventory if from_dir is None: from_dir_id = None + inv = self.root_inventory else: - from_dir_id = inv.path2id(from_dir) + inv, from_dir_id = self._path2inv_file_id(from_dir) if from_dir_id is None: # Directory not versioned return @@ -150,26 +155,29 @@ yield path, 'V', entry.kind, entry.file_id, entry def get_symlink_target(self, file_id, path=None): - ie = self._inventory[file_id] + inv, inv_file_id = self._unpack_file_id(file_id) + ie = inv[inv_file_id] # Inventories store symlink targets in unicode return ie.symlink_target def get_reference_revision(self, file_id, path=None): - return self.inventory[file_id].reference_revision + inv, inv_file_id = self._unpack_file_id(file_id) + return inv[inv_file_id].reference_revision def get_root_id(self): - if self.inventory.root: - return self.inventory.root.file_id + if self.root_inventory.root: + return self.root_inventory.root.file_id def kind(self, file_id): - return self._inventory[file_id].kind + inv, inv_file_id = self._unpack_file_id(file_id) + return inv[inv_file_id].kind def path_content_summary(self, path): """See Tree.path_content_summary.""" - id = self.inventory.path2id(path) - if id is None: + inv, file_id = self._path2inv_file_id(path) + if file_id is None: return ('missing', None, None, None) - entry = self._inventory[id] + entry = inv[file_id] kind = entry.kind if kind == 'file': return (kind, entry.text_size, entry.executable, entry.text_sha1) @@ -188,8 +196,7 @@ def walkdirs(self, prefix=""): _directory = 'directory' - inv = self.inventory - top_id = inv.path2id(prefix) + inv, top_id = self._path2inv_file_id(prefix) if top_id is None: pending = [] else: @@ -235,6 +242,19 @@ annotations = annotator.annotate_flat(text_key) return [(key[-1], line) for key, line in annotations] + def __eq__(self, other): + if self is other: + return True + if isinstance(other, InventoryRevisionTree): + return (self.root_inventory == other.root_inventory) + return False + + def __ne__(self, other): + return not (self == other) + + def __hash__(self): + raise ValueError('not hashable') + class InterCHKRevisionTree(tree.InterTree): """Fast path optimiser for RevisionTrees with CHK inventories.""" @@ -245,8 +265,8 @@ and isinstance(target, RevisionTree)): try: # Only CHK inventories have id_to_entry attribute - source.inventory.id_to_entry - target.inventory.id_to_entry + source.root_inventory.id_to_entry + target.root_inventory.id_to_entry return True except AttributeError: pass @@ -270,7 +290,9 @@ # to CHKInventory.iter_changes and do a better job there -- vila # 20090304 changed_file_ids = set() - for result in self.target.inventory.iter_changes(self.source.inventory): + # FIXME: nested tree support + for result in self.target.root_inventory.iter_changes( + self.source.root_inventory): if specific_file_ids is not None: file_id = result[0] if file_id not in specific_file_ids: @@ -292,8 +314,9 @@ # required to. # Now walk the whole inventory, excluding the already yielded # file ids + # FIXME: Support nested trees changed_file_ids = set(changed_file_ids) - for relpath, entry in self.target.inventory.iter_entries(): + for relpath, entry in self.target.root_inventory.iter_entries(): if (specific_file_ids is not None and not entry.file_id in specific_file_ids): continue diff -Nru bzr-2.5.0/bzrlib/_rio_pyx.c bzr-2.6.0~beta1/bzrlib/_rio_pyx.c --- bzr-2.5.0/bzrlib/_rio_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_rio_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,1024 +1,360 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:29 2012 */ +/* Generated by Pyrex 0.9.8.5 on Fri Oct 8 14:00:59 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif - -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif - -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif - +#include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include -#define __PYX_HAVE_API__bzrlib___rio_pyx #include "python-compat.h" #include "stdlib.h" #include "string.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - - -/* inline attribute */ -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -/* unused attribute */ -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - -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*/ - - -/* Type Conversion Predeclarations */ -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) +typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - static PyObject *__pyx_m; static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - +static char *__pyx_filename; +static char **__pyx_f; -static const char *__pyx_f[] = { - "_rio_pyx.pyx", -}; - -/* Type declarations */ - -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif +static char __pyx_mdoc[] = "Pyrex implementation of _read_stanza_*."; -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); - end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); +static void __Pyx_AddTraceback(char *funcname); /*proto*/ -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); +/* Declarations from bzrlib._rio_pyx */ -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); +/* Declarations from implementation of bzrlib._rio_pyx */ -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); +static int __pyx_f_6bzrlib_8_rio_pyx__valid_tag_char(char); /*proto*/ +static PyObject *__pyx_f_6bzrlib_8_rio_pyx__split_first_line_utf8(char *,int,char *,Py_ssize_t *); /*proto*/ +static PyObject *__pyx_f_6bzrlib_8_rio_pyx__split_first_line_unicode(Py_UNICODE *,int,Py_UNICODE *,Py_ssize_t *); /*proto*/ -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); +static char __pyx_k1[] = "invalid tag in line %r"; +static char __pyx_k2[] = "tag/value separator not found in line %r"; +static char __pyx_k3[] = "strict"; +static char __pyx_k4[] = "%r is not a plain string"; +static char __pyx_k5[] = "invalid continuation line %r"; +static char __pyx_k6[] = "_valid_tag"; +static char __pyx_k7[] = "invalid rio tag %r"; +static char __pyx_k8[] = "Stanza"; +static char __pyx_k9[] = "from_pairs"; +static char __pyx_k10[] = "%r is not a unicode string"; +static char __pyx_k11[] = "bzrlib.rio"; + +static PyObject *__pyx_n_Stanza; +static PyObject *__pyx_n__valid_tag; +static PyObject *__pyx_n_from_pairs; + +static PyObject *__pyx_k1p; +static PyObject *__pyx_k2p; +static PyObject *__pyx_k4p; +static PyObject *__pyx_k5p; +static PyObject *__pyx_k7p; +static PyObject *__pyx_k10p; +static PyObject *__pyx_k11p; -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_Stanza, 1, __pyx_k8, sizeof(__pyx_k8)}, + {&__pyx_n__valid_tag, 1, __pyx_k6, sizeof(__pyx_k6)}, + {&__pyx_n_from_pairs, 1, __pyx_k9, sizeof(__pyx_k9)}, + {&__pyx_k1p, 0, __pyx_k1, sizeof(__pyx_k1)}, + {&__pyx_k2p, 0, __pyx_k2, sizeof(__pyx_k2)}, + {&__pyx_k4p, 0, __pyx_k4, sizeof(__pyx_k4)}, + {&__pyx_k5p, 0, __pyx_k5, sizeof(__pyx_k5)}, + {&__pyx_k7p, 0, __pyx_k7, sizeof(__pyx_k7)}, + {&__pyx_k10p, 0, __pyx_k10, sizeof(__pyx_k10)}, + {&__pyx_k11p, 0, __pyx_k11, sizeof(__pyx_k11)}, + {0, 0, 0, 0} +}; -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from bzrlib._rio_pyx */ -static int __pyx_f_6bzrlib_8_rio_pyx__valid_tag_char(char); /*proto*/ -static PyObject *__pyx_f_6bzrlib_8_rio_pyx__split_first_line_utf8(char *, int, char *, Py_ssize_t *); /*proto*/ -static PyObject *__pyx_f_6bzrlib_8_rio_pyx__split_first_line_unicode(Py_UNICODE *, int, Py_UNICODE *, Py_ssize_t *); /*proto*/ -#define __Pyx_MODULE_NAME "bzrlib._rio_pyx" -static int __pyx_module_is_main_bzrlib___rio_pyx = 0; /* Implementation of bzrlib._rio_pyx */ -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_MemoryError; -static char __pyx_k_1[] = "invalid tag in line %r"; -static char __pyx_k_2[] = "tag/value separator not found in line %r"; -static char __pyx_k_3[] = "%r is not a plain string"; -static char __pyx_k_4[] = "invalid continuation line %r"; -static char __pyx_k_5[] = "invalid rio tag %r"; -static char __pyx_k_6[] = "%r is not a unicode string"; -static char __pyx_k_7[] = "Pyrex implementation of _read_stanza_*."; -static char __pyx_k_8[] = "bzrlib.rio"; -static char __pyx_k_9[] = "bzrlib._rio_pyx"; -static char __pyx_k_10[] = "_read_stanza_unicode"; -static char __pyx_k__Stanza[] = "Stanza"; -static char __pyx_k__strict[] = "strict"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k__ValueError[] = "ValueError"; -static char __pyx_k___valid_tag[] = "_valid_tag"; -static char __pyx_k__from_pairs[] = "from_pairs"; -static char __pyx_k__MemoryError[] = "MemoryError"; -static char __pyx_k___read_stanza_utf8[] = "_read_stanza_utf8"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_n_s_10; -static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_5; -static PyObject *__pyx_kp_s_6; -static PyObject *__pyx_n_s_8; -static PyObject *__pyx_n_s_9; -static PyObject *__pyx_n_s__MemoryError; -static PyObject *__pyx_n_s__Stanza; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s__ValueError; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___read_stanza_utf8; -static PyObject *__pyx_n_s___valid_tag; -static PyObject *__pyx_n_s__from_pairs; - -/* "bzrlib/_rio_pyx.pyx":52 - * from bzrlib.rio import Stanza - * - * cdef int _valid_tag_char(char c): # cannot_raise # <<<<<<<<<<<<<< - * return (c == c'_' or c == c'-' or - * (c >= c'a' and c <= c'z') or - */ -static int __pyx_f_6bzrlib_8_rio_pyx__valid_tag_char(char __pyx_v_c) { +static int __pyx_f_6bzrlib_8_rio_pyx__valid_tag_char(char __pyx_v_c) { int __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - __Pyx_RefNannySetupContext("_valid_tag_char"); - - /* "bzrlib/_rio_pyx.pyx":53 - * - * cdef int _valid_tag_char(char c): # cannot_raise - * return (c == c'_' or c == c'-' or # <<<<<<<<<<<<<< - * (c >= c'a' and c <= c'z') or - * (c >= c'A' and c <= c'Z') or - */ - __pyx_t_1 = (__pyx_v_c == '_'); - if (!__pyx_t_1) { - __pyx_t_2 = (__pyx_v_c == '-'); - if (!__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":54 - * cdef int _valid_tag_char(char c): # cannot_raise - * return (c == c'_' or c == c'-' or - * (c >= c'a' and c <= c'z') or # <<<<<<<<<<<<<< - * (c >= c'A' and c <= c'Z') or - * (c >= c'0' and c <= c'9')) - */ - __pyx_t_3 = (__pyx_v_c >= 'a'); - if (__pyx_t_3) { - __pyx_t_4 = (__pyx_v_c <= 'z'); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_3; - } - if (!__pyx_t_5) { - - /* "bzrlib/_rio_pyx.pyx":55 - * return (c == c'_' or c == c'-' or - * (c >= c'a' and c <= c'z') or - * (c >= c'A' and c <= c'Z') or # <<<<<<<<<<<<<< - * (c >= c'0' and c <= c'9')) - * - */ - __pyx_t_3 = (__pyx_v_c >= 'A'); - if (__pyx_t_3) { - __pyx_t_4 = (__pyx_v_c <= 'Z'); - __pyx_t_6 = __pyx_t_4; - } else { - __pyx_t_6 = __pyx_t_3; - } - if (!__pyx_t_6) { - - /* "bzrlib/_rio_pyx.pyx":56 - * (c >= c'a' and c <= c'z') or - * (c >= c'A' and c <= c'Z') or - * (c >= c'0' and c <= c'9')) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_3 = (__pyx_v_c >= '0'); - if (__pyx_t_3) { - __pyx_t_4 = (__pyx_v_c <= '9'); - __pyx_t_7 = __pyx_t_4; - } else { - __pyx_t_7 = __pyx_t_3; + int __pyx_1; + __pyx_1 = (__pyx_v_c == '_'); + if (!__pyx_1) { + __pyx_1 = (__pyx_v_c == '-'); + if (!__pyx_1) { + __pyx_1 = (__pyx_v_c >= 'a'); + if (__pyx_1) { + __pyx_1 = (__pyx_v_c <= 'z'); + } + if (!__pyx_1) { + __pyx_1 = (__pyx_v_c >= 'A'); + if (__pyx_1) { + __pyx_1 = (__pyx_v_c <= 'Z'); + } + if (!__pyx_1) { + __pyx_1 = (__pyx_v_c >= '0'); + if (__pyx_1) { + __pyx_1 = (__pyx_v_c <= '9'); } - __pyx_t_3 = __pyx_t_7; - } else { - __pyx_t_3 = __pyx_t_6; } - __pyx_t_6 = __pyx_t_3; - } else { - __pyx_t_6 = __pyx_t_5; - } - __pyx_t_5 = __pyx_t_6; - } else { - __pyx_t_5 = __pyx_t_2; + } } - __pyx_t_2 = __pyx_t_5; - } else { - __pyx_t_2 = __pyx_t_1; } - __pyx_r = __pyx_t_2; + __pyx_r = __pyx_1; goto __pyx_L0; __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "bzrlib/_rio_pyx.pyx":59 - * - * - * def _valid_tag(tag): # <<<<<<<<<<<<<< - * cdef char *c_tag - * cdef Py_ssize_t c_len - */ - -static PyObject *__pyx_pf_6bzrlib_8_rio_pyx__valid_tag(PyObject *__pyx_self, PyObject *__pyx_v_tag); /*proto*/ -static PyMethodDef __pyx_mdef_6bzrlib_8_rio_pyx__valid_tag = {__Pyx_NAMESTR("_valid_tag"), (PyCFunction)__pyx_pf_6bzrlib_8_rio_pyx__valid_tag, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pf_6bzrlib_8_rio_pyx__valid_tag(PyObject *__pyx_self, PyObject *__pyx_v_tag) { +static PyObject *__pyx_f_6bzrlib_8_rio_pyx__valid_tag(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_8_rio_pyx__valid_tag(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_tag = 0; char *__pyx_v_c_tag; Py_ssize_t __pyx_v_c_len; int __pyx_v_i; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; - __Pyx_RefNannySetupContext("_valid_tag"); - __pyx_self = __pyx_self; - - /* "bzrlib/_rio_pyx.pyx":63 - * cdef Py_ssize_t c_len - * cdef int i - * if not PyString_CheckExact(tag): # <<<<<<<<<<<<<< - * raise TypeError(tag) - * c_tag = PyString_AS_STRING(tag) - */ - __pyx_t_1 = (!PyString_CheckExact(__pyx_v_tag)); - if (__pyx_t_1) { - - /* "bzrlib/_rio_pyx.pyx":64 - * cdef int i - * if not PyString_CheckExact(tag): - * raise TypeError(tag) # <<<<<<<<<<<<<< - * c_tag = PyString_AS_STRING(tag) - * c_len = PyString_GET_SIZE(tag) - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - __Pyx_INCREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tag); - __Pyx_GIVEREF(__pyx_v_tag); - __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_ssize_t __pyx_4; + static char *__pyx_argnames[] = {"tag",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_tag)) return 0; + Py_INCREF(__pyx_v_tag); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":63 */ + __pyx_1 = (!PyString_CheckExact(__pyx_v_tag)); + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + Py_INCREF(__pyx_v_tag); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_tag); + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_rio_pyx.pyx":65 - * if not PyString_CheckExact(tag): - * raise TypeError(tag) - * c_tag = PyString_AS_STRING(tag) # <<<<<<<<<<<<<< - * c_len = PyString_GET_SIZE(tag) - * if c_len < 1: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":65 */ __pyx_v_c_tag = PyString_AS_STRING(__pyx_v_tag); - /* "bzrlib/_rio_pyx.pyx":66 - * raise TypeError(tag) - * c_tag = PyString_AS_STRING(tag) - * c_len = PyString_GET_SIZE(tag) # <<<<<<<<<<<<<< - * if c_len < 1: - * return False - */ - __pyx_t_4 = PyString_GET_SIZE(__pyx_v_tag); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_c_len = __pyx_t_4; - - /* "bzrlib/_rio_pyx.pyx":67 - * c_tag = PyString_AS_STRING(tag) - * c_len = PyString_GET_SIZE(tag) - * if c_len < 1: # <<<<<<<<<<<<<< - * return False - * for i from 0 <= i < c_len: - */ - __pyx_t_1 = (__pyx_v_c_len < 1); - if (__pyx_t_1) { - - /* "bzrlib/_rio_pyx.pyx":68 - * c_len = PyString_GET_SIZE(tag) - * if c_len < 1: - * return False # <<<<<<<<<<<<<< - * for i from 0 <= i < c_len: - * if not _valid_tag_char(c_tag[i]): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":66 */ + __pyx_4 = PyString_GET_SIZE(__pyx_v_tag); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;} + __pyx_v_c_len = __pyx_4; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":67 */ + __pyx_1 = (__pyx_v_c_len < 1); + if (__pyx_1) { + Py_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - goto __pyx_L6; + goto __pyx_L3; } - __pyx_L6:; + __pyx_L3:; - /* "bzrlib/_rio_pyx.pyx":69 - * if c_len < 1: - * return False - * for i from 0 <= i < c_len: # <<<<<<<<<<<<<< - * if not _valid_tag_char(c_tag[i]): - * return False - */ - __pyx_t_4 = __pyx_v_c_len; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { - - /* "bzrlib/_rio_pyx.pyx":70 - * return False - * for i from 0 <= i < c_len: - * if not _valid_tag_char(c_tag[i]): # <<<<<<<<<<<<<< - * return False - * return True - */ - __pyx_t_1 = (!__pyx_f_6bzrlib_8_rio_pyx__valid_tag_char((__pyx_v_c_tag[__pyx_v_i]))); - if (__pyx_t_1) { - - /* "bzrlib/_rio_pyx.pyx":71 - * for i from 0 <= i < c_len: - * if not _valid_tag_char(c_tag[i]): - * return False # <<<<<<<<<<<<<< - * return True - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":69 */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_c_len; ++__pyx_v_i) { + __pyx_1 = (!__pyx_f_6bzrlib_8_rio_pyx__valid_tag_char((__pyx_v_c_tag[__pyx_v_i]))); + if (__pyx_1) { + Py_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - goto __pyx_L9; + goto __pyx_L6; } - __pyx_L9:; + __pyx_L6:; } - /* "bzrlib/_rio_pyx.pyx":72 - * if not _valid_tag_char(c_tag[i]): - * return False - * return True # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":72 */ + Py_INCREF(Py_True); + __pyx_r = Py_True; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._rio_pyx._valid_tag"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_tag); return __pyx_r; } -/* "bzrlib/_rio_pyx.pyx":75 - * - * - * cdef object _split_first_line_utf8(char *line, int len, # <<<<<<<<<<<<<< - * char *value, Py_ssize_t *value_len): - * cdef int i - */ - -static PyObject *__pyx_f_6bzrlib_8_rio_pyx__split_first_line_utf8(char *__pyx_v_line, int __pyx_v_len, char *__pyx_v_value, Py_ssize_t *__pyx_v_value_len) { +static PyObject *__pyx_f_6bzrlib_8_rio_pyx__split_first_line_utf8(char *__pyx_v_line,int __pyx_v_len,char *__pyx_v_value,Py_ssize_t *__pyx_v_value_len) { int __pyx_v_i; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_split_first_line_utf8"); - - /* "bzrlib/_rio_pyx.pyx":78 - * char *value, Py_ssize_t *value_len): - * cdef int i - * for i from 0 <= i < len: # <<<<<<<<<<<<<< - * if line[i] == c':': - * if line[i+1] != c' ': - */ - __pyx_t_1 = __pyx_v_len; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - - /* "bzrlib/_rio_pyx.pyx":79 - * cdef int i - * for i from 0 <= i < len: - * if line[i] == c':': # <<<<<<<<<<<<<< - * if line[i+1] != c' ': - * raise ValueError("invalid tag in line %r" % line) - */ - __pyx_t_2 = ((__pyx_v_line[__pyx_v_i]) == ':'); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":80 - * for i from 0 <= i < len: - * if line[i] == c':': - * if line[i+1] != c' ': # <<<<<<<<<<<<<< - * raise ValueError("invalid tag in line %r" % line) - * memcpy(value, line+i+2, len-i-2) - */ - __pyx_t_2 = ((__pyx_v_line[(__pyx_v_i + 1)]) != ' '); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":81 - * if line[i] == c':': - * if line[i+1] != c' ': - * raise ValueError("invalid tag in line %r" % line) # <<<<<<<<<<<<<< - * memcpy(value, line+i+2, len-i-2) - * value_len[0] = len-i-2 - */ - __pyx_t_3 = PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "bzrlib/_rio_pyx.pyx":82 - * if line[i+1] != c' ': - * raise ValueError("invalid tag in line %r" % line) - * memcpy(value, line+i+2, len-i-2) # <<<<<<<<<<<<<< - * value_len[0] = len-i-2 - * return PyString_FromStringAndSize(line, i) - */ - memcpy(__pyx_v_value, ((__pyx_v_line + __pyx_v_i) + 2), ((__pyx_v_len - __pyx_v_i) - 2)); - - /* "bzrlib/_rio_pyx.pyx":83 - * raise ValueError("invalid tag in line %r" % line) - * memcpy(value, line+i+2, len-i-2) - * value_len[0] = len-i-2 # <<<<<<<<<<<<<< - * return PyString_FromStringAndSize(line, i) - * raise ValueError('tag/value separator not found in line %r' % line) - */ + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":78 */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_len; ++__pyx_v_i) { + __pyx_1 = ((__pyx_v_line[__pyx_v_i]) == ':'); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":80 */ + __pyx_1 = ((__pyx_v_line[(__pyx_v_i + 1)]) != ' '); + if (__pyx_1) { + __pyx_2 = PyString_FromString(__pyx_v_line); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k1p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;} + goto __pyx_L5; + } + __pyx_L5:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":82 */ + memcpy(__pyx_v_value,((__pyx_v_line + __pyx_v_i) + 2),((__pyx_v_len - __pyx_v_i) - 2)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":83 */ (__pyx_v_value_len[0]) = ((__pyx_v_len - __pyx_v_i) - 2); - /* "bzrlib/_rio_pyx.pyx":84 - * memcpy(value, line+i+2, len-i-2) - * value_len[0] = len-i-2 - * return PyString_FromStringAndSize(line, i) # <<<<<<<<<<<<<< - * raise ValueError('tag/value separator not found in line %r' % line) - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyString_FromStringAndSize(__pyx_v_line, __pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":84 */ + __pyx_2 = PyString_FromStringAndSize(__pyx_v_line,__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; } - /* "bzrlib/_rio_pyx.pyx":85 - * value_len[0] = len-i-2 - * return PyString_FromStringAndSize(line, i) - * raise ValueError('tag/value separator not found in line %r' % line) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_4 = PyBytes_FromString(__pyx_v_line); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":85 */ + __pyx_3 = PyString_FromString(__pyx_v_line); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} + __pyx_2 = PyNumber_Remainder(__pyx_k2p, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; goto __pyx_L1;} - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._rio_pyx._split_first_line_utf8"); __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "bzrlib/_rio_pyx.pyx":88 - * - * - * cdef object _split_first_line_unicode(Py_UNICODE *line, int len, # <<<<<<<<<<<<<< - * Py_UNICODE *value, Py_ssize_t *value_len): - * cdef int i - */ - -static PyObject *__pyx_f_6bzrlib_8_rio_pyx__split_first_line_unicode(Py_UNICODE *__pyx_v_line, int __pyx_v_len, Py_UNICODE *__pyx_v_value, Py_ssize_t *__pyx_v_value_len) { +static PyObject *__pyx_f_6bzrlib_8_rio_pyx__split_first_line_unicode(Py_UNICODE *__pyx_v_line,int __pyx_v_len,Py_UNICODE *__pyx_v_value,Py_ssize_t *__pyx_v_value_len) { int __pyx_v_i; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_split_first_line_unicode"); - - /* "bzrlib/_rio_pyx.pyx":91 - * Py_UNICODE *value, Py_ssize_t *value_len): - * cdef int i - * for i from 0 <= i < len: # <<<<<<<<<<<<<< - * if line[i] == c':': - * if line[i+1] != c' ': - */ - __pyx_t_1 = __pyx_v_len; - for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) { - - /* "bzrlib/_rio_pyx.pyx":92 - * cdef int i - * for i from 0 <= i < len: - * if line[i] == c':': # <<<<<<<<<<<<<< - * if line[i+1] != c' ': - * raise ValueError("invalid tag in line %r" % - */ - __pyx_t_2 = ((__pyx_v_line[__pyx_v_i]) == ':'); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":93 - * for i from 0 <= i < len: - * if line[i] == c':': - * if line[i+1] != c' ': # <<<<<<<<<<<<<< - * raise ValueError("invalid tag in line %r" % - * PyUnicode_FromUnicode(line, len)) - */ - __pyx_t_2 = ((__pyx_v_line[(__pyx_v_i + 1)]) != ' '); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":95 - * if line[i+1] != c' ': - * raise ValueError("invalid tag in line %r" % - * PyUnicode_FromUnicode(line, len)) # <<<<<<<<<<<<<< - * memcpy(value, &line[i+2], (len-i-2) * sizeof(Py_UNICODE)) - * value_len[0] = len-i-2 - */ - __pyx_t_3 = PyUnicode_FromUnicode(__pyx_v_line, __pyx_v_len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; - } - __pyx_L6:; - - /* "bzrlib/_rio_pyx.pyx":96 - * raise ValueError("invalid tag in line %r" % - * PyUnicode_FromUnicode(line, len)) - * memcpy(value, &line[i+2], (len-i-2) * sizeof(Py_UNICODE)) # <<<<<<<<<<<<<< - * value_len[0] = len-i-2 - * return PyUnicode_EncodeASCII(line, i, "strict") - */ - memcpy(__pyx_v_value, (&(__pyx_v_line[(__pyx_v_i + 2)])), (((__pyx_v_len - __pyx_v_i) - 2) * (sizeof(Py_UNICODE)))); - - /* "bzrlib/_rio_pyx.pyx":97 - * PyUnicode_FromUnicode(line, len)) - * memcpy(value, &line[i+2], (len-i-2) * sizeof(Py_UNICODE)) - * value_len[0] = len-i-2 # <<<<<<<<<<<<<< - * return PyUnicode_EncodeASCII(line, i, "strict") - * raise ValueError("tag/value separator not found in line %r" % - */ + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":91 */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_len; ++__pyx_v_i) { + __pyx_1 = ((__pyx_v_line[__pyx_v_i]) == ':'); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":93 */ + __pyx_1 = ((__pyx_v_line[(__pyx_v_i + 1)]) != ' '); + if (__pyx_1) { + __pyx_2 = PyUnicode_FromUnicode(__pyx_v_line,__pyx_v_len); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;} + __pyx_3 = PyNumber_Remainder(__pyx_k1p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;} + goto __pyx_L5; + } + __pyx_L5:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":96 */ + memcpy(__pyx_v_value,(&(__pyx_v_line[(__pyx_v_i + 2)])),(((__pyx_v_len - __pyx_v_i) - 2) * (sizeof(Py_UNICODE)))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":97 */ (__pyx_v_value_len[0]) = ((__pyx_v_len - __pyx_v_i) - 2); - /* "bzrlib/_rio_pyx.pyx":98 - * memcpy(value, &line[i+2], (len-i-2) * sizeof(Py_UNICODE)) - * value_len[0] = len-i-2 - * return PyUnicode_EncodeASCII(line, i, "strict") # <<<<<<<<<<<<<< - * raise ValueError("tag/value separator not found in line %r" % - * PyUnicode_FromUnicode(line, len)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyUnicode_EncodeASCII(__pyx_v_line, __pyx_v_i, __pyx_k__strict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":98 */ + __pyx_2 = PyUnicode_EncodeASCII(__pyx_v_line,__pyx_v_i,__pyx_k3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; } - /* "bzrlib/_rio_pyx.pyx":100 - * return PyUnicode_EncodeASCII(line, i, "strict") - * raise ValueError("tag/value separator not found in line %r" % - * PyUnicode_FromUnicode(line, len)) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_4 = PyUnicode_FromUnicode(__pyx_v_line, __pyx_v_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":99 */ + __pyx_3 = PyUnicode_FromUnicode(__pyx_v_line,__pyx_v_len); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;} + __pyx_2 = PyNumber_Remainder(__pyx_k2p, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;} - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._rio_pyx._split_first_line_unicode"); __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "bzrlib/_rio_pyx.pyx":103 - * - * - * def _read_stanza_utf8(line_iter): # <<<<<<<<<<<<<< - * cdef char *c_line - * cdef Py_ssize_t c_len - */ - -static PyObject *__pyx_pf_6bzrlib_8_rio_pyx_1_read_stanza_utf8(PyObject *__pyx_self, PyObject *__pyx_v_line_iter); /*proto*/ -static PyMethodDef __pyx_mdef_6bzrlib_8_rio_pyx_1_read_stanza_utf8 = {__Pyx_NAMESTR("_read_stanza_utf8"), (PyCFunction)__pyx_pf_6bzrlib_8_rio_pyx_1_read_stanza_utf8, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pf_6bzrlib_8_rio_pyx_1_read_stanza_utf8(PyObject *__pyx_self, PyObject *__pyx_v_line_iter) { +static PyObject *__pyx_f_6bzrlib_8_rio_pyx__read_stanza_utf8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_8_rio_pyx__read_stanza_utf8(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_line_iter = 0; char *__pyx_v_c_line; Py_ssize_t __pyx_v_c_len; char *__pyx_v_accum_value; @@ -1028,638 +364,311 @@ PyObject *__pyx_v_pairs; PyObject *__pyx_v_tag; PyObject *__pyx_v_line; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - int __pyx_t_7; - int __pyx_t_8; - int __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - __Pyx_RefNannySetupContext("_read_stanza_utf8"); - __pyx_self = __pyx_self; - __pyx_v_pairs = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_line = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_rio_pyx.pyx":108 - * cdef char *accum_value, *new_accum_value - * cdef Py_ssize_t accum_len, accum_size - * pairs = [] # <<<<<<<<<<<<<< - * tag = None - * accum_len = 0 - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_pairs)); - __pyx_v_pairs = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_rio_pyx.pyx":109 - * cdef Py_ssize_t accum_len, accum_size - * pairs = [] - * tag = None # <<<<<<<<<<<<<< - * accum_len = 0 - * accum_size = 4096 - */ - __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_v_tag); + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_ssize_t __pyx_5; + PyObject *__pyx_6 = 0; + int __pyx_7; + static char *__pyx_argnames[] = {"line_iter",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_line_iter)) return 0; + Py_INCREF(__pyx_v_line_iter); + __pyx_v_pairs = Py_None; Py_INCREF(Py_None); + __pyx_v_tag = Py_None; Py_INCREF(Py_None); + __pyx_v_line = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":108 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;} + Py_DECREF(__pyx_v_pairs); + __pyx_v_pairs = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":109 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_tag); __pyx_v_tag = Py_None; - /* "bzrlib/_rio_pyx.pyx":110 - * pairs = [] - * tag = None - * accum_len = 0 # <<<<<<<<<<<<<< - * accum_size = 4096 - * accum_value = malloc(accum_size) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":110 */ __pyx_v_accum_len = 0; - /* "bzrlib/_rio_pyx.pyx":111 - * tag = None - * accum_len = 0 - * accum_size = 4096 # <<<<<<<<<<<<<< - * accum_value = malloc(accum_size) - * if accum_value == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":111 */ __pyx_v_accum_size = 4096; - /* "bzrlib/_rio_pyx.pyx":112 - * accum_len = 0 - * accum_size = 4096 - * accum_value = malloc(accum_size) # <<<<<<<<<<<<<< - * if accum_value == NULL: - * raise MemoryError - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":112 */ __pyx_v_accum_value = ((char *)malloc(__pyx_v_accum_size)); - /* "bzrlib/_rio_pyx.pyx":113 - * accum_size = 4096 - * accum_value = malloc(accum_size) - * if accum_value == NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * try: - */ - __pyx_t_2 = (__pyx_v_accum_value == NULL); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":114 - * accum_value = malloc(accum_size) - * if accum_value == NULL: - * raise MemoryError # <<<<<<<<<<<<<< - * try: - * for line in line_iter: - */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":113 */ + __pyx_2 = (__pyx_v_accum_value == NULL); + if (__pyx_2) { + __Pyx_Raise(PyExc_MemoryError, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_rio_pyx.pyx":115 - * if accum_value == NULL: - * raise MemoryError - * try: # <<<<<<<<<<<<<< - * for line in line_iter: - * if line is None: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":115 */ /*try:*/ { - /* "bzrlib/_rio_pyx.pyx":116 - * raise MemoryError - * try: - * for line in line_iter: # <<<<<<<<<<<<<< - * if line is None: - * break # end of file - */ - if (PyList_CheckExact(__pyx_v_line_iter) || PyTuple_CheckExact(__pyx_v_line_iter)) { - __pyx_t_3 = 0; __pyx_t_1 = __pyx_v_line_iter; __Pyx_INCREF(__pyx_t_1); - } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_line_iter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_1); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":116 */ + __pyx_1 = PyObject_GetIter(__pyx_v_line_iter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L4;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; - } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; - } else { - __pyx_t_4 = PyIter_Next(__pyx_t_1); - if (!__pyx_t_4) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L7;} - break; - } - __Pyx_GOTREF(__pyx_t_4); + __pyx_3 = PyIter_Next(__pyx_1); + if (!__pyx_3) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L4;} + break; + } + Py_DECREF(__pyx_v_line); + __pyx_v_line = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":117 */ + __pyx_2 = __pyx_v_line == Py_None; + if (__pyx_2) { + goto __pyx_L7; + goto __pyx_L8; + } + __pyx_L8:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":119 */ + __pyx_2 = (!PyString_CheckExact(__pyx_v_line)); + if (__pyx_2) { + __pyx_3 = PyNumber_Remainder(__pyx_k4p, __pyx_v_line); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L4;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L4;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L4;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L4;} + goto __pyx_L9; } - __Pyx_DECREF(__pyx_v_line); - __pyx_v_line = __pyx_t_4; - __pyx_t_4 = 0; - - /* "bzrlib/_rio_pyx.pyx":117 - * try: - * for line in line_iter: - * if line is None: # <<<<<<<<<<<<<< - * break # end of file - * if not PyString_CheckExact(line): - */ - __pyx_t_2 = (__pyx_v_line == Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":118 - * for line in line_iter: - * if line is None: - * break # end of file # <<<<<<<<<<<<<< - * if not PyString_CheckExact(line): - * raise TypeError("%r is not a plain string" % line) - */ - goto __pyx_L10_break; - goto __pyx_L11; - } - __pyx_L11:; + __pyx_L9:; - /* "bzrlib/_rio_pyx.pyx":119 - * if line is None: - * break # end of file - * if not PyString_CheckExact(line): # <<<<<<<<<<<<<< - * raise TypeError("%r is not a plain string" % line) - * c_line = PyString_AS_STRING(line) - */ - __pyx_t_2 = (!PyString_CheckExact(__pyx_v_line)); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":120 - * break # end of file - * if not PyString_CheckExact(line): - * raise TypeError("%r is not a plain string" % line) # <<<<<<<<<<<<<< - * c_line = PyString_AS_STRING(line) - * c_len = PyString_GET_SIZE(line) - */ - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_v_line); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L12; - } - __pyx_L12:; - - /* "bzrlib/_rio_pyx.pyx":121 - * if not PyString_CheckExact(line): - * raise TypeError("%r is not a plain string" % line) - * c_line = PyString_AS_STRING(line) # <<<<<<<<<<<<<< - * c_len = PyString_GET_SIZE(line) - * if c_len < 1: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":121 */ __pyx_v_c_line = PyString_AS_STRING(__pyx_v_line); - /* "bzrlib/_rio_pyx.pyx":122 - * raise TypeError("%r is not a plain string" % line) - * c_line = PyString_AS_STRING(line) - * c_len = PyString_GET_SIZE(line) # <<<<<<<<<<<<<< - * if c_len < 1: - * break # end of file - */ - __pyx_t_6 = PyString_GET_SIZE(__pyx_v_line); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L7;} - __pyx_v_c_len = __pyx_t_6; - - /* "bzrlib/_rio_pyx.pyx":123 - * c_line = PyString_AS_STRING(line) - * c_len = PyString_GET_SIZE(line) - * if c_len < 1: # <<<<<<<<<<<<<< - * break # end of file - * if c_len == 1 and c_line[0] == c"\n": - */ - __pyx_t_2 = (__pyx_v_c_len < 1); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":124 - * c_len = PyString_GET_SIZE(line) - * if c_len < 1: - * break # end of file # <<<<<<<<<<<<<< - * if c_len == 1 and c_line[0] == c"\n": - * break # end of stanza - */ - goto __pyx_L10_break; - goto __pyx_L13; - } - __pyx_L13:; - - /* "bzrlib/_rio_pyx.pyx":125 - * if c_len < 1: - * break # end of file - * if c_len == 1 and c_line[0] == c"\n": # <<<<<<<<<<<<<< - * break # end of stanza - * if accum_len + c_len > accum_size: - */ - __pyx_t_2 = (__pyx_v_c_len == 1); - if (__pyx_t_2) { - __pyx_t_7 = ((__pyx_v_c_line[0]) == '\n'); - __pyx_t_8 = __pyx_t_7; - } else { - __pyx_t_8 = __pyx_t_2; - } - if (__pyx_t_8) { - - /* "bzrlib/_rio_pyx.pyx":126 - * break # end of file - * if c_len == 1 and c_line[0] == c"\n": - * break # end of stanza # <<<<<<<<<<<<<< - * if accum_len + c_len > accum_size: - * accum_size = (accum_len + c_len) - */ - goto __pyx_L10_break; - goto __pyx_L14; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":122 */ + __pyx_5 = PyString_GET_SIZE(__pyx_v_line); if (__pyx_5 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L4;} + __pyx_v_c_len = __pyx_5; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":123 */ + __pyx_2 = (__pyx_v_c_len < 1); + if (__pyx_2) { + goto __pyx_L7; + goto __pyx_L10; + } + __pyx_L10:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":125 */ + __pyx_2 = (__pyx_v_c_len == 1); + if (__pyx_2) { + __pyx_2 = ((__pyx_v_c_line[0]) == '\n'); } - __pyx_L14:; + if (__pyx_2) { + goto __pyx_L7; + goto __pyx_L11; + } + __pyx_L11:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":127 */ + __pyx_2 = ((__pyx_v_accum_len + __pyx_v_c_len) > __pyx_v_accum_size); + if (__pyx_2) { - /* "bzrlib/_rio_pyx.pyx":127 - * if c_len == 1 and c_line[0] == c"\n": - * break # end of stanza - * if accum_len + c_len > accum_size: # <<<<<<<<<<<<<< - * accum_size = (accum_len + c_len) - * new_accum_value = realloc(accum_value, accum_size) - */ - __pyx_t_8 = ((__pyx_v_accum_len + __pyx_v_c_len) > __pyx_v_accum_size); - if (__pyx_t_8) { - - /* "bzrlib/_rio_pyx.pyx":128 - * break # end of stanza - * if accum_len + c_len > accum_size: - * accum_size = (accum_len + c_len) # <<<<<<<<<<<<<< - * new_accum_value = realloc(accum_value, accum_size) - * if new_accum_value == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":128 */ __pyx_v_accum_size = (__pyx_v_accum_len + __pyx_v_c_len); - /* "bzrlib/_rio_pyx.pyx":129 - * if accum_len + c_len > accum_size: - * accum_size = (accum_len + c_len) - * new_accum_value = realloc(accum_value, accum_size) # <<<<<<<<<<<<<< - * if new_accum_value == NULL: - * raise MemoryError - */ - __pyx_v_new_accum_value = ((char *)realloc(__pyx_v_accum_value, __pyx_v_accum_size)); - - /* "bzrlib/_rio_pyx.pyx":130 - * accum_size = (accum_len + c_len) - * new_accum_value = realloc(accum_value, accum_size) - * if new_accum_value == NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * else: - */ - __pyx_t_8 = (__pyx_v_new_accum_value == NULL); - if (__pyx_t_8) { - - /* "bzrlib/_rio_pyx.pyx":131 - * new_accum_value = realloc(accum_value, accum_size) - * if new_accum_value == NULL: - * raise MemoryError # <<<<<<<<<<<<<< - * else: - * accum_value = new_accum_value - */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L16; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":129 */ + __pyx_v_new_accum_value = ((char *)realloc(__pyx_v_accum_value,__pyx_v_accum_size)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":130 */ + __pyx_2 = (__pyx_v_new_accum_value == NULL); + if (__pyx_2) { + __Pyx_Raise(PyExc_MemoryError, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L4;} + goto __pyx_L13; } /*else*/ { - - /* "bzrlib/_rio_pyx.pyx":133 - * raise MemoryError - * else: - * accum_value = new_accum_value # <<<<<<<<<<<<<< - * if c_line[0] == c'\t': # continues previous value - * if tag is None: - */ __pyx_v_accum_value = __pyx_v_new_accum_value; } - __pyx_L16:; - goto __pyx_L15; + __pyx_L13:; + goto __pyx_L12; } - __pyx_L15:; + __pyx_L12:; - /* "bzrlib/_rio_pyx.pyx":134 - * else: - * accum_value = new_accum_value - * if c_line[0] == c'\t': # continues previous value # <<<<<<<<<<<<<< - * if tag is None: - * raise ValueError('invalid continuation line %r' % line) - */ - __pyx_t_8 = ((__pyx_v_c_line[0]) == '\t'); - if (__pyx_t_8) { - - /* "bzrlib/_rio_pyx.pyx":135 - * accum_value = new_accum_value - * if c_line[0] == c'\t': # continues previous value - * if tag is None: # <<<<<<<<<<<<<< - * raise ValueError('invalid continuation line %r' % line) - * memcpy(accum_value+accum_len, c_line+1, c_len-1) - */ - __pyx_t_8 = (__pyx_v_tag == Py_None); - if (__pyx_t_8) { - - /* "bzrlib/_rio_pyx.pyx":136 - * if c_line[0] == c'\t': # continues previous value - * if tag is None: - * raise ValueError('invalid continuation line %r' % line) # <<<<<<<<<<<<<< - * memcpy(accum_value+accum_len, c_line+1, c_len-1) - * accum_len = accum_len + c_len-1 - */ - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), __pyx_v_line); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L18; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":134 */ + __pyx_2 = ((__pyx_v_c_line[0]) == '\t'); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":135 */ + __pyx_2 = __pyx_v_tag == Py_None; + if (__pyx_2) { + __pyx_4 = PyNumber_Remainder(__pyx_k5p, __pyx_v_line); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L4;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L4;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L4;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; goto __pyx_L4;} + goto __pyx_L15; } - __pyx_L18:; + __pyx_L15:; - /* "bzrlib/_rio_pyx.pyx":137 - * if tag is None: - * raise ValueError('invalid continuation line %r' % line) - * memcpy(accum_value+accum_len, c_line+1, c_len-1) # <<<<<<<<<<<<<< - * accum_len = accum_len + c_len-1 - * else: # new tag:value line - */ - memcpy((__pyx_v_accum_value + __pyx_v_accum_len), (__pyx_v_c_line + 1), (__pyx_v_c_len - 1)); - - /* "bzrlib/_rio_pyx.pyx":138 - * raise ValueError('invalid continuation line %r' % line) - * memcpy(accum_value+accum_len, c_line+1, c_len-1) - * accum_len = accum_len + c_len-1 # <<<<<<<<<<<<<< - * else: # new tag:value line - * if tag is not None: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":137 */ + memcpy((__pyx_v_accum_value + __pyx_v_accum_len),(__pyx_v_c_line + 1),(__pyx_v_c_len - 1)); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":138 */ __pyx_v_accum_len = ((__pyx_v_accum_len + __pyx_v_c_len) - 1); - goto __pyx_L17; + goto __pyx_L14; } /*else*/ { - /* "bzrlib/_rio_pyx.pyx":140 - * accum_len = accum_len + c_len-1 - * else: # new tag:value line - * if tag is not None: # <<<<<<<<<<<<<< - * PyList_Append(pairs, - * (tag, PyUnicode_DecodeUTF8(accum_value, accum_len-1, - */ - __pyx_t_8 = (__pyx_v_tag != Py_None); - if (__pyx_t_8) { - - /* "bzrlib/_rio_pyx.pyx":142 - * if tag is not None: - * PyList_Append(pairs, - * (tag, PyUnicode_DecodeUTF8(accum_value, accum_len-1, # <<<<<<<<<<<<<< - * "strict"))) - * tag = _split_first_line_utf8(c_line, c_len, accum_value, - */ - __pyx_t_4 = PyUnicode_DecodeUTF8(__pyx_v_accum_value, (__pyx_v_accum_len - 1), __pyx_k__strict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tag); - __Pyx_GIVEREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_9 = PyList_Append(((PyObject *)__pyx_v_pairs), ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - goto __pyx_L19; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":140 */ + __pyx_2 = __pyx_v_tag != Py_None; + if (__pyx_2) { + __pyx_3 = PyUnicode_DecodeUTF8(__pyx_v_accum_value,(__pyx_v_accum_len - 1),__pyx_k3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L4;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L4;} + Py_INCREF(__pyx_v_tag); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_tag); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_3 = 0; + __pyx_2 = PyList_Append(__pyx_v_pairs,__pyx_4); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L4;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + goto __pyx_L16; } - __pyx_L19:; + __pyx_L16:; - /* "bzrlib/_rio_pyx.pyx":145 - * "strict"))) - * tag = _split_first_line_utf8(c_line, c_len, accum_value, - * &accum_len) # <<<<<<<<<<<<<< - * if not _valid_tag(tag): - * raise ValueError("invalid rio tag %r" % (tag,)) - */ - __pyx_t_5 = __pyx_f_6bzrlib_8_rio_pyx__split_first_line_utf8(__pyx_v_c_line, __pyx_v_c_len, __pyx_v_accum_value, (&__pyx_v_accum_len)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_v_tag); - __pyx_v_tag = __pyx_t_5; - __pyx_t_5 = 0; - - /* "bzrlib/_rio_pyx.pyx":146 - * tag = _split_first_line_utf8(c_line, c_len, accum_value, - * &accum_len) - * if not _valid_tag(tag): # <<<<<<<<<<<<<< - * raise ValueError("invalid rio tag %r" % (tag,)) - * if tag is not None: # add last tag-value - */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___valid_tag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tag); - __Pyx_GIVEREF(__pyx_v_tag); - __pyx_t_10 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_2 = (!__pyx_t_8); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":147 - * &accum_len) - * if not _valid_tag(tag): - * raise ValueError("invalid rio tag %r" % (tag,)) # <<<<<<<<<<<<<< - * if tag is not None: # add last tag-value - * PyList_Append(pairs, - */ - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - __Pyx_INCREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_tag); - __Pyx_GIVEREF(__pyx_v_tag); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_10)); - PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L20; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":144 */ + __pyx_3 = __pyx_f_6bzrlib_8_rio_pyx__split_first_line_utf8(__pyx_v_c_line,__pyx_v_c_len,__pyx_v_accum_value,(&__pyx_v_accum_len)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; goto __pyx_L4;} + Py_DECREF(__pyx_v_tag); + __pyx_v_tag = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":146 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__valid_tag); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L4;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L4;} + Py_INCREF(__pyx_v_tag); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_tag); + __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L4;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = PyObject_IsTrue(__pyx_6); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L4;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_7 = (!__pyx_2); + if (__pyx_7) { + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L4;} + Py_INCREF(__pyx_v_tag); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_tag); + __pyx_3 = PyNumber_Remainder(__pyx_k7p, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L4;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L4;} + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_3); + __pyx_3 = 0; + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L4;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L4;} + goto __pyx_L17; } - __pyx_L20:; + __pyx_L17:; } - __pyx_L17:; + __pyx_L14:; } - __pyx_L10_break:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_L7:; + Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "bzrlib/_rio_pyx.pyx":148 - * if not _valid_tag(tag): - * raise ValueError("invalid rio tag %r" % (tag,)) - * if tag is not None: # add last tag-value # <<<<<<<<<<<<<< - * PyList_Append(pairs, - * (tag, PyUnicode_DecodeUTF8(accum_value, accum_len-1, "strict"))) - */ - __pyx_t_2 = (__pyx_v_tag != Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":150 - * if tag is not None: # add last tag-value - * PyList_Append(pairs, - * (tag, PyUnicode_DecodeUTF8(accum_value, accum_len-1, "strict"))) # <<<<<<<<<<<<<< - * return Stanza.from_pairs(pairs) - * else: # didn't see any content - */ - __pyx_t_1 = PyUnicode_DecodeUTF8(__pyx_v_accum_value, (__pyx_v_accum_len - 1), __pyx_k__strict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tag); - __Pyx_GIVEREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_9 = PyList_Append(((PyObject *)__pyx_v_pairs), ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - - /* "bzrlib/_rio_pyx.pyx":151 - * PyList_Append(pairs, - * (tag, PyUnicode_DecodeUTF8(accum_value, accum_len-1, "strict"))) - * return Stanza.from_pairs(pairs) # <<<<<<<<<<<<<< - * else: # didn't see any content - * return None - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__Stanza); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__from_pairs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(((PyObject *)__pyx_v_pairs)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_pairs)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_pairs)); - __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_r = __pyx_t_10; - __pyx_t_10 = 0; - goto __pyx_L6; - goto __pyx_L21; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":148 */ + __pyx_2 = __pyx_v_tag != Py_None; + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":149 */ + __pyx_3 = PyUnicode_DecodeUTF8(__pyx_v_accum_value,(__pyx_v_accum_len - 1),__pyx_k3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L4;} + __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L4;} + Py_INCREF(__pyx_v_tag); + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_tag); + PyTuple_SET_ITEM(__pyx_6, 1, __pyx_3); + __pyx_3 = 0; + __pyx_7 = PyList_Append(__pyx_v_pairs,__pyx_6); if (__pyx_7 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L4;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":151 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Stanza); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L4;} + __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_from_pairs); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L4;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L4;} + Py_INCREF(__pyx_v_pairs); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_pairs); + __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L4;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_r = __pyx_6; + __pyx_6 = 0; + goto __pyx_L3; + goto __pyx_L18; } /*else*/ { - - /* "bzrlib/_rio_pyx.pyx":153 - * return Stanza.from_pairs(pairs) - * else: # didn't see any content - * return None # <<<<<<<<<<<<<< - * finally: - * free(accum_value) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); + Py_INCREF(Py_None); __pyx_r = Py_None; - goto __pyx_L6; + goto __pyx_L3; } - __pyx_L21:; + __pyx_L18:; } - - /* "bzrlib/_rio_pyx.pyx":155 - * return None - * finally: - * free(accum_value) # <<<<<<<<<<<<<< - * - * - */ /*finally:*/ { int __pyx_why; PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L8; - __pyx_L6: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 3; goto __pyx_L8; - __pyx_L7: { + __pyx_why = 0; goto __pyx_L5; + __pyx_L3: __pyx_why = 3; goto __pyx_L5; + __pyx_L4: { __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + Py_XDECREF(__pyx_4); __pyx_4 = 0; + Py_XDECREF(__pyx_1); __pyx_1 = 0; + Py_XDECREF(__pyx_3); __pyx_3 = 0; + Py_XDECREF(__pyx_6); __pyx_6 = 0; + PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L8; + goto __pyx_L5; } - __pyx_L8:; + __pyx_L5:; free(__pyx_v_accum_value); switch (__pyx_why) { case 3: goto __pyx_L0; case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); __pyx_lineno = __pyx_exc_lineno; __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; - goto __pyx_L1_error; + goto __pyx_L1; } } } - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_6); __Pyx_AddTraceback("bzrlib._rio_pyx._read_stanza_utf8"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_pairs); - __Pyx_DECREF(__pyx_v_tag); - __Pyx_DECREF(__pyx_v_line); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_pairs); + Py_DECREF(__pyx_v_tag); + Py_DECREF(__pyx_v_line); + Py_DECREF(__pyx_v_line_iter); return __pyx_r; } -/* "bzrlib/_rio_pyx.pyx":158 - * - * - * def _read_stanza_unicode(unicode_iter): # <<<<<<<<<<<<<< - * cdef Py_UNICODE *c_line - * cdef int c_len - */ - -static PyObject *__pyx_pf_6bzrlib_8_rio_pyx_2_read_stanza_unicode(PyObject *__pyx_self, PyObject *__pyx_v_unicode_iter); /*proto*/ -static PyMethodDef __pyx_mdef_6bzrlib_8_rio_pyx_2_read_stanza_unicode = {__Pyx_NAMESTR("_read_stanza_unicode"), (PyCFunction)__pyx_pf_6bzrlib_8_rio_pyx_2_read_stanza_unicode, METH_O, __Pyx_DOCSTR(0)}; -static PyObject *__pyx_pf_6bzrlib_8_rio_pyx_2_read_stanza_unicode(PyObject *__pyx_self, PyObject *__pyx_v_unicode_iter) { +static PyObject *__pyx_f_6bzrlib_8_rio_pyx__read_stanza_unicode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_8_rio_pyx__read_stanza_unicode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_unicode_iter = 0; Py_UNICODE *__pyx_v_c_line; int __pyx_v_c_len; Py_UNICODE *__pyx_v_accum_value; @@ -1669,864 +678,356 @@ PyObject *__pyx_v_pairs; PyObject *__pyx_v_tag; PyObject *__pyx_v_line; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - Py_ssize_t __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - Py_ssize_t __pyx_t_6; - int __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - int __pyx_t_9; - __Pyx_RefNannySetupContext("_read_stanza_unicode"); - __pyx_self = __pyx_self; - __pyx_v_pairs = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); - __pyx_v_tag = Py_None; __Pyx_INCREF(Py_None); - __pyx_v_line = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_rio_pyx.pyx":163 - * cdef Py_UNICODE *accum_value, *new_accum_value - * cdef Py_ssize_t accum_len, accum_size - * pairs = [] # <<<<<<<<<<<<<< - * tag = None - * accum_len = 0 - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_DECREF(((PyObject *)__pyx_v_pairs)); - __pyx_v_pairs = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_rio_pyx.pyx":164 - * cdef Py_ssize_t accum_len, accum_size - * pairs = [] - * tag = None # <<<<<<<<<<<<<< - * accum_len = 0 - * accum_size = 4096 - */ - __Pyx_INCREF(Py_None); - __Pyx_DECREF(__pyx_v_tag); + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_ssize_t __pyx_5; + PyObject *__pyx_6 = 0; + int __pyx_7; + static char *__pyx_argnames[] = {"unicode_iter",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_unicode_iter)) return 0; + Py_INCREF(__pyx_v_unicode_iter); + __pyx_v_pairs = Py_None; Py_INCREF(Py_None); + __pyx_v_tag = Py_None; Py_INCREF(Py_None); + __pyx_v_line = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":163 */ + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;} + Py_DECREF(__pyx_v_pairs); + __pyx_v_pairs = __pyx_1; + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":164 */ + Py_INCREF(Py_None); + Py_DECREF(__pyx_v_tag); __pyx_v_tag = Py_None; - /* "bzrlib/_rio_pyx.pyx":165 - * pairs = [] - * tag = None - * accum_len = 0 # <<<<<<<<<<<<<< - * accum_size = 4096 - * accum_value = malloc(accum_size*sizeof(Py_UNICODE)) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":165 */ __pyx_v_accum_len = 0; - /* "bzrlib/_rio_pyx.pyx":166 - * tag = None - * accum_len = 0 - * accum_size = 4096 # <<<<<<<<<<<<<< - * accum_value = malloc(accum_size*sizeof(Py_UNICODE)) - * if accum_value == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":166 */ __pyx_v_accum_size = 4096; - /* "bzrlib/_rio_pyx.pyx":167 - * accum_len = 0 - * accum_size = 4096 - * accum_value = malloc(accum_size*sizeof(Py_UNICODE)) # <<<<<<<<<<<<<< - * if accum_value == NULL: - * raise MemoryError - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":167 */ __pyx_v_accum_value = ((Py_UNICODE *)malloc((__pyx_v_accum_size * (sizeof(Py_UNICODE))))); - /* "bzrlib/_rio_pyx.pyx":168 - * accum_size = 4096 - * accum_value = malloc(accum_size*sizeof(Py_UNICODE)) - * if accum_value == NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * try: - */ - __pyx_t_2 = (__pyx_v_accum_value == NULL); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":169 - * accum_value = malloc(accum_size*sizeof(Py_UNICODE)) - * if accum_value == NULL: - * raise MemoryError # <<<<<<<<<<<<<< - * try: - * for line in unicode_iter: - */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":168 */ + __pyx_2 = (__pyx_v_accum_value == NULL); + if (__pyx_2) { + __Pyx_Raise(PyExc_MemoryError, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_rio_pyx.pyx":170 - * if accum_value == NULL: - * raise MemoryError - * try: # <<<<<<<<<<<<<< - * for line in unicode_iter: - * if line is None: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":170 */ /*try:*/ { - /* "bzrlib/_rio_pyx.pyx":171 - * raise MemoryError - * try: - * for line in unicode_iter: # <<<<<<<<<<<<<< - * if line is None: - * break # end of file - */ - if (PyList_CheckExact(__pyx_v_unicode_iter) || PyTuple_CheckExact(__pyx_v_unicode_iter)) { - __pyx_t_3 = 0; __pyx_t_1 = __pyx_v_unicode_iter; __Pyx_INCREF(__pyx_t_1); - } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_unicode_iter); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_1); - } + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":171 */ + __pyx_1 = PyObject_GetIter(__pyx_v_unicode_iter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L4;} for (;;) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; - } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; - } else { - __pyx_t_4 = PyIter_Next(__pyx_t_1); - if (!__pyx_t_4) { - if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L7;} - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_DECREF(__pyx_v_line); - __pyx_v_line = __pyx_t_4; - __pyx_t_4 = 0; - - /* "bzrlib/_rio_pyx.pyx":172 - * try: - * for line in unicode_iter: - * if line is None: # <<<<<<<<<<<<<< - * break # end of file - * if not PyUnicode_CheckExact(line): - */ - __pyx_t_2 = (__pyx_v_line == Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":173 - * for line in unicode_iter: - * if line is None: - * break # end of file # <<<<<<<<<<<<<< - * if not PyUnicode_CheckExact(line): - * raise TypeError("%r is not a unicode string" % line) - */ - goto __pyx_L10_break; - goto __pyx_L11; + __pyx_3 = PyIter_Next(__pyx_1); + if (!__pyx_3) { + if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L4;} + break; + } + Py_DECREF(__pyx_v_line); + __pyx_v_line = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":172 */ + __pyx_2 = __pyx_v_line == Py_None; + if (__pyx_2) { + goto __pyx_L7; + goto __pyx_L8; + } + __pyx_L8:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":174 */ + __pyx_2 = (!PyUnicode_CheckExact(__pyx_v_line)); + if (__pyx_2) { + __pyx_3 = PyNumber_Remainder(__pyx_k10p, __pyx_v_line); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L4;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L4;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L4;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L4;} + goto __pyx_L9; } - __pyx_L11:; - - /* "bzrlib/_rio_pyx.pyx":174 - * if line is None: - * break # end of file - * if not PyUnicode_CheckExact(line): # <<<<<<<<<<<<<< - * raise TypeError("%r is not a unicode string" % line) - * c_line = PyUnicode_AS_UNICODE(line) - */ - __pyx_t_2 = (!PyUnicode_CheckExact(__pyx_v_line)); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":175 - * break # end of file - * if not PyUnicode_CheckExact(line): - * raise TypeError("%r is not a unicode string" % line) # <<<<<<<<<<<<<< - * c_line = PyUnicode_AS_UNICODE(line) - * c_len = PyUnicode_GET_SIZE(line) - */ - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_6), __pyx_v_line); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L12; - } - __pyx_L12:; + __pyx_L9:; - /* "bzrlib/_rio_pyx.pyx":176 - * if not PyUnicode_CheckExact(line): - * raise TypeError("%r is not a unicode string" % line) - * c_line = PyUnicode_AS_UNICODE(line) # <<<<<<<<<<<<<< - * c_len = PyUnicode_GET_SIZE(line) - * if c_len < 1: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":176 */ __pyx_v_c_line = PyUnicode_AS_UNICODE(__pyx_v_line); - /* "bzrlib/_rio_pyx.pyx":177 - * raise TypeError("%r is not a unicode string" % line) - * c_line = PyUnicode_AS_UNICODE(line) - * c_len = PyUnicode_GET_SIZE(line) # <<<<<<<<<<<<<< - * if c_len < 1: - * break # end of file - */ - __pyx_t_6 = PyUnicode_GET_SIZE(__pyx_v_line); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L7;} - __pyx_v_c_len = __pyx_t_6; - - /* "bzrlib/_rio_pyx.pyx":178 - * c_line = PyUnicode_AS_UNICODE(line) - * c_len = PyUnicode_GET_SIZE(line) - * if c_len < 1: # <<<<<<<<<<<<<< - * break # end of file - * if Py_UNICODE_ISLINEBREAK(c_line[0]): - */ - __pyx_t_2 = (__pyx_v_c_len < 1); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":179 - * c_len = PyUnicode_GET_SIZE(line) - * if c_len < 1: - * break # end of file # <<<<<<<<<<<<<< - * if Py_UNICODE_ISLINEBREAK(c_line[0]): - * break # end of stanza - */ - goto __pyx_L10_break; - goto __pyx_L13; - } - __pyx_L13:; - - /* "bzrlib/_rio_pyx.pyx":180 - * if c_len < 1: - * break # end of file - * if Py_UNICODE_ISLINEBREAK(c_line[0]): # <<<<<<<<<<<<<< - * break # end of stanza - * if accum_len + c_len > accum_size: - */ - __pyx_t_7 = Py_UNICODE_ISLINEBREAK((__pyx_v_c_line[0])); - if (__pyx_t_7) { - - /* "bzrlib/_rio_pyx.pyx":181 - * break # end of file - * if Py_UNICODE_ISLINEBREAK(c_line[0]): - * break # end of stanza # <<<<<<<<<<<<<< - * if accum_len + c_len > accum_size: - * accum_size = accum_len + c_len - */ - goto __pyx_L10_break; - goto __pyx_L14; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":177 */ + __pyx_5 = PyUnicode_GET_SIZE(__pyx_v_line); if (__pyx_5 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L4;} + __pyx_v_c_len = __pyx_5; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":178 */ + __pyx_2 = (__pyx_v_c_len < 1); + if (__pyx_2) { + goto __pyx_L7; + goto __pyx_L10; + } + __pyx_L10:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":180 */ + __pyx_2 = Py_UNICODE_ISLINEBREAK((__pyx_v_c_line[0])); + if (__pyx_2) { + goto __pyx_L7; + goto __pyx_L11; } - __pyx_L14:; + __pyx_L11:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":182 */ + __pyx_2 = ((__pyx_v_accum_len + __pyx_v_c_len) > __pyx_v_accum_size); + if (__pyx_2) { - /* "bzrlib/_rio_pyx.pyx":182 - * if Py_UNICODE_ISLINEBREAK(c_line[0]): - * break # end of stanza - * if accum_len + c_len > accum_size: # <<<<<<<<<<<<<< - * accum_size = accum_len + c_len - * new_accum_value = realloc(accum_value, - */ - __pyx_t_2 = ((__pyx_v_accum_len + __pyx_v_c_len) > __pyx_v_accum_size); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":183 - * break # end of stanza - * if accum_len + c_len > accum_size: - * accum_size = accum_len + c_len # <<<<<<<<<<<<<< - * new_accum_value = realloc(accum_value, - * accum_size*sizeof(Py_UNICODE)) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":183 */ __pyx_v_accum_size = (__pyx_v_accum_len + __pyx_v_c_len); - /* "bzrlib/_rio_pyx.pyx":185 - * accum_size = accum_len + c_len - * new_accum_value = realloc(accum_value, - * accum_size*sizeof(Py_UNICODE)) # <<<<<<<<<<<<<< - * if new_accum_value == NULL: - * raise MemoryError - */ - __pyx_v_new_accum_value = ((Py_UNICODE *)realloc(__pyx_v_accum_value, (__pyx_v_accum_size * (sizeof(Py_UNICODE))))); - - /* "bzrlib/_rio_pyx.pyx":186 - * new_accum_value = realloc(accum_value, - * accum_size*sizeof(Py_UNICODE)) - * if new_accum_value == NULL: # <<<<<<<<<<<<<< - * raise MemoryError - * else: - */ - __pyx_t_2 = (__pyx_v_new_accum_value == NULL); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":187 - * accum_size*sizeof(Py_UNICODE)) - * if new_accum_value == NULL: - * raise MemoryError # <<<<<<<<<<<<<< - * else: - * accum_value = new_accum_value - */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L16; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":184 */ + __pyx_v_new_accum_value = ((Py_UNICODE *)realloc(__pyx_v_accum_value,(__pyx_v_accum_size * (sizeof(Py_UNICODE))))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":186 */ + __pyx_2 = (__pyx_v_new_accum_value == NULL); + if (__pyx_2) { + __Pyx_Raise(PyExc_MemoryError, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L4;} + goto __pyx_L13; } /*else*/ { - - /* "bzrlib/_rio_pyx.pyx":189 - * raise MemoryError - * else: - * accum_value = new_accum_value # <<<<<<<<<<<<<< - * if c_line[0] == c'\t': # continues previous value, - * if tag is None: - */ __pyx_v_accum_value = __pyx_v_new_accum_value; } - __pyx_L16:; - goto __pyx_L15; + __pyx_L13:; + goto __pyx_L12; } - __pyx_L15:; + __pyx_L12:; - /* "bzrlib/_rio_pyx.pyx":190 - * else: - * accum_value = new_accum_value - * if c_line[0] == c'\t': # continues previous value, # <<<<<<<<<<<<<< - * if tag is None: - * raise ValueError('invalid continuation line %r' % line) - */ - __pyx_t_2 = ((__pyx_v_c_line[0]) == '\t'); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":191 - * accum_value = new_accum_value - * if c_line[0] == c'\t': # continues previous value, - * if tag is None: # <<<<<<<<<<<<<< - * raise ValueError('invalid continuation line %r' % line) - * memcpy(&accum_value[accum_len], &c_line[1], - */ - __pyx_t_2 = (__pyx_v_tag == Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":192 - * if c_line[0] == c'\t': # continues previous value, - * if tag is None: - * raise ValueError('invalid continuation line %r' % line) # <<<<<<<<<<<<<< - * memcpy(&accum_value[accum_len], &c_line[1], - * (c_len-1)*sizeof(Py_UNICODE)) - */ - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), __pyx_v_line); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L18; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":190 */ + __pyx_2 = ((__pyx_v_c_line[0]) == '\t'); + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":191 */ + __pyx_2 = __pyx_v_tag == Py_None; + if (__pyx_2) { + __pyx_4 = PyNumber_Remainder(__pyx_k5p, __pyx_v_line); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L4;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L4;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L4;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L4;} + goto __pyx_L15; } - __pyx_L18:; + __pyx_L15:; - /* "bzrlib/_rio_pyx.pyx":194 - * raise ValueError('invalid continuation line %r' % line) - * memcpy(&accum_value[accum_len], &c_line[1], - * (c_len-1)*sizeof(Py_UNICODE)) # <<<<<<<<<<<<<< - * accum_len = accum_len + (c_len-1) - * else: # new tag:value line - */ - memcpy((&(__pyx_v_accum_value[__pyx_v_accum_len])), (&(__pyx_v_c_line[1])), ((__pyx_v_c_len - 1) * (sizeof(Py_UNICODE)))); - - /* "bzrlib/_rio_pyx.pyx":195 - * memcpy(&accum_value[accum_len], &c_line[1], - * (c_len-1)*sizeof(Py_UNICODE)) - * accum_len = accum_len + (c_len-1) # <<<<<<<<<<<<<< - * else: # new tag:value line - * if tag is not None: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":193 */ + memcpy((&(__pyx_v_accum_value[__pyx_v_accum_len])),(&(__pyx_v_c_line[1])),((__pyx_v_c_len - 1) * (sizeof(Py_UNICODE)))); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":195 */ __pyx_v_accum_len = (__pyx_v_accum_len + (__pyx_v_c_len - 1)); - goto __pyx_L17; + goto __pyx_L14; } /*else*/ { - /* "bzrlib/_rio_pyx.pyx":197 - * accum_len = accum_len + (c_len-1) - * else: # new tag:value line - * if tag is not None: # <<<<<<<<<<<<<< - * PyList_Append(pairs, - * (tag, PyUnicode_FromUnicode(accum_value, accum_len-1))) - */ - __pyx_t_2 = (__pyx_v_tag != Py_None); - if (__pyx_t_2) { - - /* "bzrlib/_rio_pyx.pyx":199 - * if tag is not None: - * PyList_Append(pairs, - * (tag, PyUnicode_FromUnicode(accum_value, accum_len-1))) # <<<<<<<<<<<<<< - * tag = _split_first_line_unicode(c_line, c_len, accum_value, - * &accum_len) - */ - __pyx_t_4 = PyUnicode_FromUnicode(__pyx_v_accum_value, (__pyx_v_accum_len - 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - __Pyx_INCREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tag); - __Pyx_GIVEREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_pairs), ((PyObject *)__pyx_t_5)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; - goto __pyx_L19; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":197 */ + __pyx_2 = __pyx_v_tag != Py_None; + if (__pyx_2) { + __pyx_3 = PyUnicode_FromUnicode(__pyx_v_accum_value,(__pyx_v_accum_len - 1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L4;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L4;} + Py_INCREF(__pyx_v_tag); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_tag); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_3 = 0; + __pyx_2 = PyList_Append(__pyx_v_pairs,__pyx_4); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L4;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + goto __pyx_L16; } - __pyx_L19:; + __pyx_L16:; - /* "bzrlib/_rio_pyx.pyx":201 - * (tag, PyUnicode_FromUnicode(accum_value, accum_len-1))) - * tag = _split_first_line_unicode(c_line, c_len, accum_value, - * &accum_len) # <<<<<<<<<<<<<< - * if not _valid_tag(tag): - * raise ValueError("invalid rio tag %r" % (tag,)) - */ - __pyx_t_5 = __pyx_f_6bzrlib_8_rio_pyx__split_first_line_unicode(__pyx_v_c_line, __pyx_v_c_len, __pyx_v_accum_value, (&__pyx_v_accum_len)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_v_tag); - __pyx_v_tag = __pyx_t_5; - __pyx_t_5 = 0; - - /* "bzrlib/_rio_pyx.pyx":202 - * tag = _split_first_line_unicode(c_line, c_len, accum_value, - * &accum_len) - * if not _valid_tag(tag): # <<<<<<<<<<<<<< - * raise ValueError("invalid rio tag %r" % (tag,)) - * if tag is not None: # add last tag-value - */ - __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s___valid_tag); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tag); - __Pyx_GIVEREF(__pyx_v_tag); - __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_9 = (!__pyx_t_2); - if (__pyx_t_9) { - - /* "bzrlib/_rio_pyx.pyx":203 - * &accum_len) - * if not _valid_tag(tag): - * raise ValueError("invalid rio tag %r" % (tag,)) # <<<<<<<<<<<<<< - * if tag is not None: # add last tag-value - * PyList_Append(pairs, - */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - __Pyx_INCREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_tag); - __Pyx_GIVEREF(__pyx_v_tag); - __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_8)); - PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); - __pyx_t_4 = 0; - __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7;} - goto __pyx_L20; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":200 */ + __pyx_3 = __pyx_f_6bzrlib_8_rio_pyx__split_first_line_unicode(__pyx_v_c_line,__pyx_v_c_len,__pyx_v_accum_value,(&__pyx_v_accum_len)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L4;} + Py_DECREF(__pyx_v_tag); + __pyx_v_tag = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":202 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__valid_tag); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L4;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L4;} + Py_INCREF(__pyx_v_tag); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_tag); + __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L4;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = PyObject_IsTrue(__pyx_6); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; goto __pyx_L4;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_7 = (!__pyx_2); + if (__pyx_7) { + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L4;} + Py_INCREF(__pyx_v_tag); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_tag); + __pyx_3 = PyNumber_Remainder(__pyx_k7p, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L4;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L4;} + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_3); + __pyx_3 = 0; + __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L4;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; goto __pyx_L4;} + goto __pyx_L17; } - __pyx_L20:; + __pyx_L17:; } - __pyx_L17:; + __pyx_L14:; } - __pyx_L10_break:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_L7:; + Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "bzrlib/_rio_pyx.pyx":204 - * if not _valid_tag(tag): - * raise ValueError("invalid rio tag %r" % (tag,)) - * if tag is not None: # add last tag-value # <<<<<<<<<<<<<< - * PyList_Append(pairs, - * (tag, PyUnicode_FromUnicode(accum_value, accum_len-1))) - */ - __pyx_t_9 = (__pyx_v_tag != Py_None); - if (__pyx_t_9) { - - /* "bzrlib/_rio_pyx.pyx":206 - * if tag is not None: # add last tag-value - * PyList_Append(pairs, - * (tag, PyUnicode_FromUnicode(accum_value, accum_len-1))) # <<<<<<<<<<<<<< - * return Stanza.from_pairs(pairs) - * else: # didn't see any content - */ - __pyx_t_1 = PyUnicode_FromUnicode(__pyx_v_accum_value, (__pyx_v_accum_len - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tag); - __Pyx_GIVEREF(__pyx_v_tag); - PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_pairs), ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - - /* "bzrlib/_rio_pyx.pyx":207 - * PyList_Append(pairs, - * (tag, PyUnicode_FromUnicode(accum_value, accum_len-1))) - * return Stanza.from_pairs(pairs) # <<<<<<<<<<<<<< - * else: # didn't see any content - * return None - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__Stanza); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__from_pairs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - __Pyx_INCREF(((PyObject *)__pyx_v_pairs)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_pairs)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_pairs)); - __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L7;} - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __pyx_r = __pyx_t_8; - __pyx_t_8 = 0; - goto __pyx_L6; - goto __pyx_L21; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":204 */ + __pyx_2 = __pyx_v_tag != Py_None; + if (__pyx_2) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":205 */ + __pyx_3 = PyUnicode_FromUnicode(__pyx_v_accum_value,(__pyx_v_accum_len - 1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L4;} + __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; goto __pyx_L4;} + Py_INCREF(__pyx_v_tag); + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_tag); + PyTuple_SET_ITEM(__pyx_6, 1, __pyx_3); + __pyx_3 = 0; + __pyx_7 = PyList_Append(__pyx_v_pairs,__pyx_6); if (__pyx_7 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L4;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":207 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Stanza); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L4;} + __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_from_pairs); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L4;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L4;} + Py_INCREF(__pyx_v_pairs); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_pairs); + __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L4;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_r = __pyx_6; + __pyx_6 = 0; + goto __pyx_L3; + goto __pyx_L18; } /*else*/ { - - /* "bzrlib/_rio_pyx.pyx":209 - * return Stanza.from_pairs(pairs) - * else: # didn't see any content - * return None # <<<<<<<<<<<<<< - * finally: - * free(accum_value) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); + Py_INCREF(Py_None); __pyx_r = Py_None; - goto __pyx_L6; + goto __pyx_L3; } - __pyx_L21:; + __pyx_L18:; } - - /* "bzrlib/_rio_pyx.pyx":211 - * return None - * finally: - * free(accum_value) # <<<<<<<<<<<<<< - */ /*finally:*/ { int __pyx_why; PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; int __pyx_exc_lineno; - __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 0; goto __pyx_L8; - __pyx_L6: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; - __pyx_why = 3; goto __pyx_L8; - __pyx_L7: { + __pyx_why = 0; goto __pyx_L5; + __pyx_L3: __pyx_why = 3; goto __pyx_L5; + __pyx_L4: { __pyx_why = 4; - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); + Py_XDECREF(__pyx_4); __pyx_4 = 0; + Py_XDECREF(__pyx_1); __pyx_1 = 0; + Py_XDECREF(__pyx_3); __pyx_3 = 0; + Py_XDECREF(__pyx_6); __pyx_6 = 0; + PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; - goto __pyx_L8; + goto __pyx_L5; } - __pyx_L8:; + __pyx_L5:; free(__pyx_v_accum_value); switch (__pyx_why) { case 3: goto __pyx_L0; case 4: { - __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); + PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); __pyx_lineno = __pyx_exc_lineno; __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; - goto __pyx_L1_error; + goto __pyx_L1; } } } - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_6); __Pyx_AddTraceback("bzrlib._rio_pyx._read_stanza_unicode"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_pairs); - __Pyx_DECREF(__pyx_v_tag); - __Pyx_DECREF(__pyx_v_line); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_pairs); + Py_DECREF(__pyx_v_tag); + Py_DECREF(__pyx_v_line); + Py_DECREF(__pyx_v_unicode_iter); return __pyx_r; } -static PyMethodDef __pyx_methods[] = { +static struct PyMethodDef __pyx_methods[] = { + {"_valid_tag", (PyCFunction)__pyx_f_6bzrlib_8_rio_pyx__valid_tag, METH_VARARGS|METH_KEYWORDS, 0}, + {"_read_stanza_utf8", (PyCFunction)__pyx_f_6bzrlib_8_rio_pyx__read_stanza_utf8, METH_VARARGS|METH_KEYWORDS, 0}, + {"_read_stanza_unicode", (PyCFunction)__pyx_f_6bzrlib_8_rio_pyx__read_stanza_unicode, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("_rio_pyx"), - __Pyx_DOCSTR(__pyx_k_7), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif +static void __pyx_init_filenames(void); /*proto*/ -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_n_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 1}, - {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, - {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, - {&__pyx_n_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 1}, - {&__pyx_n_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 1}, - {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1}, - {&__pyx_n_s__Stanza, __pyx_k__Stanza, sizeof(__pyx_k__Stanza), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___read_stanza_utf8, __pyx_k___read_stanza_utf8, sizeof(__pyx_k___read_stanza_utf8), 0, 0, 1, 1}, - {&__pyx_n_s___valid_tag, __pyx_k___valid_tag, sizeof(__pyx_k___valid_tag), 0, 0, 1, 1}, - {&__pyx_n_s__from_pairs, __pyx_k__from_pairs, sizeof(__pyx_k__from_pairs), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __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;} - __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC init_rio_pyx(void); /*proto*/ -PyMODINIT_FUNC init_rio_pyx(void) -#else -PyMODINIT_FUNC PyInit__rio_pyx(void); /*proto*/ -PyMODINIT_FUNC PyInit__rio_pyx(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__rio_pyx(void)", __LINE__, __FILE__); - #endif - __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;} - __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;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_rio_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_7), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_rio_pyx(void) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + __pyx_init_filenames(); + __pyx_m = Py_InitModule4("_rio_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_bzrlib___rio_pyx) { - 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;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "bzrlib/_rio_pyx.pyx":50 - * void *memcpy(void *, void *, int) - * - * from bzrlib.rio import Stanza # <<<<<<<<<<<<<< - * - * cdef int _valid_tag_char(char c): # cannot_raise - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(((PyObject *)__pyx_n_s__Stanza)); - PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__Stanza)); - __Pyx_GIVEREF(((PyObject *)__pyx_n_s__Stanza)); - __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s_8), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__Stanza); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s__Stanza, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_rio_pyx.pyx":59 - * - * - * def _valid_tag(tag): # <<<<<<<<<<<<<< - * cdef char *c_tag - * cdef Py_ssize_t c_len - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_8_rio_pyx__valid_tag, NULL, __pyx_n_s_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___valid_tag, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_rio_pyx.pyx":103 - * - * - * def _read_stanza_utf8(line_iter): # <<<<<<<<<<<<<< - * cdef char *c_line - * cdef Py_ssize_t c_len - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_8_rio_pyx_1_read_stanza_utf8, NULL, __pyx_n_s_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s___read_stanza_utf8, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_rio_pyx.pyx":158 - * - * - * def _read_stanza_unicode(unicode_iter): # <<<<<<<<<<<<<< - * cdef Py_UNICODE *c_line - * cdef int c_len - */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6bzrlib_8_rio_pyx_2_read_stanza_unicode, NULL, __pyx_n_s_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_10, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "bzrlib/_rio_pyx.pyx":1 - * # Copyright (C) 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<< - * # - * # This program is free software; you can redistribute it and/or modify - */ - __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;} - __Pyx_GOTREF(((PyObject *)__pyx_t_2)); - 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;} - __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - if (__pyx_m) { - __Pyx_AddTraceback("init bzrlib._rio_pyx"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init bzrlib._rio_pyx"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 + __pyx_b = PyImport_AddModule("__builtin__"); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":50 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;} + Py_INCREF(__pyx_n_Stanza); + PyList_SET_ITEM(__pyx_1, 0, __pyx_n_Stanza); + __pyx_2 = __Pyx_Import(__pyx_k11p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_Stanza); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_Stanza, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_rio_pyx.pyx":158 */ return; - #else - return __pyx_m; - #endif + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("bzrlib._rio_pyx"); } -/* Runtime support code */ - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} +static char *__pyx_filenames[] = { + "_rio_pyx.pyx", +}; -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} +/* Runtime support code */ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; } - -#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); @@ -2567,13 +1068,12 @@ Py_INCREF(type); } else { - type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else - type = (PyObject*) Py_TYPE(type); + type = (PyObject*) type->ob_type; Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, @@ -2582,8 +1082,7 @@ } #endif } - - __Pyx_ErrRestore(type, value, tb); + PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); @@ -2592,59 +1091,35 @@ return; } -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; +} - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + if (!*t->p) + return -1; + if (t->i) + PyString_InternInPlace(t->p); + ++t; } - -bad: - return; + return 0; } -#endif static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { - PyObject *py_import = 0; + PyObject *__import__ = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; - py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); - if (!py_import) + __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); + if (!__import__) goto bad; if (from_list) list = from_list; @@ -2660,471 +1135,57 @@ empty_dict = PyDict_New(); if (!empty_dict) goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, NULL); + module = PyObject_CallFunction(__import__, "OOOO", + name, global_dict, empty_dict, list); bad: Py_XDECREF(empty_list); - Py_XDECREF(py_import); + Py_XDECREF(__import__); Py_XDECREF(empty_dict); return module; } -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - #include "compile.h" #include "frameobject.h" #include "traceback.h" -static void __Pyx_AddTraceback(const char *funcname) { +static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; + PyObject *empty_tuple = 0; + PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } + py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; + empty_tuple = PyTuple_New(0); + if (!empty_tuple) goto bad; + empty_string = PyString_FromString(""); + if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + empty_string, /*PyObject *code,*/ + empty_tuple, /*PyObject *consts,*/ + empty_tuple, /*PyObject *names,*/ + empty_tuple, /*PyObject *varnames,*/ + empty_tuple, /*PyObject *freevars,*/ + empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ + empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ + PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ @@ -3135,128 +1196,8 @@ bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); + Py_XDECREF(empty_tuple); + Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} - -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff -Nru bzr-2.5.0/bzrlib/send.py bzr-2.6.0~beta1/bzrlib/send.py --- bzr-2.5.0/bzrlib/send.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/send.py 2012-03-15 10:00:24.000000000 +0000 @@ -49,9 +49,10 @@ branch.lock_write() try: if output is None: + config_stack = branch.get_config_stack() if mail_to is None: - mail_to = branch.get_config_stack().get('submit_to') - mail_client = branch.get_config().get_mail_client() + mail_to = config_stack.get('submit_to') + mail_client = config_stack.get('mail_client')(config_stack) if (not getattr(mail_client, 'supports_body', False) and body is not None): raise errors.BzrCommandError(gettext( diff -Nru bzr-2.5.0/bzrlib/_simple_set_pyx_api.h bzr-2.6.0~beta1/bzrlib/_simple_set_pyx_api.h --- bzr-2.5.0/bzrlib/_simple_set_pyx_api.h 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_simple_set_pyx_api.h 2012-03-15 10:00:25.000000000 +0000 @@ -7,33 +7,26 @@ #define SimpleSet_Type (*__pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet) static struct SimpleSetObject *(*SimpleSet_New)(void); -static PyObject *(*SimpleSet_Add)(PyObject *, PyObject *); -static int (*SimpleSet_Contains)(PyObject *, PyObject *); -static int (*SimpleSet_Discard)(PyObject *, PyObject *); -static PyObject *(*SimpleSet_Get)(struct SimpleSetObject *, PyObject *); +static PyObject *(*SimpleSet_Add)(PyObject *,PyObject *); +static int (*SimpleSet_Contains)(PyObject *,PyObject *); +static int (*SimpleSet_Discard)(PyObject *,PyObject *); +static PyObject *(*SimpleSet_Get)(struct SimpleSetObject *,PyObject *); static Py_ssize_t (*SimpleSet_Size)(PyObject *); -static int (*SimpleSet_Next)(PyObject *, Py_ssize_t *, PyObject **); -static PyObject **(*_SimpleSet_Lookup)(PyObject *, PyObject *); +static int (*SimpleSet_Next)(PyObject *,Py_ssize_t *,PyObject **); +static PyObject **(*_SimpleSet_Lookup)(PyObject *,PyObject *); #ifndef __PYX_HAVE_API_FUNC_import_module #define __PYX_HAVE_API_FUNC_import_module #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { +static PyObject *__Pyx_ImportModule(char *name) { PyObject *py_name = 0; - PyObject *py_module = 0; - - #if PY_MAJOR_VERSION < 3 + py_name = PyString_FromString(name); - #else - py_name = PyUnicode_FromString(name); - #endif if (!py_name) goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; + return PyImport_Import(py_name); bad: Py_XDECREF(py_name); return 0; @@ -45,15 +38,12 @@ #ifndef __PYX_HAVE_RT_ImportFunction #define __PYX_HAVE_RT_ImportFunction -static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) { +static int __Pyx_ImportFunction(PyObject *module, char *funcname, void **f, char *sig) { PyObject *d = 0; PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - - d = PyObject_GetAttrString(module, (char *)"__pyx_capi__"); + char *desc; + + d = PyObject_GetAttrString(module, "__pyx_capi__"); if (!d) goto bad; cobj = PyDict_GetItemString(d, funcname); @@ -63,32 +53,16 @@ PyModule_GetName(module), funcname); goto bad; } -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - if (!PyCapsule_IsValid(cobj, sig)) { - PyErr_Format(PyExc_TypeError, - "C function %s.%s has wrong signature (expected %s, got %s)", - PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj)); - goto bad; - } - tmp.p = PyCapsule_GetPointer(cobj, sig); -#else - {const char *desc, *s1, *s2; - desc = (const char *)PyCObject_GetDesc(cobj); + desc = (char *)PyCObject_GetDesc(cobj); if (!desc) goto bad; - s1 = desc; s2 = sig; - while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; } - if (*s1 != *s2) { + if (strcmp(desc, sig) != 0) { PyErr_Format(PyExc_TypeError, "C function %s.%s has wrong signature (expected %s, got %s)", - PyModule_GetName(module), funcname, sig, desc); + PyModule_GetName(module), funcname, sig, desc); goto bad; } - tmp.p = PyCObject_AsVoidPtr(cobj);} -#endif - *f = tmp.fp; - if (!(*f)) - goto bad; + *f = PyCObject_AsVoidPtr(cobj); Py_DECREF(d); return 0; bad: @@ -100,56 +74,32 @@ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - long size, int strict) +static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, + long size) { PyObject *py_module = 0; PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - + py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; - #if PY_MAJOR_VERSION < 3 - py_name = PyString_FromString(class_name); - #else - py_name = PyUnicode_FromString(class_name); - #endif - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; + result = PyObject_GetAttrString(py_module, class_name); if (!result) goto bad; if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, + PyErr_Format(PyExc_TypeError, "%s.%s is not a type object", module_name, class_name); goto bad; } - if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility", - module_name, class_name); - #if PY_VERSION_HEX < 0x02050000 - PyErr_Warn(NULL, warning); - #else - PyErr_WarnEx(NULL, warning, 0); - #endif - } - else if (((PyTypeObject *)result)->tp_basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%s.%s has the wrong size, try recompiling", + if (((PyTypeObject *)result)->tp_basicsize != size) { + PyErr_Format(PyExc_ValueError, + "%s.%s does not appear to be the correct type object", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: - Py_XDECREF(py_module); Py_XDECREF(result); return 0; } @@ -159,16 +109,16 @@ PyObject *module = 0; module = __Pyx_ImportModule("bzrlib._simple_set_pyx"); if (!module) goto bad; - if (__Pyx_ImportFunction(module, "SimpleSet_New", (void (**)(void))&SimpleSet_New, "struct SimpleSetObject *(void)") < 0) goto bad; - if (__Pyx_ImportFunction(module, "SimpleSet_Add", (void (**)(void))&SimpleSet_Add, "PyObject *(PyObject *, PyObject *)") < 0) goto bad; - if (__Pyx_ImportFunction(module, "SimpleSet_Contains", (void (**)(void))&SimpleSet_Contains, "int (PyObject *, PyObject *)") < 0) goto bad; - if (__Pyx_ImportFunction(module, "SimpleSet_Discard", (void (**)(void))&SimpleSet_Discard, "int (PyObject *, PyObject *)") < 0) goto bad; - if (__Pyx_ImportFunction(module, "SimpleSet_Get", (void (**)(void))&SimpleSet_Get, "PyObject *(struct SimpleSetObject *, PyObject *)") < 0) goto bad; - if (__Pyx_ImportFunction(module, "SimpleSet_Size", (void (**)(void))&SimpleSet_Size, "Py_ssize_t (PyObject *)") < 0) goto bad; - if (__Pyx_ImportFunction(module, "SimpleSet_Next", (void (**)(void))&SimpleSet_Next, "int (PyObject *, Py_ssize_t *, PyObject **)") < 0) goto bad; - if (__Pyx_ImportFunction(module, "_SimpleSet_Lookup", (void (**)(void))&_SimpleSet_Lookup, "PyObject **(PyObject *, PyObject *)") < 0) goto bad; + if (__Pyx_ImportFunction(module, "SimpleSet_New", (void**)&SimpleSet_New, "struct SimpleSetObject *(void)") < 0) goto bad; + if (__Pyx_ImportFunction(module, "SimpleSet_Add", (void**)&SimpleSet_Add, "PyObject *(PyObject *,PyObject *)") < 0) goto bad; + if (__Pyx_ImportFunction(module, "SimpleSet_Contains", (void**)&SimpleSet_Contains, "int (PyObject *,PyObject *)") < 0) goto bad; + if (__Pyx_ImportFunction(module, "SimpleSet_Discard", (void**)&SimpleSet_Discard, "int (PyObject *,PyObject *)") < 0) goto bad; + if (__Pyx_ImportFunction(module, "SimpleSet_Get", (void**)&SimpleSet_Get, "PyObject *(struct SimpleSetObject *,PyObject *)") < 0) goto bad; + if (__Pyx_ImportFunction(module, "SimpleSet_Size", (void**)&SimpleSet_Size, "Py_ssize_t (PyObject *)") < 0) goto bad; + if (__Pyx_ImportFunction(module, "SimpleSet_Next", (void**)&SimpleSet_Next, "int (PyObject *,Py_ssize_t *,PyObject **)") < 0) goto bad; + if (__Pyx_ImportFunction(module, "_SimpleSet_Lookup", (void**)&_SimpleSet_Lookup, "PyObject **(PyObject *,PyObject *)") < 0) goto bad; Py_DECREF(module); module = 0; - __pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet = __Pyx_ImportType("bzrlib._simple_set_pyx", "SimpleSet", sizeof(struct SimpleSetObject), 1); if (!__pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet) goto bad; + __pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet = __Pyx_ImportType("bzrlib._simple_set_pyx", "SimpleSet", sizeof(struct SimpleSetObject)); if (!__pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet) goto bad; return 0; bad: Py_XDECREF(module); diff -Nru bzr-2.5.0/bzrlib/_simple_set_pyx.c bzr-2.6.0~beta1/bzrlib/_simple_set_pyx.c --- bzr-2.5.0/bzrlib/_simple_set_pyx.c 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_simple_set_pyx.c 2012-03-15 10:00:25.000000000 +0000 @@ -1,332 +1,60 @@ -/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:40 2012 */ +/* Generated by Pyrex 0.9.8.5 on Fri Oct 8 14:01:06 2010 */ #define PY_SSIZE_T_CLEAN #include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#else - -#include /* For offsetof */ -#ifndef offsetof -#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif - -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif - -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif - +#include "structmember.h" #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif - -#if PY_VERSION_HEX < 0x02040000 - #define METH_COEXIST 0 - #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) - #define PyDict_Contains(d,o) PySequence_Contains(d,o) -#endif - #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN - #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) - #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) - #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) - #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) - #define PyVarObject_HEAD_INIT(type, size) \ - PyObject_HEAD_INIT(type) size, - #define PyType_Modified(t) - - typedef struct { - void *buf; - PyObject *obj; - Py_ssize_t len; - Py_ssize_t itemsize; - int readonly; - int ndim; - char *format; - Py_ssize_t *shape; - Py_ssize_t *strides; - Py_ssize_t *suboffsets; - void *internal; - } Py_buffer; - - #define PyBUF_SIMPLE 0 - #define PyBUF_WRITABLE 0x0001 - #define PyBUF_FORMAT 0x0004 - #define PyBUF_ND 0x0008 - #define PyBUF_STRIDES (0x0010 | PyBUF_ND) - #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) - #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) - #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) - #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) - -#endif - -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" -#endif - -#if PY_MAJOR_VERSION >= 3 - #define Py_TPFLAGS_CHECKTYPES 0 - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif - -#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact + #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #endif - -#if PY_VERSION_HEX < 0x02060000 - #define PyBytesObject PyStringObject - #define PyBytes_Type PyString_Type - #define PyBytes_Check PyString_Check - #define PyBytes_CheckExact PyString_CheckExact - #define PyBytes_FromString PyString_FromString - #define PyBytes_FromStringAndSize PyString_FromStringAndSize - #define PyBytes_FromFormat PyString_FromFormat - #define PyBytes_DecodeEscape PyString_DecodeEscape - #define PyBytes_AsString PyString_AsString - #define PyBytes_AsStringAndSize PyString_AsStringAndSize - #define PyBytes_Size PyString_Size - #define PyBytes_AS_STRING PyString_AS_STRING - #define PyBytes_GET_SIZE PyString_GET_SIZE - #define PyBytes_Repr PyString_Repr - #define PyBytes_Concat PyString_Concat - #define PyBytes_ConcatAndDel PyString_ConcatAndDel -#endif - -#if PY_VERSION_HEX < 0x02060000 - #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) - #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif - -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) - -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif - - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) - #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) - #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) -#else - #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) - #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) - #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ - (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ - (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ - (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) -#endif - -#if PY_MAJOR_VERSION >= 3 - #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) -#else - #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) - #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) - #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) -#endif - -#if PY_VERSION_HEX < 0x02050000 - #define __Pyx_NAMESTR(n) ((char *)(n)) - #define __Pyx_DOCSTR(n) ((char *)(n)) -#else - #define __Pyx_NAMESTR(n) (n) - #define __Pyx_DOCSTR(n) (n) +#if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall + #define __stdcall + #endif + #ifndef __cdecl + #define __cdecl + #endif #endif - #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif - -#if defined(WIN32) || defined(MS_WINDOWS) -#define _USE_MATH_DEFINES -#endif #include -#define __PYX_HAVE_API__bzrlib___simple_set_pyx #include "python-compat.h" -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - - -/* inline attribute */ -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -/* unused attribute */ -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || defined(__INTEL_COMPILER) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif - -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*/ +typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ -/* Type Conversion Predeclarations */ - -#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) -#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) - -#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); - -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - static PyObject *__pyx_m; static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; +static char *__pyx_filename; +static char **__pyx_f; +static char __pyx_mdoc[] = "Interface definition of a class like PySet but without caching the hash.\n\nThis is generally useful when you want to \'intern\' objects, etc. Note that this\ndiffers from Set in that we:\n 1) Don\'t have all of the .intersection, .difference, etc functions\n 2) Do return the object from the set via queries\n eg. SimpleSet.add(key) => saved_key and SimpleSet[key] => saved_key\n\nDefinition of a class that is similar to Set with some small changes."; -static const char *__pyx_f[] = { - "_simple_set_pyx.pyx", -}; +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -/* Type declarations */ +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ -/* "bzrlib/_simple_set_pyx.pyx":361 - * - * - * cdef class _SimpleSet_iterator: # <<<<<<<<<<<<<< - * """Iterator over the SimpleSet structure.""" - * - */ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator { - PyObject_HEAD - Py_ssize_t pos; - struct SimpleSetObject *set; - Py_ssize_t _used; - Py_ssize_t len; -}; +static int __Pyx_ExportFunction(char *n, void *f, char *s); /*proto*/ + +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ -/* "bzrlib/_simple_set_pyx.pxd":31 - * - * - * cdef public api class SimpleSet [object SimpleSetObject, type SimpleSet_Type]: # <<<<<<<<<<<<<< - * """A class similar to PySet, but with simpler implementation. - * - */ +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static void __Pyx_AddTraceback(char *funcname); /*proto*/ + +/* Declarations from bzrlib._simple_set_pyx */ struct SimpleSetObject { PyObject_HEAD @@ -339,1215 +67,571 @@ __PYX_EXTERN_C DL_EXPORT(PyTypeObject) SimpleSet_Type; -/* "bzrlib/_simple_set_pyx.pyx":88 - * - * - * cdef public api class SimpleSet [object SimpleSetObject, type SimpleSet_Type]: # <<<<<<<<<<<<<< - * """This class can be used to track canonical forms for objects. - * - */ - struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet { - PyObject *(*_get)(struct SimpleSetObject *, PyObject *); - PyObject *(*_add)(struct SimpleSetObject *, PyObject *); - int (*_discard)(struct SimpleSetObject *, PyObject *); - int (*_insert_clean)(struct SimpleSetObject *, PyObject *); - Py_ssize_t (*_resize)(struct SimpleSetObject *, Py_ssize_t); + PyObject *(*_get)(struct SimpleSetObject *,PyObject *); + PyObject *(*_add)(struct SimpleSetObject *,PyObject *); + int (*_discard)(struct SimpleSetObject *,PyObject *); + int (*_insert_clean)(struct SimpleSetObject *,PyObject *); + Py_ssize_t (*_resize)(struct SimpleSetObject *,Py_ssize_t); }; static struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *__pyx_vtabptr_6bzrlib_15_simple_set_pyx_SimpleSet; -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif - -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); - end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; - } - #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) - #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) -#else - #define __Pyx_RefNannySetupContext(name) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) -#endif /* CYTHON_REFNANNY */ -#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) -#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) - -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ - -static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, - Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ - -static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, - const char* function_name, int kw_allowed); /*proto*/ - -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, PyObject* kw_name); /*proto*/ - -static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; } -static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { - return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b); -} - -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); - -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /*proto*/ +static PyTypeObject *__pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet = 0; +static struct SimpleSetObject *SimpleSet_New(void); /*proto*/ +static PyObject *SimpleSet_Add(PyObject *,PyObject *); /*proto*/ +static int SimpleSet_Contains(PyObject *,PyObject *); /*proto*/ +static int SimpleSet_Discard(PyObject *,PyObject *); /*proto*/ +static PyObject *SimpleSet_Get(struct SimpleSetObject *,PyObject *); /*proto*/ +static Py_ssize_t SimpleSet_Size(PyObject *); /*proto*/ +static int SimpleSet_Next(PyObject *,Py_ssize_t *,PyObject **); /*proto*/ -static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ +/* Declarations from implementation of bzrlib._simple_set_pyx */ -static void __Pyx_AddTraceback(const char *funcname); /*proto*/ +struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator { + PyObject_HEAD + Py_ssize_t pos; + struct SimpleSetObject *set; + Py_ssize_t _used; + Py_ssize_t len; +}; -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ -/* Module declarations from bzrlib._simple_set_pyx */ -static PyTypeObject *__pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet = 0; static PyTypeObject *__pyx_ptype_6bzrlib_15_simple_set_pyx__SimpleSet_iterator = 0; -static PyObject *__pyx_v_6bzrlib_15_simple_set_pyx__dummy_obj = 0; +static PyObject *__pyx_v_6bzrlib_15_simple_set_pyx__dummy_obj; static PyObject *__pyx_v_6bzrlib_15_simple_set_pyx__dummy; -static PyObject *__pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented = 0; -static struct SimpleSetObject *SimpleSet_New(void); /*proto*/ -static PyObject *SimpleSet_Add(PyObject *, PyObject *); /*proto*/ -static int SimpleSet_Contains(PyObject *, PyObject *); /*proto*/ -static int SimpleSet_Discard(PyObject *, PyObject *); /*proto*/ -static PyObject *SimpleSet_Get(struct SimpleSetObject *, PyObject *); /*proto*/ -static Py_ssize_t SimpleSet_Size(PyObject *); /*proto*/ -static int SimpleSet_Next(PyObject *, Py_ssize_t *, PyObject **); /*proto*/ -static int __pyx_f_6bzrlib_15_simple_set_pyx__is_equal(PyObject *, long, PyObject *); /*proto*/ +static PyObject *__pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented; +static int __pyx_f_6bzrlib_15_simple_set_pyx__is_equal(PyObject *,long,PyObject *); /*proto*/ static struct SimpleSetObject *__pyx_f_6bzrlib_15_simple_set_pyx__check_self(PyObject *); /*proto*/ -static PyObject **__pyx_f_6bzrlib_15_simple_set_pyx__lookup(struct SimpleSetObject *, PyObject *); /*proto*/ -static PyObject **_SimpleSet_Lookup(PyObject *, PyObject *); /*proto*/ -static int __pyx_f_6bzrlib_15_simple_set_pyx_SimpleSet_traverse(struct SimpleSetObject *, visitproc, void *); /*proto*/ -#define __Pyx_MODULE_NAME "bzrlib._simple_set_pyx" -static int __pyx_module_is_main_bzrlib___simple_set_pyx = 0; +static PyObject **__pyx_f_6bzrlib_15_simple_set_pyx__lookup(struct SimpleSetObject *,PyObject *); /*proto*/ +static PyObject **_SimpleSet_Lookup(PyObject *,PyObject *); /*proto*/ +static int __pyx_f_6bzrlib_15_simple_set_pyx_SimpleSet_traverse(struct SimpleSetObject *,visitproc,void *); /*proto*/ + +static char __pyx_k1[] = ""; +static char __pyx_k2[] = ""; +static char __pyx_k3[] = "Key %s is not present"; +static char __pyx_k4[] = "ran out of slots."; +static char __pyx_k5[] = "Types added to SimpleSet must implement both tp_richcompare and tp_hash"; +static char __pyx_k6[] = "Set size changed during iteration"; +static char __pyx_k7[] = "self must not be None"; +static char __pyx_k8[] = "should never get here"; +static char __pyx_k9[] = "object"; +static char __pyx_k10[] = "NotImplemented"; + +static PyObject *__pyx_n_NotImplemented; +static PyObject *__pyx_n_object; + +static PyObject *__pyx_k1p; +static PyObject *__pyx_k2p; +static PyObject *__pyx_k3p; +static PyObject *__pyx_k4p; +static PyObject *__pyx_k5p; +static PyObject *__pyx_k6p; +static PyObject *__pyx_k7p; +static PyObject *__pyx_k8p; + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_n_NotImplemented, 1, __pyx_k10, sizeof(__pyx_k10)}, + {&__pyx_n_object, 1, __pyx_k9, sizeof(__pyx_k9)}, + {&__pyx_k1p, 0, __pyx_k1, sizeof(__pyx_k1)}, + {&__pyx_k2p, 0, __pyx_k2, sizeof(__pyx_k2)}, + {&__pyx_k3p, 0, __pyx_k3, sizeof(__pyx_k3)}, + {&__pyx_k4p, 0, __pyx_k4, sizeof(__pyx_k4)}, + {&__pyx_k5p, 0, __pyx_k5, sizeof(__pyx_k5)}, + {&__pyx_k6p, 0, __pyx_k6, sizeof(__pyx_k6)}, + {&__pyx_k7p, 0, __pyx_k7, sizeof(__pyx_k7)}, + {&__pyx_k8p, 0, __pyx_k8, sizeof(__pyx_k8)}, + {0, 0, 0, 0} +}; + + /* Implementation of bzrlib._simple_set_pyx */ -static PyObject *__pyx_builtin_object; -static PyObject *__pyx_builtin_NotImplemented; -static PyObject *__pyx_builtin_MemoryError; -static PyObject *__pyx_builtin_KeyError; -static PyObject *__pyx_builtin_RuntimeError; -static PyObject *__pyx_builtin_TypeError; -static PyObject *__pyx_builtin_StopIteration; -static PyObject *__pyx_builtin_AssertionError; -static char __pyx_k_1[] = ""; -static char __pyx_k_2[] = ""; -static char __pyx_k_3[] = "Key %s is not present"; -static char __pyx_k_4[] = "ran out of slots."; -static char __pyx_k_6[] = "Types added to SimpleSet must implement both tp_richcompare and tp_hash"; -static char __pyx_k_8[] = "Set size changed during iteration"; -static char __pyx_k_10[] = "self must not be None"; -static char __pyx_k_12[] = "should never get here"; -static char __pyx_k_14[] = "Definition of a class that is similar to Set with some small changes."; -static char __pyx_k__len[] = "len"; -static char __pyx_k__obj[] = "obj"; -static char __pyx_k__pos[] = "pos"; -static char __pyx_k__set[] = "set"; -static char __pyx_k___add[] = "_add"; -static char __pyx_k___get[] = "_get"; -static char __pyx_k___fill[] = "_fill"; -static char __pyx_k___mask[] = "_mask"; -static char __pyx_k___used[] = "_used"; -static char __pyx_k___table[] = "_table"; -static char __pyx_k__object[] = "object"; -static char __pyx_k___resize[] = "_resize"; -static char __pyx_k__tp_hash[] = "tp_hash"; -static char __pyx_k__KeyError[] = "KeyError"; -static char __pyx_k____main__[] = "__main__"; -static char __pyx_k____test__[] = "__test__"; -static char __pyx_k___discard[] = "_discard"; -static char __pyx_k__TypeError[] = "TypeError"; -static char __pyx_k__MemoryError[] = "MemoryError"; -static char __pyx_k__tp_traverse[] = "tp_traverse"; -static char __pyx_k__RuntimeError[] = "RuntimeError"; -static char __pyx_k__StopIteration[] = "StopIteration"; -static char __pyx_k___insert_clean[] = "_insert_clean"; -static char __pyx_k__AssertionError[] = "AssertionError"; -static char __pyx_k__NotImplemented[] = "NotImplemented"; -static char __pyx_k__tp_richcompare[] = "tp_richcompare"; -static PyObject *__pyx_kp_s_1; -static PyObject *__pyx_kp_s_10; -static PyObject *__pyx_kp_s_12; -static PyObject *__pyx_kp_s_2; -static PyObject *__pyx_kp_s_3; -static PyObject *__pyx_kp_s_4; -static PyObject *__pyx_kp_s_6; -static PyObject *__pyx_kp_s_8; -static PyObject *__pyx_n_s__AssertionError; -static PyObject *__pyx_n_s__KeyError; -static PyObject *__pyx_n_s__MemoryError; -static PyObject *__pyx_n_s__NotImplemented; -static PyObject *__pyx_n_s__RuntimeError; -static PyObject *__pyx_n_s__StopIteration; -static PyObject *__pyx_n_s__TypeError; -static PyObject *__pyx_n_s____main__; -static PyObject *__pyx_n_s____test__; -static PyObject *__pyx_n_s___add; -static PyObject *__pyx_n_s___discard; -static PyObject *__pyx_n_s___fill; -static PyObject *__pyx_n_s___get; -static PyObject *__pyx_n_s___insert_clean; -static PyObject *__pyx_n_s___mask; -static PyObject *__pyx_n_s___resize; -static PyObject *__pyx_n_s___table; -static PyObject *__pyx_n_s___used; -static PyObject *__pyx_n_s__len; -static PyObject *__pyx_n_s__obj; -static PyObject *__pyx_n_s__object; -static PyObject *__pyx_n_s__pos; -static PyObject *__pyx_n_s__set; -static PyObject *__pyx_n_s__tp_hash; -static PyObject *__pyx_n_s__tp_richcompare; -static PyObject *__pyx_n_s__tp_traverse; -static PyObject *__pyx_int_0; -static PyObject *__pyx_k_tuple_5; -static PyObject *__pyx_k_tuple_7; -static PyObject *__pyx_k_tuple_9; -static PyObject *__pyx_k_tuple_11; -static PyObject *__pyx_k_tuple_13; - -/* "bzrlib/_simple_set_pyx.pyx":62 - * - * - * cdef int _is_equal(PyObject *this, long this_hash, PyObject *other) except -1: # <<<<<<<<<<<<<< - * cdef long other_hash - * - */ -static int __pyx_f_6bzrlib_15_simple_set_pyx__is_equal(PyObject *__pyx_v_this, long __pyx_v_this_hash, PyObject *__pyx_v_other) { +static int __pyx_f_6bzrlib_15_simple_set_pyx__is_equal(PyObject *__pyx_v_this,long __pyx_v_this_hash,PyObject *__pyx_v_other) { long __pyx_v_other_hash; PyObject *__pyx_v_res; int __pyx_r; - int __pyx_t_1; - long __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("_is_equal"); - __pyx_v_res = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_simple_set_pyx.pyx":65 - * cdef long other_hash - * - * if this == other: # <<<<<<<<<<<<<< - * return 1 - * other_hash = PyObject_Hash(other) - */ - __pyx_t_1 = (__pyx_v_this == __pyx_v_other); - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":66 - * - * if this == other: - * return 1 # <<<<<<<<<<<<<< - * other_hash = PyObject_Hash(other) - * if other_hash != this_hash: - */ + int __pyx_1; + long __pyx_2; + PyObject *__pyx_3 = 0; + __pyx_v_res = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":65 */ + __pyx_1 = (__pyx_v_this == __pyx_v_other); + if (__pyx_1) { __pyx_r = 1; goto __pyx_L0; - goto __pyx_L3; + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":67 */ + __pyx_2 = PyObject_Hash(__pyx_v_other); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;} + __pyx_v_other_hash = __pyx_2; - /* "bzrlib/_simple_set_pyx.pyx":67 - * if this == other: - * return 1 - * other_hash = PyObject_Hash(other) # <<<<<<<<<<<<<< - * if other_hash != this_hash: - * return 0 - */ - __pyx_t_2 = PyObject_Hash(__pyx_v_other); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_other_hash = __pyx_t_2; - - /* "bzrlib/_simple_set_pyx.pyx":68 - * return 1 - * other_hash = PyObject_Hash(other) - * if other_hash != this_hash: # <<<<<<<<<<<<<< - * return 0 - * - */ - __pyx_t_1 = (__pyx_v_other_hash != __pyx_v_this_hash); - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":69 - * other_hash = PyObject_Hash(other) - * if other_hash != this_hash: - * return 0 # <<<<<<<<<<<<<< - * - * # This implements a subset of the PyObject_RichCompareBool functionality. - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":68 */ + __pyx_1 = (__pyx_v_other_hash != __pyx_v_this_hash); + if (__pyx_1) { __pyx_r = 0; goto __pyx_L0; - goto __pyx_L4; + goto __pyx_L3; } - __pyx_L4:; + __pyx_L3:; - /* "bzrlib/_simple_set_pyx.pyx":78 - * # equal. (It doesn't try to cast them both to some intermediate form - * # that would compare equal.) - * res = Py_TYPE(this).tp_richcompare(this, other, Py_EQ) # <<<<<<<<<<<<<< - * if res is _NotImplemented: - * res = Py_TYPE(other).tp_richcompare(other, this, Py_EQ) - */ - __pyx_t_3 = Py_TYPE(__pyx_v_this)->tp_richcompare(__pyx_v_this, __pyx_v_other, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_res); - __pyx_v_res = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_simple_set_pyx.pyx":79 - * # that would compare equal.) - * res = Py_TYPE(this).tp_richcompare(this, other, Py_EQ) - * if res is _NotImplemented: # <<<<<<<<<<<<<< - * res = Py_TYPE(other).tp_richcompare(other, this, Py_EQ) - * if res is _NotImplemented: - */ - __pyx_t_1 = (__pyx_v_res == __pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented); - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":80 - * res = Py_TYPE(this).tp_richcompare(this, other, Py_EQ) - * if res is _NotImplemented: - * res = Py_TYPE(other).tp_richcompare(other, this, Py_EQ) # <<<<<<<<<<<<<< - * if res is _NotImplemented: - * return 0 - */ - __pyx_t_3 = Py_TYPE(__pyx_v_other)->tp_richcompare(__pyx_v_other, __pyx_v_this, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_v_res); - __pyx_v_res = __pyx_t_3; - __pyx_t_3 = 0; - - /* "bzrlib/_simple_set_pyx.pyx":81 - * if res is _NotImplemented: - * res = Py_TYPE(other).tp_richcompare(other, this, Py_EQ) - * if res is _NotImplemented: # <<<<<<<<<<<<<< - * return 0 - * if res: - */ - __pyx_t_1 = (__pyx_v_res == __pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented); - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":82 - * res = Py_TYPE(other).tp_richcompare(other, this, Py_EQ) - * if res is _NotImplemented: - * return 0 # <<<<<<<<<<<<<< - * if res: - * return 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":78 */ + __pyx_3 = Py_TYPE(__pyx_v_this)->tp_richcompare(__pyx_v_this,__pyx_v_other,Py_EQ); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; goto __pyx_L1;} + Py_DECREF(__pyx_v_res); + __pyx_v_res = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":79 */ + __pyx_1 = __pyx_v_res == __pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented; + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":80 */ + __pyx_3 = Py_TYPE(__pyx_v_other)->tp_richcompare(__pyx_v_other,__pyx_v_this,Py_EQ); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;} + Py_DECREF(__pyx_v_res); + __pyx_v_res = __pyx_3; + __pyx_3 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":81 */ + __pyx_1 = __pyx_v_res == __pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented; + if (__pyx_1) { __pyx_r = 0; goto __pyx_L0; - goto __pyx_L6; + goto __pyx_L5; } - __pyx_L6:; - goto __pyx_L5; + __pyx_L5:; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; - /* "bzrlib/_simple_set_pyx.pyx":83 - * if res is _NotImplemented: - * return 0 - * if res: # <<<<<<<<<<<<<< - * return 1 - * return 0 - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_res); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":84 - * return 0 - * if res: - * return 1 # <<<<<<<<<<<<<< - * return 0 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":83 */ + __pyx_1 = PyObject_IsTrue(__pyx_v_res); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;} + if (__pyx_1) { __pyx_r = 1; goto __pyx_L0; - goto __pyx_L7; + goto __pyx_L6; } - __pyx_L7:; + __pyx_L6:; - /* "bzrlib/_simple_set_pyx.pyx":85 - * if res: - * return 1 - * return 0 # <<<<<<<<<<<<<< - * - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":85 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._simple_set_pyx._is_equal"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_DECREF(__pyx_v_res); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_res); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":105 - * DEF DEFAULT_SIZE=1024 - * - * def __init__(self): # <<<<<<<<<<<<<< - * cdef Py_ssize_t size, n_bytes - * - */ - -static int __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_size; Py_ssize_t __pyx_v_n_bytes; int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { - __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} - if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; - - /* "bzrlib/_simple_set_pyx.pyx":108 - * cdef Py_ssize_t size, n_bytes - * - * size = DEFAULT_SIZE # <<<<<<<<<<<<<< - * self._mask = size - 1 - * self._used = 0 - */ + int __pyx_1; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":108 */ __pyx_v_size = 1024; - /* "bzrlib/_simple_set_pyx.pyx":109 - * - * size = DEFAULT_SIZE - * self._mask = size - 1 # <<<<<<<<<<<<<< - * self._used = 0 - * self._fill = 0 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":109 */ ((struct SimpleSetObject *)__pyx_v_self)->_mask = (__pyx_v_size - 1); - /* "bzrlib/_simple_set_pyx.pyx":110 - * size = DEFAULT_SIZE - * self._mask = size - 1 - * self._used = 0 # <<<<<<<<<<<<<< - * self._fill = 0 - * n_bytes = sizeof(PyObject*) * size; - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":110 */ ((struct SimpleSetObject *)__pyx_v_self)->_used = 0; - /* "bzrlib/_simple_set_pyx.pyx":111 - * self._mask = size - 1 - * self._used = 0 - * self._fill = 0 # <<<<<<<<<<<<<< - * n_bytes = sizeof(PyObject*) * size; - * self._table = PyMem_Malloc(n_bytes) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":111 */ ((struct SimpleSetObject *)__pyx_v_self)->_fill = 0; - /* "bzrlib/_simple_set_pyx.pyx":112 - * self._used = 0 - * self._fill = 0 - * n_bytes = sizeof(PyObject*) * size; # <<<<<<<<<<<<<< - * self._table = PyMem_Malloc(n_bytes) - * if self._table == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":112 */ __pyx_v_n_bytes = ((sizeof(PyObject *)) * __pyx_v_size); - /* "bzrlib/_simple_set_pyx.pyx":113 - * self._fill = 0 - * n_bytes = sizeof(PyObject*) * size; - * self._table = PyMem_Malloc(n_bytes) # <<<<<<<<<<<<<< - * if self._table == NULL: - * raise MemoryError() - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":113 */ ((struct SimpleSetObject *)__pyx_v_self)->_table = ((PyObject **)PyMem_Malloc(__pyx_v_n_bytes)); - /* "bzrlib/_simple_set_pyx.pyx":114 - * n_bytes = sizeof(PyObject*) * size; - * self._table = PyMem_Malloc(n_bytes) - * if self._table == NULL: # <<<<<<<<<<<<<< - * raise MemoryError() - * memset(self._table, 0, n_bytes) - */ - __pyx_t_1 = (((struct SimpleSetObject *)__pyx_v_self)->_table == NULL); - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":115 - * self._table = PyMem_Malloc(n_bytes) - * if self._table == NULL: - * raise MemoryError() # <<<<<<<<<<<<<< - * memset(self._table, 0, n_bytes) - * - */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":114 */ + __pyx_1 = (((struct SimpleSetObject *)__pyx_v_self)->_table == NULL); + if (__pyx_1) { + __pyx_2 = PyObject_CallObject(PyExc_MemoryError, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_simple_set_pyx.pyx":116 - * if self._table == NULL: - * raise MemoryError() - * memset(self._table, 0, n_bytes) # <<<<<<<<<<<<<< - * - * def __sizeof__(self): - */ - memset(((struct SimpleSetObject *)__pyx_v_self)->_table, 0, __pyx_v_n_bytes); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":116 */ + memset(((struct SimpleSetObject *)__pyx_v_self)->_table,0,__pyx_v_n_bytes); __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet.__init__"); __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":118 - * memset(self._table, 0, n_bytes) - * - * def __sizeof__(self): # <<<<<<<<<<<<<< - * # Note: Pyrex doesn't allow sizeof(class) so we re-implement it here. - * # Bits are: - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_1__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_1__sizeof__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__sizeof__"); - - /* "bzrlib/_simple_set_pyx.pyx":128 - * # better than no estimate at all - * # return sizeof(SimpleSet) + (self._mask + 1) * (sizeof(PyObject*)) - * return (sizeof(PyObject) + sizeof(void*) # <<<<<<<<<<<<<< - * + 3*sizeof(Py_ssize_t) + sizeof(PyObject**) - * + (self._mask + 1) * sizeof(PyObject*)) - */ - __Pyx_XDECREF(__pyx_r); - - /* "bzrlib/_simple_set_pyx.pyx":130 - * return (sizeof(PyObject) + sizeof(void*) - * + 3*sizeof(Py_ssize_t) + sizeof(PyObject**) - * + (self._mask + 1) * sizeof(PyObject*)) # <<<<<<<<<<<<<< - * - * def __dealloc__(self): - */ - __pyx_t_1 = __Pyx_PyInt_FromSize_t((((((sizeof(PyObject)) + (sizeof(void *))) + (3 * (sizeof(Py_ssize_t)))) + (sizeof(PyObject **))) + ((((struct SimpleSetObject *)__pyx_v_self)->_mask + 1) * (sizeof(PyObject *))))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___sizeof__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___sizeof__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyInt_FromSsize_t((((((sizeof(PyObject)) + (sizeof(void *))) + (3 * (sizeof(Py_ssize_t)))) + (sizeof(PyObject **))) + ((((struct SimpleSetObject *)__pyx_v_self)->_mask + 1) * (sizeof(PyObject *))))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet.__sizeof__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":132 - * + (self._mask + 1) * sizeof(PyObject*)) - * - * def __dealloc__(self): # <<<<<<<<<<<<<< - * if self._table != NULL: - * PyMem_Free(self._table) - */ - -static void __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_2__dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_2__dealloc__(PyObject *__pyx_v_self) { - int __pyx_t_1; - __Pyx_RefNannySetupContext("__dealloc__"); - - /* "bzrlib/_simple_set_pyx.pyx":133 - * - * def __dealloc__(self): - * if self._table != NULL: # <<<<<<<<<<<<<< - * PyMem_Free(self._table) - * self._table = NULL - */ - __pyx_t_1 = (((struct SimpleSetObject *)__pyx_v_self)->_table != NULL); - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":134 - * def __dealloc__(self): - * if self._table != NULL: - * PyMem_Free(self._table) # <<<<<<<<<<<<<< - * self._table = NULL - * - */ +static void __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___dealloc__(PyObject *__pyx_v_self) { + int __pyx_1; + Py_INCREF(__pyx_v_self); + __pyx_1 = (((struct SimpleSetObject *)__pyx_v_self)->_table != NULL); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":134 */ PyMem_Free(((struct SimpleSetObject *)__pyx_v_self)->_table); - /* "bzrlib/_simple_set_pyx.pyx":135 - * if self._table != NULL: - * PyMem_Free(self._table) - * self._table = NULL # <<<<<<<<<<<<<< - * - * property used: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":135 */ ((struct SimpleSetObject *)__pyx_v_self)->_table = NULL; - goto __pyx_L5; + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); } -/* "bzrlib/_simple_set_pyx.pyx":138 - * - * property used: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._used - * - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4used___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4used___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "bzrlib/_simple_set_pyx.pyx":139 - * property used: - * def __get__(self): - * return self._used # <<<<<<<<<<<<<< - * - * property fill: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(((struct SimpleSetObject *)__pyx_v_self)->_used); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_4used___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_4used___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyInt_FromSsize_t(((struct SimpleSetObject *)__pyx_v_self)->_used); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet.used.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":142 - * - * property fill: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._fill - * - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4fill___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4fill___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "bzrlib/_simple_set_pyx.pyx":143 - * property fill: - * def __get__(self): - * return self._fill # <<<<<<<<<<<<<< - * - * property mask: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(((struct SimpleSetObject *)__pyx_v_self)->_fill); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_4fill___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_4fill___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyInt_FromSsize_t(((struct SimpleSetObject *)__pyx_v_self)->_fill); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet.fill.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":146 - * - * property mask: - * def __get__(self): # <<<<<<<<<<<<<< - * return self._mask - * - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4mask___get__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4mask___get__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("__get__"); - - /* "bzrlib/_simple_set_pyx.pyx":147 - * property mask: - * def __get__(self): - * return self._mask # <<<<<<<<<<<<<< - * - * def _memory_size(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyInt_FromSsize_t(((struct SimpleSetObject *)__pyx_v_self)->_mask); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_4mask___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_4mask___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyInt_FromSsize_t(((struct SimpleSetObject *)__pyx_v_self)->_mask); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet.mask.__get__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":149 - * return self._mask - * - * def _memory_size(self): # <<<<<<<<<<<<<< - * """Return the number of bytes of memory consumed by this class.""" - * return sizeof(self) + (sizeof(PyObject*)*(self._mask + 1)) - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_3_memory_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static char __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_3_memory_size[] = "Return the number of bytes of memory consumed by this class."; -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_3_memory_size(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("_memory_size"); - - /* "bzrlib/_simple_set_pyx.pyx":151 - * def _memory_size(self): - * """Return the number of bytes of memory consumed by this class.""" - * return sizeof(self) + (sizeof(PyObject*)*(self._mask + 1)) # <<<<<<<<<<<<<< - * - * def __len__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyInt_FromSize_t(((sizeof(__pyx_v_self)) + ((sizeof(PyObject *)) * (((struct SimpleSetObject *)__pyx_v_self)->_mask + 1)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__memory_size(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet__memory_size[] = "Return the number of bytes of memory consumed by this class."; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__memory_size(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyInt_FromSsize_t(((sizeof(__pyx_v_self)) + ((sizeof(PyObject *)) * (((struct SimpleSetObject *)__pyx_v_self)->_mask + 1)))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet._memory_size"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":153 - * return sizeof(self) + (sizeof(PyObject*)*(self._mask + 1)) - * - * def __len__(self): # <<<<<<<<<<<<<< - * return self._used - * - */ - -static Py_ssize_t __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4__len__(PyObject *__pyx_v_self); /*proto*/ -static Py_ssize_t __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4__len__(PyObject *__pyx_v_self) { +static Py_ssize_t __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___len__(PyObject *__pyx_v_self); /*proto*/ +static Py_ssize_t __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___len__(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; - __Pyx_RefNannySetupContext("__len__"); - - /* "bzrlib/_simple_set_pyx.pyx":154 - * - * def __len__(self): - * return self._used # <<<<<<<<<<<<<< - * - * def _test_lookup(self, key): - */ + Py_INCREF(__pyx_v_self); __pyx_r = ((struct SimpleSetObject *)__pyx_v_self)->_used; goto __pyx_L0; __pyx_r = 0; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":156 - * return self._used - * - * def _test_lookup(self, key): # <<<<<<<<<<<<<< - * cdef PyObject **slot - * - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_5_test_lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_5_test_lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__test_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__test_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; PyObject **__pyx_v_slot; PyObject *__pyx_v_res; - PyObject *__pyx_r = NULL; - PyObject **__pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("_test_lookup"); - __pyx_v_res = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_simple_set_pyx.pyx":159 - * cdef PyObject **slot - * - * slot = _lookup(self, key) # <<<<<<<<<<<<<< - * if slot[0] == NULL: - * res = '' - */ - __pyx_t_1 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(((struct SimpleSetObject *)__pyx_v_self), __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_slot = __pyx_t_1; - - /* "bzrlib/_simple_set_pyx.pyx":160 - * - * slot = _lookup(self, key) - * if slot[0] == NULL: # <<<<<<<<<<<<<< - * res = '' - * elif slot[0] == _dummy: - */ - __pyx_t_2 = ((__pyx_v_slot[0]) == NULL); - if (__pyx_t_2) { - - /* "bzrlib/_simple_set_pyx.pyx":161 - * slot = _lookup(self, key) - * if slot[0] == NULL: - * res = '' # <<<<<<<<<<<<<< - * elif slot[0] == _dummy: - * res = '' - */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_1)); - __Pyx_DECREF(__pyx_v_res); - __pyx_v_res = ((PyObject *)__pyx_kp_s_1); - goto __pyx_L5; - } - - /* "bzrlib/_simple_set_pyx.pyx":162 - * if slot[0] == NULL: - * res = '' - * elif slot[0] == _dummy: # <<<<<<<<<<<<<< - * res = '' - * else: - */ - __pyx_t_2 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); - if (__pyx_t_2) { - - /* "bzrlib/_simple_set_pyx.pyx":163 - * res = '' - * elif slot[0] == _dummy: - * res = '' # <<<<<<<<<<<<<< - * else: - * res = slot[0] - */ - __Pyx_INCREF(((PyObject *)__pyx_kp_s_2)); - __Pyx_DECREF(__pyx_v_res); - __pyx_v_res = ((PyObject *)__pyx_kp_s_2); - goto __pyx_L5; + PyObject *__pyx_r; + PyObject **__pyx_1; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + static char *__pyx_argnames[] = {"key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_v_res = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":159 */ + __pyx_1 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(((struct SimpleSetObject *)__pyx_v_self),__pyx_v_key); if (__pyx_1 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;} + __pyx_v_slot = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":160 */ + __pyx_2 = ((__pyx_v_slot[0]) == NULL); + if (__pyx_2) { + Py_INCREF(__pyx_k1p); + Py_DECREF(__pyx_v_res); + __pyx_v_res = __pyx_k1p; + goto __pyx_L2; + } + __pyx_2 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); + if (__pyx_2) { + Py_INCREF(__pyx_k2p); + Py_DECREF(__pyx_v_res); + __pyx_v_res = __pyx_k2p; + goto __pyx_L2; } /*else*/ { - - /* "bzrlib/_simple_set_pyx.pyx":165 - * res = '' - * else: - * res = slot[0] # <<<<<<<<<<<<<< - * return (slot - self._table), res - * - */ - __pyx_t_3 = (__pyx_v_slot[0]); - __Pyx_INCREF(((PyObject *)__pyx_t_3)); - __Pyx_DECREF(__pyx_v_res); - __pyx_v_res = ((PyObject *)__pyx_t_3); - } - __pyx_L5:; - - /* "bzrlib/_simple_set_pyx.pyx":166 - * else: - * res = slot[0] - * return (slot - self._table), res # <<<<<<<<<<<<<< - * - * def __contains__(self, key): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyInt_FromLong((__pyx_v_slot - ((struct SimpleSetObject *)__pyx_v_self)->_table)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_5)); - PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_res); - PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_res); - __Pyx_GIVEREF(__pyx_v_res); - __pyx_t_4 = 0; - __pyx_r = ((PyObject *)__pyx_t_5); - __pyx_t_5 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); + Py_INCREF(((PyObject *)(__pyx_v_slot[0]))); + Py_DECREF(__pyx_v_res); + __pyx_v_res = ((PyObject *)(__pyx_v_slot[0])); + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":166 */ + __pyx_3 = PyInt_FromLong(((int)(__pyx_v_slot - ((struct SimpleSetObject *)__pyx_v_self)->_table))); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + Py_INCREF(__pyx_v_res); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_res); + __pyx_3 = 0; + __pyx_r = __pyx_4; + __pyx_4 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet._test_lookup"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_res); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_res); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":168 - * return (slot - self._table), res - * - * def __contains__(self, key): # <<<<<<<<<<<<<< - * """Is key present in this SimpleSet.""" - * cdef PyObject **slot - */ - -static int __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_6__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static char __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_6__contains__[] = "Is key present in this SimpleSet."; -struct wrapperbase __pyx_wrapperbase_6bzrlib_15_simple_set_pyx_9SimpleSet_6__contains__; -static int __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_6__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { +static int __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static int __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject **__pyx_v_slot; int __pyx_r; - PyObject **__pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("__contains__"); - - /* "bzrlib/_simple_set_pyx.pyx":172 - * cdef PyObject **slot - * - * slot = _lookup(self, key) # <<<<<<<<<<<<<< - * if slot[0] == NULL or slot[0] == _dummy: - * return False - */ - __pyx_t_1 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(((struct SimpleSetObject *)__pyx_v_self), __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_slot = __pyx_t_1; - - /* "bzrlib/_simple_set_pyx.pyx":173 - * - * slot = _lookup(self, key) - * if slot[0] == NULL or slot[0] == _dummy: # <<<<<<<<<<<<<< - * return False - * return True - */ - __pyx_t_2 = ((__pyx_v_slot[0]) == NULL); - if (!__pyx_t_2) { - __pyx_t_3 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = __pyx_t_2; - } - if (__pyx_t_4) { - - /* "bzrlib/_simple_set_pyx.pyx":174 - * slot = _lookup(self, key) - * if slot[0] == NULL or slot[0] == _dummy: - * return False # <<<<<<<<<<<<<< - * return True - * - */ - __pyx_r = 0; + PyObject **__pyx_1; + int __pyx_2; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":172 */ + __pyx_1 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(((struct SimpleSetObject *)__pyx_v_self),__pyx_v_key); if (__pyx_1 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} + __pyx_v_slot = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":173 */ + __pyx_2 = ((__pyx_v_slot[0]) == NULL); + if (!__pyx_2) { + __pyx_2 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); + } + if (__pyx_2) { + __pyx_2 = PyInt_AsLong(Py_False); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + __pyx_r = __pyx_2; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_simple_set_pyx.pyx":175 - * if slot[0] == NULL or slot[0] == _dummy: - * return False - * return True # <<<<<<<<<<<<<< - * - * cdef PyObject *_get(self, object key) except? NULL: - */ - __pyx_r = 1; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":175 */ + __pyx_2 = PyInt_AsLong(Py_True); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + __pyx_r = __pyx_2; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet.__contains__"); __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":177 - * return True - * - * cdef PyObject *_get(self, object key) except? NULL: # <<<<<<<<<<<<<< - * """Return the object (or nothing) define at the given location.""" - * cdef PyObject **slot - */ - -static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__get(struct SimpleSetObject *__pyx_v_self, PyObject *__pyx_v_key) { +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__get(struct SimpleSetObject *__pyx_v_self,PyObject *__pyx_v_key) { PyObject **__pyx_v_slot; PyObject *__pyx_r; - PyObject **__pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("_get"); - - /* "bzrlib/_simple_set_pyx.pyx":181 - * cdef PyObject **slot - * - * slot = _lookup(self, key) # <<<<<<<<<<<<<< - * if slot[0] == NULL or slot[0] == _dummy: - * return NULL - */ - __pyx_t_1 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(__pyx_v_self, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_slot = __pyx_t_1; - - /* "bzrlib/_simple_set_pyx.pyx":182 - * - * slot = _lookup(self, key) - * if slot[0] == NULL or slot[0] == _dummy: # <<<<<<<<<<<<<< - * return NULL - * return slot[0] - */ - __pyx_t_2 = ((__pyx_v_slot[0]) == NULL); - if (!__pyx_t_2) { - __pyx_t_3 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = __pyx_t_2; - } - if (__pyx_t_4) { - - /* "bzrlib/_simple_set_pyx.pyx":183 - * slot = _lookup(self, key) - * if slot[0] == NULL or slot[0] == _dummy: - * return NULL # <<<<<<<<<<<<<< - * return slot[0] - * - */ + PyObject **__pyx_1; + int __pyx_2; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":181 */ + __pyx_1 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(__pyx_v_self,__pyx_v_key); if (__pyx_1 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + __pyx_v_slot = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":182 */ + __pyx_2 = ((__pyx_v_slot[0]) == NULL); + if (!__pyx_2) { + __pyx_2 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); + } + if (__pyx_2) { __pyx_r = NULL; goto __pyx_L0; - goto __pyx_L3; + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_simple_set_pyx.pyx":184 - * if slot[0] == NULL or slot[0] == _dummy: - * return NULL - * return slot[0] # <<<<<<<<<<<<<< - * - * def __getitem__(self, key): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":184 */ __pyx_r = (__pyx_v_slot[0]); goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet._get"); __pyx_r = NULL; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":186 - * return slot[0] - * - * def __getitem__(self, key): # <<<<<<<<<<<<<< - * """Return a stored item that is equivalent to key.""" - * cdef PyObject *py_val - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static char __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_7__getitem__[] = "Return a stored item that is equivalent to key."; -struct wrapperbase __pyx_wrapperbase_6bzrlib_15_simple_set_pyx_9SimpleSet_7__getitem__; -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { PyObject *__pyx_v_py_val; PyObject *__pyx_v_val; - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__getitem__"); - __pyx_v_val = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_simple_set_pyx.pyx":190 - * cdef PyObject *py_val - * - * py_val = self._get(key) # <<<<<<<<<<<<<< - * if py_val == NULL: - * raise KeyError("Key %s is not present" % key) - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_v_self)->__pyx_vtab)->_get(((struct SimpleSetObject *)__pyx_v_self), __pyx_v_key); if (unlikely(__pyx_t_1 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_py_val = __pyx_t_1; - - /* "bzrlib/_simple_set_pyx.pyx":191 - * - * py_val = self._get(key) - * if py_val == NULL: # <<<<<<<<<<<<<< - * raise KeyError("Key %s is not present" % key) - * val = (py_val) - */ - __pyx_t_2 = (__pyx_v_py_val == NULL); - if (__pyx_t_2) { - - /* "bzrlib/_simple_set_pyx.pyx":192 - * py_val = self._get(key) - * if py_val == NULL: - * raise KeyError("Key %s is not present" % key) # <<<<<<<<<<<<<< - * val = (py_val) - * return val - */ - __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_v_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_3)); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_4)); - PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3)); - __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); - __pyx_t_3 = 0; - __pyx_t_3 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "bzrlib/_simple_set_pyx.pyx":193 - * if py_val == NULL: - * raise KeyError("Key %s is not present" % key) - * val = (py_val) # <<<<<<<<<<<<<< - * return val - * - */ - __Pyx_INCREF(((PyObject *)__pyx_v_py_val)); - __Pyx_DECREF(__pyx_v_val); + PyObject *__pyx_r; + PyObject *__pyx_1; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_v_val = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":190 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_v_self)->__pyx_vtab)->_get(((struct SimpleSetObject *)__pyx_v_self),__pyx_v_key); if (__pyx_1 == NULL && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;} + __pyx_v_py_val = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":191 */ + __pyx_2 = (__pyx_v_py_val == NULL); + if (__pyx_2) { + __pyx_3 = PyNumber_Remainder(__pyx_k3p, __pyx_v_key); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(PyExc_KeyError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":193 */ + Py_INCREF(((PyObject *)__pyx_v_py_val)); + Py_DECREF(__pyx_v_val); __pyx_v_val = ((PyObject *)__pyx_v_py_val); - /* "bzrlib/_simple_set_pyx.pyx":194 - * raise KeyError("Key %s is not present" % key) - * val = (py_val) - * return val # <<<<<<<<<<<<<< - * - * cdef int _insert_clean(self, PyObject *key) except -1: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_val); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":194 */ + Py_INCREF(__pyx_v_val); __pyx_r = __pyx_v_val; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet.__getitem__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_val); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_val); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":196 - * return val - * - * cdef int _insert_clean(self, PyObject *key) except -1: # <<<<<<<<<<<<<< - * """Insert a key into self.table. - * - */ - -static int __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__insert_clean(struct SimpleSetObject *__pyx_v_self, PyObject *__pyx_v_key) { +static int __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__insert_clean(struct SimpleSetObject *__pyx_v_self,PyObject *__pyx_v_key) { size_t __pyx_v_i; size_t __pyx_v_n_lookup; long __pyx_v_the_hash; @@ -1555,206 +639,111 @@ PyObject **__pyx_v_slot; Py_ssize_t __pyx_v_mask; int __pyx_r; - long __pyx_t_1; - size_t __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("_insert_clean"); - - /* "bzrlib/_simple_set_pyx.pyx":208 - * cdef Py_ssize_t mask - * - * mask = self._mask # <<<<<<<<<<<<<< - * table = self._table - * - */ + long __pyx_1; + size_t __pyx_2; + int __pyx_3; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":208 */ __pyx_v_mask = __pyx_v_self->_mask; - /* "bzrlib/_simple_set_pyx.pyx":209 - * - * mask = self._mask - * table = self._table # <<<<<<<<<<<<<< - * - * the_hash = PyObject_Hash(key) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":209 */ __pyx_v_table = __pyx_v_self->_table; - /* "bzrlib/_simple_set_pyx.pyx":211 - * table = self._table - * - * the_hash = PyObject_Hash(key) # <<<<<<<<<<<<<< - * i = the_hash - * for n_lookup from 0 <= n_lookup <= mask: # Don't loop forever - */ - __pyx_t_1 = PyObject_Hash(__pyx_v_key); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_the_hash = __pyx_t_1; - - /* "bzrlib/_simple_set_pyx.pyx":212 - * - * the_hash = PyObject_Hash(key) - * i = the_hash # <<<<<<<<<<<<<< - * for n_lookup from 0 <= n_lookup <= mask: # Don't loop forever - * slot = &table[i & mask] - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":211 */ + __pyx_1 = PyObject_Hash(__pyx_v_key); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;} + __pyx_v_the_hash = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":212 */ __pyx_v_i = __pyx_v_the_hash; - /* "bzrlib/_simple_set_pyx.pyx":213 - * the_hash = PyObject_Hash(key) - * i = the_hash - * for n_lookup from 0 <= n_lookup <= mask: # Don't loop forever # <<<<<<<<<<<<<< - * slot = &table[i & mask] - * if slot[0] == NULL: - */ - __pyx_t_2 = ((size_t)__pyx_v_mask); - for (__pyx_v_n_lookup = 0; __pyx_v_n_lookup <= __pyx_t_2; __pyx_v_n_lookup++) { - - /* "bzrlib/_simple_set_pyx.pyx":214 - * i = the_hash - * for n_lookup from 0 <= n_lookup <= mask: # Don't loop forever - * slot = &table[i & mask] # <<<<<<<<<<<<<< - * if slot[0] == NULL: - * slot[0] = key - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":213 */ + __pyx_2 = __pyx_v_mask; + for (__pyx_v_n_lookup = 0; __pyx_v_n_lookup <= __pyx_2; ++__pyx_v_n_lookup) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":214 */ __pyx_v_slot = (&(__pyx_v_table[(__pyx_v_i & __pyx_v_mask)])); - /* "bzrlib/_simple_set_pyx.pyx":215 - * for n_lookup from 0 <= n_lookup <= mask: # Don't loop forever - * slot = &table[i & mask] - * if slot[0] == NULL: # <<<<<<<<<<<<<< - * slot[0] = key - * self._fill = self._fill + 1 - */ - __pyx_t_3 = ((__pyx_v_slot[0]) == NULL); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":216 - * slot = &table[i & mask] - * if slot[0] == NULL: - * slot[0] = key # <<<<<<<<<<<<<< - * self._fill = self._fill + 1 - * self._used = self._used + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":215 */ + __pyx_3 = ((__pyx_v_slot[0]) == NULL); + if (__pyx_3) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":216 */ (__pyx_v_slot[0]) = __pyx_v_key; - /* "bzrlib/_simple_set_pyx.pyx":217 - * if slot[0] == NULL: - * slot[0] = key - * self._fill = self._fill + 1 # <<<<<<<<<<<<<< - * self._used = self._used + 1 - * return 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":217 */ __pyx_v_self->_fill = (__pyx_v_self->_fill + 1); - /* "bzrlib/_simple_set_pyx.pyx":218 - * slot[0] = key - * self._fill = self._fill + 1 - * self._used = self._used + 1 # <<<<<<<<<<<<<< - * return 1 - * i = i + 1 + n_lookup - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":218 */ __pyx_v_self->_used = (__pyx_v_self->_used + 1); - /* "bzrlib/_simple_set_pyx.pyx":219 - * self._fill = self._fill + 1 - * self._used = self._used + 1 - * return 1 # <<<<<<<<<<<<<< - * i = i + 1 + n_lookup - * raise RuntimeError('ran out of slots.') - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":219 */ __pyx_r = 1; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; - /* "bzrlib/_simple_set_pyx.pyx":220 - * self._used = self._used + 1 - * return 1 - * i = i + 1 + n_lookup # <<<<<<<<<<<<<< - * raise RuntimeError('ran out of slots.') - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":220 */ __pyx_v_i = ((__pyx_v_i + 1) + __pyx_v_n_lookup); } - /* "bzrlib/_simple_set_pyx.pyx":221 - * return 1 - * i = i + 1 + n_lookup - * raise RuntimeError('ran out of slots.') # <<<<<<<<<<<<<< - * - * def _py_resize(self, min_used): - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":221 */ + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} + Py_INCREF(__pyx_k4p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k4p); + __pyx_5 = PyObject_CallObject(PyExc_RuntimeError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_5, 0, 0); + Py_DECREF(__pyx_5); __pyx_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;} __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet._insert_clean"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":223 - * raise RuntimeError('ran out of slots.') - * - * def _py_resize(self, min_used): # <<<<<<<<<<<<<< - * """Do not use this directly, it is only exposed for testing.""" - * return self._resize(min_used) - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_8_py_resize(PyObject *__pyx_v_self, PyObject *__pyx_v_min_used); /*proto*/ -static char __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_8_py_resize[] = "Do not use this directly, it is only exposed for testing."; -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_8_py_resize(PyObject *__pyx_v_self, PyObject *__pyx_v_min_used) { - PyObject *__pyx_r = NULL; - Py_ssize_t __pyx_t_1; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - __Pyx_RefNannySetupContext("_py_resize"); - - /* "bzrlib/_simple_set_pyx.pyx":225 - * def _py_resize(self, min_used): - * """Do not use this directly, it is only exposed for testing.""" - * return self._resize(min_used) # <<<<<<<<<<<<<< - * - * cdef Py_ssize_t _resize(self, Py_ssize_t min_used) except -1: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_min_used); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_v_self)->__pyx_vtab)->_resize(((struct SimpleSetObject *)__pyx_v_self), __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__py_resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet__py_resize[] = "Do not use this directly, it is only exposed for testing."; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__py_resize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_min_used = 0; + PyObject *__pyx_r; + Py_ssize_t __pyx_1; + Py_ssize_t __pyx_2; + PyObject *__pyx_3 = 0; + static char *__pyx_argnames[] = {"min_used",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_min_used)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_min_used); + __pyx_1 = PyInt_AsSsize_t(__pyx_v_min_used); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_v_self)->__pyx_vtab)->_resize(((struct SimpleSetObject *)__pyx_v_self),__pyx_1); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + __pyx_3 = PyInt_FromSsize_t(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); + __pyx_L1:; + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet._py_resize"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_min_used); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":227 - * return self._resize(min_used) - * - * cdef Py_ssize_t _resize(self, Py_ssize_t min_used) except -1: # <<<<<<<<<<<<<< - * """Resize the internal table. - * - */ - -static Py_ssize_t __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__resize(struct SimpleSetObject *__pyx_v_self, Py_ssize_t __pyx_v_min_used) { +static Py_ssize_t __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__resize(struct SimpleSetObject *__pyx_v_self,Py_ssize_t __pyx_v_min_used) { Py_ssize_t __pyx_v_new_size; Py_ssize_t __pyx_v_n_bytes; Py_ssize_t __pyx_v_remaining; @@ -1762,1338 +751,634 @@ PyObject **__pyx_v_old_table; PyObject **__pyx_v_slot; Py_ssize_t __pyx_r; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - __Pyx_RefNannySetupContext("_resize"); - - /* "bzrlib/_simple_set_pyx.pyx":239 - * cdef PyObject **new_table, **old_table, **slot - * - * new_size = DEFAULT_SIZE # <<<<<<<<<<<<<< - * while new_size <= min_used and new_size > 0: - * new_size = new_size << 1 - */ + int __pyx_1; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":239 */ __pyx_v_new_size = 1024; - /* "bzrlib/_simple_set_pyx.pyx":240 - * - * new_size = DEFAULT_SIZE - * while new_size <= min_used and new_size > 0: # <<<<<<<<<<<<<< - * new_size = new_size << 1 - * # We rolled over our signed size field - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":240 */ while (1) { - __pyx_t_1 = (__pyx_v_new_size <= __pyx_v_min_used); - if (__pyx_t_1) { - __pyx_t_2 = (__pyx_v_new_size > 0); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; + __pyx_1 = (__pyx_v_new_size <= __pyx_v_min_used); + if (__pyx_1) { + __pyx_1 = (__pyx_v_new_size > 0); } - if (!__pyx_t_3) break; - - /* "bzrlib/_simple_set_pyx.pyx":241 - * new_size = DEFAULT_SIZE - * while new_size <= min_used and new_size > 0: - * new_size = new_size << 1 # <<<<<<<<<<<<<< - * # We rolled over our signed size field - * if new_size <= 0: - */ + if (!__pyx_1) break; __pyx_v_new_size = (__pyx_v_new_size << 1); } - /* "bzrlib/_simple_set_pyx.pyx":243 - * new_size = new_size << 1 - * # We rolled over our signed size field - * if new_size <= 0: # <<<<<<<<<<<<<< - * raise MemoryError() - * # Even if min_used == self._mask + 1, and we aren't changing the actual - */ - __pyx_t_3 = (__pyx_v_new_size <= 0); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":244 - * # We rolled over our signed size field - * if new_size <= 0: - * raise MemoryError() # <<<<<<<<<<<<<< - * # Even if min_used == self._mask + 1, and we aren't changing the actual - * # size, we will still run the algorithm so that dummy entries are - */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":243 */ + __pyx_1 = (__pyx_v_new_size <= 0); + if (__pyx_1) { + __pyx_2 = PyObject_CallObject(PyExc_MemoryError, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;} + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; - /* "bzrlib/_simple_set_pyx.pyx":252 - * # raise RuntimeError('cannot shrink SimpleSet to something' - * # ' smaller than the number of used slots.') - * n_bytes = sizeof(PyObject*) * new_size; # <<<<<<<<<<<<<< - * new_table = PyMem_Malloc(n_bytes) - * if new_table == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":252 */ __pyx_v_n_bytes = ((sizeof(PyObject *)) * __pyx_v_new_size); - /* "bzrlib/_simple_set_pyx.pyx":253 - * # ' smaller than the number of used slots.') - * n_bytes = sizeof(PyObject*) * new_size; - * new_table = PyMem_Malloc(n_bytes) # <<<<<<<<<<<<<< - * if new_table == NULL: - * raise MemoryError() - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":253 */ __pyx_v_new_table = ((PyObject **)PyMem_Malloc(__pyx_v_n_bytes)); - /* "bzrlib/_simple_set_pyx.pyx":254 - * n_bytes = sizeof(PyObject*) * new_size; - * new_table = PyMem_Malloc(n_bytes) - * if new_table == NULL: # <<<<<<<<<<<<<< - * raise MemoryError() - * - */ - __pyx_t_3 = (__pyx_v_new_table == NULL); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":255 - * new_table = PyMem_Malloc(n_bytes) - * if new_table == NULL: - * raise MemoryError() # <<<<<<<<<<<<<< - * - * old_table = self._table - */ - PyErr_NoMemory(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":254 */ + __pyx_1 = (__pyx_v_new_table == NULL); + if (__pyx_1) { + __pyx_2 = PyObject_CallObject(PyExc_MemoryError, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; goto __pyx_L1;} + goto __pyx_L5; } - __pyx_L6:; + __pyx_L5:; - /* "bzrlib/_simple_set_pyx.pyx":257 - * raise MemoryError() - * - * old_table = self._table # <<<<<<<<<<<<<< - * self._table = new_table - * memset(self._table, 0, n_bytes) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":257 */ __pyx_v_old_table = __pyx_v_self->_table; - /* "bzrlib/_simple_set_pyx.pyx":258 - * - * old_table = self._table - * self._table = new_table # <<<<<<<<<<<<<< - * memset(self._table, 0, n_bytes) - * self._mask = new_size - 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":258 */ __pyx_v_self->_table = __pyx_v_new_table; - /* "bzrlib/_simple_set_pyx.pyx":259 - * old_table = self._table - * self._table = new_table - * memset(self._table, 0, n_bytes) # <<<<<<<<<<<<<< - * self._mask = new_size - 1 - * self._used = 0 - */ - memset(__pyx_v_self->_table, 0, __pyx_v_n_bytes); - - /* "bzrlib/_simple_set_pyx.pyx":260 - * self._table = new_table - * memset(self._table, 0, n_bytes) - * self._mask = new_size - 1 # <<<<<<<<<<<<<< - * self._used = 0 - * remaining = self._fill - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":259 */ + memset(__pyx_v_self->_table,0,__pyx_v_n_bytes); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":260 */ __pyx_v_self->_mask = (__pyx_v_new_size - 1); - /* "bzrlib/_simple_set_pyx.pyx":261 - * memset(self._table, 0, n_bytes) - * self._mask = new_size - 1 - * self._used = 0 # <<<<<<<<<<<<<< - * remaining = self._fill - * self._fill = 0 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":261 */ __pyx_v_self->_used = 0; - /* "bzrlib/_simple_set_pyx.pyx":262 - * self._mask = new_size - 1 - * self._used = 0 - * remaining = self._fill # <<<<<<<<<<<<<< - * self._fill = 0 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":262 */ __pyx_v_remaining = __pyx_v_self->_fill; - /* "bzrlib/_simple_set_pyx.pyx":263 - * self._used = 0 - * remaining = self._fill - * self._fill = 0 # <<<<<<<<<<<<<< - * - * # Moving everything to the other table is refcount neutral, so we don't - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":263 */ __pyx_v_self->_fill = 0; - /* "bzrlib/_simple_set_pyx.pyx":267 - * # Moving everything to the other table is refcount neutral, so we don't - * # worry about it. - * slot = old_table # <<<<<<<<<<<<<< - * while remaining > 0: - * if slot[0] == NULL: # unused slot - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":267 */ __pyx_v_slot = __pyx_v_old_table; - /* "bzrlib/_simple_set_pyx.pyx":268 - * # worry about it. - * slot = old_table - * while remaining > 0: # <<<<<<<<<<<<<< - * if slot[0] == NULL: # unused slot - * pass - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":268 */ while (1) { - __pyx_t_3 = (__pyx_v_remaining > 0); - if (!__pyx_t_3) break; + __pyx_1 = (__pyx_v_remaining > 0); + if (!__pyx_1) break; - /* "bzrlib/_simple_set_pyx.pyx":269 - * slot = old_table - * while remaining > 0: - * if slot[0] == NULL: # unused slot # <<<<<<<<<<<<<< - * pass - * elif slot[0] == _dummy: # dummy slot - */ - __pyx_t_3 = ((__pyx_v_slot[0]) == NULL); - if (__pyx_t_3) { - goto __pyx_L9; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":269 */ + __pyx_1 = ((__pyx_v_slot[0]) == NULL); + if (__pyx_1) { + goto __pyx_L8; } - - /* "bzrlib/_simple_set_pyx.pyx":271 - * if slot[0] == NULL: # unused slot - * pass - * elif slot[0] == _dummy: # dummy slot # <<<<<<<<<<<<<< - * remaining = remaining - 1 - * else: # active slot - */ - __pyx_t_3 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":272 - * pass - * elif slot[0] == _dummy: # dummy slot - * remaining = remaining - 1 # <<<<<<<<<<<<<< - * else: # active slot - * remaining = remaining - 1 - */ + __pyx_1 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); + if (__pyx_1) { __pyx_v_remaining = (__pyx_v_remaining - 1); - goto __pyx_L9; + goto __pyx_L8; } /*else*/ { - /* "bzrlib/_simple_set_pyx.pyx":274 - * remaining = remaining - 1 - * else: # active slot - * remaining = remaining - 1 # <<<<<<<<<<<<<< - * self._insert_clean(slot[0]) - * slot = slot + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":274 */ __pyx_v_remaining = (__pyx_v_remaining - 1); - /* "bzrlib/_simple_set_pyx.pyx":275 - * else: # active slot - * remaining = remaining - 1 - * self._insert_clean(slot[0]) # <<<<<<<<<<<<<< - * slot = slot + 1 - * PyMem_Free(old_table) - */ - __pyx_t_4 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)__pyx_v_self->__pyx_vtab)->_insert_clean(__pyx_v_self, (__pyx_v_slot[0])); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":275 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)__pyx_v_self->__pyx_vtab)->_insert_clean(__pyx_v_self,(__pyx_v_slot[0])); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; goto __pyx_L1;} } - __pyx_L9:; + __pyx_L8:; - /* "bzrlib/_simple_set_pyx.pyx":276 - * remaining = remaining - 1 - * self._insert_clean(slot[0]) - * slot = slot + 1 # <<<<<<<<<<<<<< - * PyMem_Free(old_table) - * return new_size - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":276 */ __pyx_v_slot = (__pyx_v_slot + 1); } - /* "bzrlib/_simple_set_pyx.pyx":277 - * self._insert_clean(slot[0]) - * slot = slot + 1 - * PyMem_Free(old_table) # <<<<<<<<<<<<<< - * return new_size - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":277 */ PyMem_Free(__pyx_v_old_table); - /* "bzrlib/_simple_set_pyx.pyx":278 - * slot = slot + 1 - * PyMem_Free(old_table) - * return new_size # <<<<<<<<<<<<<< - * - * def add(self, key): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":278 */ __pyx_r = __pyx_v_new_size; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet._resize"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":280 - * return new_size - * - * def add(self, key): # <<<<<<<<<<<<<< - * """Similar to set.add(), start tracking this key. - * - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_9add(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static char __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_9add[] = "Similar to set.add(), start tracking this key.\n \n There is one small difference, which is that we return the object that\n is stored at the given location. (which is closer to the\n dict.setdefault() functionality.)\n "; -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_9add(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("add"); - - /* "bzrlib/_simple_set_pyx.pyx":287 - * dict.setdefault() functionality.) - * """ - * return self._add(key) # <<<<<<<<<<<<<< - * - * cdef object _add(self, key): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_v_self)->__pyx_vtab)->_add(((struct SimpleSetObject *)__pyx_v_self), __pyx_v_key); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_add[] = "Similar to set.add(), start tracking this key.\n \n There is one small difference, which is that we return the object that\n is stored at the given location. (which is closer to the\n dict.setdefault() functionality.)\n "; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {"key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_v_self)->__pyx_vtab)->_add(((struct SimpleSetObject *)__pyx_v_self),__pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet.add"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":289 - * return self._add(key) - * - * cdef object _add(self, key): # <<<<<<<<<<<<<< - * cdef PyObject **slot, *py_key - * cdef int added - */ - -static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__add(struct SimpleSetObject *__pyx_v_self, PyObject *__pyx_v_key) { +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__add(struct SimpleSetObject *__pyx_v_self,PyObject *__pyx_v_key) { PyObject **__pyx_v_slot; PyObject *__pyx_v_py_key; int __pyx_v_added; PyObject *__pyx_v_retval; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject **__pyx_t_5; - PyObject *__pyx_t_6; - Py_ssize_t __pyx_t_7; - __Pyx_RefNannySetupContext("_add"); - __pyx_v_retval = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_simple_set_pyx.pyx":293 - * cdef int added - * - * py_key = key # <<<<<<<<<<<<<< - * if (Py_TYPE(py_key).tp_richcompare == NULL - * or Py_TYPE(py_key).tp_hash == NULL): - */ + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject **__pyx_4; + Py_ssize_t __pyx_5; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_v_retval = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":293 */ __pyx_v_py_key = ((PyObject *)__pyx_v_key); - /* "bzrlib/_simple_set_pyx.pyx":294 - * - * py_key = key - * if (Py_TYPE(py_key).tp_richcompare == NULL # <<<<<<<<<<<<<< - * or Py_TYPE(py_key).tp_hash == NULL): - * raise TypeError('Types added to SimpleSet must implement' - */ - __pyx_t_1 = (Py_TYPE(__pyx_v_py_key)->tp_richcompare == NULL); - if (!__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":295 - * py_key = key - * if (Py_TYPE(py_key).tp_richcompare == NULL - * or Py_TYPE(py_key).tp_hash == NULL): # <<<<<<<<<<<<<< - * raise TypeError('Types added to SimpleSet must implement' - * ' both tp_richcompare and tp_hash') - */ - __pyx_t_2 = (Py_TYPE(__pyx_v_py_key)->tp_hash == NULL); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":296 - * if (Py_TYPE(py_key).tp_richcompare == NULL - * or Py_TYPE(py_key).tp_hash == NULL): - * raise TypeError('Types added to SimpleSet must implement' # <<<<<<<<<<<<<< - * ' both tp_richcompare and tp_hash') - * added = 0 - */ - __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":294 */ + __pyx_1 = (Py_TYPE(__pyx_v_py_key)->tp_richcompare == NULL); + if (!__pyx_1) { + __pyx_1 = (Py_TYPE(__pyx_v_py_key)->tp_hash == NULL); + } + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; goto __pyx_L1;} + Py_INCREF(__pyx_k5p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k5p); + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; goto __pyx_L1;} + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_simple_set_pyx.pyx":298 - * raise TypeError('Types added to SimpleSet must implement' - * ' both tp_richcompare and tp_hash') - * added = 0 # <<<<<<<<<<<<<< - * # We need at least one empty slot - * assert self._used < self._mask - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":298 */ __pyx_v_added = 0; - /* "bzrlib/_simple_set_pyx.pyx":300 - * added = 0 - * # We need at least one empty slot - * assert self._used < self._mask # <<<<<<<<<<<<<< - * slot = _lookup(self, key) - * if (slot[0] == NULL): - */ - #ifndef CYTHON_WITHOUT_ASSERTIONS - if (unlikely(!(__pyx_v_self->_used < __pyx_v_self->_mask))) { + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":300 */ + #ifndef PYREX_WITHOUT_ASSERTIONS + if (!(__pyx_v_self->_used < __pyx_v_self->_mask)) { PyErr_SetNone(PyExc_AssertionError); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; goto __pyx_L1;} } #endif - /* "bzrlib/_simple_set_pyx.pyx":301 - * # We need at least one empty slot - * assert self._used < self._mask - * slot = _lookup(self, key) # <<<<<<<<<<<<<< - * if (slot[0] == NULL): - * Py_INCREF(py_key) - */ - __pyx_t_5 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(__pyx_v_self, __pyx_v_key); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_slot = __pyx_t_5; - - /* "bzrlib/_simple_set_pyx.pyx":302 - * assert self._used < self._mask - * slot = _lookup(self, key) - * if (slot[0] == NULL): # <<<<<<<<<<<<<< - * Py_INCREF(py_key) - * self._fill = self._fill + 1 - */ - __pyx_t_3 = ((__pyx_v_slot[0]) == NULL); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":303 - * slot = _lookup(self, key) - * if (slot[0] == NULL): - * Py_INCREF(py_key) # <<<<<<<<<<<<<< - * self._fill = self._fill + 1 - * self._used = self._used + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":301 */ + __pyx_4 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(__pyx_v_self,__pyx_v_key); if (__pyx_4 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;} + __pyx_v_slot = __pyx_4; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":302 */ + __pyx_1 = ((__pyx_v_slot[0]) == NULL); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":303 */ Py_INCREF(__pyx_v_py_key); - /* "bzrlib/_simple_set_pyx.pyx":304 - * if (slot[0] == NULL): - * Py_INCREF(py_key) - * self._fill = self._fill + 1 # <<<<<<<<<<<<<< - * self._used = self._used + 1 - * slot[0] = py_key - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":304 */ __pyx_v_self->_fill = (__pyx_v_self->_fill + 1); - /* "bzrlib/_simple_set_pyx.pyx":305 - * Py_INCREF(py_key) - * self._fill = self._fill + 1 - * self._used = self._used + 1 # <<<<<<<<<<<<<< - * slot[0] = py_key - * added = 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":305 */ __pyx_v_self->_used = (__pyx_v_self->_used + 1); - /* "bzrlib/_simple_set_pyx.pyx":306 - * self._fill = self._fill + 1 - * self._used = self._used + 1 - * slot[0] = py_key # <<<<<<<<<<<<<< - * added = 1 - * elif (slot[0] == _dummy): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":306 */ (__pyx_v_slot[0]) = __pyx_v_py_key; - /* "bzrlib/_simple_set_pyx.pyx":307 - * self._used = self._used + 1 - * slot[0] = py_key - * added = 1 # <<<<<<<<<<<<<< - * elif (slot[0] == _dummy): - * Py_INCREF(py_key) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":307 */ __pyx_v_added = 1; - goto __pyx_L4; + goto __pyx_L3; } + __pyx_1 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); + if (__pyx_1) { - /* "bzrlib/_simple_set_pyx.pyx":308 - * slot[0] = py_key - * added = 1 - * elif (slot[0] == _dummy): # <<<<<<<<<<<<<< - * Py_INCREF(py_key) - * self._used = self._used + 1 - */ - __pyx_t_3 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":309 - * added = 1 - * elif (slot[0] == _dummy): - * Py_INCREF(py_key) # <<<<<<<<<<<<<< - * self._used = self._used + 1 - * slot[0] = py_key - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":309 */ Py_INCREF(__pyx_v_py_key); - /* "bzrlib/_simple_set_pyx.pyx":310 - * elif (slot[0] == _dummy): - * Py_INCREF(py_key) - * self._used = self._used + 1 # <<<<<<<<<<<<<< - * slot[0] = py_key - * added = 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":310 */ __pyx_v_self->_used = (__pyx_v_self->_used + 1); - /* "bzrlib/_simple_set_pyx.pyx":311 - * Py_INCREF(py_key) - * self._used = self._used + 1 - * slot[0] = py_key # <<<<<<<<<<<<<< - * added = 1 - * # No else: clause. If _lookup returns a pointer to - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":311 */ (__pyx_v_slot[0]) = __pyx_v_py_key; - /* "bzrlib/_simple_set_pyx.pyx":312 - * self._used = self._used + 1 - * slot[0] = py_key - * added = 1 # <<<<<<<<<<<<<< - * # No else: clause. If _lookup returns a pointer to - * # a live object, then we already have a value at this location. - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":312 */ __pyx_v_added = 1; - goto __pyx_L4; + goto __pyx_L3; } - __pyx_L4:; + __pyx_L3:; - /* "bzrlib/_simple_set_pyx.pyx":315 - * # No else: clause. If _lookup returns a pointer to - * # a live object, then we already have a value at this location. - * retval = (slot[0]) # <<<<<<<<<<<<<< - * # PySet and PyDict use a 2-3rds full algorithm, we'll follow suit - * if added and (self._fill * 3) >= ((self._mask + 1) * 2): - */ - __pyx_t_6 = (__pyx_v_slot[0]); - __Pyx_INCREF(((PyObject *)__pyx_t_6)); - __Pyx_DECREF(__pyx_v_retval); - __pyx_v_retval = ((PyObject *)__pyx_t_6); - - /* "bzrlib/_simple_set_pyx.pyx":317 - * retval = (slot[0]) - * # PySet and PyDict use a 2-3rds full algorithm, we'll follow suit - * if added and (self._fill * 3) >= ((self._mask + 1) * 2): # <<<<<<<<<<<<<< - * # However, we always work for a load factor of 2:1 - * self._resize(self._used * 2) - */ - if (__pyx_v_added) { - __pyx_t_3 = ((__pyx_v_self->_fill * 3) >= ((__pyx_v_self->_mask + 1) * 2)); - __pyx_t_1 = __pyx_t_3; - } else { - __pyx_t_1 = __pyx_v_added; - } - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":319 - * if added and (self._fill * 3) >= ((self._mask + 1) * 2): - * # However, we always work for a load factor of 2:1 - * self._resize(self._used * 2) # <<<<<<<<<<<<<< - * # Even if we resized and ended up moving retval into a different slot, - * # it is still the value that is held at the slot equivalent to 'key', - */ - __pyx_t_7 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)__pyx_v_self->__pyx_vtab)->_resize(__pyx_v_self, (__pyx_v_self->_used * 2)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":315 */ + Py_INCREF(((PyObject *)(__pyx_v_slot[0]))); + Py_DECREF(__pyx_v_retval); + __pyx_v_retval = ((PyObject *)(__pyx_v_slot[0])); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":317 */ + __pyx_1 = __pyx_v_added; + if (__pyx_1) { + __pyx_1 = ((__pyx_v_self->_fill * 3) >= ((__pyx_v_self->_mask + 1) * 2)); } - __pyx_L5:; + if (__pyx_1) { + __pyx_5 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)__pyx_v_self->__pyx_vtab)->_resize(__pyx_v_self,(__pyx_v_self->_used * 2)); if (__pyx_5 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} + goto __pyx_L4; + } + __pyx_L4:; - /* "bzrlib/_simple_set_pyx.pyx":323 - * # it is still the value that is held at the slot equivalent to 'key', - * # so we can still return it - * return retval # <<<<<<<<<<<<<< - * - * def discard(self, key): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_retval); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":323 */ + Py_INCREF(__pyx_v_retval); __pyx_r = __pyx_v_retval; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet._add"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_retval); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_retval); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":325 - * return retval - * - * def discard(self, key): # <<<<<<<<<<<<<< - * """Remove key from the set, whether it exists or not. - * - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_10discard(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/ -static char __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_10discard[] = "Remove key from the set, whether it exists or not.\n\n :return: False if the item did not exist, True if it did\n "; -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_10discard(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("discard"); - - /* "bzrlib/_simple_set_pyx.pyx":330 - * :return: False if the item did not exist, True if it did - * """ - * if self._discard(key): # <<<<<<<<<<<<<< - * return True - * return False - */ - __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_v_self)->__pyx_vtab)->_discard(((struct SimpleSetObject *)__pyx_v_self), __pyx_v_key); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":331 - * """ - * if self._discard(key): - * return True # <<<<<<<<<<<<<< - * return False - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_discard(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static char __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_discard[] = "Remove key from the set, whether it exists or not.\n\n :return: False if the item did not exist, True if it did\n "; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_discard(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_key = 0; + PyObject *__pyx_r; + int __pyx_1; + static char *__pyx_argnames[] = {"key",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":330 */ + __pyx_1 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_v_self)->__pyx_vtab)->_discard(((struct SimpleSetObject *)__pyx_v_self),__pyx_v_key); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; goto __pyx_L1;} + if (__pyx_1) { + Py_INCREF(Py_True); + __pyx_r = Py_True; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_simple_set_pyx.pyx":332 - * if self._discard(key): - * return True - * return False # <<<<<<<<<<<<<< - * - * cdef int _discard(self, key) except -1: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":332 */ + Py_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet.discard"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":334 - * return False - * - * cdef int _discard(self, key) except -1: # <<<<<<<<<<<<<< - * cdef PyObject **slot, *py_key - * - */ - -static int __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__discard(struct SimpleSetObject *__pyx_v_self, PyObject *__pyx_v_key) { +static int __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__discard(struct SimpleSetObject *__pyx_v_self,PyObject *__pyx_v_key) { PyObject **__pyx_v_slot; int __pyx_r; - PyObject **__pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - Py_ssize_t __pyx_t_5; - __Pyx_RefNannySetupContext("_discard"); - - /* "bzrlib/_simple_set_pyx.pyx":337 - * cdef PyObject **slot, *py_key - * - * slot = _lookup(self, key) # <<<<<<<<<<<<<< - * if slot[0] == NULL or slot[0] == _dummy: - * return 0 - */ - __pyx_t_1 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(__pyx_v_self, __pyx_v_key); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_slot = __pyx_t_1; - - /* "bzrlib/_simple_set_pyx.pyx":338 - * - * slot = _lookup(self, key) - * if slot[0] == NULL or slot[0] == _dummy: # <<<<<<<<<<<<<< - * return 0 - * self._used = self._used - 1 - */ - __pyx_t_2 = ((__pyx_v_slot[0]) == NULL); - if (!__pyx_t_2) { - __pyx_t_3 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); - __pyx_t_4 = __pyx_t_3; - } else { - __pyx_t_4 = __pyx_t_2; - } - if (__pyx_t_4) { - - /* "bzrlib/_simple_set_pyx.pyx":339 - * slot = _lookup(self, key) - * if slot[0] == NULL or slot[0] == _dummy: - * return 0 # <<<<<<<<<<<<<< - * self._used = self._used - 1 - * Py_DECREF(slot[0]) - */ + PyObject **__pyx_1; + int __pyx_2; + Py_ssize_t __pyx_3; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":337 */ + __pyx_1 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(__pyx_v_self,__pyx_v_key); if (__pyx_1 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} + __pyx_v_slot = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":338 */ + __pyx_2 = ((__pyx_v_slot[0]) == NULL); + if (!__pyx_2) { + __pyx_2 = ((__pyx_v_slot[0]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); + } + if (__pyx_2) { __pyx_r = 0; goto __pyx_L0; - goto __pyx_L3; + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_simple_set_pyx.pyx":340 - * if slot[0] == NULL or slot[0] == _dummy: - * return 0 - * self._used = self._used - 1 # <<<<<<<<<<<<<< - * Py_DECREF(slot[0]) - * slot[0] = _dummy - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":340 */ __pyx_v_self->_used = (__pyx_v_self->_used - 1); - /* "bzrlib/_simple_set_pyx.pyx":341 - * return 0 - * self._used = self._used - 1 - * Py_DECREF(slot[0]) # <<<<<<<<<<<<<< - * slot[0] = _dummy - * # PySet uses the heuristic: If more than 1/5 are dummies, then resize - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":341 */ Py_DECREF((__pyx_v_slot[0])); - /* "bzrlib/_simple_set_pyx.pyx":342 - * self._used = self._used - 1 - * Py_DECREF(slot[0]) - * slot[0] = _dummy # <<<<<<<<<<<<<< - * # PySet uses the heuristic: If more than 1/5 are dummies, then resize - * # them away - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":342 */ (__pyx_v_slot[0]) = __pyx_v_6bzrlib_15_simple_set_pyx__dummy; - /* "bzrlib/_simple_set_pyx.pyx":353 - * # For now, we'll just use their algorithm, but we may want to revisit - * # it - * if ((self._fill - self._used) * 5 > self._mask): # <<<<<<<<<<<<<< - * self._resize(self._used * 2) - * return 1 - */ - __pyx_t_4 = (((__pyx_v_self->_fill - __pyx_v_self->_used) * 5) > __pyx_v_self->_mask); - if (__pyx_t_4) { - - /* "bzrlib/_simple_set_pyx.pyx":354 - * # it - * if ((self._fill - self._used) * 5 > self._mask): - * self._resize(self._used * 2) # <<<<<<<<<<<<<< - * return 1 - * - */ - __pyx_t_5 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)__pyx_v_self->__pyx_vtab)->_resize(__pyx_v_self, (__pyx_v_self->_used * 2)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L4; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":353 */ + __pyx_2 = (((__pyx_v_self->_fill - __pyx_v_self->_used) * 5) > __pyx_v_self->_mask); + if (__pyx_2) { + __pyx_3 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)__pyx_v_self->__pyx_vtab)->_resize(__pyx_v_self,(__pyx_v_self->_used * 2)); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; goto __pyx_L1;} + goto __pyx_L3; } - __pyx_L4:; + __pyx_L3:; - /* "bzrlib/_simple_set_pyx.pyx":355 - * if ((self._fill - self._used) * 5 > self._mask): - * self._resize(self._used * 2) - * return 1 # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":355 */ __pyx_r = 1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet._discard"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":357 - * return 1 - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return _SimpleSet_iterator(self) - * - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_11__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_11__iter__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("__iter__"); - - /* "bzrlib/_simple_set_pyx.pyx":358 - * - * def __iter__(self): - * return _SimpleSet_iterator(self) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - __Pyx_INCREF(__pyx_v_self); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_simple_set_pyx__SimpleSet_iterator)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;} + Py_INCREF(__pyx_v_self); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self); + __pyx_2 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_15_simple_set_pyx__SimpleSet_iterator), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet.__iter__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":369 - * cdef Py_ssize_t len # number of entries left - * - * def __init__(self, obj): # <<<<<<<<<<<<<< - * self.set = obj - * self.pos = 0 - */ - -static int __pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_obj = 0; int __pyx_r; - static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,0}; - __Pyx_RefNannySetupContext("__init__"); - if (unlikely(__pyx_kwds)) { - Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); - PyObject* values[1] = {0}; - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - switch (PyTuple_GET_SIZE(__pyx_args)) { - case 0: - values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj); - if (likely(values[0])) kw_args--; - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - } - __pyx_v_obj = values[0]; - } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { - goto __pyx_L5_argtuple_error; - } else { - __pyx_v_obj = PyTuple_GET_ITEM(__pyx_args, 0); - } - goto __pyx_L4_argument_unpacking_done; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L3_error;} - __pyx_L3_error:; - __Pyx_AddTraceback("bzrlib._simple_set_pyx._SimpleSet_iterator.__init__"); - __Pyx_RefNannyFinishContext(); - return -1; - __pyx_L4_argument_unpacking_done:; - - /* "bzrlib/_simple_set_pyx.pyx":370 - * - * def __init__(self, obj): - * self.set = obj # <<<<<<<<<<<<<< - * self.pos = 0 - * self._used = self.set._used - */ - if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_obj); - __Pyx_GIVEREF(__pyx_v_obj); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set)); + static char *__pyx_argnames[] = {"obj",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_obj)) return -1; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_obj); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":370 */ + if (!__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; goto __pyx_L1;} + Py_INCREF(__pyx_v_obj); + Py_DECREF(((PyObject *)((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set)); ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set = ((struct SimpleSetObject *)__pyx_v_obj); - /* "bzrlib/_simple_set_pyx.pyx":371 - * def __init__(self, obj): - * self.set = obj - * self.pos = 0 # <<<<<<<<<<<<<< - * self._used = self.set._used - * self.len = self.set._used - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":371 */ ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->pos = 0; - /* "bzrlib/_simple_set_pyx.pyx":372 - * self.set = obj - * self.pos = 0 - * self._used = self.set._used # <<<<<<<<<<<<<< - * self.len = self.set._used - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":372 */ ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->_used = ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set->_used; - /* "bzrlib/_simple_set_pyx.pyx":373 - * self.pos = 0 - * self._used = self.set._used - * self.len = self.set._used # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":373 */ ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->len = ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set->_used; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; __Pyx_AddTraceback("bzrlib._simple_set_pyx._SimpleSet_iterator.__init__"); __pyx_r = -1; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_obj); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":375 - * self.len = self.set._used - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return self - * - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator_1__iter__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator_1__iter__(PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannySetupContext("__iter__"); - - /* "bzrlib/_simple_set_pyx.pyx":376 - * - * def __iter__(self): - * return self # <<<<<<<<<<<<<< - * - * def __next__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_self); +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___iter__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___iter__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_self); __pyx_r = __pyx_v_self; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":378 - * return self - * - * def __next__(self): # <<<<<<<<<<<<<< - * cdef Py_ssize_t mask, i - * cdef PyObject *key - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator_2__next__(PyObject *__pyx_v_self); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator_2__next__(PyObject *__pyx_v_self) { +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___next__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___next__(PyObject *__pyx_v_self) { PyObject *__pyx_v_key; PyObject *__pyx_v_the_key; - PyObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - __Pyx_RefNannySetupContext("__next__"); - __pyx_v_the_key = Py_None; __Pyx_INCREF(Py_None); - - /* "bzrlib/_simple_set_pyx.pyx":382 - * cdef PyObject *key - * - * if self.set is None: # <<<<<<<<<<<<<< - * raise StopIteration - * if self.set._used != self._used: - */ - __pyx_t_1 = (((PyObject *)((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set) == Py_None); - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":383 - * - * if self.set is None: - * raise StopIteration # <<<<<<<<<<<<<< - * if self.set._used != self._used: - * # Force this exception to continue to be raised - */ - __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L5; - } - __pyx_L5:; - - /* "bzrlib/_simple_set_pyx.pyx":384 - * if self.set is None: - * raise StopIteration - * if self.set._used != self._used: # <<<<<<<<<<<<<< - * # Force this exception to continue to be raised - * self._used = -1 - */ - __pyx_t_1 = (((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set->_used != ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->_used); - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":386 - * if self.set._used != self._used: - * # Force this exception to continue to be raised - * self._used = -1 # <<<<<<<<<<<<<< - * raise RuntimeError("Set size changed during iteration") - * if not SimpleSet_Next(self.set, &self.pos, &key): - */ - ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->_used = -1; - - /* "bzrlib/_simple_set_pyx.pyx":387 - * # Force this exception to continue to be raised - * self._used = -1 - * raise RuntimeError("Set size changed during iteration") # <<<<<<<<<<<<<< - * if not SimpleSet_Next(self.set, &self.pos, &key): - * self.set = None - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L6; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + int __pyx_4; + Py_INCREF(__pyx_v_self); + __pyx_v_the_key = Py_None; Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":382 */ + __pyx_1 = ((PyObject *)((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set) == Py_None; + if (__pyx_1) { + __Pyx_Raise(PyExc_StopIteration, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":384 */ + __pyx_1 = (((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set->_used != ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->_used); + if (__pyx_1) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":386 */ + ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->_used = (-1); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":387 */ + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;} + Py_INCREF(__pyx_k6p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k6p); + __pyx_3 = PyObject_CallObject(PyExc_RuntimeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;} + goto __pyx_L3; } - __pyx_L6:; + __pyx_L3:; - /* "bzrlib/_simple_set_pyx.pyx":388 - * self._used = -1 - * raise RuntimeError("Set size changed during iteration") - * if not SimpleSet_Next(self.set, &self.pos, &key): # <<<<<<<<<<<<<< - * self.set = None - * raise StopIteration - */ - __pyx_t_2 = ((PyObject *)((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set); - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = SimpleSet_Next(__pyx_t_2, (&((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->pos), (&__pyx_v_key)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = (!__pyx_t_3); - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":389 - * raise RuntimeError("Set size changed during iteration") - * if not SimpleSet_Next(self.set, &self.pos, &key): - * self.set = None # <<<<<<<<<<<<<< - * raise StopIteration - * # we found something - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set); - __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":388 */ + __pyx_1 = SimpleSet_Next(((PyObject *)((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set),(&((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->pos),(&__pyx_v_key)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;} + __pyx_4 = (!__pyx_1); + if (__pyx_4) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":389 */ + Py_INCREF(Py_None); + Py_DECREF(((PyObject *)((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set)); ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set = ((struct SimpleSetObject *)Py_None); - /* "bzrlib/_simple_set_pyx.pyx":390 - * if not SimpleSet_Next(self.set, &self.pos, &key): - * self.set = None - * raise StopIteration # <<<<<<<<<<<<<< - * # we found something - * the_key = key # INCREF - */ - __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0); - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L7; - } - __pyx_L7:; - - /* "bzrlib/_simple_set_pyx.pyx":392 - * raise StopIteration - * # we found something - * the_key = key # INCREF # <<<<<<<<<<<<<< - * self.len = self.len - 1 - * return the_key - */ - __Pyx_INCREF(((PyObject *)__pyx_v_key)); - __Pyx_DECREF(__pyx_v_the_key); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":390 */ + __Pyx_Raise(PyExc_StopIteration, 0, 0); + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; goto __pyx_L1;} + goto __pyx_L4; + } + __pyx_L4:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":392 */ + Py_INCREF(((PyObject *)__pyx_v_key)); + Py_DECREF(__pyx_v_the_key); __pyx_v_the_key = ((PyObject *)__pyx_v_key); - /* "bzrlib/_simple_set_pyx.pyx":393 - * # we found something - * the_key = key # INCREF - * self.len = self.len - 1 # <<<<<<<<<<<<<< - * return the_key - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":393 */ ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->len = (((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->len - 1); - /* "bzrlib/_simple_set_pyx.pyx":394 - * the_key = key # INCREF - * self.len = self.len - 1 - * return the_key # <<<<<<<<<<<<<< - * - * def __length_hint__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_the_key); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":394 */ + Py_INCREF(__pyx_v_the_key); __pyx_r = __pyx_v_the_key; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._simple_set_pyx._SimpleSet_iterator.__next__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF(__pyx_v_the_key); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_the_key); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":396 - * return the_key - * - * def __length_hint__(self): # <<<<<<<<<<<<<< - * if self.set is not None and self._used == self.set._used: - * return self.len - */ - -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator_3__length_hint__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator_3__length_hint__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { - PyObject *__pyx_r = NULL; - int __pyx_t_1; - int __pyx_t_2; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannySetupContext("__length_hint__"); - - /* "bzrlib/_simple_set_pyx.pyx":397 - * - * def __length_hint__(self): - * if self.set is not None and self._used == self.set._used: # <<<<<<<<<<<<<< - * return self.len - * return 0 - */ - __pyx_t_1 = (((PyObject *)((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set) != Py_None); - if (__pyx_t_1) { - __pyx_t_2 = (((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->_used == ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set->_used); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_3 = __pyx_t_1; - } - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":398 - * def __length_hint__(self): - * if self.set is not None and self._used == self.set._used: - * return self.len # <<<<<<<<<<<<<< - * return 0 - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyInt_FromSsize_t(((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___length_hint__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___length_hint__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":397 */ + __pyx_1 = ((PyObject *)((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set) != Py_None; + if (__pyx_1) { + __pyx_1 = (((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->_used == ((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->set->_used); + } + if (__pyx_1) { + __pyx_2 = PyInt_FromSsize_t(((struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)__pyx_v_self)->len); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L2; } - __pyx_L5:; + __pyx_L2:; - /* "bzrlib/_simple_set_pyx.pyx":399 - * if self.set is not None and self._used == self.set._used: - * return self.len - * return 0 # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_int_0); - __pyx_r = __pyx_int_0; + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":399 */ + __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; goto __pyx_L0; - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_4); + __pyx_L1:; + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._simple_set_pyx._SimpleSet_iterator.__length_hint__"); - __pyx_r = NULL; + __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":403 - * - * - * cdef api SimpleSet SimpleSet_New(): # <<<<<<<<<<<<<< - * """Create a new SimpleSet object.""" - * return SimpleSet() - */ - -static struct SimpleSetObject *SimpleSet_New(void) { - struct SimpleSetObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("SimpleSet_New"); - - /* "bzrlib/_simple_set_pyx.pyx":405 - * cdef api SimpleSet SimpleSet_New(): - * """Create a new SimpleSet object.""" - * return SimpleSet() # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = ((struct SimpleSetObject *)__pyx_t_1); - __pyx_t_1 = 0; +static struct SimpleSetObject *SimpleSet_New(void) { + struct SimpleSetObject *__pyx_r; + PyObject *__pyx_1 = 0; + __pyx_1 = PyObject_CallObject(((PyObject *)__pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; goto __pyx_L1;} + __pyx_r = ((struct SimpleSetObject *)__pyx_1); + __pyx_1 = 0; goto __pyx_L0; - __pyx_r = ((struct SimpleSetObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_r = ((struct SimpleSetObject *)Py_None); Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet_New"); __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":408 - * - * - * cdef SimpleSet _check_self(object self): # <<<<<<<<<<<<<< - * """Check that the parameter is not None. - * - */ - -static struct SimpleSetObject *__pyx_f_6bzrlib_15_simple_set_pyx__check_self(PyObject *__pyx_v_self) { +static struct SimpleSetObject *__pyx_f_6bzrlib_15_simple_set_pyx__check_self(PyObject *__pyx_v_self) { struct SimpleSetObject *__pyx_v_true_self; - struct SimpleSetObject *__pyx_r = NULL; - int __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("_check_self"); - __pyx_v_true_self = ((struct SimpleSetObject *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_simple_set_pyx.pyx":417 - * """ - * cdef SimpleSet true_self - * if self is None: # <<<<<<<<<<<<<< - * raise TypeError('self must not be None') - * true_self = self - */ - __pyx_t_1 = (__pyx_v_self == Py_None); - if (__pyx_t_1) { - - /* "bzrlib/_simple_set_pyx.pyx":418 - * cdef SimpleSet true_self - * if self is None: - * raise TypeError('self must not be None') # <<<<<<<<<<<<<< - * true_self = self - * return true_self - */ - __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_Raise(__pyx_t_2, 0, 0); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - goto __pyx_L3; - } - __pyx_L3:; - - /* "bzrlib/_simple_set_pyx.pyx":419 - * if self is None: - * raise TypeError('self must not be None') - * true_self = self # <<<<<<<<<<<<<< - * return true_self - * - */ - if (!(likely(((__pyx_v_self) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_INCREF(__pyx_v_self); - __Pyx_DECREF(((PyObject *)__pyx_v_true_self)); + struct SimpleSetObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + Py_INCREF(__pyx_v_self); + __pyx_v_true_self = ((struct SimpleSetObject *)Py_None); Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":417 */ + __pyx_1 = __pyx_v_self == Py_None; + if (__pyx_1) { + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;} + Py_INCREF(__pyx_k7p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k7p); + __pyx_3 = PyObject_CallObject(PyExc_TypeError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":419 */ + if (!__Pyx_TypeTest(__pyx_v_self, __pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;} + Py_INCREF(__pyx_v_self); + Py_DECREF(((PyObject *)__pyx_v_true_self)); __pyx_v_true_self = ((struct SimpleSetObject *)__pyx_v_self); - /* "bzrlib/_simple_set_pyx.pyx":420 - * raise TypeError('self must not be None') - * true_self = self - * return true_self # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(((PyObject *)__pyx_r)); - __Pyx_INCREF(((PyObject *)__pyx_v_true_self)); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":420 */ + Py_INCREF(((PyObject *)__pyx_v_true_self)); __pyx_r = __pyx_v_true_self; goto __pyx_L0; - __pyx_r = ((struct SimpleSetObject *)Py_None); __Pyx_INCREF(Py_None); + __pyx_r = ((struct SimpleSetObject *)Py_None); Py_INCREF(Py_None); goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("bzrlib._simple_set_pyx._check_self"); __pyx_r = 0; __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_true_self); - __Pyx_XGIVEREF((PyObject *)__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_true_self); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":423 - * - * - * cdef PyObject **_lookup(SimpleSet self, object key) except NULL: # <<<<<<<<<<<<<< - * """Find the slot where 'key' would fit. - * - */ - -static PyObject **__pyx_f_6bzrlib_15_simple_set_pyx__lookup(struct SimpleSetObject *__pyx_v_self, PyObject *__pyx_v_key) { +static PyObject **__pyx_f_6bzrlib_15_simple_set_pyx__lookup(struct SimpleSetObject *__pyx_v_self,PyObject *__pyx_v_key) { size_t __pyx_v_i; size_t __pyx_v_n_lookup; Py_ssize_t __pyx_v_mask; @@ -3104,774 +1389,382 @@ PyObject **__pyx_v_free_slot; PyObject *__pyx_v_py_key; PyObject **__pyx_r; - long __pyx_t_1; - size_t __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - PyObject *__pyx_t_5 = NULL; - __Pyx_RefNannySetupContext("_lookup"); - - /* "bzrlib/_simple_set_pyx.pyx":464 - * cdef PyObject **table, **slot, *cur, **free_slot, *py_key - * - * py_key = key # <<<<<<<<<<<<<< - * # Note: avoid using hash(obj) because of a bug w/ pyrex 0.9.8.5 and 64-bit - * # (it treats hash() as returning an 'int' rather than a 'long') - */ + long __pyx_1; + size_t __pyx_2; + int __pyx_3; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":464 */ __pyx_v_py_key = ((PyObject *)__pyx_v_key); - /* "bzrlib/_simple_set_pyx.pyx":467 - * # Note: avoid using hash(obj) because of a bug w/ pyrex 0.9.8.5 and 64-bit - * # (it treats hash() as returning an 'int' rather than a 'long') - * key_hash = PyObject_Hash(py_key) # <<<<<<<<<<<<<< - * i = key_hash - * mask = self._mask - */ - __pyx_t_1 = PyObject_Hash(__pyx_v_py_key); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_v_key_hash = __pyx_t_1; - - /* "bzrlib/_simple_set_pyx.pyx":468 - * # (it treats hash() as returning an 'int' rather than a 'long') - * key_hash = PyObject_Hash(py_key) - * i = key_hash # <<<<<<<<<<<<<< - * mask = self._mask - * table = self._table - */ - __pyx_v_i = ((size_t)__pyx_v_key_hash); - - /* "bzrlib/_simple_set_pyx.pyx":469 - * key_hash = PyObject_Hash(py_key) - * i = key_hash - * mask = self._mask # <<<<<<<<<<<<<< - * table = self._table - * free_slot = NULL - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":467 */ + __pyx_1 = PyObject_Hash(__pyx_v_py_key); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; goto __pyx_L1;} + __pyx_v_key_hash = __pyx_1; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":468 */ + __pyx_v_i = __pyx_v_key_hash; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":469 */ __pyx_v_mask = __pyx_v_self->_mask; - /* "bzrlib/_simple_set_pyx.pyx":470 - * i = key_hash - * mask = self._mask - * table = self._table # <<<<<<<<<<<<<< - * free_slot = NULL - * for n_lookup from 0 <= n_lookup <= mask: # Don't loop forever - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":470 */ __pyx_v_table = __pyx_v_self->_table; - /* "bzrlib/_simple_set_pyx.pyx":471 - * mask = self._mask - * table = self._table - * free_slot = NULL # <<<<<<<<<<<<<< - * for n_lookup from 0 <= n_lookup <= mask: # Don't loop forever - * slot = &table[i & mask] - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":471 */ __pyx_v_free_slot = NULL; - /* "bzrlib/_simple_set_pyx.pyx":472 - * table = self._table - * free_slot = NULL - * for n_lookup from 0 <= n_lookup <= mask: # Don't loop forever # <<<<<<<<<<<<<< - * slot = &table[i & mask] - * cur = slot[0] - */ - __pyx_t_2 = ((size_t)__pyx_v_mask); - for (__pyx_v_n_lookup = 0; __pyx_v_n_lookup <= __pyx_t_2; __pyx_v_n_lookup++) { - - /* "bzrlib/_simple_set_pyx.pyx":473 - * free_slot = NULL - * for n_lookup from 0 <= n_lookup <= mask: # Don't loop forever - * slot = &table[i & mask] # <<<<<<<<<<<<<< - * cur = slot[0] - * if cur == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":472 */ + __pyx_2 = __pyx_v_mask; + for (__pyx_v_n_lookup = 0; __pyx_v_n_lookup <= __pyx_2; ++__pyx_v_n_lookup) { + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":473 */ __pyx_v_slot = (&(__pyx_v_table[(__pyx_v_i & __pyx_v_mask)])); - /* "bzrlib/_simple_set_pyx.pyx":474 - * for n_lookup from 0 <= n_lookup <= mask: # Don't loop forever - * slot = &table[i & mask] - * cur = slot[0] # <<<<<<<<<<<<<< - * if cur == NULL: - * # Found a blank spot - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":474 */ __pyx_v_cur = (__pyx_v_slot[0]); - /* "bzrlib/_simple_set_pyx.pyx":475 - * slot = &table[i & mask] - * cur = slot[0] - * if cur == NULL: # <<<<<<<<<<<<<< - * # Found a blank spot - * if free_slot != NULL: - */ - __pyx_t_3 = (__pyx_v_cur == NULL); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":477 - * if cur == NULL: - * # Found a blank spot - * if free_slot != NULL: # <<<<<<<<<<<<<< - * # Did we find an earlier _dummy entry? - * return free_slot - */ - __pyx_t_3 = (__pyx_v_free_slot != NULL); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":479 - * if free_slot != NULL: - * # Did we find an earlier _dummy entry? - * return free_slot # <<<<<<<<<<<<<< - * else: - * return slot - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":475 */ + __pyx_3 = (__pyx_v_cur == NULL); + if (__pyx_3) { + __pyx_3 = (__pyx_v_free_slot != NULL); + if (__pyx_3) { __pyx_r = __pyx_v_free_slot; goto __pyx_L0; - goto __pyx_L6; + goto __pyx_L5; } /*else*/ { - - /* "bzrlib/_simple_set_pyx.pyx":481 - * return free_slot - * else: - * return slot # <<<<<<<<<<<<<< - * if cur == py_key: - * # Found an exact pointer to the key - */ __pyx_r = __pyx_v_slot; goto __pyx_L0; } - __pyx_L6:; - goto __pyx_L5; + __pyx_L5:; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; - /* "bzrlib/_simple_set_pyx.pyx":482 - * else: - * return slot - * if cur == py_key: # <<<<<<<<<<<<<< - * # Found an exact pointer to the key - * return slot - */ - __pyx_t_3 = (__pyx_v_cur == __pyx_v_py_key); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":484 - * if cur == py_key: - * # Found an exact pointer to the key - * return slot # <<<<<<<<<<<<<< - * if cur == _dummy: - * if free_slot == NULL: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":482 */ + __pyx_3 = (__pyx_v_cur == __pyx_v_py_key); + if (__pyx_3) { __pyx_r = __pyx_v_slot; goto __pyx_L0; - goto __pyx_L7; + goto __pyx_L6; } - __pyx_L7:; + __pyx_L6:; - /* "bzrlib/_simple_set_pyx.pyx":485 - * # Found an exact pointer to the key - * return slot - * if cur == _dummy: # <<<<<<<<<<<<<< - * if free_slot == NULL: - * free_slot = slot - */ - __pyx_t_3 = (__pyx_v_cur == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":486 - * return slot - * if cur == _dummy: - * if free_slot == NULL: # <<<<<<<<<<<<<< - * free_slot = slot - * elif _is_equal(py_key, key_hash, cur): - */ - __pyx_t_3 = (__pyx_v_free_slot == NULL); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":487 - * if cur == _dummy: - * if free_slot == NULL: - * free_slot = slot # <<<<<<<<<<<<<< - * elif _is_equal(py_key, key_hash, cur): - * # Both py_key and cur belong in this slot, return it - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":485 */ + __pyx_3 = (__pyx_v_cur == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); + if (__pyx_3) { + __pyx_3 = (__pyx_v_free_slot == NULL); + if (__pyx_3) { __pyx_v_free_slot = __pyx_v_slot; - goto __pyx_L9; + goto __pyx_L8; } - __pyx_L9:; - goto __pyx_L8; + __pyx_L8:; + goto __pyx_L7; } - - /* "bzrlib/_simple_set_pyx.pyx":488 - * if free_slot == NULL: - * free_slot = slot - * elif _is_equal(py_key, key_hash, cur): # <<<<<<<<<<<<<< - * # Both py_key and cur belong in this slot, return it - * return slot - */ - __pyx_t_4 = __pyx_f_6bzrlib_15_simple_set_pyx__is_equal(__pyx_v_py_key, __pyx_v_key_hash, __pyx_v_cur); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_t_4) { - - /* "bzrlib/_simple_set_pyx.pyx":490 - * elif _is_equal(py_key, key_hash, cur): - * # Both py_key and cur belong in this slot, return it - * return slot # <<<<<<<<<<<<<< - * i = i + 1 + n_lookup - * raise AssertionError('should never get here') - */ + __pyx_3 = __pyx_f_6bzrlib_15_simple_set_pyx__is_equal(__pyx_v_py_key,__pyx_v_key_hash,__pyx_v_cur); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;} + if (__pyx_3) { __pyx_r = __pyx_v_slot; goto __pyx_L0; - goto __pyx_L8; + goto __pyx_L7; } - __pyx_L8:; + __pyx_L7:; - /* "bzrlib/_simple_set_pyx.pyx":491 - * # Both py_key and cur belong in this slot, return it - * return slot - * i = i + 1 + n_lookup # <<<<<<<<<<<<<< - * raise AssertionError('should never get here') - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":491 */ __pyx_v_i = ((__pyx_v_i + 1) + __pyx_v_n_lookup); } - /* "bzrlib/_simple_set_pyx.pyx":492 - * return slot - * i = i + 1 + n_lookup - * raise AssertionError('should never get here') # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_5 = PyObject_Call(__pyx_builtin_AssertionError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_5); - __Pyx_Raise(__pyx_t_5, 0, 0); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":492 */ + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} + Py_INCREF(__pyx_k8p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k8p); + __pyx_5 = PyObject_CallObject(PyExc_AssertionError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_5, 0, 0); + Py_DECREF(__pyx_5); __pyx_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_5); + __pyx_L1:; + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); __Pyx_AddTraceback("bzrlib._simple_set_pyx._lookup"); __pyx_r = NULL; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":495 - * - * - * cdef api PyObject **_SimpleSet_Lookup(object self, object key) except NULL: # <<<<<<<<<<<<<< - * """Find the slot where 'key' would fit. - * - */ - -static PyObject **_SimpleSet_Lookup(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { +static PyObject **_SimpleSet_Lookup(PyObject *__pyx_v_self,PyObject *__pyx_v_key) { PyObject **__pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject **__pyx_t_2; - __Pyx_RefNannySetupContext("_SimpleSet_Lookup"); - - /* "bzrlib/_simple_set_pyx.pyx":507 - * should never be NULL, but may reference a NULL (PyObject*) - * """ - * return _lookup(_check_self(self), key) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(((struct SimpleSetObject *)__pyx_t_1), __pyx_v_key); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; + PyObject *__pyx_1 = 0; + PyObject **__pyx_2; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; goto __pyx_L1;} + __pyx_2 = __pyx_f_6bzrlib_15_simple_set_pyx__lookup(((struct SimpleSetObject *)__pyx_1),__pyx_v_key); if (__pyx_2 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx._SimpleSet_Lookup"); __pyx_r = NULL; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":510 - * - * - * cdef api object SimpleSet_Add(object self, object key): # <<<<<<<<<<<<<< - * """Add a key to the SimpleSet (set). - * - */ - -static PyObject *SimpleSet_Add(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - __Pyx_RefNannySetupContext("SimpleSet_Add"); - - /* "bzrlib/_simple_set_pyx.pyx":520 - * (consider dict.setdefault(key, key)) - * """ - * return _check_self(self)._add(key) # <<<<<<<<<<<<<< - * - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_t_1)->__pyx_vtab)->_add(((struct SimpleSetObject *)__pyx_t_1), __pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); +static PyObject *SimpleSet_Add(PyObject *__pyx_v_self,PyObject *__pyx_v_key) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;} + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_1)->__pyx_vtab)->_add(((struct SimpleSetObject *)__pyx_1),__pyx_v_key); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet_Add"); __pyx_r = 0; __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":523 - * - * - * cdef api int SimpleSet_Contains(object self, object key) except -1: # <<<<<<<<<<<<<< - * """Is key present in self?""" - * return (key in _check_self(self)) - */ - -static int SimpleSet_Contains(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { +static int SimpleSet_Contains(PyObject *__pyx_v_self,PyObject *__pyx_v_key) { int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannySetupContext("SimpleSet_Contains"); - - /* "bzrlib/_simple_set_pyx.pyx":525 - * cdef api int SimpleSet_Contains(object self, object key) except -1: - * """Is key present in self?""" - * return (key in _check_self(self)) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((PySequence_Contains(__pyx_t_1, __pyx_v_key))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; + PyObject *__pyx_1 = 0; + int __pyx_2; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} + __pyx_2 = PySequence_Contains(__pyx_1, __pyx_v_key); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet_Contains"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":528 - * - * - * cdef api int SimpleSet_Discard(object self, object key) except -1: # <<<<<<<<<<<<<< - * """Remove the object referenced at location 'key'. - * - */ - -static int SimpleSet_Discard(PyObject *__pyx_v_self, PyObject *__pyx_v_key) { +static int SimpleSet_Discard(PyObject *__pyx_v_self,PyObject *__pyx_v_key) { int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannySetupContext("SimpleSet_Discard"); - - /* "bzrlib/_simple_set_pyx.pyx":536 - * error. - * """ - * return _check_self(self)._discard(key) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_t_1)->__pyx_vtab)->_discard(((struct SimpleSetObject *)__pyx_t_1), __pyx_v_key); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; + PyObject *__pyx_1 = 0; + int __pyx_2; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; goto __pyx_L1;} + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_1)->__pyx_vtab)->_discard(((struct SimpleSetObject *)__pyx_1),__pyx_v_key); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet_Discard"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":539 - * - * - * cdef api PyObject *SimpleSet_Get(SimpleSet self, object key) except? NULL: # <<<<<<<<<<<<<< - * """Get a pointer to the object present at location 'key'. - * - */ - -static PyObject *SimpleSet_Get(struct SimpleSetObject *__pyx_v_self, PyObject *__pyx_v_key) { +static PyObject *SimpleSet_Get(struct SimpleSetObject *__pyx_v_self,PyObject *__pyx_v_key) { PyObject *__pyx_r; - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2; - __Pyx_RefNannySetupContext("SimpleSet_Get"); - - /* "bzrlib/_simple_set_pyx.pyx":549 - * :return: The object present at that location - * """ - * return _check_self(self)._get(key) # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_t_1)->__pyx_vtab)->_get(((struct SimpleSetObject *)__pyx_t_1), __pyx_v_key); if (unlikely(__pyx_t_2 == NULL && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_key); + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(((PyObject *)__pyx_v_self))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} + __pyx_2 = ((struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *)((struct SimpleSetObject *)__pyx_1)->__pyx_vtab)->_get(((struct SimpleSetObject *)__pyx_1),__pyx_v_key); if (__pyx_2 == NULL && PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_r = __pyx_2; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet_Get"); __pyx_r = NULL; __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_key); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":552 - * - * - * cdef api Py_ssize_t SimpleSet_Size(object self) except -1: # <<<<<<<<<<<<<< - * """Get the number of active entries in 'self'""" - * return _check_self(self)._used - */ - -static Py_ssize_t SimpleSet_Size(PyObject *__pyx_v_self) { +static Py_ssize_t SimpleSet_Size(PyObject *__pyx_v_self) { Py_ssize_t __pyx_r; - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("SimpleSet_Size"); - - /* "bzrlib/_simple_set_pyx.pyx":554 - * cdef api Py_ssize_t SimpleSet_Size(object self) except -1: - * """Get the number of active entries in 'self'""" - * return _check_self(self)._used # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = ((struct SimpleSetObject *)__pyx_t_1)->_used; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;} + __pyx_r = ((struct SimpleSetObject *)__pyx_1)->_used; + Py_DECREF(__pyx_1); __pyx_1 = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet_Size"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":557 - * - * - * cdef api int SimpleSet_Next(object self, Py_ssize_t *pos, # <<<<<<<<<<<<<< - * PyObject **key) except -1: - * """Walk over items in a SimpleSet. - */ - -static int SimpleSet_Next(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_pos, PyObject **__pyx_v_key) { +static int SimpleSet_Next(PyObject *__pyx_v_self,Py_ssize_t *__pyx_v_pos,PyObject **__pyx_v_key) { Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_mask; struct SimpleSetObject *__pyx_v_true_self; PyObject **__pyx_v_table; int __pyx_r; - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - int __pyx_t_3; - int __pyx_t_4; - int __pyx_t_5; - __Pyx_RefNannySetupContext("SimpleSet_Next"); - __pyx_v_true_self = ((struct SimpleSetObject *)Py_None); __Pyx_INCREF(Py_None); - - /* "bzrlib/_simple_set_pyx.pyx":569 - * cdef SimpleSet true_self - * cdef PyObject **table - * true_self = _check_self(self) # <<<<<<<<<<<<<< - * i = pos[0] - * if (i < 0): - */ - __pyx_t_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(((PyObject *)__pyx_v_true_self)); - __pyx_v_true_self = ((struct SimpleSetObject *)__pyx_t_1); - __pyx_t_1 = 0; - - /* "bzrlib/_simple_set_pyx.pyx":570 - * cdef PyObject **table - * true_self = _check_self(self) - * i = pos[0] # <<<<<<<<<<<<<< - * if (i < 0): - * return 0 - */ + PyObject *__pyx_1 = 0; + int __pyx_2; + Py_INCREF(__pyx_v_self); + __pyx_v_true_self = ((struct SimpleSetObject *)Py_None); Py_INCREF(Py_None); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":569 */ + __pyx_1 = ((PyObject *)__pyx_f_6bzrlib_15_simple_set_pyx__check_self(__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_true_self)); + __pyx_v_true_self = ((struct SimpleSetObject *)__pyx_1); + __pyx_1 = 0; + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":570 */ __pyx_v_i = (__pyx_v_pos[0]); - /* "bzrlib/_simple_set_pyx.pyx":571 - * true_self = _check_self(self) - * i = pos[0] - * if (i < 0): # <<<<<<<<<<<<<< - * return 0 - * mask = true_self._mask - */ - __pyx_t_2 = (__pyx_v_i < 0); - if (__pyx_t_2) { - - /* "bzrlib/_simple_set_pyx.pyx":572 - * i = pos[0] - * if (i < 0): - * return 0 # <<<<<<<<<<<<<< - * mask = true_self._mask - * table= true_self._table - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":571 */ + __pyx_2 = (__pyx_v_i < 0); + if (__pyx_2) { __pyx_r = 0; goto __pyx_L0; - goto __pyx_L3; + goto __pyx_L2; } - __pyx_L3:; + __pyx_L2:; - /* "bzrlib/_simple_set_pyx.pyx":573 - * if (i < 0): - * return 0 - * mask = true_self._mask # <<<<<<<<<<<<<< - * table= true_self._table - * while (i <= mask and (table[i] == NULL or table[i] == _dummy)): - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":573 */ __pyx_v_mask = __pyx_v_true_self->_mask; - /* "bzrlib/_simple_set_pyx.pyx":574 - * return 0 - * mask = true_self._mask - * table= true_self._table # <<<<<<<<<<<<<< - * while (i <= mask and (table[i] == NULL or table[i] == _dummy)): - * i = i + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":574 */ __pyx_v_table = __pyx_v_true_self->_table; - /* "bzrlib/_simple_set_pyx.pyx":575 - * mask = true_self._mask - * table= true_self._table - * while (i <= mask and (table[i] == NULL or table[i] == _dummy)): # <<<<<<<<<<<<<< - * i = i + 1 - * pos[0] = i + 1 - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":575 */ while (1) { - __pyx_t_2 = (__pyx_v_i <= __pyx_v_mask); - if (__pyx_t_2) { - __pyx_t_3 = ((__pyx_v_table[__pyx_v_i]) == NULL); - if (!__pyx_t_3) { - __pyx_t_4 = ((__pyx_v_table[__pyx_v_i]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); - __pyx_t_5 = __pyx_t_4; - } else { - __pyx_t_5 = __pyx_t_3; + __pyx_2 = (__pyx_v_i <= __pyx_v_mask); + if (__pyx_2) { + __pyx_2 = ((__pyx_v_table[__pyx_v_i]) == NULL); + if (!__pyx_2) { + __pyx_2 = ((__pyx_v_table[__pyx_v_i]) == __pyx_v_6bzrlib_15_simple_set_pyx__dummy); } - __pyx_t_3 = __pyx_t_5; - } else { - __pyx_t_3 = __pyx_t_2; } - if (!__pyx_t_3) break; - - /* "bzrlib/_simple_set_pyx.pyx":576 - * table= true_self._table - * while (i <= mask and (table[i] == NULL or table[i] == _dummy)): - * i = i + 1 # <<<<<<<<<<<<<< - * pos[0] = i + 1 - * if (i > mask): - */ + if (!__pyx_2) break; __pyx_v_i = (__pyx_v_i + 1); } - /* "bzrlib/_simple_set_pyx.pyx":577 - * while (i <= mask and (table[i] == NULL or table[i] == _dummy)): - * i = i + 1 - * pos[0] = i + 1 # <<<<<<<<<<<<<< - * if (i > mask): - * return 0 # All done - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":577 */ (__pyx_v_pos[0]) = (__pyx_v_i + 1); - /* "bzrlib/_simple_set_pyx.pyx":578 - * i = i + 1 - * pos[0] = i + 1 - * if (i > mask): # <<<<<<<<<<<<<< - * return 0 # All done - * if (key != NULL): - */ - __pyx_t_3 = (__pyx_v_i > __pyx_v_mask); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":579 - * pos[0] = i + 1 - * if (i > mask): - * return 0 # All done # <<<<<<<<<<<<<< - * if (key != NULL): - * key[0] = table[i] - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":578 */ + __pyx_2 = (__pyx_v_i > __pyx_v_mask); + if (__pyx_2) { __pyx_r = 0; goto __pyx_L0; - goto __pyx_L6; + goto __pyx_L5; } - __pyx_L6:; + __pyx_L5:; - /* "bzrlib/_simple_set_pyx.pyx":580 - * if (i > mask): - * return 0 # All done - * if (key != NULL): # <<<<<<<<<<<<<< - * key[0] = table[i] - * return 1 - */ - __pyx_t_3 = (__pyx_v_key != NULL); - if (__pyx_t_3) { - - /* "bzrlib/_simple_set_pyx.pyx":581 - * return 0 # All done - * if (key != NULL): - * key[0] = table[i] # <<<<<<<<<<<<<< - * return 1 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":580 */ + __pyx_2 = (__pyx_v_key != NULL); + if (__pyx_2) { (__pyx_v_key[0]) = (__pyx_v_table[__pyx_v_i]); - goto __pyx_L7; + goto __pyx_L6; } - __pyx_L7:; + __pyx_L6:; - /* "bzrlib/_simple_set_pyx.pyx":582 - * if (key != NULL): - * key[0] = table[i] - * return 1 # <<<<<<<<<<<<<< - * - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":582 */ __pyx_r = 1; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); + __pyx_L1:; + Py_XDECREF(__pyx_1); __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet_Next"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_DECREF((PyObject *)__pyx_v_true_self); - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_true_self); + Py_DECREF(__pyx_v_self); return __pyx_r; } -/* "bzrlib/_simple_set_pyx.pyx":585 - * - * - * cdef int SimpleSet_traverse(SimpleSet self, visitproc visit, # <<<<<<<<<<<<<< - * void *arg) except -1: - * """This is an implementation of 'tp_traverse' that hits the whole table. - */ - -static int __pyx_f_6bzrlib_15_simple_set_pyx_SimpleSet_traverse(struct SimpleSetObject *__pyx_v_self, visitproc __pyx_v_visit, void *__pyx_v_arg) { +static int __pyx_f_6bzrlib_15_simple_set_pyx_SimpleSet_traverse(struct SimpleSetObject *__pyx_v_self,visitproc __pyx_v_visit,void *__pyx_v_arg) { Py_ssize_t __pyx_v_pos; PyObject *__pyx_v_next_key; int __pyx_v_ret; int __pyx_r; - int __pyx_t_1; - __Pyx_RefNannySetupContext("SimpleSet_traverse"); + int __pyx_1; + Py_INCREF(__pyx_v_self); - /* "bzrlib/_simple_set_pyx.pyx":597 - * cdef int ret - * - * pos = 0 # <<<<<<<<<<<<<< - * while SimpleSet_Next(self, &pos, &next_key): - * ret = visit(next_key, arg) - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":597 */ __pyx_v_pos = 0; - /* "bzrlib/_simple_set_pyx.pyx":598 - * - * pos = 0 - * while SimpleSet_Next(self, &pos, &next_key): # <<<<<<<<<<<<<< - * ret = visit(next_key, arg) - * if ret: - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":598 */ while (1) { - __pyx_t_1 = SimpleSet_Next(((PyObject *)__pyx_v_self), (&__pyx_v_pos), (&__pyx_v_next_key)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (!__pyx_t_1) break; + __pyx_1 = SimpleSet_Next(((PyObject *)__pyx_v_self),(&__pyx_v_pos),(&__pyx_v_next_key)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; goto __pyx_L1;} + if (!__pyx_1) break; - /* "bzrlib/_simple_set_pyx.pyx":599 - * pos = 0 - * while SimpleSet_Next(self, &pos, &next_key): - * ret = visit(next_key, arg) # <<<<<<<<<<<<<< - * if ret: - * return ret - */ - __pyx_v_ret = __pyx_v_visit(__pyx_v_next_key, __pyx_v_arg); - - /* "bzrlib/_simple_set_pyx.pyx":600 - * while SimpleSet_Next(self, &pos, &next_key): - * ret = visit(next_key, arg) - * if ret: # <<<<<<<<<<<<<< - * return ret - * return 0 - */ - if (__pyx_v_ret) { - - /* "bzrlib/_simple_set_pyx.pyx":601 - * ret = visit(next_key, arg) - * if ret: - * return ret # <<<<<<<<<<<<<< - * return 0 - * - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":599 */ + __pyx_v_ret = __pyx_v_visit(__pyx_v_next_key,__pyx_v_arg); + + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":600 */ + __pyx_1 = __pyx_v_ret; + if (__pyx_1) { __pyx_r = __pyx_v_ret; goto __pyx_L0; - goto __pyx_L5; + goto __pyx_L4; } - __pyx_L5:; + __pyx_L4:; } - /* "bzrlib/_simple_set_pyx.pyx":602 - * if ret: - * return ret - * return 0 # <<<<<<<<<<<<<< - * - * # It is a little bit ugly to do this, but it works, and means that Meliae can - */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":602 */ __pyx_r = 0; goto __pyx_L0; __pyx_r = 0; goto __pyx_L0; - __pyx_L1_error:; + __pyx_L1:; __Pyx_AddTraceback("bzrlib._simple_set_pyx.SimpleSet_traverse"); - __pyx_r = -1; + __pyx_r = (-1); __pyx_L0:; - __Pyx_RefNannyFinishContext(); + Py_DECREF(__pyx_v_self); return __pyx_r; } static struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet __pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet; @@ -3881,7 +1774,7 @@ PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct SimpleSetObject *)o); - p->__pyx_vtab = __pyx_vtabptr_6bzrlib_15_simple_set_pyx_SimpleSet; + *(struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet **)&p->__pyx_vtab = __pyx_vtabptr_6bzrlib_15_simple_set_pyx_SimpleSet; return o; } @@ -3889,48 +1782,48 @@ { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); - ++Py_REFCNT(o); - __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_2__dealloc__(o); + ++o->ob_refcnt; + __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); - --Py_REFCNT(o); + --o->ob_refcnt; PyErr_Restore(etype, eval, etb); } - (*Py_TYPE(o)->tp_free)(o); + (*o->ob_type->tp_free)(o); } static PyObject *__pyx_sq_item_6bzrlib_15_simple_set_pyx_SimpleSet(PyObject *o, Py_ssize_t i) { PyObject *r; PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0; - r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x); + r = o->ob_type->tp_as_mapping->mp_subscript(o, x); Py_DECREF(x); return r; } static PyObject *__pyx_getprop_6bzrlib_15_simple_set_pyx_9SimpleSet_used(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4used___get__(o); + return __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_4used___get__(o); } static PyObject *__pyx_getprop_6bzrlib_15_simple_set_pyx_9SimpleSet_fill(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4fill___get__(o); + return __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_4fill___get__(o); } static PyObject *__pyx_getprop_6bzrlib_15_simple_set_pyx_9SimpleSet_mask(PyObject *o, void *x) { - return __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4mask___get__(o); + return __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_4mask___get__(o); } -static PyMethodDef __pyx_methods_6bzrlib_15_simple_set_pyx_SimpleSet[] = { - {__Pyx_NAMESTR("__sizeof__"), (PyCFunction)__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_1__sizeof__, METH_NOARGS, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("_memory_size"), (PyCFunction)__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_3_memory_size, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_3_memory_size)}, - {__Pyx_NAMESTR("_test_lookup"), (PyCFunction)__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_5_test_lookup, METH_O, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("_py_resize"), (PyCFunction)__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_8_py_resize, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_8_py_resize)}, - {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_9add, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_9add)}, - {__Pyx_NAMESTR("discard"), (PyCFunction)__pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_10discard, METH_O, __Pyx_DOCSTR(__pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_10discard)}, +static struct PyMethodDef __pyx_methods_6bzrlib_15_simple_set_pyx_SimpleSet[] = { + {"__sizeof__", (PyCFunction)__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___sizeof__, METH_VARARGS|METH_KEYWORDS, 0}, + {"_memory_size", (PyCFunction)__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__memory_size, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet__memory_size}, + {"_test_lookup", (PyCFunction)__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__test_lookup, METH_VARARGS|METH_KEYWORDS, 0}, + {"_py_resize", (PyCFunction)__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__py_resize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet__py_resize}, + {"add", (PyCFunction)__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_add}, + {"discard", (PyCFunction)__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet_discard, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_discard}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_6bzrlib_15_simple_set_pyx_SimpleSet[] = { - {(char *)"used", __pyx_getprop_6bzrlib_15_simple_set_pyx_9SimpleSet_used, 0, 0, 0}, - {(char *)"fill", __pyx_getprop_6bzrlib_15_simple_set_pyx_9SimpleSet_fill, 0, 0, 0}, - {(char *)"mask", __pyx_getprop_6bzrlib_15_simple_set_pyx_9SimpleSet_mask, 0, 0, 0}, + {"used", __pyx_getprop_6bzrlib_15_simple_set_pyx_9SimpleSet_used, 0, 0, 0}, + {"fill", __pyx_getprop_6bzrlib_15_simple_set_pyx_9SimpleSet_fill, 0, 0, 0}, + {"mask", __pyx_getprop_6bzrlib_15_simple_set_pyx_9SimpleSet_mask, 0, 0, 0}, {0, 0, 0, 0, 0} }; @@ -3938,9 +1831,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -3954,28 +1845,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -3987,65 +1866,48 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_SimpleSet = { - __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4__len__, /*sq_length*/ + __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___len__, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ __pyx_sq_item_6bzrlib_15_simple_set_pyx_SimpleSet, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ - __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_6__contains__, /*sq_contains*/ + __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___contains__, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_SimpleSet = { - __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_4__len__, /*mp_length*/ - __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_7__getitem__, /*mp_subscript*/ + __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___len__, /*mp_length*/ + __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___getitem__, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_SimpleSet = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; DL_EXPORT(PyTypeObject) SimpleSet_Type = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._simple_set_pyx.SimpleSet"), /*tp_name*/ + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._simple_set_pyx.SimpleSet", /*tp_name*/ sizeof(struct SimpleSetObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_15_simple_set_pyx_SimpleSet, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif 0, /*tp_repr*/ &__pyx_tp_as_number_SimpleSet, /*tp_as_number*/ &__pyx_tp_as_sequence_SimpleSet, /*tp_as_sequence*/ @@ -4056,13 +1918,13 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_SimpleSet, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ - __Pyx_DOCSTR("This class can be used to track canonical forms for objects.\n\n It is similar in function to the interned dictionary that is used by\n strings. However:\n\n 1) It assumes that hash(obj) is cheap, so does not need to inline a copy\n of it\n 2) It only stores one reference to the object, rather than 2 (key vs\n key:value)\n\n As such, it uses 1/3rd the amount of memory to store a pointer to the\n interned object.\n "), /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + "This class can be used to track canonical forms for objects.\n\n It is similar in function to the interned dictionary that is used by\n strings. However:\n\n 1) It assumes that hash(obj) is cheap, so does not need to inline a copy\n of it\n 2) It only stores one reference to the object, rather than 2 (key vs\n key:value)\n\n As such, it uses 1/3rd the amount of memory to store a pointer to the\n interned object.\n ", /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet_11__iter__, /*tp_iter*/ + __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_6bzrlib_15_simple_set_pyx_SimpleSet, /*tp_methods*/ 0, /*tp_members*/ @@ -4072,7 +1934,7 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_6bzrlib_15_simple_set_pyx_9SimpleSet___init__, /*tp_init*/ + __pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6bzrlib_15_simple_set_pyx_SimpleSet, /*tp_new*/ 0, /*tp_free*/ @@ -4082,10 +1944,6 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif }; static PyObject *__pyx_tp_new_6bzrlib_15_simple_set_pyx__SimpleSet_iterator(PyTypeObject *t, PyObject *a, PyObject *k) { @@ -4100,7 +1958,7 @@ static void __pyx_tp_dealloc_6bzrlib_15_simple_set_pyx__SimpleSet_iterator(PyObject *o) { struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *p = (struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)o; Py_XDECREF(((PyObject *)p->set)); - (*Py_TYPE(o)->tp_free)(o); + (*o->ob_type->tp_free)(o); } static int __pyx_tp_traverse_6bzrlib_15_simple_set_pyx__SimpleSet_iterator(PyObject *o, visitproc v, void *a) { @@ -4114,16 +1972,15 @@ static int __pyx_tp_clear_6bzrlib_15_simple_set_pyx__SimpleSet_iterator(PyObject *o) { struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *p = (struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator *)o; - PyObject* tmp; - tmp = ((PyObject*)p->set); + PyObject *t; + t = ((PyObject *)p->set); p->set = ((struct SimpleSetObject *)Py_None); Py_INCREF(Py_None); - Py_XDECREF(tmp); + Py_XDECREF(t); return 0; } -static PyMethodDef __pyx_methods_6bzrlib_15_simple_set_pyx__SimpleSet_iterator[] = { - {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator_2__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)}, - {__Pyx_NAMESTR("__length_hint__"), (PyCFunction)__pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator_3__length_hint__, METH_NOARGS, __Pyx_DOCSTR(0)}, +static struct PyMethodDef __pyx_methods_6bzrlib_15_simple_set_pyx__SimpleSet_iterator[] = { + {"__length_hint__", (PyCFunction)__pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___length_hint__, METH_VARARGS|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; @@ -4131,9 +1988,7 @@ 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ - #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ @@ -4147,28 +2002,16 @@ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ - #endif 0, /*nb_int*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ - #else - 0, /*reserved*/ - #endif 0, /*nb_float*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ - #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ - #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -4180,7 +2023,7 @@ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ - #if PY_VERSION_HEX >= 0x02050000 + #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX 0, /*nb_index*/ #endif }; @@ -4205,40 +2048,23 @@ }; static PyBufferProcs __pyx_tp_as_buffer__SimpleSet_iterator = { - #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ - #endif - #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_getbuffer*/ - #endif - #if PY_VERSION_HEX >= 0x02060000 - 0, /*bf_releasebuffer*/ - #endif }; -static PyTypeObject __pyx_type_6bzrlib_15_simple_set_pyx__SimpleSet_iterator = { - PyVarObject_HEAD_INIT(0, 0) - __Pyx_NAMESTR("bzrlib._simple_set_pyx._SimpleSet_iterator"), /*tp_name*/ +PyTypeObject __pyx_type_6bzrlib_15_simple_set_pyx__SimpleSet_iterator = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "bzrlib._simple_set_pyx._SimpleSet_iterator", /*tp_name*/ sizeof(struct __pyx_obj_6bzrlib_15_simple_set_pyx__SimpleSet_iterator), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_6bzrlib_15_simple_set_pyx__SimpleSet_iterator, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ - #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ - #else - 0, /*reserved*/ - #endif 0, /*tp_repr*/ &__pyx_tp_as_number__SimpleSet_iterator, /*tp_as_number*/ &__pyx_tp_as_sequence__SimpleSet_iterator, /*tp_as_sequence*/ @@ -4249,14 +2075,14 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__SimpleSet_iterator, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ - __Pyx_DOCSTR("Iterator over the SimpleSet structure."), /*tp_doc*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ + "Iterator over the SimpleSet structure.", /*tp_doc*/ __pyx_tp_traverse_6bzrlib_15_simple_set_pyx__SimpleSet_iterator, /*tp_traverse*/ __pyx_tp_clear_6bzrlib_15_simple_set_pyx__SimpleSet_iterator, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ - __pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator_1__iter__, /*tp_iter*/ - __pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator_2__next__, /*tp_iternext*/ + __pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___iter__, /*tp_iter*/ + __pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___next__, /*tp_iternext*/ __pyx_methods_6bzrlib_15_simple_set_pyx__SimpleSet_iterator, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ @@ -4265,7 +2091,7 @@ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ - __pyx_pf_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___init__, /*tp_init*/ + __pyx_f_6bzrlib_15_simple_set_pyx_19_SimpleSet_iterator___init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_6bzrlib_15_simple_set_pyx__SimpleSet_iterator, /*tp_new*/ 0, /*tp_free*/ @@ -4275,441 +2101,87 @@ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ - 0, /*tp_del*/ - #if PY_VERSION_HEX >= 0x02060000 - 0, /*tp_version_tag*/ - #endif }; -static PyMethodDef __pyx_methods[] = { +static struct PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - PyModuleDef_HEAD_INIT, - __Pyx_NAMESTR("_simple_set_pyx"), - __Pyx_DOCSTR(__pyx_k_14), /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif +static void __pyx_init_filenames(void); /*proto*/ -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, - {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0}, - {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0}, - {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, - {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, - {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, - {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0}, - {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0}, - {&__pyx_n_s__AssertionError, __pyx_k__AssertionError, sizeof(__pyx_k__AssertionError), 0, 0, 1, 1}, - {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1}, - {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1}, - {&__pyx_n_s__NotImplemented, __pyx_k__NotImplemented, sizeof(__pyx_k__NotImplemented), 0, 0, 1, 1}, - {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1}, - {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, - {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, - {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, - {&__pyx_n_s___add, __pyx_k___add, sizeof(__pyx_k___add), 0, 0, 1, 1}, - {&__pyx_n_s___discard, __pyx_k___discard, sizeof(__pyx_k___discard), 0, 0, 1, 1}, - {&__pyx_n_s___fill, __pyx_k___fill, sizeof(__pyx_k___fill), 0, 0, 1, 1}, - {&__pyx_n_s___get, __pyx_k___get, sizeof(__pyx_k___get), 0, 0, 1, 1}, - {&__pyx_n_s___insert_clean, __pyx_k___insert_clean, sizeof(__pyx_k___insert_clean), 0, 0, 1, 1}, - {&__pyx_n_s___mask, __pyx_k___mask, sizeof(__pyx_k___mask), 0, 0, 1, 1}, - {&__pyx_n_s___resize, __pyx_k___resize, sizeof(__pyx_k___resize), 0, 0, 1, 1}, - {&__pyx_n_s___table, __pyx_k___table, sizeof(__pyx_k___table), 0, 0, 1, 1}, - {&__pyx_n_s___used, __pyx_k___used, sizeof(__pyx_k___used), 0, 0, 1, 1}, - {&__pyx_n_s__len, __pyx_k__len, sizeof(__pyx_k__len), 0, 0, 1, 1}, - {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1}, - {&__pyx_n_s__object, __pyx_k__object, sizeof(__pyx_k__object), 0, 0, 1, 1}, - {&__pyx_n_s__pos, __pyx_k__pos, sizeof(__pyx_k__pos), 0, 0, 1, 1}, - {&__pyx_n_s__set, __pyx_k__set, sizeof(__pyx_k__set), 0, 0, 1, 1}, - {&__pyx_n_s__tp_hash, __pyx_k__tp_hash, sizeof(__pyx_k__tp_hash), 0, 0, 1, 1}, - {&__pyx_n_s__tp_richcompare, __pyx_k__tp_richcompare, sizeof(__pyx_k__tp_richcompare), 0, 0, 1, 1}, - {&__pyx_n_s__tp_traverse, __pyx_k__tp_traverse, sizeof(__pyx_k__tp_traverse), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_object = __Pyx_GetName(__pyx_b, __pyx_n_s__object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_NotImplemented = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplemented); if (!__pyx_builtin_NotImplemented) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __pyx_builtin_AssertionError = __Pyx_GetName(__pyx_b, __pyx_n_s__AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); - - /* "bzrlib/_simple_set_pyx.pyx":221 - * return 1 - * i = i + 1 + n_lookup - * raise RuntimeError('ran out of slots.') # <<<<<<<<<<<<<< - * - * def _py_resize(self, min_used): - */ - __pyx_k_tuple_5 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_4)); - PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5)); - - /* "bzrlib/_simple_set_pyx.pyx":296 - * if (Py_TYPE(py_key).tp_richcompare == NULL - * or Py_TYPE(py_key).tp_hash == NULL): - * raise TypeError('Types added to SimpleSet must implement' # <<<<<<<<<<<<<< - * ' both tp_richcompare and tp_hash') - * added = 0 - */ - __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_6)); - PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_kp_s_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7)); - - /* "bzrlib/_simple_set_pyx.pyx":387 - * # Force this exception to continue to be raised - * self._used = -1 - * raise RuntimeError("Set size changed during iteration") # <<<<<<<<<<<<<< - * if not SimpleSet_Next(self.set, &self.pos, &key): - * self.set = None - */ - __pyx_k_tuple_9 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_9)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_8)); - PyTuple_SET_ITEM(__pyx_k_tuple_9, 0, ((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_8)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9)); - - /* "bzrlib/_simple_set_pyx.pyx":418 - * cdef SimpleSet true_self - * if self is None: - * raise TypeError('self must not be None') # <<<<<<<<<<<<<< - * true_self = self - * return true_self - */ - __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_11)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_10)); - PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_10)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); - - /* "bzrlib/_simple_set_pyx.pyx":492 - * return slot - * i = i + 1 + n_lookup - * raise AssertionError('should never get here') # <<<<<<<<<<<<<< - * - * - */ - __pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_13)); - __Pyx_INCREF(((PyObject *)__pyx_kp_s_12)); - PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_12)); - __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13)); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC init_simple_set_pyx(void); /*proto*/ -PyMODINIT_FUNC init_simple_set_pyx(void) -#else -PyMODINIT_FUNC PyInit__simple_set_pyx(void); /*proto*/ -PyMODINIT_FUNC PyInit__simple_set_pyx(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - #if CYTHON_REFNANNY - void* __pyx_refnanny = NULL; - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__simple_set_pyx(void)", __LINE__, __FILE__); - #endif - __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;} - __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;} - #ifdef __pyx_binding_PyCFunctionType_USED - if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_simple_set_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_14), 0, PYTHON_API_VERSION); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - #if PY_MAJOR_VERSION < 3 +PyMODINIT_FUNC init_simple_set_pyx(void) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + __pyx_init_filenames(); + __pyx_m = Py_InitModule4("_simple_set_pyx", __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; Py_INCREF(__pyx_m); - #endif - __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); - if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; - /*--- Initialize various global constants etc. ---*/ - if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__pyx_module_is_main_bzrlib___simple_set_pyx) { - 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;}; - } - /*--- Builtin init code ---*/ - if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Constants init code ---*/ - if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Global init code ---*/ + __pyx_b = PyImport_AddModule("__builtin__"); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}; __pyx_v_6bzrlib_15_simple_set_pyx__dummy_obj = Py_None; Py_INCREF(Py_None); __pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented = Py_None; Py_INCREF(Py_None); - /*--- Function export code ---*/ - if (__Pyx_ExportFunction("SimpleSet_New", (void (*)(void))SimpleSet_New, "struct SimpleSetObject *(void)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("SimpleSet_Add", (void (*)(void))SimpleSet_Add, "PyObject *(PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("SimpleSet_Contains", (void (*)(void))SimpleSet_Contains, "int (PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("SimpleSet_Discard", (void (*)(void))SimpleSet_Discard, "int (PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("SimpleSet_Get", (void (*)(void))SimpleSet_Get, "PyObject *(struct SimpleSetObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("SimpleSet_Size", (void (*)(void))SimpleSet_Size, "Py_ssize_t (PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("SimpleSet_Next", (void (*)(void))SimpleSet_Next, "int (PyObject *, Py_ssize_t *, PyObject **)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_ExportFunction("_SimpleSet_Lookup", (void (*)(void))_SimpleSet_Lookup, "PyObject **(PyObject *, PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - /*--- Type init code ---*/ + if (__Pyx_ExportFunction("SimpleSet_New", (void*)SimpleSet_New, "struct SimpleSetObject *(void)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} + if (__Pyx_ExportFunction("SimpleSet_Add", (void*)SimpleSet_Add, "PyObject *(PyObject *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} + if (__Pyx_ExportFunction("SimpleSet_Contains", (void*)SimpleSet_Contains, "int (PyObject *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} + if (__Pyx_ExportFunction("SimpleSet_Discard", (void*)SimpleSet_Discard, "int (PyObject *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} + if (__Pyx_ExportFunction("SimpleSet_Get", (void*)SimpleSet_Get, "PyObject *(struct SimpleSetObject *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} + if (__Pyx_ExportFunction("SimpleSet_Size", (void*)SimpleSet_Size, "Py_ssize_t (PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} + if (__Pyx_ExportFunction("SimpleSet_Next", (void*)SimpleSet_Next, "int (PyObject *,Py_ssize_t *,PyObject **)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} + if (__Pyx_ExportFunction("_SimpleSet_Lookup", (void*)_SimpleSet_Lookup, "PyObject **(PyObject *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;} __pyx_vtabptr_6bzrlib_15_simple_set_pyx_SimpleSet = &__pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet; - __pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet._get = (PyObject *(*)(struct SimpleSetObject *, PyObject *))__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__get; - __pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet._add = (PyObject *(*)(struct SimpleSetObject *, PyObject *))__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__add; - __pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet._discard = (int (*)(struct SimpleSetObject *, PyObject *))__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__discard; - __pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet._insert_clean = (int (*)(struct SimpleSetObject *, PyObject *))__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__insert_clean; - __pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet._resize = (Py_ssize_t (*)(struct SimpleSetObject *, Py_ssize_t))__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__resize; - if (PyType_Ready(&SimpleSet_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - { - PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&SimpleSet_Type, "__contains__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_6bzrlib_15_simple_set_pyx_9SimpleSet_6__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_6bzrlib_15_simple_set_pyx_9SimpleSet_6__contains__.doc = __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_6__contains__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6bzrlib_15_simple_set_pyx_9SimpleSet_6__contains__; - } - } - { - PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&SimpleSet_Type, "__getitem__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) { - __pyx_wrapperbase_6bzrlib_15_simple_set_pyx_9SimpleSet_7__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base; - __pyx_wrapperbase_6bzrlib_15_simple_set_pyx_9SimpleSet_7__getitem__.doc = __pyx_doc_6bzrlib_15_simple_set_pyx_9SimpleSet_7__getitem__; - ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6bzrlib_15_simple_set_pyx_9SimpleSet_7__getitem__; - } - } - if (__Pyx_SetVtable(SimpleSet_Type.tp_dict, __pyx_vtabptr_6bzrlib_15_simple_set_pyx_SimpleSet) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "SimpleSet", (PyObject *)&SimpleSet_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + *(void(**)(void))&__pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet._get = (void(*)(void))__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__get; + *(void(**)(void))&__pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet._add = (void(*)(void))__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__add; + *(void(**)(void))&__pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet._discard = (void(*)(void))__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__discard; + *(void(**)(void))&__pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet._insert_clean = (void(*)(void))__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__insert_clean; + *(void(**)(void))&__pyx_vtable_6bzrlib_15_simple_set_pyx_SimpleSet._resize = (void(*)(void))__pyx_f_6bzrlib_15_simple_set_pyx_9SimpleSet__resize; + if (PyType_Ready(&SimpleSet_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} + if (__Pyx_SetVtable(SimpleSet_Type.tp_dict, __pyx_vtabptr_6bzrlib_15_simple_set_pyx_SimpleSet) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "SimpleSet", (PyObject *)&SimpleSet_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;} __pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet = &SimpleSet_Type; - if (PyType_Ready(&__pyx_type_6bzrlib_15_simple_set_pyx__SimpleSet_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - if (__Pyx_SetAttrString(__pyx_m, "_SimpleSet_iterator", (PyObject *)&__pyx_type_6bzrlib_15_simple_set_pyx__SimpleSet_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;} + __pyx_type_6bzrlib_15_simple_set_pyx__SimpleSet_iterator.tp_free = _PyObject_GC_Del; + if (PyType_Ready(&__pyx_type_6bzrlib_15_simple_set_pyx__SimpleSet_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "_SimpleSet_iterator", (PyObject *)&__pyx_type_6bzrlib_15_simple_set_pyx__SimpleSet_iterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; goto __pyx_L1;} __pyx_ptype_6bzrlib_15_simple_set_pyx__SimpleSet_iterator = &__pyx_type_6bzrlib_15_simple_set_pyx__SimpleSet_iterator; - /*--- Type import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - - /* "bzrlib/_simple_set_pyx.pyx":54 - * cdef object _dummy_obj - * cdef PyObject *_dummy - * _dummy_obj = object() # <<<<<<<<<<<<<< - * _dummy = _dummy_obj - * - */ - __pyx_t_1 = PyObject_Call(__pyx_builtin_object, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GOTREF(__pyx_v_6bzrlib_15_simple_set_pyx__dummy_obj); - __Pyx_DECREF(__pyx_v_6bzrlib_15_simple_set_pyx__dummy_obj); - __Pyx_GIVEREF(__pyx_t_1); - __pyx_v_6bzrlib_15_simple_set_pyx__dummy_obj = __pyx_t_1; - __pyx_t_1 = 0; - - /* "bzrlib/_simple_set_pyx.pyx":55 - * cdef PyObject *_dummy - * _dummy_obj = object() - * _dummy = _dummy_obj # <<<<<<<<<<<<<< - * - * - */ - __pyx_v_6bzrlib_15_simple_set_pyx__dummy = ((PyObject *)__pyx_v_6bzrlib_15_simple_set_pyx__dummy_obj); - /* "bzrlib/_simple_set_pyx.pyx":59 - * - * cdef object _NotImplemented - * _NotImplemented = NotImplemented # <<<<<<<<<<<<<< - * - * - */ - __Pyx_INCREF(__pyx_builtin_NotImplemented); - __Pyx_GOTREF(__pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented); - __Pyx_DECREF(__pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented); - __Pyx_GIVEREF(__pyx_builtin_NotImplemented); - __pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented = __pyx_builtin_NotImplemented; - - /* "bzrlib/_simple_set_pyx.pyx":606 - * # It is a little bit ugly to do this, but it works, and means that Meliae can - * # dump the total memory consumed by all child objects. - * (SimpleSet).tp_traverse = SimpleSet_traverse # <<<<<<<<<<<<<< - */ - ((PyTypeObject *)((PyObject*)__pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet))->tp_traverse = ((traverseproc)__pyx_f_6bzrlib_15_simple_set_pyx_SimpleSet_traverse); - - /* "bzrlib/_simple_set_pyx.pyx":1 - * # Copyright (C) 2009, 2010 Canonical Ltd # <<<<<<<<<<<<<< - * # - * # This program is free software; you can redistribute it and/or modify - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_GOTREF(((PyObject *)__pyx_t_1)); - if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} - __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - __Pyx_AddTraceback("init bzrlib._simple_set_pyx"); - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init bzrlib._simple_set_pyx"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":54 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_object); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_v_6bzrlib_15_simple_set_pyx__dummy_obj); + __pyx_v_6bzrlib_15_simple_set_pyx__dummy_obj = __pyx_2; + __pyx_2 = 0; -/* Runtime support code */ + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":55 */ + __pyx_v_6bzrlib_15_simple_set_pyx__dummy = ((PyObject *)__pyx_v_6bzrlib_15_simple_set_pyx__dummy_obj); -static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { - PyObject *result; - result = PyObject_GetAttr(dict, name); - if (!result) - PyErr_SetObject(PyExc_NameError, name); - return result; -} + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":59 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplemented); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; goto __pyx_L1;} + Py_DECREF(__pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented); + __pyx_v_6bzrlib_15_simple_set_pyx__NotImplemented = __pyx_1; + __pyx_1 = 0; -static void __Pyx_RaiseArgtupleInvalid( - const char* func_name, - int exact, - Py_ssize_t num_min, - Py_ssize_t num_max, - Py_ssize_t num_found) -{ - Py_ssize_t num_expected; - const char *number, *more_or_less; - - if (num_found < num_min) { - num_expected = num_min; - more_or_less = "at least"; - } else { - num_expected = num_max; - more_or_less = "at most"; - } - if (exact) { - more_or_less = "exactly"; - } - number = (num_expected == 1) ? "" : "s"; - PyErr_Format(PyExc_TypeError, - #if PY_VERSION_HEX < 0x02050000 - "%s() takes %s %d positional argument%s (%d given)", - #else - "%s() takes %s %zd positional argument%s (%zd given)", - #endif - func_name, more_or_less, num_expected, number, num_found); + /* "/home/vila/src/bzr/integration/trunk/bzrlib/_simple_set_pyx.pyx":606 */ + ((PyTypeObject *)__pyx_ptype_6bzrlib_15_simple_set_pyx_SimpleSet)->tp_traverse = ((traverseproc)__pyx_f_6bzrlib_15_simple_set_pyx_SimpleSet_traverse); + return; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("bzrlib._simple_set_pyx"); } -static CYTHON_INLINE int __Pyx_CheckKeywordStrings( - PyObject *kwdict, - const char* function_name, - int kw_allowed) -{ - PyObject* key = 0; - Py_ssize_t pos = 0; - while (PyDict_Next(kwdict, &pos, &key, 0)) { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) - #endif - goto invalid_keyword_type; - } - if ((!kw_allowed) && unlikely(key)) - goto invalid_keyword; - return 1; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - return 0; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif - return 0; -} +static char *__pyx_filenames[] = { + "_simple_set_pyx.pyx", +}; -static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyThreadState *tstate = PyThreadState_GET(); - - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} - -static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { - PyThreadState *tstate = PyThreadState_GET(); - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} +/* Runtime support code */ +static void __pyx_init_filenames(void) { + __pyx_f = __pyx_filenames; +} -#if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); @@ -4750,13 +2222,12 @@ Py_INCREF(type); } else { - type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else - type = (PyObject*) Py_TYPE(type); + type = (PyObject*) type->ob_type; Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, @@ -4765,8 +2236,7 @@ } #endif } - - __Pyx_ErrRestore(type, value, tb); + PyErr_Restore(type, value, tb); return; raise_error: Py_XDECREF(value); @@ -4775,664 +2245,125 @@ return; } -#else /* Python 3+ */ - -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (!PyExceptionClass_Check(type)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } - - PyErr_SetObject(type, value); - - if (tb) { - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } - } - -bad: - return; -} -#endif - -static void __Pyx_RaiseDoubleKeywordsError( - const char* func_name, - PyObject* kw_name) -{ - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION >= 3 - "%s() got multiple values for keyword argument '%U'", func_name, kw_name); - #else - "%s() got multiple values for keyword argument '%s'", func_name, - PyString_AS_STRING(kw_name)); - #endif -} - -static int __Pyx_ParseOptionalKeywords( - PyObject *kwds, - PyObject **argnames[], - PyObject *kwds2, - PyObject *values[], - Py_ssize_t num_pos_args, - const char* function_name) -{ - PyObject *key = 0, *value = 0; - Py_ssize_t pos = 0; - PyObject*** name; - PyObject*** first_kw_arg = argnames + num_pos_args; - - while (PyDict_Next(kwds, &pos, &key, &value)) { - name = first_kw_arg; - while (*name && (**name != key)) name++; - if (*name) { - values[name-argnames] = value; - } else { - #if PY_MAJOR_VERSION < 3 - if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { - #else - if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { - #endif - goto invalid_keyword_type; - } else { - for (name = first_kw_arg; *name; name++) { - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) break; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) break; - #endif - } - if (*name) { - values[name-argnames] = value; - } else { - /* unexpected keyword found */ - for (name=argnames; name != first_kw_arg; name++) { - if (**name == key) goto arg_passed_twice; - #if PY_MAJOR_VERSION >= 3 - if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && - PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; - #else - if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && - _PyString_Eq(**name, key)) goto arg_passed_twice; - #endif - } - if (kwds2) { - if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; - } else { - goto invalid_keyword; - } - } - } - } - } - return 0; -arg_passed_twice: - __Pyx_RaiseDoubleKeywordsError(function_name, **name); - goto bad; -invalid_keyword_type: - PyErr_Format(PyExc_TypeError, - "%s() keywords must be strings", function_name); - goto bad; -invalid_keyword: - PyErr_Format(PyExc_TypeError, - #if PY_MAJOR_VERSION < 3 - "%s() got an unexpected keyword argument '%s'", - function_name, PyString_AsString(key)); - #else - "%s() got an unexpected keyword argument '%U'", - function_name, key); - #endif -bad: - return -1; -} - -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (!type) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } - if (likely(PyObject_TypeCheck(obj, type))) + if (obj == Py_None || PyObject_TypeCheck(obj, type)) return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); + PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", + obj->ob_type->tp_name, type->tp_name); return 0; } -static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { - const unsigned char neg_one = (unsigned char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned char" : - "value too large to convert to unsigned char"); - } - return (unsigned char)-1; - } - return (unsigned char)val; - } - return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { - const unsigned short neg_one = (unsigned short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned short" : - "value too large to convert to unsigned short"); - } - return (unsigned short)-1; - } - return (unsigned short)val; - } - return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { - const unsigned int neg_one = (unsigned int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(unsigned int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(unsigned int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to unsigned int" : - "value too large to convert to unsigned int"); - } - return (unsigned int)-1; - } - return (unsigned int)val; - } - return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); -} - -static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { - const char neg_one = (char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to char" : - "value too large to convert to char"); - } - return (char)-1; - } - return (char)val; - } - return (char)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { - const short neg_one = (short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to short" : - "value too large to convert to short"); - } - return (short)-1; - } - return (short)val; - } - return (short)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { - const signed char neg_one = (signed char)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed char) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed char)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed char" : - "value too large to convert to signed char"); - } - return (signed char)-1; - } - return (signed char)val; - } - return (signed char)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { - const signed short neg_one = (signed short)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed short) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed short)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed short" : - "value too large to convert to signed short"); - } - return (signed short)-1; - } - return (signed short)val; - } - return (signed short)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { - const signed int neg_one = (signed int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(signed int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(signed int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to signed int" : - "value too large to convert to signed int"); - } - return (signed int)-1; - } - return (signed int)val; - } - return (signed int)__Pyx_PyInt_AsSignedLong(x); -} - -static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { - const int neg_one = (int)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; - if (sizeof(int) < sizeof(long)) { - long val = __Pyx_PyInt_AsLong(x); - if (unlikely(val != (long)(int)val)) { - if (!unlikely(val == -1 && PyErr_Occurred())) { - PyErr_SetString(PyExc_OverflowError, - (is_unsigned && unlikely(val < 0)) ? - "can't convert negative value to int" : - "value too large to convert to int"); - } - return (int)-1; - } - return (int)val; - } - return (int)__Pyx_PyInt_AsLong(x); -} - -static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { - const unsigned long neg_one = (unsigned long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return (unsigned long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned long"); - return (unsigned long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - unsigned long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned long)-1; - val = __Pyx_PyInt_AsUnsignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { - const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return (unsigned PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to unsigned PY_LONG_LONG"); - return (unsigned PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - unsigned PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (unsigned PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsUnsignedLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { - const long neg_one = (long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return (long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (long)-1; - val = __Pyx_PyInt_AsLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { - const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return (PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to PY_LONG_LONG"); - return (PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsLongLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { - const signed long neg_one = (signed long)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return (signed long)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed long"); - return (signed long)-1; - } - return PyLong_AsUnsignedLong(x); - } else { - return PyLong_AsLong(x); - } - } else { - signed long val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed long)-1; - val = __Pyx_PyInt_AsSignedLong(tmp); - Py_DECREF(tmp); - return val; - } -} - -static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { - const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; - const int is_unsigned = neg_one > const_zero; -#if PY_VERSION_HEX < 0x03000000 - if (likely(PyInt_Check(x))) { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return (signed PY_LONG_LONG)val; - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { - if (unlikely(Py_SIZE(x) < 0)) { - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to signed PY_LONG_LONG"); - return (signed PY_LONG_LONG)-1; - } - return PyLong_AsUnsignedLongLong(x); - } else { - return PyLong_AsLongLong(x); - } - } else { - signed PY_LONG_LONG val; - PyObject *tmp = __Pyx_PyNumber_Int(x); - if (!tmp) return (signed PY_LONG_LONG)-1; - val = __Pyx_PyInt_AsSignedLongLong(tmp); - Py_DECREF(tmp); - return val; +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + if (!*t->p) + return -1; + if (t->i) + PyString_InternInPlace(t->p); + ++t; } + return 0; } -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { +static int __Pyx_ExportFunction(char *n, void *f, char *s) { PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - - d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); + PyObject *p = 0; + d = PyObject_GetAttrString(__pyx_m, "__pyx_capi__"); if (!d) { PyErr_Clear(); d = PyDict_New(); if (!d) goto bad; Py_INCREF(d); - if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) + if (PyModule_AddObject(__pyx_m, "__pyx_capi__", d) < 0) goto bad; } - tmp.fp = f; -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - cobj = PyCapsule_New(tmp.p, sig, 0); -#else - cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); -#endif - if (!cobj) + p = PyCObject_FromVoidPtrAndDesc(f, s, 0); + if (!p) goto bad; - if (PyDict_SetItemString(d, name, cobj) < 0) + if (PyDict_SetItemString(d, n, p) < 0) goto bad; - Py_DECREF(cobj); Py_DECREF(d); return 0; bad: - Py_XDECREF(cobj); + Py_XDECREF(p); Py_XDECREF(d); return -1; } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { -#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) - PyObject *ob = PyCapsule_New(vtable, 0, 0); -#else - PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); -#endif - if (!ob) + PyObject *pycobj = 0; + int result; + + pycobj = PyCObject_FromVoidPtr(vtable, 0); + if (!pycobj) goto bad; - if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) + if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0) goto bad; - Py_DECREF(ob); - return 0; + result = 0; + goto done; + bad: - Py_XDECREF(ob); - return -1; + result = -1; +done: + Py_XDECREF(pycobj); + return result; +} + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; } #include "compile.h" #include "frameobject.h" #include "traceback.h" -static void __Pyx_AddTraceback(const char *funcname) { +static void __Pyx_AddTraceback(char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; + PyObject *empty_tuple = 0; + PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - - #if PY_MAJOR_VERSION < 3 + py_srcfile = PyString_FromString(__pyx_filename); - #else - py_srcfile = PyUnicode_FromString(__pyx_filename); - #endif if (!py_srcfile) goto bad; - if (__pyx_clineno) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } + py_funcname = PyString_FromString(funcname); if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; + empty_tuple = PyTuple_New(0); + if (!empty_tuple) goto bad; + empty_string = PyString_FromString(""); + if (!empty_string) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ - #if PY_MAJOR_VERSION >= 3 - 0, /*int kwonlyargcount,*/ - #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ + empty_string, /*PyObject *code,*/ + empty_tuple, /*PyObject *consts,*/ + empty_tuple, /*PyObject *names,*/ + empty_tuple, /*PyObject *varnames,*/ + empty_tuple, /*PyObject *freevars,*/ + empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ - __pyx_empty_bytes /*PyObject *lnotab*/ + empty_string /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ + PyThreadState_Get(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ @@ -5443,128 +2374,8 @@ bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); + Py_XDECREF(empty_tuple); + Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else /* Python 3+ has unicode identifiers */ - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -/* Type Conversion Functions */ - -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} - -static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_VERSION_HEX < 0x03000000 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return Py_INCREF(x), x; - m = Py_TYPE(x)->tp_as_number; -#if PY_VERSION_HEX < 0x03000000 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_VERSION_HEX < 0x03000000 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%s__ returned non-%s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} - -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { -#if PY_VERSION_HEX < 0x02050000 - if (ival <= LONG_MAX) - return PyInt_FromLong((long)ival); - else { - unsigned char *bytes = (unsigned char *) &ival; - int one = 1; int little = (int)*(unsigned char*)&one; - return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); - } -#else - return PyInt_FromSize_t(ival); -#endif -} - -static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { - unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); - if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { - return (size_t)-1; - } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to size_t"); - return (size_t)-1; - } - return (size_t)val; -} - - -#endif /* Py_PYTHON_H */ diff -Nru bzr-2.5.0/bzrlib/_simple_set_pyx.h bzr-2.6.0~beta1/bzrlib/_simple_set_pyx.h --- bzr-2.5.0/bzrlib/_simple_set_pyx.h 2012-02-24 10:42:20.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/_simple_set_pyx.h 2012-03-15 10:00:25.000000000 +0000 @@ -6,14 +6,6 @@ #define __PYX_EXTERN_C extern #endif -/* "bzrlib/_simple_set_pyx.pxd":31 - * - * - * cdef public api class SimpleSet [object SimpleSetObject, type SimpleSet_Type]: # <<<<<<<<<<<<<< - * """A class similar to PySet, but with simpler implementation. - * - */ - struct SimpleSetObject { PyObject_HEAD struct __pyx_vtabstruct_6bzrlib_15_simple_set_pyx_SimpleSet *__pyx_vtab; diff -Nru bzr-2.5.0/bzrlib/smart/branch.py bzr-2.6.0~beta1/bzrlib/smart/branch.py --- bzr-2.5.0/bzrlib/smart/branch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/smart/branch.py 2012-03-15 10:00:24.000000000 +0000 @@ -299,13 +299,12 @@ def do_tip_change_with_locked_branch(self, branch, new_last_revision_id): if new_last_revision_id == 'null:': - branch._set_revision_history([]) + branch.set_last_revision_info(0, new_last_revision_id) else: if not branch.repository.has_revision(new_last_revision_id): return FailedSmartServerResponse( ('NoSuchRevision', new_last_revision_id)) - branch._set_revision_history(branch._lefthand_history( - new_last_revision_id, None, None)) + branch.generate_revision_history(new_last_revision_id, None, None) return SuccessfulSmartServerResponse(('ok',)) diff -Nru bzr-2.5.0/bzrlib/smart/request.py bzr-2.6.0~beta1/bzrlib/smart/request.py --- bzr-2.5.0/bzrlib/smart/request.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/smart/request.py 2012-03-15 10:00:24.000000000 +0000 @@ -36,7 +36,6 @@ import threading from bzrlib import ( - bzrdir, debug, errors, osutils, @@ -47,6 +46,7 @@ ) from bzrlib.lazy_import import lazy_import lazy_import(globals(), """ +from bzrlib import bzrdir from bzrlib.bundle import serializer import tempfile diff -Nru bzr-2.5.0/bzrlib/store/versioned/__init__.py bzr-2.6.0~beta1/bzrlib/store/versioned/__init__.py --- bzr-2.5.0/bzrlib/store/versioned/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/store/versioned/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -219,7 +219,7 @@ "is deprecated. Please provide a to_transaction.", DeprecationWarning, stacklevel=2) - # we are copying single objects, and there may be open tranasactions + # we are copying single objects, and there may be open transactions # so again with the passthrough to_transaction = PassThroughTransaction() pb = bzrlib.ui.ui_factory.nested_progress_bar() diff -Nru bzr-2.5.0/bzrlib/switch.py bzr-2.6.0~beta1/bzrlib/switch.py --- bzr-2.5.0/bzrlib/switch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/switch.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2007, 2009, 2010 Canonical Ltd. +# Copyright (C) 2007, 2009-2012 Canonical Ltd. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -105,11 +105,15 @@ 'Unable to connect to current master branch %(target)s: ' '%(error)s To switch anyway, use --force.') % e.__dict__) - b.set_bound_location(None) - b.pull(to_branch, overwrite=True, - possible_transports=possible_transports) - b.set_bound_location(to_branch.base) - b.set_parent(b.get_master_branch().get_parent()) + b.lock_write() + try: + b.set_bound_location(None) + b.pull(to_branch, overwrite=True, + possible_transports=possible_transports) + b.set_bound_location(to_branch.base) + b.set_parent(b.get_master_branch().get_parent()) + finally: + b.unlock() else: # If this is a standalone tree and the new branch # is derived from this one, create a lightweight checkout. diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_add.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_add.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_add.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_add.py 2012-03-15 10:00:24.000000000 +0000 @@ -94,6 +94,13 @@ self.run_bzr('add inertiatic/../cicatriz/esp') self.assertEquals(self.run_bzr('unknowns')[0], '') + def test_add_no_recurse(self): + tree = self.make_branch_and_tree('.') + self.build_tree(['inertiatic/', 'inertiatic/esp']) + self.assertEquals(self.run_bzr('unknowns')[0], 'inertiatic\n') + self.run_bzr('add -N inertiatic') + self.assertEquals(self.run_bzr('unknowns')[0], 'inertiatic/esp\n') + def test_add_in_versioned(self): """Try to add a file in a versioned directory. @@ -109,8 +116,6 @@ def test_subdir_add(self): """Add in subdirectory should add only things from there down""" - from bzrlib.workingtree import WorkingTree - eq = self.assertEqual ass = self.assertTrue @@ -247,7 +252,7 @@ self.build_tree_contents([('small.txt', '0\n')]) self.build_tree_contents([('big.txt', '01234567890123456789\n')]) self.build_tree_contents([('big2.txt', '01234567890123456789\n')]) - tree.branch.get_config().set_user_option('add.maximum_file_size', 5) + tree.branch.get_config_stack().set('add.maximum_file_size', 5) out = self.run_bzr('add')[0] results = sorted(out.rstrip('\n').split('\n')) self.assertEquals(['adding small.txt'], results) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_annotate.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_annotate.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_annotate.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_annotate.py 2012-03-15 10:00:24.000000000 +0000 @@ -233,7 +233,8 @@ def test_annotated_edited_merged_file_revnos(self): wt = self._create_merged_file() out, err = self.run_bzr(['annotate', 'file']) - email = config.extract_email_address(wt.branch.get_config().username()) + email = config.extract_email_address( + wt.branch.get_config_stack().get('email')) self.assertEqual( '3? %-7s | local\n' '1 test@ho | foo\n' diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_bound_branches.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_bound_branches.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_bound_branches.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_bound_branches.py 2012-03-15 10:00:24.000000000 +0000 @@ -19,7 +19,7 @@ from bzrlib import ( branch, - bzrdir, + controldir, errors, tests, ) @@ -35,19 +35,18 @@ base_tree.add(['a', 'b']) base_tree.commit('init') base_tree.unlock() - branch = base_tree.branch - child_tree = branch.create_checkout('child') + child_tree = base_tree.branch.create_checkout('child') self.check_revno(1, 'child') - d = bzrdir.BzrDir.open('child') + d = controldir.ControlDir.open('child') self.assertNotEqual(None, d.open_branch().get_master_branch()) return base_tree, child_tree def check_revno(self, val, loc='.'): self.assertEqual( - val, bzrdir.BzrDir.open(loc).open_branch().last_revision_info()[0]) + val, controldir.ControlDir.open(loc).open_branch().last_revision_info()[0]) def test_simple_binding(self): tree = self.make_branch_and_tree('base') @@ -59,7 +58,7 @@ self.run_bzr('bind ../base', working_dir='child') - d = bzrdir.BzrDir.open('child') + d = controldir.ControlDir.open('child') self.assertNotEqual(None, d.open_branch().get_master_branch()) self.run_bzr('unbind', working_dir='child') @@ -127,12 +126,13 @@ def test_double_binding(self): child_tree = self.create_branches()[1] - - child2_tree = child_tree.bzrdir.sprout('child2').open_workingtree() + child_tree.bzrdir.sprout('child2') # Double binding succeeds, but committing to child2 should fail self.run_bzr('bind ../child', working_dir='child2') + # Refresh the child tree object as 'unbind' modified it + child2_tree = controldir.ControlDir.open('child2').open_workingtree() self.assertRaises(errors.CommitToDoubleBoundBranch, child2_tree.commit, message='child2', allow_pointless=True) @@ -150,6 +150,8 @@ self.run_bzr("commit -m child", retcode=3, working_dir='child') self.check_revno(1, 'child') self.run_bzr('unbind', working_dir='child') + # Refresh the child tree/branch objects as 'unbind' modified them + child_tree = child_tree.bzrdir.open_workingtree() child_tree.commit(message='child') self.check_revno(2, 'child') @@ -200,6 +202,8 @@ self.run_bzr('unbind', working_dir='child') + # Refresh the child tree/branch objects as 'unbind' modified them + child_tree = child_tree.bzrdir.open_workingtree() child_tree.commit(message='child', allow_pointless=True) self.check_revno(2, 'child') @@ -210,6 +214,8 @@ # These branches have diverged, but bind should succeed anyway self.run_bzr('bind ../base', working_dir='child') + # Refresh the child tree/branch objects as 'bind' modified them + child_tree = child_tree.bzrdir.open_workingtree() # This should turn the local commit into a merge child_tree.update() child_tree.commit(message='merged') @@ -248,6 +254,8 @@ child_tree = self.create_branches()[1] self.run_bzr('unbind', working_dir='child') + # Refresh the child tree/branch objects as 'bind' modified them + child_tree = child_tree.bzrdir.open_workingtree() child_tree.commit(message='child', allow_pointless=True) self.check_revno(2, 'child') self.check_revno(1, 'base') @@ -347,7 +355,7 @@ branch = tree.branch tree.bzrdir.sprout('child') self.run_bzr('bind --directory=child base') - d = bzrdir.BzrDir.open('child') + d = controldir.ControlDir.open('child') self.assertNotEqual(None, d.open_branch().get_master_branch()) self.run_bzr('unbind -d child') self.assertEqual(None, d.open_branch().get_master_branch()) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_branches.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_branches.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_branches.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_branches.py 2012-03-15 10:00:24.000000000 +0000 @@ -17,6 +17,7 @@ """Black-box tests for bzr branches.""" +from bzrlib.bzrdir import BzrDir from bzrlib.tests import TestCaseWithTransport @@ -76,3 +77,17 @@ out, err = self.run_bzr('branches a') self.assertEquals(out, " another\n" "* colocated\n") + + def test_shared_repos(self): + self.make_repository('a', shared=True) + BzrDir.create_branch_convenience('a/branch1') + b = BzrDir.create_branch_convenience('a/branch2') + b.create_checkout(lightweight=True, to_location='b') + out, err = self.run_bzr('branches b') + self.assertEquals(out, " branch1\n" + "* branch2\n") + + def test_standalone_branch(self): + self.make_branch('a') + out, err = self.run_bzr('branches a') + self.assertEquals(out, "* (default)\n") diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_branch.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_branch.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_branch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_branch.py 2012-03-15 10:00:24.000000000 +0000 @@ -363,12 +363,12 @@ def assertRevisionInRepository(self, repo_path, revid): """Check that a revision is in a repo, disregarding stacking.""" - repo = bzrdir.BzrDir.open(repo_path).open_repository() + repo = controldir.ControlDir.open(repo_path).open_repository() self.assertTrue(repo.has_revision(revid)) def assertRevisionNotInRepository(self, repo_path, revid): """Check that a revision is not in a repo, disregarding stacking.""" - repo = bzrdir.BzrDir.open(repo_path).open_repository() + repo = controldir.ControlDir.open(repo_path).open_repository() self.assertFalse(repo.has_revision(revid)) def assertRevisionsInBranchRepository(self, revid_list, branch_path): @@ -400,7 +400,7 @@ # capable of supporting stacking, but not actually have a stacked_on # branch configured self.assertRaises(errors.NotStacked, - bzrdir.BzrDir.open('newbranch').open_branch().get_stacked_on_url) + controldir.ControlDir.open('newbranch').open_branch().get_stacked_on_url) def test_branch_stacked_branch_stacked(self): """Asking to stack on a stacked branch does work""" diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_break_lock.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_break_lock.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_break_lock.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_break_lock.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,8 +18,8 @@ from bzrlib import ( branch, - bzrdir, config, + controldir, errors, osutils, tests, @@ -54,13 +54,13 @@ 'repo/', 'repo/branch/', 'checkout/']) - bzrdir.BzrDir.create('master-repo').create_repository() - self.master_branch = bzrdir.BzrDir.create_branch_convenience( + controldir.ControlDir.create('master-repo').create_repository() + self.master_branch = controldir.ControlDir.create_branch_convenience( 'master-repo/master-branch') - bzrdir.BzrDir.create('repo').create_repository() - local_branch = bzrdir.BzrDir.create_branch_convenience('repo/branch') + controldir.ControlDir.create('repo').create_repository() + local_branch = controldir.ControlDir.create_branch_convenience('repo/branch') local_branch.bind(self.master_branch) - checkoutdir = bzrdir.BzrDir.create('checkout') + checkoutdir = controldir.ControlDir.create('checkout') checkoutdir.set_branch_reference(local_branch) self.wt = checkoutdir.create_workingtree() diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_checkout.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_checkout.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_checkout.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_checkout.py 2012-03-15 10:00:24.000000000 +0000 @@ -21,6 +21,7 @@ from bzrlib import ( branch as _mod_branch, bzrdir, + controldir, errors, workingtree, ) @@ -37,7 +38,7 @@ def setUp(self): super(TestCheckout, self).setUp() - tree = bzrdir.BzrDir.create_standalone_workingtree('branch') + tree = controldir.ControlDir.create_standalone_workingtree('branch') tree.commit('1', rev_id='1', allow_pointless=True) self.build_tree(['branch/added_in_2']) tree.add('added_in_2') @@ -46,16 +47,16 @@ def test_checkout_makes_bound_branch(self): self.run_bzr('checkout branch checkout') # if we have a checkout, the branch base should be 'branch' - source = bzrdir.BzrDir.open('branch') - result = bzrdir.BzrDir.open('checkout') + source = controldir.ControlDir.open('branch') + result = controldir.ControlDir.open('checkout') self.assertEqual(source.open_branch().bzrdir.root_transport.base, result.open_branch().get_bound_location()) def test_checkout_light_makes_checkout(self): self.run_bzr('checkout --lightweight branch checkout') # if we have a checkout, the branch base should be 'branch' - source = bzrdir.BzrDir.open('branch') - result = bzrdir.BzrDir.open('checkout') + source = controldir.ControlDir.open('branch') + result = controldir.ControlDir.open('checkout') self.assertEqual(source.open_branch().bzrdir.root_transport.base, result.open_branch().bzrdir.root_transport.base) @@ -63,7 +64,7 @@ out, err = self.run_bzr(['checkout', '-r', '-2', 'branch', 'checkout']) # the working tree should now be at revision '1' with the content # from 1. - result = bzrdir.BzrDir.open('checkout') + result = controldir.ControlDir.open('checkout') self.assertEqual(['1'], result.open_workingtree().get_parent_ids()) self.assertPathDoesNotExist('checkout/added_in_2') @@ -72,14 +73,14 @@ 'branch', 'checkout']) # the working tree should now be at revision '1' with the content # from 1. - result = bzrdir.BzrDir.open('checkout') + result = controldir.ControlDir.open('checkout') self.assertEqual(['1'], result.open_workingtree().get_parent_ids()) self.assertPathDoesNotExist('checkout/added_in_2') def test_checkout_into_empty_dir(self): self.make_bzrdir('checkout') out, err = self.run_bzr(['checkout', 'branch', 'checkout']) - result = bzrdir.BzrDir.open('checkout') + result = controldir.ControlDir.open('checkout') tree = result.open_workingtree() branch = result.open_branch() @@ -88,7 +89,7 @@ # or a 'bzr checkout path' with path the name of a directory with # a branch with no tree will reconsistute the tree. os.mkdir('treeless-branch') - branch = bzrdir.BzrDir.create_branch_convenience( + branch = controldir.ControlDir.create_branch_convenience( 'treeless-branch', force_new_tree=False, format=bzrdir.BzrDirMetaFormat1()) @@ -101,7 +102,7 @@ out, err = self.run_bzr('diff treeless-branch') # now test with no parameters - branch = bzrdir.BzrDir.create_branch_convenience( + branch = controldir.ControlDir.create_branch_convenience( '.', force_new_tree=False, format=bzrdir.BzrDirMetaFormat1()) @@ -223,5 +224,5 @@ # being too low. If rpc_count increases, more network roundtrips have # become necessary for this use case. Please do not adjust this number # upwards without agreement from bzr's network support maintainers. - self.assertLength(15, self.hpss_calls) + self.assertLength(13, self.hpss_calls) self.assertThat(self.hpss_calls, ContainsNoVfsCalls) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_commit.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_commit.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_commit.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_commit.py 2012-03-15 10:00:24.000000000 +0000 @@ -30,7 +30,7 @@ ignores, msgeditor, ) -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib.tests import ( test_foreign, features, @@ -117,7 +117,7 @@ def prepare_simple_history(self): """Prepare and return a working tree with one commit of one file""" # Commit with modified file should say so - wt = BzrDir.create_standalone_workingtree('.') + wt = ControlDir.create_standalone_workingtree('.') self.build_tree(['hello.txt', 'extra.txt']) wt.add(['hello.txt']) wt.commit(message='added') @@ -225,7 +225,7 @@ def test_verbose_commit_with_unknown(self): """Unknown files should not be listed by default in verbose output""" # Is that really the best policy? - wt = BzrDir.create_standalone_workingtree('.') + wt = ControlDir.create_standalone_workingtree('.') self.build_tree(['hello.txt', 'extra.txt']) wt.add(['hello.txt']) out,err = self.run_bzr('commit -m added') @@ -628,7 +628,7 @@ "Commit refused."], 'commit -m add-b --fixes=123', working_dir='tree') - tree.branch.get_config().set_user_option("bugtracker", "lp") + tree.branch.get_config_stack().set("bugtracker", "lp") self.run_bzr('commit -m hello --fixes=234 tree/hello.txt') last_rev = tree.branch.repository.get_revision(tree.last_revision()) self.assertEqual('https://launchpad.net/bugs/234 fixed', @@ -757,7 +757,7 @@ # "UnlockableTransport error trying to commit in checkout of readonly # branch" self.make_branch('master') - master = BzrDir.open_from_transport( + master = ControlDir.open_from_transport( self.get_readonly_transport('master')).open_branch() master.create_checkout('checkout') out, err = self.run_bzr(['commit', '--unchanged', '-mfoo', 'checkout'], @@ -887,7 +887,7 @@ # being too low. If rpc_count increases, more network roundtrips have # become necessary for this use case. Please do not adjust this number # upwards without agreement from bzr's network support maintainers. - self.assertLength(214, self.hpss_calls) + self.assertLength(211, self.hpss_calls) self.assertLength(2, self.hpss_connections) self.expectFailure("commit still uses VFS calls", self.assertThat, self.hpss_calls, ContainsNoVfsCalls) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_config.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_config.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_config.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_config.py 2012-03-15 10:00:24.000000000 +0000 @@ -95,7 +95,7 @@ """ ''') - def test_list_all_values(self): + def test_list_value_all(self): config.option_registry.register(config.ListOption('list')) self.addCleanup(config.option_registry.remove, 'list') self.bazaar_config.set_user_option('list', [1, 'a', 'with, a comma']) @@ -106,7 +106,7 @@ list = 1, a, "with, a comma" ''') - def test_list_value_only(self): + def test_list_value_one(self): config.option_registry.register(config.ListOption('list')) self.addCleanup(config.option_registry.remove, 'list') self.bazaar_config.set_user_option('list', [1, 'a', 'with, a comma']) @@ -115,6 +115,24 @@ 1, a, "with, a comma" ''') + def test_registry_value_all(self): + self.bazaar_config.set_user_option('bzr.transform.orphan_policy', + u'move') + script.run_script(self, '''\ + $ bzr config -d tree + bazaar: + [DEFAULT] + bzr.transform.orphan_policy = move + ''') + + def test_registry_value_one(self): + self.bazaar_config.set_user_option('bzr.transform.orphan_policy', + u'move') + script.run_script(self, '''\ + $ bzr config -d tree bzr.transform.orphan_policy + move + ''') + def test_bazaar_config(self): self.bazaar_config.set_user_option('hello', 'world') script.run_script(self, '''\ diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_dpush.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_dpush.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_dpush.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_dpush.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Canonical Ltd +# Copyright (C) 2009-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,7 @@ from bzrlib import ( + branch, tests, ) from bzrlib.tests import ( @@ -144,10 +145,8 @@ 'to', format=test_foreign.DummyForeignVcsDirFormat()) def set_config_push_strict(self, value): - # set config var (any of bazaar.conf, locations.conf, branch.conf - # should do) - conf = self.tree.branch.get_config_stack() - conf.set('dpush_strict', value) + br = branch.Branch.open('local') + br.get_config_stack().set('dpush_strict', value) _default_command = ['dpush', '../to'] diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_exceptions.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_exceptions.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_exceptions.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_exceptions.py 2012-03-15 10:00:24.000000000 +0000 @@ -141,8 +141,8 @@ def test_repository_deprecation_warning_suppressed_global(self): """Old formats give a warning""" - conf = config.GlobalConfig() - conf.set_user_option('suppress_warnings', 'format_deprecation') + conf = config.GlobalStack() + conf.set('suppress_warnings', 'format_deprecation') self.make_obsolete_repo('foo') self.enable_deprecation_warning() out, err = self.run_bzr('status', working_dir='foo') @@ -151,8 +151,8 @@ def test_repository_deprecation_warning_suppressed_locations(self): """Old formats give a warning""" self.make_obsolete_repo('foo') - conf = config.LocationConfig(osutils.pathjoin(self.test_dir, 'foo')) - conf.set_user_option('suppress_warnings', 'format_deprecation') + conf = config.LocationStack(osutils.pathjoin(self.test_dir, 'foo')) + conf.set('suppress_warnings', 'format_deprecation') self.enable_deprecation_warning() out, err = self.run_bzr('status', working_dir='foo') self.check_warning(False) @@ -160,8 +160,8 @@ def test_repository_deprecation_warning_suppressed_branch(self): """Old formats give a warning""" tree = self.make_obsolete_repo('foo') - conf = tree.branch.get_config() - conf.set_user_option('suppress_warnings', 'format_deprecation') + conf = tree.branch.get_config_stack() + conf.set('suppress_warnings', 'format_deprecation') self.enable_deprecation_warning() out, err = self.run_bzr('status', working_dir='foo') self.check_warning(False) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_filtered_view_ops.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_filtered_view_ops.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_filtered_view_ops.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_filtered_view_ops.py 2012-03-15 10:00:24.000000000 +0000 @@ -16,10 +16,7 @@ """Tests that an enabled view is reported and impacts expected commands.""" -import os - from bzrlib import ( - bzrdir, osutils, tests, ) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_help.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_help.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_help.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_help.py 2012-03-15 10:00:24.000000000 +0000 @@ -19,12 +19,16 @@ """ -import bzrlib -from bzrlib import config -from bzrlib.tests import TestCaseWithTransport +from bzrlib import ( + config, + i18n, + tests, + ) +from bzrlib.tests.test_i18n import ZzzTranslations -class TestHelp(TestCaseWithTransport): + +class TestHelp(tests.TestCaseWithTransport): def test_help_basic(self): for cmd in ['--help', 'help', '-h', '-?']: @@ -175,3 +179,27 @@ self.assertEqual("'bzr c' is an alias for 'bzr cat'.\n", self.run_bzr('help c')[0]) + + +class TestTranslatedHelp(tests.TestCaseWithTransport): + """Tests for display of translated help topics""" + + def setUp(self): + super(TestTranslatedHelp, self).setUp() + self.overrideAttr(i18n, '_translations', ZzzTranslations()) + + def test_help_command_utf8(self): + out, err = self.run_bzr(["help", "push"], encoding="utf-8") + self.assertContainsRe(out, "zz\xc3\xa5{{:See also:") + + def test_help_switch_utf8(self): + out, err = self.run_bzr(["push", "--help"], encoding="utf-8") + self.assertContainsRe(out, "zz\xc3\xa5{{:See also:") + + def test_help_command_ascii(self): + out, err = self.run_bzr(["help", "push"], encoding="ascii") + self.assertContainsRe(out, "zz\\?{{:See also:") + + def test_help_switch_ascii(self): + out, err = self.run_bzr(["push", "--help"], encoding="ascii") + self.assertContainsRe(out, "zz\\?{{:See also:") diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_hooks.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_hooks.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_hooks.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_hooks.py 2012-03-15 10:00:24.000000000 +0000 @@ -39,17 +39,17 @@ def test_hooks_with_unnamed_hook(self): self.make_branch('.') def foo(): return - Branch.hooks.install_named_hook('set_rh', foo, None) + Branch.hooks.install_named_hook('post_push', foo, None) out, err = self.run_bzr('hooks') - self._check_hooks_output(out, {'set_rh': ["No hook name"]}) + self._check_hooks_output(out, {'post_push': ["No hook name"]}) def test_hooks_with_named_hook(self): self.make_branch('.') def foo(): return name = "Foo Bar Hook" - Branch.hooks.install_named_hook('set_rh', foo, name) + Branch.hooks.install_named_hook('post_push', foo, name) out, err = self.run_bzr('hooks') - self._check_hooks_output(out, {'set_rh': [name]}) + self._check_hooks_output(out, {'post_push': [name]}) def test_hooks_no_branch(self): self.run_bzr('hooks') @@ -57,19 +57,19 @@ def test_hooks_lazy_with_unnamed_hook(self): self.make_branch('.') def foo(): return - Branch.hooks.install_named_hook_lazy('set_rh', + Branch.hooks.install_named_hook_lazy('post_push', 'bzrlib.tests.blackbox.test_hooks', '_foo_hook', None) out, err = self.run_bzr('hooks') - self._check_hooks_output(out, {'set_rh': ["No hook name"]}) + self._check_hooks_output(out, {'post_push': ["No hook name"]}) def test_hooks_lazy_with_named_hook(self): self.make_branch('.') def foo(): return - Branch.hooks.install_named_hook_lazy('set_rh', + Branch.hooks.install_named_hook_lazy('post_push', 'bzrlib.tests.blackbox.test_hooks', '_foo_hook', 'hook has a name') out, err = self.run_bzr('hooks') - self._check_hooks_output(out, {'set_rh': ["hook has a name"]}) + self._check_hooks_output(out, {'post_push': ["hook has a name"]}) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_info.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_info.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_info.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_info.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2010 Canonical Ltd +# Copyright (C) 2006-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -231,7 +231,7 @@ # Branch and bind to standalone, needs upgrade to metadir # (creates backup as unknown) branch1.bzrdir.sprout('bound') - knit1_format = bzrdir.format_registry.make_bzrdir('knit') + knit1_format = controldir.format_registry.make_bzrdir('knit') upgrade.upgrade('bound', knit1_format) branch3 = controldir.ControlDir.open('bound').open_branch() branch3.bind(branch1) @@ -328,7 +328,7 @@ tree5 = branch1.create_checkout('lightcheckout', lightweight=True) branch5 = tree5.branch out, err = self.run_bzr('info -v lightcheckout') - if "metaweave" in bzrdir.format_registry: + if "metaweave" in controldir.format_registry: format_description = "knit or metaweave" else: format_description = "knit" @@ -546,7 +546,7 @@ def test_info_standalone_no_tree(self): # create standalone branch without a working tree - format = bzrdir.format_registry.make_bzrdir('default') + format = controldir.format_registry.make_bzrdir('default') branch = self.make_branch('branch') repo = branch.repository out, err = self.run_bzr('info branch -v') @@ -575,7 +575,7 @@ self.assertEqual('', err) def test_info_shared_repository(self): - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') transport = self.get_transport() # Create shared repository @@ -871,7 +871,7 @@ self.assertEqual('', err) def test_info_shared_repository_with_trees(self): - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') transport = self.get_transport() # Create shared repository with working trees @@ -1098,7 +1098,7 @@ self.assertEqual('', err) def test_info_shared_repository_with_tree_in_root(self): - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') transport = self.get_transport() # Create shared repository with working trees @@ -1166,7 +1166,7 @@ self.assertEqual('', err) def test_info_repository_hook(self): - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') def repo_info(repo, stats, outf): outf.write("more info\n") info.hooks.install_named_hook('repository', repo_info, None) @@ -1195,7 +1195,7 @@ self.assertEqual('', err) def test_info_unshared_repository_with_colocated_branches(self): - format = bzrdir.format_registry.make_bzrdir('development-colo') + format = controldir.format_registry.make_bzrdir('development-colo') transport = self.get_transport() # Create unshared repository @@ -1561,7 +1561,7 @@ # being too low. If rpc_count increases, more network roundtrips have # become necessary for this use case. Please do not adjust this number # upwards without agreement from bzr's network support maintainers. - self.assertLength(12, self.hpss_calls) + self.assertLength(10, self.hpss_calls) self.assertLength(1, self.hpss_connections) self.assertThat(self.hpss_calls, ContainsNoVfsCalls) @@ -1578,6 +1578,6 @@ # being too low. If rpc_count increases, more network roundtrips have # become necessary for this use case. Please do not adjust this number # upwards without agreement from bzr's network support maintainers. - self.assertLength(16, self.hpss_calls) + self.assertLength(14, self.hpss_calls) self.assertLength(1, self.hpss_connections) self.assertThat(self.hpss_calls, ContainsNoVfsCalls) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_join.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_join.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_join.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_join.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,9 +18,7 @@ import os from bzrlib import ( - bzrdir, osutils, - repository, tests, workingtree, ) @@ -30,7 +28,7 @@ def make_trees(self): base_tree = self.make_branch_and_tree('tree', - format='dirstate-with-subtree') + format='development-subtree') base_tree.commit('empty commit') self.build_tree(['tree/subtree/', 'tree/subtree/file1']) sub_tree = self.make_branch_and_tree('tree/subtree') diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_log.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_log.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_log.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_log.py 2012-03-15 10:00:24.000000000 +0000 @@ -1096,7 +1096,7 @@ # upwards without agreement from bzr's network support maintainers. self.assertThat(self.hpss_calls, ContainsNoVfsCalls) self.assertLength(1, self.hpss_connections) - self.assertLength(10, self.hpss_calls) + self.assertLength(9, self.hpss_calls) def test_verbose_log(self): self.setup_smart_server_with_call_log() @@ -1111,7 +1111,7 @@ # being too low. If rpc_count increases, more network roundtrips have # become necessary for this use case. Please do not adjust this number # upwards without agreement from bzr's network support maintainers. - self.assertLength(11, self.hpss_calls) + self.assertLength(10, self.hpss_calls) self.assertLength(1, self.hpss_connections) self.assertThat(self.hpss_calls, ContainsNoVfsCalls) @@ -1128,6 +1128,6 @@ # being too low. If rpc_count increases, more network roundtrips have # become necessary for this use case. Please do not adjust this number # upwards without agreement from bzr's network support maintainers. - self.assertLength(15, self.hpss_calls) + self.assertLength(14, self.hpss_calls) self.assertLength(1, self.hpss_connections) self.assertThat(self.hpss_calls, ContainsNoVfsCalls) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_merge_directive.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_merge_directive.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_merge_directive.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_merge_directive.py 2012-03-15 10:00:24.000000000 +0000 @@ -223,7 +223,8 @@ def test_mail_uses_config(self): tree1, tree2 = self.prepare_merge_directive() - tree1.branch.get_config_stack().set('smtp_server', 'bogushost') + br = tree1.branch + br.get_config_stack().set('smtp_server', 'bogushost') md_text, errr, connect_calls, sendmail_calls =\ self.run_bzr_fakemail('merge-directive --mail-to' ' pqm@example.com --plain ../tree2 .') diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_merge.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_merge.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_merge.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_merge.py 2012-03-15 10:00:24.000000000 +0000 @@ -26,8 +26,8 @@ from bzrlib import ( branch, - bzrdir, conflicts, + controldir, merge_directive, osutils, tests, @@ -75,7 +75,7 @@ return tree, other def test_merge_reprocess(self): - d = bzrdir.BzrDir.create_standalone_workingtree('.') + d = controldir.ControlDir.create_standalone_workingtree('.') d.commit('h') self.run_bzr('merge . --reprocess --merge-type weave') @@ -278,6 +278,8 @@ base = urlutils.local_path_from_url(branch_a.base) self.assertEndsWith(err, '+N b\nAll changes applied successfully.\n') + # re-open branch as external run_bzr modified it + branch_b = branch_b.bzrdir.open_branch() self.assertEquals(osutils.abspath(branch_b.get_submit_branch()), osutils.abspath(parent)) # test implicit --remember when committing new file @@ -295,6 +297,8 @@ working_dir='branch_b') self.assertEquals(out, '') self.assertEquals(err, '+N c\nAll changes applied successfully.\n') + # re-open branch as external run_bzr modified it + branch_b = branch_b.bzrdir.open_branch() self.assertEquals(osutils.abspath(branch_b.get_submit_branch()), osutils.abspath(branch_c.bzrdir.root_transport.base)) # re-open tree as external run_bzr modified it @@ -553,10 +557,16 @@ tree_b = tree_a.bzrdir.sprout('b').open_workingtree() tree_c = tree_a.bzrdir.sprout('c').open_workingtree() out, err = self.run_bzr(['merge', '-d', 'c']) - self.assertContainsRe(err, 'Merging from remembered parent location .*a\/') - tree_c.branch.set_submit_branch(tree_b.bzrdir.root_transport.base) + self.assertContainsRe(err, + 'Merging from remembered parent location .*a\/') + tree_c.branch.lock_write() + try: + tree_c.branch.set_submit_branch(tree_b.bzrdir.root_transport.base) + finally: + tree_c.branch.unlock() out, err = self.run_bzr(['merge', '-d', 'c']) - self.assertContainsRe(err, 'Merging from remembered submit location .*b\/') + self.assertContainsRe(err, + 'Merging from remembered submit location .*b\/') def test_remember_sets_submit(self): tree_a = self.make_branch_and_tree('a') @@ -566,11 +576,13 @@ # Remember should not happen if using default from parent out, err = self.run_bzr(['merge', '-d', 'b']) - self.assertIs(tree_b.branch.get_submit_branch(), None) + refreshed = workingtree.WorkingTree.open('b') + self.assertIs(refreshed.branch.get_submit_branch(), None) # Remember should happen if user supplies location out, err = self.run_bzr(['merge', '-d', 'b', 'a']) - self.assertEqual(tree_b.branch.get_submit_branch(), + refreshed = workingtree.WorkingTree.open('b') + self.assertEqual(refreshed.branch.get_submit_branch(), tree_a.bzrdir.root_transport.base) def test_no_remember_dont_set_submit(self): diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_pull.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_pull.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_pull.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_pull.py 2012-03-15 10:00:24.000000000 +0000 @@ -236,6 +236,7 @@ tree_a.commit('commit b') # reset parent parent = branch_b.get_parent() + branch_b = branch.Branch.open('branch_b') branch_b.set_parent(None) self.assertEqual(None, branch_b.get_parent()) # test pull for failure without parent set @@ -252,16 +253,22 @@ ('','bzr: ERROR: These branches have diverged.' ' Use the missing command to see how.\n' 'Use the merge command to reconcile them.\n')) - self.assertEqual(branch_b.get_parent(), parent) + tree_b = tree_b.bzrdir.open_workingtree() + branch_b = tree_b.branch + self.assertEqual(parent, branch_b.get_parent()) # test implicit --remember after resolving previous failure uncommit.uncommit(branch=branch_b, tree=tree_b) t.delete('branch_b/d') self.run_bzr('pull', working_dir='branch_b') + # Refresh the branch object as 'pull' modified it + branch_b = branch_b.bzrdir.open_branch() self.assertEqual(branch_b.get_parent(), parent) # test explicit --remember self.run_bzr('pull ../branch_c --remember', working_dir='branch_b') - self.assertEqual(branch_b.get_parent(), - branch_c.bzrdir.root_transport.base) + # Refresh the branch object as 'pull' modified it + branch_b = branch_b.bzrdir.open_branch() + self.assertEqual(branch_c.bzrdir.root_transport.base, + branch_b.get_parent()) def test_pull_bundle(self): from bzrlib.testament import Testament @@ -360,8 +367,7 @@ def test_pull_verbose_uses_default_log(self): tree = self.example_branch('source') target = self.make_branch_and_tree('target') - target_config = target.branch.get_config_stack() - target_config.set('log_format', 'short') + target.branch.get_config_stack().set('log_format', 'short') out = self.run_bzr('pull -v source -d target')[0] self.assertContainsRe(out, r'\n {4}1 .*\n {6}setup\n') self.assertNotContainsRe( diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_push.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_push.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_push.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_push.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2011 Canonical Ltd +# Copyright (C) 2006-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -117,6 +117,8 @@ self.assertEquals(out, ('','bzr: ERROR: These branches have diverged. ' 'See "bzr help diverged-branches" for more information.\n')) + # Refresh the branch as 'push' modified it + branch_a = branch_a.bzrdir.open_branch() self.assertEquals(osutils.abspath(branch_a.get_push_location()), osutils.abspath(branch_b.bzrdir.root_transport.base)) @@ -124,6 +126,8 @@ uncommit.uncommit(branch=branch_b, tree=tree_b) transport.delete('branch_b/c') out, err = self.run_bzr('push', working_dir='branch_a') + # Refresh the branch as 'push' modified it + branch_a = branch_a.bzrdir.open_branch() path = branch_a.get_push_location() self.assertEqual(err, 'Using saved push location: %s\n' @@ -134,6 +138,8 @@ branch_b.bzrdir.root_transport.base) # test explicit --remember self.run_bzr('push ../branch_c --remember', working_dir='branch_a') + # Refresh the branch as 'push' modified it + branch_a = branch_a.bzrdir.open_branch() self.assertEquals(branch_a.get_push_location(), branch_c.bzrdir.root_transport.base) @@ -176,11 +182,12 @@ t.add('file') t.commit('commit 1') self.run_bzr('push -d tree pushed-to') - path = t.branch.get_push_location() + # Refresh the branch as 'push' modified it and get the push location + push_loc = t.branch.bzrdir.open_branch().get_push_location() out, err = self.run_bzr('push', working_dir="tree") self.assertEqual('Using saved push location: %s\n' 'No new revisions or tags to push.\n' % - urlutils.local_path_from_url(path), err) + urlutils.local_path_from_url(push_loc), err) out, err = self.run_bzr('push -q', working_dir="tree") self.assertEqual('', out) self.assertEqual('', err) @@ -285,7 +292,7 @@ # being too low. If rpc_count increases, more network roundtrips have # become necessary for this use case. Please do not adjust this number # upwards without agreement from bzr's network support maintainers. - self.assertLength(14, self.hpss_calls) + self.assertLength(15, self.hpss_calls) self.assertLength(1, self.hpss_connections) self.assertThat(self.hpss_calls, ContainsNoVfsCalls) remote = branch.Branch.open('public') @@ -506,7 +513,8 @@ trunk_public = self.make_branch('public_trunk', format='1.9') trunk_public.pull(trunk_tree.branch) trunk_public_url = self.get_readonly_url('public_trunk') - trunk_tree.branch.set_public_branch(trunk_public_url) + br = trunk_tree.branch + br.set_public_branch(trunk_public_url) # now we do a stacked push, which should determine the public location # for us. out, err = self.run_bzr(['push', '--stacked', @@ -703,10 +711,8 @@ self.tree.commit('modify file', rev_id='modified') def set_config_push_strict(self, value): - # set config var (any of bazaar.conf, locations.conf, branch.conf - # should do) - conf = self.tree.branch.get_config_stack() - conf.set('push_strict', value) + br = branch.Branch.open('local') + br.get_config_stack().set('push_strict', value) _default_command = ['push', '../to'] _default_wd = 'local' diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_reconcile.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_reconcile.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_reconcile.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_reconcile.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,7 +18,7 @@ from bzrlib import ( - bzrdir, + controldir, inventory, tests, ) @@ -28,7 +28,7 @@ class TrivialTest(tests.TestCaseWithTransport): def test_trivial_reconcile(self): - t = bzrdir.BzrDir.create_standalone_workingtree('.') + t = controldir.ControlDir.create_standalone_workingtree('.') (out, err) = self.run_bzr('reconcile') if t.branch.repository._reconcile_backsup_inventory: does_backup_text = "Inventory ok.\n" @@ -45,7 +45,7 @@ self.assertEqualDiff(err, "") def test_does_something_reconcile(self): - t = bzrdir.BzrDir.create_standalone_workingtree('.') + t = controldir.ControlDir.create_standalone_workingtree('.') # an empty inventory with no revision will trigger reconciliation. repo = t.branch.repository inv = inventory.Inventory(revision_id='missing') diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_reconfigure.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_reconfigure.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_reconfigure.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_reconfigure.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2007, 2009 Canonical Ltd +# Copyright (C) 2007-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,12 +15,11 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA from bzrlib import ( - bzrdir, + controldir, errors, tests, workingtree, ) -from bzrlib.branchbuilder import BranchBuilder from bzrlib.tests.script import TestCaseWithTransportAndScript @@ -86,7 +85,7 @@ def test_use_shared_to_standalone(self): repo = self.make_repository('repo', shared=True) - branch = bzrdir.BzrDir.create_branch_convenience('repo/tree') + branch = controldir.ControlDir.create_branch_convenience('repo/tree') self.assertNotEqual(branch.bzrdir.root_transport.base, branch.repository.bzrdir.root_transport.base) self.run_bzr('reconfigure --standalone', working_dir='repo/tree') @@ -126,7 +125,7 @@ def test_make_without_trees_leaves_tree_alone(self): repo = self.make_repository('repo', shared=True) - branch = bzrdir.BzrDir.create_branch_convenience('repo/branch') + branch = controldir.ControlDir.create_branch_convenience('repo/branch') tree = workingtree.WorkingTree.open('repo/branch') self.build_tree(['repo/branch/foo']) tree.add('foo') @@ -137,7 +136,7 @@ def test_shared_format_to_standalone(self, format=None): repo = self.make_repository('repo', shared=True, format=format) - branch = bzrdir.BzrDir.create_branch_convenience('repo/tree') + branch = controldir.ControlDir.create_branch_convenience('repo/tree') self.assertNotEqual(branch.bzrdir.root_transport.base, branch.repository.bzrdir.root_transport.base) tree = workingtree.WorkingTree.open('repo/tree') @@ -242,20 +241,19 @@ branch_2 = tree_2.branch # now reconfigure to be stacked out, err = self.run_bzr('reconfigure --stacked-on b1 b2') - self.assertContainsRe(out, - '^.*/b2/ is now stacked on ../b1\n$') + self.assertContainsRe(out, '^.*/b2/ is now stacked on ../b1\n$') self.assertEquals('', err) # can also give the absolute URL of the branch, and it gets stored # as a relative path if possible out, err = self.run_bzr('reconfigure --stacked-on %s b2' - % (self.get_url('b1'),)) - self.assertContainsRe(out, - '^.*/b2/ is now stacked on ../b1\n$') + % (self.get_url('b1'),)) + self.assertContainsRe(out, '^.*/b2/ is now stacked on ../b1\n$') self.assertEquals('', err) + # Refresh the branch as 'reconfigure' modified it + branch_2 = branch_2.bzrdir.open_branch() # It should be given a relative URL to the destination, if possible, # because that's most likely to work across different transports - self.assertEquals(branch_2.get_stacked_on_url(), - '../b1') + self.assertEquals('../b1', branch_2.get_stacked_on_url()) # commit, and it should be stored into b2's repo self.build_tree_contents([('foo', 'new foo')]) tree_2.commit('update foo') @@ -264,8 +262,9 @@ self.assertContainsRe(out, '^.*/b2/ is now not stacked\n$') self.assertEquals('', err) - self.assertRaises(errors.NotStacked, - branch_2.get_stacked_on_url) + # Refresh the branch as 'reconfigure' modified it + branch_2 = branch_2.bzrdir.open_branch() + self.assertRaises(errors.NotStacked, branch_2.get_stacked_on_url) # XXX: Needs a test for reconfiguring stacking and shape at the same time; # no branch at location; stacked-on is not a branch; quiet mode. diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_reference.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_reference.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_reference.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_reference.py 2012-03-15 10:00:24.000000000 +0000 @@ -17,7 +17,7 @@ from bzrlib import ( branch as _mod_branch, - bzrdir, + controldir, ) from bzrlib.tests import TestCaseWithTransport @@ -25,7 +25,7 @@ class TestReference(TestCaseWithTransport): def get_default_format(self): - format = bzrdir.format_registry.make_bzrdir('1.9') + format = controldir.format_registry.make_bzrdir('1.9') format.set_branch_format(_mod_branch.BzrBranchFormat8()) return format diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_re_sign.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_re_sign.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_re_sign.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_re_sign.py 2012-03-15 10:00:24.000000000 +0000 @@ -23,7 +23,7 @@ gpg, tests, ) -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib.testament import Testament @@ -39,7 +39,7 @@ self.overrideAttr(gpg, 'GPGStrategy', gpg.LoopbackGPGStrategy) def setup_tree(self): - wt = BzrDir.create_standalone_workingtree('.') + wt = ControlDir.create_standalone_workingtree('.') wt.commit("base A", allow_pointless=True, rev_id='A') wt.commit("base B", allow_pointless=True, rev_id='B') wt.commit("base C", allow_pointless=True, rev_id='C') @@ -89,7 +89,7 @@ def test_resign_directory(self): """Test --directory option""" - wt = BzrDir.create_standalone_workingtree('a') + wt = ControlDir.create_standalone_workingtree('a') wt.commit("base A", allow_pointless=True, rev_id='A') wt.commit("base B", allow_pointless=True, rev_id='B') wt.commit("base C", allow_pointless=True, rev_id='C') diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_rmbranch.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_rmbranch.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_rmbranch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_rmbranch.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,7 +18,7 @@ """Black-box tests for bzr rmbranch.""" from bzrlib import ( - bzrdir, + controldir, ) from bzrlib.tests import ( TestCaseWithTransport, @@ -28,7 +28,7 @@ class TestRemoveBranch(TestCaseWithTransport): - def example_branch(self, path='.', format=None): + def example_tree(self, path='.', format=None): tree = self.make_branch_and_tree(path, format=format) self.build_tree_contents([(path + '/hello', 'foo')]) tree.add('hello') @@ -40,36 +40,69 @@ def test_remove_local(self): # Remove a local branch. - self.example_branch('a') - self.run_bzr('rmbranch a') - dir = bzrdir.BzrDir.open('a') + tree = self.example_tree('a') + self.run_bzr_error(['Branch is active. Use --force to remove it.\n'], + 'rmbranch a') + self.run_bzr('rmbranch --force a') + dir = controldir.ControlDir.open('a') self.assertFalse(dir.has_branch()) self.assertPathExists('a/hello') self.assertPathExists('a/goodbye') def test_no_branch(self): - # No branch in the current directory. + # No branch in the current directory. self.make_repository('a') self.run_bzr_error(['Not a branch'], 'rmbranch a') + def test_no_tree(self): + # removing the active branch is possible if there is no tree + tree = self.example_tree('a') + tree.bzrdir.destroy_workingtree() + self.run_bzr('rmbranch', working_dir='a') + dir = controldir.ControlDir.open('a') + self.assertFalse(dir.has_branch()) + def test_no_arg(self): # location argument defaults to current directory - self.example_branch('a') - self.run_bzr('rmbranch', working_dir='a') - dir = bzrdir.BzrDir.open('a') + self.example_tree('a') + self.run_bzr_error(['Branch is active. Use --force to remove it.\n'], + 'rmbranch a') + self.run_bzr('rmbranch --force', working_dir='a') + dir = controldir.ControlDir.open('a') self.assertFalse(dir.has_branch()) def test_remove_colo(self): # Remove a colocated branch. - tree = self.example_branch('a', format='development-colo') + tree = self.example_tree('a') tree.bzrdir.create_branch(name="otherbranch") self.assertTrue(tree.bzrdir.has_branch('otherbranch')) self.run_bzr('rmbranch %s,branch=otherbranch' % tree.bzrdir.user_url) - dir = bzrdir.BzrDir.open('a') + dir = controldir.ControlDir.open('a') self.assertFalse(dir.has_branch('otherbranch')) self.assertTrue(dir.has_branch()) + def test_remove_colo_directory(self): + # Remove a colocated branch. + tree = self.example_tree('a') + tree.bzrdir.create_branch(name="otherbranch") + self.assertTrue(tree.bzrdir.has_branch('otherbranch')) + self.run_bzr('rmbranch otherbranch -d %s' % tree.bzrdir.user_url) + dir = controldir.ControlDir.open('a') + self.assertFalse(dir.has_branch('otherbranch')) + self.assertTrue(dir.has_branch()) + + def test_remove_active_colo_branch(self): + # Remove a colocated branch. + dir = self.make_repository('a').bzrdir + branch = dir.create_branch('otherbranch') + branch.create_checkout('a') + self.run_bzr_error(['Branch is active. Use --force to remove it.\n'], + 'rmbranch otherbranch -d %s' % branch.bzrdir.user_url) + self.assertTrue(dir.has_branch('otherbranch')) + self.run_bzr('rmbranch --force otherbranch -d %s' % branch.bzrdir.user_url) + self.assertFalse(dir.has_branch('otherbranch')) + class TestSmartServerRemoveBranch(TestCaseWithTransport): @@ -83,6 +116,6 @@ # being too low. If rpc_count increases, more network roundtrips have # become necessary for this use case. Please do not adjust this number # upwards without agreement from bzr's network support maintainers. - self.assertLength(2, self.hpss_calls) + self.assertLength(5, self.hpss_calls) self.assertLength(1, self.hpss_connections) self.assertThat(self.hpss_calls, ContainsNoVfsCalls) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_send.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_send.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_send.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_send.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2011 Canonical Ltd +# Copyright (C) 2006-2012 Canonical Ltd # Authors: Aaron Bentley # # This program is free software; you can redistribute it and/or modify @@ -20,7 +20,6 @@ from bzrlib import ( branch, - bzrdir, merge_directive, tests, ) @@ -63,7 +62,7 @@ def setUp(self): super(TestSend, self).setUp() - grandparent_tree = bzrdir.BzrDir.create_standalone_workingtree( + grandparent_tree = ControlDir.create_standalone_workingtree( 'grandparent') self.build_tree_contents([('grandparent/file1', 'grandparent')]) grandparent_tree.add('file1') @@ -193,25 +192,26 @@ def test_mailto_option(self): b = branch.Branch.open('branch') - b.get_config().set_user_option('mail_client', 'editor') + b.get_config_stack().set('mail_client', 'editor') self.run_bzr_error( ('No mail-to address \\(--mail-to\\) or output \\(-o\\) specified', ), 'send -f branch') - b.get_config().set_user_option('mail_client', 'bogus') + b.get_config_stack().set('mail_client', 'bogus') self.run_send([]) - self.run_bzr_error(('Unknown mail client: bogus',), + self.run_bzr_error(('Bad value "bogus" for option "mail_client"',), 'send -f branch --mail-to jrandom@example.org') b.get_config_stack().set('submit_to', 'jrandom@example.org') - self.run_bzr_error(('Unknown mail client: bogus',), + self.run_bzr_error(('Bad value "bogus" for option "mail_client"',), 'send -f branch') def test_mailto_child_option(self): """Make sure that child_submit_to is used.""" b = branch.Branch.open('branch') - b.get_config().set_user_option('mail_client', 'bogus') + b.get_config_stack().set('mail_client', 'bogus') parent = branch.Branch.open('parent') parent.get_config_stack().set('child_submit_to', 'somebody@example.org') - self.run_bzr_error(('Unknown mail client: bogus',), 'send -f branch') + self.run_bzr_error(('Bad value "bogus" for option "mail_client"',), + 'send -f branch') def test_format(self): md = self.get_MD(['--format=4']) @@ -229,12 +229,13 @@ 'send -f branch -o- --format=0.999')[0] def test_format_child_option(self): - parent_config = branch.Branch.open('parent').get_config_stack() - parent_config.set('child_submit_format', '4') + br = branch.Branch.open('parent') + conf = br.get_config_stack() + conf.set('child_submit_format', '4') md = self.get_MD([]) self.assertIs(merge_directive.MergeDirective2, md.__class__) - parent_config.set('child_submit_format', '0.9') + conf.set('child_submit_format', '0.9') md = self.get_MD([]) self.assertFormatIs('# Bazaar revision bundle v0.9', md) @@ -242,7 +243,7 @@ self.assertFormatIs('# Bazaar revision bundle v0.9', md) self.assertIs(merge_directive.MergeDirective, md.__class__) - parent_config.set('child_submit_format', '0.999') + conf.set('child_submit_format', '0.999') self.run_bzr_error(["No such send format '0.999'"], 'send -f branch -o-')[0] @@ -273,7 +274,7 @@ def make_parent_and_local_branches(self): # Create a 'parent' branch as the base - self.parent_tree = bzrdir.BzrDir.create_standalone_workingtree('parent') + self.parent_tree = ControlDir.create_standalone_workingtree('parent') self.build_tree_contents([('parent/file', 'parent')]) self.parent_tree.add('file') self.parent_tree.commit('first commit', rev_id='parent') @@ -292,10 +293,8 @@ _default_additional_warning = 'Uncommitted changes will not be sent.' def set_config_send_strict(self, value): - # set config var (any of bazaar.conf, locations.conf, branch.conf - # should do) - conf = self.local_tree.branch.get_config_stack() - conf.set('send_strict', value) + br = branch.Branch.open('local') + br.get_config_stack().set('send_strict', value) def assertSendFails(self, args): out, err = self.run_send(args, rc=3, err_re=self._default_errors) @@ -462,6 +461,6 @@ # being too low. If rpc_count increases, more network roundtrips have # become necessary for this use case. Please do not adjust this number # upwards without agreement from bzr's network support maintainers. - self.assertLength(9, self.hpss_calls) + self.assertLength(7, self.hpss_calls) self.assertLength(1, self.hpss_connections) self.assertThat(self.hpss_calls, ContainsNoVfsCalls) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_serve.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_serve.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_serve.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_serve.py 2012-03-15 10:00:24.000000000 +0000 @@ -34,7 +34,7 @@ urlutils, ) from bzrlib.branch import Branch -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib.smart import client, medium from bzrlib.smart.server import ( BzrServerFactory, @@ -122,7 +122,7 @@ SmartTCPServer.hooks.install_named_hook( 'server_exception', hook, 'test_server_except_hook hook') - args = ['--port', 'localhost:0', '--quiet'] + args = ['--listen', 'localhost', '--port', '0', '--quiet'] out, err = self.run_bzr_serve_then_func(args, retcode=0) self.assertEqual('catching KeyboardInterrupt\n', err) @@ -190,7 +190,7 @@ finish_bzr_subprocess, and the base url for the server. """ # Serve from the current directory - args = ['serve', '--port', 'localhost:0'] + args = ['serve', '--listen', 'localhost', '--port', '0'] args.extend(extra_options) process = self.start_bzr_subprocess(args, skip_if_plan_to_signal=True) port_line = process.stderr.readline() @@ -203,7 +203,7 @@ def test_bzr_serve_quiet(self): self.make_branch('.') - args = ['--port', 'localhost:0', '--quiet'] + args = ['--listen', 'localhost', '--port', '0', '--quiet'] out, err = self.run_bzr_serve_then_func(args, retcode=3) self.assertEqual('', out) self.assertEqual('', err) @@ -221,7 +221,7 @@ process, transport = self.start_server_inet(['--allow-writes']) # We get a working branch, and can create a directory - branch = BzrDir.open_from_transport(transport).open_branch() + branch = ControlDir.open_from_transport(transport).open_branch() self.make_read_requests(branch) transport.mkdir('adir') self.assertInetServerShutsdownCleanly(process) @@ -263,7 +263,7 @@ log_fname = os.getcwd() + '/server.log' self.overrideEnv('BZR_LOG', log_fname) process, transport = self.start_server_inet(['-Dhpss']) - branch = BzrDir.open_from_transport(transport).open_branch() + branch = ControlDir.open_from_transport(transport).open_branch() self.make_read_requests(branch) self.assertInetServerShutsdownCleanly(process) f = open(log_fname, 'rb') @@ -354,7 +354,7 @@ t = self.get_transport() t.mkdir('server-root') self.run_bzr_serve_then_func( - ['--port', '127.0.0.1:0', + ['--listen', 'localhost', '--port', '0', '--directory', t.local_abspath('server-root'), '--allow-writes'], func=self.when_server_started) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_shared_repository.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_shared_repository.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_shared_repository.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_shared_repository.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,7 +18,8 @@ import os -from bzrlib.bzrdir import BzrDir, BzrDirMetaFormat1 +from bzrlib.bzrdir import BzrDirMetaFormat1 +from bzrlib.controldir import ControlDir import bzrlib.errors as errors from bzrlib.tests import TestCaseInTempDir from bzrlib.tests.matchers import ContainsNoVfsCalls @@ -34,7 +35,7 @@ shared repository: a """) self.assertEqual(err, "") - dir = BzrDir.open('a') + dir = ControlDir.open('a') self.assertIs(dir.open_repository().is_shared(), True) self.assertRaises(errors.NotBranchError, dir.open_branch) self.assertRaises(errors.NoWorkingTree, dir.open_workingtree) @@ -43,7 +44,7 @@ out, err = self.run_bzr("init-repository a -q") self.assertEqual(out, "") self.assertEqual(err, "") - dir = BzrDir.open('a') + dir = ControlDir.open('a') self.assertIs(dir.open_repository().is_shared(), True) self.assertRaises(errors.NotBranchError, dir.open_branch) self.assertRaises(errors.NoWorkingTree, dir.open_workingtree) @@ -54,17 +55,17 @@ (Malone #38331) """ out, err = self.run_bzr("init-repository .") - dir = BzrDir.open('.') + dir = ControlDir.open('.') self.assertTrue(dir.open_repository()) def test_init(self): self.run_bzr("init-repo a") self.run_bzr("init --format=default a/b") - dir = BzrDir.open('a') + dir = ControlDir.open('a') self.assertIs(dir.open_repository().is_shared(), True) self.assertRaises(errors.NotBranchError, dir.open_branch) self.assertRaises(errors.NoWorkingTree, dir.open_workingtree) - bdir = BzrDir.open('a/b') + bdir = ControlDir.open('a/b') bdir.open_branch() self.assertRaises(errors.NoRepositoryPresent, bdir.open_repository) wt = bdir.open_workingtree() @@ -73,7 +74,7 @@ self.run_bzr("init-repo a") self.run_bzr("init --format=default a/b") self.run_bzr('branch a/b a/c') - cdir = BzrDir.open('a/c') + cdir = ControlDir.open('a/c') cdir.open_branch() self.assertRaises(errors.NoRepositoryPresent, cdir.open_repository) cdir.open_workingtree() @@ -86,7 +87,7 @@ self.run_bzr("commit -m bar b/hello") self.run_bzr('branch b a/c') - cdir = BzrDir.open('a/c') + cdir = ControlDir.open('a/c') cdir.open_branch() self.assertRaises(errors.NoRepositoryPresent, cdir.open_repository) self.assertPathExists('a/c/hello') @@ -95,20 +96,20 @@ def test_trees_default(self): # 0.15 switched to trees by default self.run_bzr("init-repo repo") - repo = BzrDir.open("repo").open_repository() + repo = ControlDir.open("repo").open_repository() self.assertEqual(True, repo.make_working_trees()) def test_trees_argument(self): # Supplying the --trees argument should be harmless, # as it was previously non-default we need to get it right. self.run_bzr("init-repo --trees trees") - repo = BzrDir.open("trees").open_repository() + repo = ControlDir.open("trees").open_repository() self.assertEqual(True, repo.make_working_trees()) def test_no_trees_argument(self): # --no-trees should make it so that there is no working tree self.run_bzr("init-repo --no-trees notrees") - repo = BzrDir.open("notrees").open_repository() + repo = ControlDir.open("notrees").open_repository() self.assertEqual(False, repo.make_working_trees()) def test_init_repo_smart_acceptance(self): @@ -129,7 +130,7 @@ out, err = self.run_bzr("init-repository -q a") self.assertEqual(out, "") self.assertEqual(err, "") - dir = BzrDir.open('a') + dir = ControlDir.open('a') dir.open_repository() # there is a repository there e = self.assertRaises(errors.NotBranchError, dir.open_branch) self.assertContainsRe(str(e), "location is a repository") @@ -145,7 +146,7 @@ def test_init_repo_with_post_repo_init_hook(self): calls = [] - BzrDir.hooks.install_named_hook('post_repo_init', calls.append, None) + ControlDir.hooks.install_named_hook('post_repo_init', calls.append, None) self.assertLength(0, calls) self.run_bzr("init-repository a") self.assertLength(1, calls) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_sign_my_commits.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_sign_my_commits.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_sign_my_commits.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_sign_my_commits.py 2012-03-15 10:00:24.000000000 +0000 @@ -109,7 +109,7 @@ outlines = out.splitlines() self.assertEquals(5, len(outlines)) - self.assertEquals('Signed 4 revisions', outlines[-1]) + self.assertEquals('Signed 4 revisions.', outlines[-1]) self.assertUnsigned(repo, 'A') self.assertUnsigned(repo, 'B') self.assertUnsigned(repo, 'C') diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_switch.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_switch.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_switch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_switch.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2010 Canonical Ltd +# Copyright (C) 2007-2012 Canonical Ltd # -*- coding: utf-8 -*- # # This program is free software; you can redistribute it and/or modify @@ -20,17 +20,17 @@ import os -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib import ( - osutils, - urlutils, - branch, - ) + osutils, + urlutils, + branch, + ) from bzrlib.workingtree import WorkingTree from bzrlib.tests import ( - TestCaseWithTransport, - script, - ) + TestCaseWithTransport, + script, + ) from bzrlib.tests.features import UnicodeFilenameFeature from bzrlib.directory_service import directories @@ -153,8 +153,11 @@ branchb_id = tree2.commit('bar') checkout = tree1.branch.create_checkout('heavyco/a', lightweight=False) self.run_bzr(['switch', 'branchb'], working_dir='heavyco/a') + # Refresh checkout as 'switch' modified it + checkout = checkout.bzrdir.open_workingtree() self.assertEqual(branchb_id, checkout.last_revision()) - self.assertEqual(tree2.branch.base, checkout.branch.get_bound_location()) + self.assertEqual(tree2.branch.base, + checkout.branch.get_bound_location()) def test_switch_finds_relative_unicode_branch(self): """Switch will find 'foo' relative to the branch the checkout is of.""" @@ -234,7 +237,7 @@ tree.add('file-1') revid1 = tree.commit('rev1') self.run_bzr(['switch', '-b', 'anotherbranch'], working_dir='branch-1') - bzrdir = BzrDir.open("branch-1") + bzrdir = ControlDir.open("branch-1") self.assertEquals( set([b.name for b in bzrdir.list_branches()]), set(["foo", "anotherbranch"])) @@ -253,7 +256,7 @@ tree.add('file-1') revid1 = tree.commit('rev1') self.run_bzr(['switch', '-b', u'branch\xe9'], working_dir='branch-1') - bzrdir = BzrDir.open("branch-1") + bzrdir = ControlDir.open("branch-1") self.assertEquals( set([b.name for b in bzrdir.list_branches()]), set(["foo", u"branch\xe9"])) @@ -472,5 +475,5 @@ # become necessary for this use case. Please do not adjust this number # upwards without agreement from bzr's network support maintainers. self.assertLength(24, self.hpss_calls) - self.assertLength(5, self.hpss_connections) + self.assertLength(4, self.hpss_connections) self.assertThat(self.hpss_calls, ContainsNoVfsCalls) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_upgrade.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_upgrade.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_upgrade.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_upgrade.py 2012-03-15 10:00:24.000000000 +0000 @@ -49,7 +49,7 @@ 'branch-format', bzrdir.BzrDirMetaFormat1().get_format_string(), mode=to_convert._get_file_mode()) - return bzrdir.BzrDir.open(to_convert.user_url) + return controldir.ControlDir.open(to_convert.user_url) class OldBzrDirFormat(bzrdir.BzrDirMetaFormat1): @@ -155,7 +155,7 @@ """ % (display_url, display_url, display_url, display_url, backup_dir), out) self.assertEqualDiff("", err) self.assertTrue(isinstance( - bzrdir.BzrDir.open(self.get_url(path))._format, + controldir.ControlDir.open(self.get_url(path))._format, bzrdir.BzrDirMetaFormat1)) def test_upgrade_explicit_knit(self): @@ -179,7 +179,7 @@ """ % (display_url, display_url, display_url, display_url, backup_dir), out) self.assertEqualDiff("", err) - converted_dir = bzrdir.BzrDir.open(self.get_url('branch')) + converted_dir = controldir.ControlDir.open(self.get_url('branch')) self.assertTrue(isinstance(converted_dir._format, bzrdir.BzrDirMetaFormat1)) self.assertTrue(isinstance(converted_dir.open_repository()._format, @@ -196,9 +196,9 @@ self.run_bzr('upgrade --format=2a branch-foo %s' % (option_str,)) def assertBranchFormat(self, dir, format): - branch = bzrdir.BzrDir.open_tree_or_branch(self.get_url(dir))[1] + branch = controldir.ControlDir.open_tree_or_branch(self.get_url(dir))[1] branch_format = branch._format - meta_format = bzrdir.format_registry.make_bzrdir(format) + meta_format = controldir.format_registry.make_bzrdir(format) expected_format = meta_format.get_branch_format() self.assertEqual(expected_format, branch_format) @@ -245,7 +245,7 @@ """ % (display_url, display_url, display_url, display_url, backup_dir2), out) self.assertEqualDiff("", err) self.assertTrue(isinstance( - bzrdir.BzrDir.open(self.get_url("old_format_branch"))._format, + controldir.ControlDir.open(self.get_url("old_format_branch"))._format, bzrdir.BzrDirMetaFormat1)) self.assertTrue(t.has(backup_dir2)) diff -Nru bzr-2.5.0/bzrlib/tests/blackbox/test_whoami.py bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_whoami.py --- bzr-2.5.0/bzrlib/tests/blackbox/test_whoami.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/blackbox/test_whoami.py 2012-03-15 10:00:24.000000000 +0000 @@ -19,6 +19,7 @@ import bzrlib from bzrlib import ( + branch, config, errors, tests, @@ -50,11 +51,14 @@ out = self.run_bzr("whoami --email 'foo '", 3)[0] self.assertEquals("", out) + def set_branch_email(self, b, email): + b.get_config_stack().set('email', email) + def test_whoami_branch(self): """branch specific user identity works.""" wt = self.make_branch_and_tree('.') b = bzrlib.branch.Branch.open('.') - b.get_config_stack().set('email', 'Branch Identity ') + self.set_branch_email(b, 'Branch Identity ') self.assertWhoAmI('Branch Identity ') self.assertWhoAmI('branch@identi.ty', '--email') @@ -79,8 +83,7 @@ """ wt = self.make_branch_and_tree('.') b = bzrlib.branch.Branch.open('.') - b.get_config_stack().set( - 'email', u'Branch Identity \u20ac ' + '') + self.set_branch_email(b, u'Branch Identity \u20ac ') self.assertWhoAmI('Branch Identity ? ', encoding='ascii') self.assertWhoAmI('branch@identi.ty', '--email', @@ -100,20 +103,20 @@ self.overrideEnv('EMAIL', None) self.overrideEnv('BZR_EMAIL', None) # Also, make sure that it's not inferred from mailname. - self.overrideAttr(config, '_auto_user_id', - lambda: (None, None)) + self.overrideAttr(config, '_auto_user_id', lambda: (None, None)) out, err = self.run_bzr(['whoami'], 3) self.assertContainsRe(err, 'Unable to determine your name') def test_whoami_directory(self): """Test --directory option.""" wt = self.make_branch_and_tree('subdir') - c = wt.branch.get_config_stack() - c.set('email', 'Branch Identity ') + self.set_branch_email(wt.branch, 'Branch Identity ') self.assertWhoAmI('Branch Identity ', '--directory', 'subdir') self.run_bzr(['whoami', '--directory', 'subdir', '--branch', 'Changed Identity ']) + # Refresh wt as 'whoami' modified it + wt = wt.bzrdir.open_workingtree() c = wt.branch.get_config_stack() self.assertEquals('Changed Identity ', c.get('email')) @@ -121,8 +124,7 @@ def test_whoami_remote_directory(self): """Test --directory option with a remote directory.""" wt = self.make_branch_and_tree('subdir') - c = wt.branch.get_config_stack() - c.set('email', 'Branch Identity ') + self.set_branch_email(wt.branch, 'Branch Identity ') url = self.get_readonly_url() + '/subdir' self.assertWhoAmI('Branch Identity ', '--directory', url) @@ -131,7 +133,7 @@ 'Changed Identity ']) # The identity has been set in the branch config (but not the global # config) - c = wt.branch.get_config_stack() + c = branch.Branch.open(url).get_config_stack() self.assertEquals('Changed Identity ', c.get('email')) # Ensuring that the value does not come from the bazaar.conf file diff -Nru bzr-2.5.0/bzrlib/tests/doc_generate/builders/__init__.py bzr-2.6.0~beta1/bzrlib/tests/doc_generate/builders/__init__.py --- bzr-2.5.0/bzrlib/tests/doc_generate/builders/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/doc_generate/builders/__init__.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -# Copyright (C) 2010 Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - -"""Sphinx builders tests.""" - -from bzrlib.tests import features - -def load_tests(basic_tests, module, loader): - suite = loader.suiteClass() - # add the tests for this module - suite.addTests(basic_tests) - - if features.sphinx.available(): - testmod_names = [ - 'texinfo', - ] - # add the tests for the sub modules - suite.addTests(loader.loadTestsFromModuleNames( - ['bzrlib.tests.doc_generate.builders.test_' + name - for name in testmod_names])) - - return suite diff -Nru bzr-2.5.0/bzrlib/tests/doc_generate/builders/test_texinfo.py bzr-2.6.0~beta1/bzrlib/tests/doc_generate/builders/test_texinfo.py --- bzr-2.5.0/bzrlib/tests/doc_generate/builders/test_texinfo.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/doc_generate/builders/test_texinfo.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -# Copyright (C) 2010, 2011 Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -"""sphinx texinfo builder tests.""" - -from bzrlib import tests -from bzrlib.doc_generate import ( - # FIXME: doc/en/conf.py should be used here, or rather merged into - # bzrlib/doc_generate/conf.py -- vila 20100429 - conf, - ) -from bzrlib.tests import ( - doc_generate as test_dg, # Avoid clash with from bzrlib import doc_generate - ) - - -class TestBuilderDefined(tests.TestCase): - - def test_builder_defined(self): - self.assertTrue('bzrlib.doc_generate.builders.texinfo' - in conf.extensions) - -class TestBuilderLoaded(test_dg.TestSphinx): - - def test_builder_loaded(self): - app, out, err = self.make_sphinx() - self.assertTrue('texinfo' in app.builderclasses) - - -class TestFileProduction(test_dg.TestSphinx): - - def test_files_generated(self): - self.build_tree_contents( - [('index.txt', """ -Table of Contents -================= - -.. toctree:: - :maxdepth: 1 - - content -"""), - ('content.txt', """ - -bzr 0.0.8 -********* - -Improvements -============ - -* Adding a file whose parent directory is not versioned will - implicitly add the parent, and so on up to the root. -"""), - ]) - app, out, err = self.make_sphinx() - self.build(app) - self.assertPathExists('index.texi') - self.assertPathExists('content.texi') diff -Nru bzr-2.5.0/bzrlib/tests/doc_generate/__init__.py bzr-2.6.0~beta1/bzrlib/tests/doc_generate/__init__.py --- bzr-2.5.0/bzrlib/tests/doc_generate/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/doc_generate/__init__.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -# Copyright (C) 2010, 2011 Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -"""Documentation generation tests.""" - -import os -from bzrlib import tests -from bzrlib.doc_generate import ( - # FIXME: doc/en/conf.py should be used here, or rather merged into - # bzrlib/doc_generate/conf.py -- vila 20100429 - conf, - ) -from bzrlib.tests import features - - -def load_tests(basic_tests, module, loader): - suite = loader.suiteClass() - # add the tests for this module - suite.addTests(basic_tests) - - testmod_names = [ - 'builders', - 'writers', - ] - # add the tests for the sub modules - suite.addTests(loader.loadTestsFromModuleNames( - ['bzrlib.tests.doc_generate.' + name - for name in testmod_names])) - - return suite - - -class TestSphinx(tests.TestCaseInTempDir): - """Base class for sphinx tests. - - This is used for both the builder and the writer until a better solution is - found to test at a lower level. - """ - - _test_needs_features = [features.sphinx] - - def sphinx_version(self): - # Convert to a tuple to avoid traps in string comparison - # ( '1.12' < '1.6' but (1, 12) > (1, 6) ) - return tuple(map(int, features.sphinx.module.__version__.split('.'))) - - def make_sphinx(self): - out = tests.StringIOWrapper() - err = tests.StringIOWrapper() - from sphinx import application - app = application.Sphinx( - '.', confdir=os.path.dirname(conf.__file__), outdir='.', - doctreedir='.', - buildername='texinfo', - confoverrides={}, - status=out, warning=err, - freshenv=True) - return app, out, err - - def build(self, app, all_files=True, file_names=None): - if file_names is None: - file_names = [] - app.build(all_files, file_names) - - # FIXME: something smells wrong here as we can't process a single file - # alone. On top of that, it seems the doc tree must contain an index.txt - # file. We may need a texinfo builder ? -- vila 20100505 - - def create_content(self, content): - """Put content into a single file. - - This is appropriate for simple tests about the content of a single file. - """ - app, out, err = self.make_sphinx() - self.build_tree_contents([('index.txt', content),]) - self.build(app) - - def assertContent(self, expected, header=None, end=None): - """Check the content of the file created with creste_content(). - - Most texinfo constructs can be tested this way without caring for any - boilerplate that texinfo may require at the beginning or the end of the - file. - """ - if header is None: - # default boilerplate - header = '''\ -This file has been converted using a beta rst->texinfo converter. -Most of the info links are currently bogus, don't report bugs about them, -this is currently worked on. -@node Top -@top Placeholder -''' - if end is None: - # By default we test constructs that are embedded into a paragraph - # which always end with two \n (even if the input has none) - end = '\n\n' - self.assertFileEqual(header + expected + end, 'index.texi') - - diff -Nru bzr-2.5.0/bzrlib/tests/doc_generate/writers/__init__.py bzr-2.6.0~beta1/bzrlib/tests/doc_generate/writers/__init__.py --- bzr-2.5.0/bzrlib/tests/doc_generate/writers/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/doc_generate/writers/__init__.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -# Copyright (C) 2010 Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - -"""Sphinx writers tests.""" - -from bzrlib.tests import features - -def load_tests(basic_tests, module, loader): - suite = loader.suiteClass() - # add the tests for this module - suite.addTests(basic_tests) - - if features.sphinx.available(): - testmod_names = [ - 'texinfo', - ] - # add the tests for the sub modules - suite.addTests(loader.loadTestsFromModuleNames( - ['bzrlib.tests.doc_generate.writers.test_' + name - for name in testmod_names])) - - return suite diff -Nru bzr-2.5.0/bzrlib/tests/doc_generate/writers/test_texinfo.py bzr-2.6.0~beta1/bzrlib/tests/doc_generate/writers/test_texinfo.py --- bzr-2.5.0/bzrlib/tests/doc_generate/writers/test_texinfo.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/doc_generate/writers/test_texinfo.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,359 +0,0 @@ -# Copyright (C) 2010, 2011 Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -"""sphinx texinfo writer tests.""" - -from bzrlib import tests -from bzrlib.tests import ( - doc_generate as test_dg, # Avoid clash with from bzrlib import doc_generate - ) - - -class TestTextGeneration(test_dg.TestSphinx): - - def test_special_chars(self): - self.create_content("A '@' a '{' and a '}'") - self.assertContent("A '@@' a '@{' and a '@}'") - - def test_emphasis(self): - self.create_content('*important*') - self.assertContent('@emph{important}') - - def test_strong(self): - self.create_content('**very important**') - self.assertContent('@strong{very important}') - - def test_literal(self): - self.create_content('the command is ``foo``') - self.assertContent('the command is @code{foo}') - - def test_paragraphs(self): - self.create_content('''\ -This is a paragraph. - -This is another one. -''') - self.assertContent('''\ -This is a paragraph. - -This is another one.''') - - def test_literal_block(self): - self.create_content('''\ -Do this:: - - bzr xxx - bzr yyy -''') - self.assertContent('''\ -Do this: - -@samp{bzr xxx -bzr yyy} - -''', - end='') - - def test_block_quote(self): - self.create_content('''\ -This is an ordinary paragraph, introducing a block quote. - - "It is my business to know things. That is my trade." - -This is another ordinary paragraph. -''') - self.assertContent('''\ -This is an ordinary paragraph, introducing a block quote. - -@example -"It is my business to know things. That is my trade." - -@end example - -This is another ordinary paragraph. - -''', - # examples are not followed by an empty line - end='') - - -class TestDocumentAttributesGeneration(test_dg.TestSphinx): - - def test_title(self): - self.create_content('''\ -#################### -Bazaar Release Notes -#################### -''') - self.assertContent('''\ -@node bazaar-release-notes -@chapter Bazaar Release Notes -''', - end='') - - -class TestListGeneration(test_dg.TestSphinx): - - def test_bullet_list(self): - self.create_content('''\ -* This is a bulleted list. -* It has two items, the second - item uses two lines. -''') - self.assertContent('''\ -@itemize @bullet -@item -This is a bulleted list. - -@item -It has two items, the second -item uses two lines. - -@end itemize -''', - end='') - - def test_enumerated_list(self): - self.create_content('''\ -#. This is a numbered list. -#. It has two items, the second - item uses two lines. -''') - self.assertContent('''\ -@enumerate -@item -This is a numbered list. - -@item -It has two items, the second -item uses two lines. - -@end enumerate -''', - end='') - - -class TestTableGeneration(test_dg.TestSphinx): - - def test_table(self): - self.create_content('''\ - =========== ================ - Prefix Description - =========== ================ - first The first - second The second - last The last - =========== ================ -''') - # FIXME: Sphinx bug ? Why are tables enclosed in a block_quote - # (translated as an @example). - self.assertContent('''\ -@example -@multitable {xxxxxxxxxxx}{xxxxxxxxxxxxxxxx} -@headitem Prefix @tab Description -@item first -@tab The first -@item second -@tab The second -@item last -@tab The last -@end multitable -@end example''') - - -class TestTocTreeGeneration(test_dg.TestSphinx): - - def test_toctree(self): - self.build_tree_contents( - [('index.txt', """ -Table of Contents -================= - -.. toctree:: - :maxdepth: 1 - - bzr 0.0.8 -"""), - ('bzr-0.0.8.txt', """ - -bzr 0.0.8 -********* - -Improvements -============ - -* Adding a file whose parent directory is not versioned will - implicitly add the parent, and so on up to the root. -"""), - ]) - app, out, err = self.make_sphinx() - self.build(app) - self.assertFileEqual("""\ -This file has been converted using a beta rst->texinfo converter. -Most of the info links are currently bogus, don't report bugs about them, -this is currently worked on. -@node Top -@top Placeholder -@node table-of-contents -@chapter Table of Contents -@menu -* bzr 0.0.8: (bzr-0.0.8.info)bzr 0.0.8. -@end menu -""", - 'index.texi') - self.assertFileEqual("""\ -This file has been converted using a beta rst->texinfo converter. -Most of the info links are currently bogus, don't report bugs about them, -this is currently worked on. -@node Top -@top Placeholder -@node bzr-0-0-8 -@chapter bzr 0.0.8 -@node improvements -@section Improvements -@itemize @bullet -@item -Adding a file whose parent directory is not versioned will -implicitly add the parent, and so on up to the root. - -@end itemize -""", - 'bzr-0.0.8.texi') - - def test_toctree_empty(self): - self.build_tree_contents( - [('index.txt', """ -Table of Contents -================= - -.. toctree:: - :maxdepth: 1 -""")]) - app, out, err = self.make_sphinx() - self.build(app) - self.assertFileEqual("""\ -This file has been converted using a beta rst->texinfo converter. -Most of the info links are currently bogus, don't report bugs about them, -this is currently worked on. -@node Top -@top Placeholder -@node table-of-contents -@chapter Table of Contents -""", - 'index.texi') - - -class TestSections(test_dg.TestSphinx): - - def test_sections(self): - self.create_content('''\ -########### -Chapter one -########### - -Chapter introduction. - -*********** -section one -*********** - -The first section. - - -subsection one -============== - -The first subsection. - -subsection two -============== - -The second subsection. - -subsubsection one ------------------ - -Here is sus sub section one. - -blob one -^^^^^^^^ - -Far tooo deep to get a name - -thing one -""""""""" - -No idea how to call that, but sphinx says it's a paragraph. -''') - self.assertContent('''\ -@node chapter-one -@chapter Chapter one -Chapter introduction. - -@node section-one -@section section one -The first section. - -@node subsection-one -@subsection subsection one -The first subsection. - -@node subsection-two -@subsection subsection two -The second subsection. - -@node subsubsection-one -@subsubsection subsubsection one -Here is sus sub section one. - -@node blob-one -@heading blob one -Far tooo deep to get a name - -@node thing-one -@heading thing one -No idea how to call that, but sphinx says it's a paragraph.''') - - -class TestReferences(test_dg.TestSphinx): - - def test_external_reference(self): - self.create_content('''\ -The `example web site`_ is nice. - -.. _example web site: http://www.example.com/ -''') - self.assertContent('''\ -The @uref{http://www.example.com/,example web site} is nice.''') - - - def test_internal_reference(self): - self.create_content('''\ -The `example web site`_ contains more examples. - -Example web site ----------------- - -Here we have a lot of nice examples. - -''') - self.assertContent('''\ -The example web site (@pxref{example-web-site}) contains more examples. - -@node example-web-site -@chapter Example web site -Here we have a lot of nice examples.''') - diff -Nru bzr-2.5.0/bzrlib/tests/features.py bzr-2.6.0~beta1/bzrlib/tests/features.py --- bzr-2.5.0/bzrlib/tests/features.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/features.py 2012-03-15 10:00:24.000000000 +0000 @@ -352,7 +352,6 @@ paramiko = ModuleAvailableFeature('paramiko') pycurl = ModuleAvailableFeature('pycurl') pywintypes = ModuleAvailableFeature('pywintypes') -sphinx = ModuleAvailableFeature('sphinx') subunit = ModuleAvailableFeature('subunit') testtools = ModuleAvailableFeature('testtools') diff -Nru bzr-2.5.0/bzrlib/tests/__init__.py bzr-2.6.0~beta1/bzrlib/tests/__init__.py --- bzr-2.5.0/bzrlib/tests/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -60,7 +60,7 @@ import bzrlib from bzrlib import ( branchbuilder, - bzrdir, + controldir, chk_map, commands as _mod_commands, config, @@ -247,7 +247,7 @@ different types of display. When a test finishes, in whatever way, it calls one of the addSuccess, - addFailure or addError classes. These in turn may redirect to a more + addFailure or addError methods. These in turn may redirect to a more specific case for the special test results supported by our extended tests. @@ -1026,10 +1026,6 @@ # between tests. We should get rid of this altogether: bug 656694. -- # mbp 20101008 self.overrideAttr(bzrlib.trace, '_verbosity_level', 0) - # Isolate config option expansion until its default value for bzrlib is - # settled on or a the FIXME associated with _get_expand_default_value - # is addressed -- vila 20110219 - self.overrideAttr(config, '_expand_default_value', None) self._log_files = set() # Each key in the ``_counters`` dict holds a value for a different # counter. When the test ends, addDetail() should be used to output the @@ -1328,7 +1324,7 @@ # hook into bzr dir opening. This leaves a small window of error for # transport tests, but they are well known, and we can improve on this # step. - bzrdir.BzrDir.hooks.install_named_hook("pre_open", + controldir.ControlDir.hooks.install_named_hook("pre_open", self._preopen_isolate_transport, "Check bzr directories are safe.") def _ndiff_strings(self, a, b): @@ -2603,7 +2599,7 @@ # http://pad.lv/825027). self.assertIs(None, os.environ.get('BZR_HOME', None)) os.environ['BZR_HOME'] = root - wt = bzrdir.BzrDir.create_standalone_workingtree(root) + wt = controldir.ControlDir.create_standalone_workingtree(root) del os.environ['BZR_HOME'] # Hack for speed: remember the raw bytes of the dirstate file so that # we don't need to re-open the wt to check it hasn't changed. @@ -2680,7 +2676,7 @@ if format is None: format = self.get_default_format() if isinstance(format, basestring): - format = bzrdir.format_registry.make_bzrdir(format) + format = controldir.format_registry.make_bzrdir(format) return format def make_bzrdir(self, relpath, format=None): @@ -2854,7 +2850,7 @@ # stacking policy to honour; create a bzr dir with an unshared # repository (but not a branch - our code would be trying to escape # then!) to stop them, and permit it to be read. - # control = bzrdir.BzrDir.create(self.test_base_dir) + # control = controldir.ControlDir.create(self.test_base_dir) # control.create_repository() self.test_home_dir = self.test_base_dir + '/home' os.mkdir(self.test_home_dir) @@ -3000,7 +2996,8 @@ if self.vfs_transport_factory is test_server.LocalURLServer: # the branch is colocated on disk, we cannot create a checkout. # hopefully callers will expect this. - local_controldir= bzrdir.BzrDir.open(self.get_vfs_only_url(relpath)) + local_controldir = controldir.ControlDir.open( + self.get_vfs_only_url(relpath)) wt = local_controldir.create_workingtree() if wt.branch._format != b._format: wt._branch = b @@ -3909,7 +3906,6 @@ 'bzrlib.doc', 'bzrlib.tests.blackbox', 'bzrlib.tests.commands', - 'bzrlib.tests.doc_generate', 'bzrlib.tests.per_branch', 'bzrlib.tests.per_bzrdir', 'bzrlib.tests.per_controldir', diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/__init__.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/__init__.py --- bzr-2.5.0/bzrlib/tests/per_branch/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -149,7 +149,6 @@ def load_tests(standard_tests, module, loader): per_branch_mod_names = [ - 'bound_sftp', 'branch', 'break_lock', 'check', @@ -169,7 +168,6 @@ 'pull', 'push', 'reconcile', - 'revision_history', 'revision_id_to_dotted_revno', 'revision_id_to_revno', 'sprout', diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_bound_sftp.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_bound_sftp.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_bound_sftp.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_bound_sftp.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,328 +0,0 @@ -# Copyright (C) 2005, 2006, 2007, 2009, 2010 Robey Pointer , Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -"""Tests for branches bound to an sftp branch.""" - - -import os - -from bzrlib import ( - branch, - bzrdir, - errors, - tests, - ) -from bzrlib.tests import test_server -from bzrlib.transport import memory - - -class BoundSFTPBranch(tests.TestCaseWithTransport): - - def setUp(self): - tests.TestCaseWithTransport.setUp(self) - self.vfs_transport_factory = memory.MemoryServer - if self.transport_server is test_server.LocalURLServer: - self.transport_server = None - - def create_branches(self): - self.build_tree(['base/', 'base/a', 'base/b']) - format = bzrdir.format_registry.make_bzrdir('knit') - try: - wt_base = bzrdir.BzrDir.create_standalone_workingtree( - self.get_url('base'), format=format) - except errors.NotLocalUrl: - raise tests.TestSkipped('Not a local URL') - - b_base = wt_base.branch - - wt_base.add('a') - wt_base.add('b') - wt_base.commit('first', rev_id='r@b-1') - - wt_child = b_base.bzrdir.sprout('child').open_workingtree() - self.sftp_base = branch.Branch.open(self.get_url('base')) - wt_child.branch.bind(self.sftp_base) - # check the branch histories are ready for using in tests. - self.assertEqual(['r@b-1'], b_base.revision_history()) - self.assertEqual(['r@b-1'], wt_child.branch.revision_history()) - return b_base, wt_child - - def test_simple_binding(self): - self.build_tree(['base/', 'base/a', 'base/b', 'child/']) - try: - wt_base = bzrdir.BzrDir.create_standalone_workingtree( - self.get_url('base')) - except errors.NotLocalUrl: - raise tests.TestSkipped('Not a local URL') - - wt_base.add('a') - wt_base.add('b') - wt_base.commit('first', rev_id='r@b-1') - - b_base = wt_base.branch - # manually make a branch we can bind, because the default format - # may not be bindable-from, and we want to test the side effects etc - # of bondage. - format = bzrdir.format_registry.make_bzrdir('knit') - b_child = bzrdir.BzrDir.create_branch_convenience( - 'child', format=format) - self.assertEqual(None, b_child.get_bound_location()) - self.assertEqual(None, b_child.get_master_branch()) - - sftp_b_base = branch.Branch.open(self.get_url('base')) - b_child.bind(sftp_b_base) - self.assertEqual(sftp_b_base.base, b_child.get_bound_location()) - # the bind must not have given b_child history: - self.assertEqual([], b_child.revision_history()) - # we should be able to update the branch at this point: - self.assertEqual(None, b_child.update()) - # and now there must be history. - self.assertEqual(['r@b-1'], b_child.revision_history()) - # this line is more of a working tree test line, but - what the hey, - # it has work to do. - b_child.bzrdir.open_workingtree().update() - self.assertPathExists('child/a') - self.assertPathExists('child/b') - - b_child.unbind() - self.assertEqual(None, b_child.get_bound_location()) - - def test_bound_commit(self): - b_base, wt_child = self.create_branches() - - with open('child/a', 'wb') as f: f.write('new contents\n') - wt_child.commit('modified a', rev_id='r@c-2') - - self.assertEqual(['r@b-1', 'r@c-2'], wt_child.branch.revision_history()) - self.assertEqual(['r@b-1', 'r@c-2'], b_base.revision_history()) - - def test_bound_commit_fails_when_out_of_date(self): - # Make sure commit fails if out of date. - b_base, wt_child = self.create_branches() - - with open('base/a', 'wb') as f: f.write('new base contents\n') - b_base.bzrdir.open_workingtree().commit('base', rev_id='r@b-2') - - with open('child/b', 'wb') as f: f.write('new b child contents\n') - self.assertRaises(errors.BoundBranchOutOfDate, - wt_child.commit, 'child', rev_id='r@c-2') - - sftp_b_base = branch.Branch.open(self.get_url('base')) - - # This is all that cmd_update does - wt_child.pull(sftp_b_base, overwrite=False) - - wt_child.commit('child', rev_id='r@c-3') - - self.assertEqual(['r@b-1', 'r@b-2', 'r@c-3'], - wt_child.branch.revision_history()) - self.assertEqual(['r@b-1', 'r@b-2', 'r@c-3'], - b_base.revision_history()) - self.assertEqual(['r@b-1', 'r@b-2', 'r@c-3'], - sftp_b_base.revision_history()) - - def test_double_binding(self): - b_base, wt_child = self.create_branches() - - wt_child2 = wt_child.branch.create_checkout('child2') - - with open('child2/a', 'wb') as f: f.write('new contents\n') - self.assertRaises(errors.CommitToDoubleBoundBranch, - wt_child2.commit, 'child2', rev_id='r@d-2') - - def test_unbinding(self): - from bzrlib import transport - b_base, wt_child = self.create_branches() - - # TestCaseWithSFTPServer only allows you to connect one time - # to the SFTP server. So we have to create a connection and - # keep it around, so that it can be reused - __unused_t = self.get_transport() - - wt_base = b_base.bzrdir.open_workingtree() - with open('base/a', 'wb') as f: f.write('new base contents\n') - wt_base.commit('base', rev_id='r@b-2') - - with open('child/b', 'wb') as f: f.write('new b child contents\n') - self.assertRaises(errors.BoundBranchOutOfDate, - wt_child.commit, 'child', rev_id='r@c-2') - self.assertEqual(['r@b-1'], wt_child.branch.revision_history()) - wt_child.branch.unbind() - wt_child.commit('child', rev_id='r@c-2') - self.assertEqual(['r@b-1', 'r@c-2'], wt_child.branch.revision_history()) - self.assertEqual(['r@b-1', 'r@b-2'], b_base.revision_history()) - - sftp_b_base = branch.Branch.open(self.get_url('base')) - self.assertRaises(errors.DivergedBranches, - wt_child.branch.bind, sftp_b_base) - - def test_commit_remote_bound(self): - # Make sure it is detected if the current base is bound during the - # objects lifetime, when the child goes to commit. - b_base, wt_child = self.create_branches() - - b_base.bzrdir.sprout('newbase') - - sftp_b_base = branch.Branch.open(self.get_url('base')) - sftp_b_newbase = branch.Branch.open(self.get_url('newbase')) - - sftp_b_base.bind(sftp_b_newbase) - - with open('child/a', 'wb') as f: f.write('new contents\n') - self.assertRaises(errors.CommitToDoubleBoundBranch, - wt_child.commit, 'failure', rev_id='r@c-2') - - self.assertEqual(['r@b-1'], b_base.revision_history()) - self.assertEqual(['r@b-1'], wt_child.branch.revision_history()) - self.assertEqual(['r@b-1'], sftp_b_newbase.revision_history()) - - def test_bind_diverged(self): - b_base, wt_child = self.create_branches() - - wt_child.branch.unbind() - with open('child/a', 'ab') as f: f.write('child contents\n') - wt_child_rev = wt_child.commit('child', rev_id='r@c-2') - - self.assertEqual(['r@b-1', 'r@c-2'], wt_child.branch.revision_history()) - self.assertEqual(['r@b-1'], b_base.revision_history()) - - with open('base/b', 'ab') as f: f.write('base contents\n') - b_base.bzrdir.open_workingtree().commit('base', rev_id='r@b-2') - self.assertEqual(['r@b-1', 'r@b-2'], b_base.revision_history()) - - sftp_b_base = branch.Branch.open(self.get_url('base')) - - self.assertRaises(errors.DivergedBranches, - wt_child.branch.bind, sftp_b_base) - - wt_child.merge_from_branch(sftp_b_base) - self.assertEqual([wt_child_rev, 'r@b-2'], wt_child.get_parent_ids()) - wt_child.commit('merged', rev_id='r@c-3') - - # After a merge, trying to bind again should succeed but not push the - # new change. - wt_child.branch.bind(sftp_b_base) - - self.assertEqual(['r@b-1', 'r@b-2'], b_base.revision_history()) - self.assertEqual(['r@b-1', 'r@c-2', 'r@c-3'], - wt_child.branch.revision_history()) - - def test_bind_parent_ahead_preserves_parent(self): - b_base, wt_child = self.create_branches() - - wt_child.branch.unbind() - - with open('a', 'ab') as f: f.write('base changes\n') - wt_base = b_base.bzrdir.open_workingtree() - wt_base.commit('base', rev_id='r@b-2') - self.assertEqual(['r@b-1', 'r@b-2'], b_base.revision_history()) - self.assertEqual(['r@b-1'], wt_child.branch.revision_history()) - - sftp_b_base = branch.Branch.open(self.get_url('base')) - wt_child.branch.bind(sftp_b_base) - - self.assertEqual(['r@b-1'], wt_child.branch.revision_history()) - - wt_child.branch.unbind() - - # Check and make sure it also works if parent is ahead multiple - wt_base.commit('base 3', rev_id='r@b-3', allow_pointless=True) - wt_base.commit('base 4', rev_id='r@b-4', allow_pointless=True) - wt_base.commit('base 5', rev_id='r@b-5', allow_pointless=True) - - self.assertEqual(['r@b-1', 'r@b-2', 'r@b-3', 'r@b-4', 'r@b-5'], - b_base.revision_history()) - - self.assertEqual(['r@b-1'], wt_child.branch.revision_history()) - - wt_child.branch.bind(sftp_b_base) - self.assertEqual(['r@b-1'], wt_child.branch.revision_history()) - - def test_bind_child_ahead_preserves_child(self): - b_base, wt_child = self.create_branches() - - wt_child.branch.unbind() - - wt_child.commit('child', rev_id='r@c-2', allow_pointless=True) - self.assertEqual(['r@b-1', 'r@c-2'], wt_child.branch.revision_history()) - self.assertEqual(['r@b-1'], b_base.revision_history()) - - sftp_b_base = branch.Branch.open(self.get_url('base')) - wt_child.branch.bind(sftp_b_base) - - self.assertEqual(['r@b-1'], b_base.revision_history()) - - # Check and make sure it also works if child is ahead multiple - wt_child.branch.unbind() - wt_child.commit('child 3', rev_id='r@c-3', allow_pointless=True) - wt_child.commit('child 4', rev_id='r@c-4', allow_pointless=True) - wt_child.commit('child 5', rev_id='r@c-5', allow_pointless=True) - - self.assertEqual(['r@b-1', 'r@c-2', 'r@c-3', 'r@c-4', 'r@c-5'], - wt_child.branch.revision_history()) - self.assertEqual(['r@b-1'], b_base.revision_history()) - - wt_child.branch.bind(sftp_b_base) - self.assertEqual(['r@b-1'], b_base.revision_history()) - - def test_commit_after_merge(self): - b_base, wt_child = self.create_branches() - - # We want merge to be able to be a local only - # operation, because it does not alter the branch data. - - # But we can't fail afterwards - - wt_other = wt_child.bzrdir.sprout('other').open_workingtree() - - with open('other/c', 'wb') as f: f.write('file c\n') - wt_other.add('c') - wt_other.commit('adding c', rev_id='r@d-2') - - self.assertFalse(wt_child.branch.repository.has_revision('r@d-2')) - self.assertFalse(b_base.repository.has_revision('r@d-2')) - - wt_child.merge_from_branch(wt_other.branch) - - self.assertPathExists('child/c') - self.assertEqual(['r@d-2'], wt_child.get_parent_ids()[1:]) - self.assertTrue(wt_child.branch.repository.has_revision('r@d-2')) - self.assertFalse(b_base.repository.has_revision('r@d-2')) - - # Commit should succeed, and cause merged revisions to - # be pushed into base - wt_child.commit('merge other', rev_id='r@c-2') - self.assertEqual(['r@b-1', 'r@c-2'], wt_child.branch.revision_history()) - self.assertEqual(['r@b-1', 'r@c-2'], b_base.revision_history()) - self.assertTrue(b_base.repository.has_revision('r@d-2')) - - def test_commit_fails(self): - b_base, wt_child = self.create_branches() - - with open('a', 'ab') as f: f.write('child adds some text\n') - - # this deletes the branch from memory - del b_base - # and this moves it out of the way on disk - os.rename('base', 'hidden_base') - - self.assertRaises(errors.BoundBranchConnectionFailure, - wt_child.commit, 'added text', rev_id='r@c-2') - - # TODO: jam 20051231 We need invasive failure tests, so that we can show - # performance even when something fails. - - diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_bound_sftp.py.THIS bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_bound_sftp.py.THIS --- bzr-2.5.0/bzrlib/tests/per_branch/test_bound_sftp.py.THIS 1970-01-01 00:00:00.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_bound_sftp.py.THIS 2012-03-15 10:00:24.000000000 +0000 @@ -0,0 +1,331 @@ +# Copyright (C) 2005, 2006, 2007, 2009, 2010 Robey Pointer , Canonical Ltd +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +"""Tests for branches bound to an sftp branch.""" + + +import os + +from bzrlib import ( + branch, + controldir, + errors, + tests, + ) +from bzrlib.tests import test_server +from bzrlib.tests.matchers import RevisionHistoryMatches +from bzrlib.transport import memory + + +class BoundSFTPBranch(tests.TestCaseWithTransport): + + def setUp(self): + tests.TestCaseWithTransport.setUp(self) + self.vfs_transport_factory = memory.MemoryServer + if self.transport_server is test_server.LocalURLServer: + self.transport_server = None + + def create_branches(self): + self.build_tree(['base/', 'base/a', 'base/b']) + format = controldir.format_registry.make_bzrdir('knit') + try: + wt_base = controldir.ControlDir.create_standalone_workingtree( + self.get_url('base'), format=format) + except errors.NotLocalUrl: + raise tests.TestSkipped('Not a local URL') + + b_base = wt_base.branch + + wt_base.add('a') + wt_base.add('b') + wt_base.commit('first', rev_id='r@b-1') + + wt_child = b_base.bzrdir.sprout('child').open_workingtree() + self.sftp_base = branch.Branch.open(self.get_url('base')) + wt_child.branch.bind(self.sftp_base) + # check the branch histories are ready for using in tests. + self.assertThat(RevisionHistoryMatches(['r@b-1']), b_base) + self.assertThat(RevisionHistoryMatches(['r@b-1']), wt_child.branch) + return b_base, wt_child + + def test_simple_binding(self): + self.build_tree(['base/', 'base/a', 'base/b', 'child/']) + try: + wt_base = controldir.ControlDir.create_standalone_workingtree( + self.get_url('base')) + except errors.NotLocalUrl: + raise tests.TestSkipped('Not a local URL') + + wt_base.add('a') + wt_base.add('b') + wt_base.commit('first', rev_id='r@b-1') + + b_base = wt_base.branch + # manually make a branch we can bind, because the default format + # may not be bindable-from, and we want to test the side effects etc + # of bondage. + format = controldir.format_registry.make_bzrdir('knit') + b_child = controldir.ControlDir.create_branch_convenience( + 'child', format=format) + self.assertEqual(None, b_child.get_bound_location()) + self.assertEqual(None, b_child.get_master_branch()) + + sftp_b_base = branch.Branch.open(self.get_url('base')) + b_child.bind(sftp_b_base) + self.assertEqual(sftp_b_base.base, b_child.get_bound_location()) + # the bind must not have given b_child history: + self.assertThat(RevisionHistoryMatches([]), b_child) + # we should be able to update the branch at this point: + self.assertEqual(None, b_child.update()) + # and now there must be history. + self.assertThat(RevisionHistoryMatches(['r@b-1']), b_child) + # this line is more of a working tree test line, but - what the hey, + # it has work to do. + b_child.bzrdir.open_workingtree().update() + self.assertPathExists('child/a') + self.assertPathExists('child/b') + + b_child.unbind() + self.assertEqual(None, b_child.get_bound_location()) + + def test_bound_commit(self): + b_base, wt_child = self.create_branches() + + with open('child/a', 'wb') as f: f.write('new contents\n') + wt_child.commit('modified a', rev_id='r@c-2') + + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@c-2']), wt_child.branch) + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@c-2']), b_base) + + def test_bound_commit_fails_when_out_of_date(self): + # Make sure commit fails if out of date. + b_base, wt_child = self.create_branches() + + with open('base/a', 'wb') as f: f.write('new base contents\n') + b_base.bzrdir.open_workingtree().commit('base', rev_id='r@b-2') + + with open('child/b', 'wb') as f: f.write('new b child contents\n') + self.assertRaises(errors.BoundBranchOutOfDate, + wt_child.commit, 'child', rev_id='r@c-2') + + sftp_b_base = branch.Branch.open(self.get_url('base')) + + # This is all that cmd_update does + wt_child.pull(sftp_b_base, overwrite=False) + + wt_child.commit('child', rev_id='r@c-3') + + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@b-2', 'r@c-3']), + wt_child.branch) + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@b-2', 'r@c-3']), + b_base) + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@b-2', 'r@c-3']), + sftp_b_base) + + def test_double_binding(self): + b_base, wt_child = self.create_branches() + + wt_child2 = wt_child.branch.create_checkout('child2') + + with open('child2/a', 'wb') as f: f.write('new contents\n') + self.assertRaises(errors.CommitToDoubleBoundBranch, + wt_child2.commit, 'child2', rev_id='r@d-2') + + def test_unbinding(self): + b_base, wt_child = self.create_branches() + + # TestCaseWithSFTPServer only allows you to connect one time + # to the SFTP server. So we have to create a connection and + # keep it around, so that it can be reused + __unused_t = self.get_transport() + + wt_base = b_base.bzrdir.open_workingtree() + with open('base/a', 'wb') as f: f.write('new base contents\n') + wt_base.commit('base', rev_id='r@b-2') + + with open('child/b', 'wb') as f: f.write('new b child contents\n') + self.assertRaises(errors.BoundBranchOutOfDate, + wt_child.commit, 'child', rev_id='r@c-2') + self.assertThat(RevisionHistoryMatches(['r@b-1']), wt_child.branch) + wt_child.branch.unbind() + wt_child.commit('child', rev_id='r@c-2') + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@c-2']), wt_child.branch) + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@b-2']), b_base) + + sftp_b_base = branch.Branch.open(self.get_url('base')) + self.assertRaises(errors.DivergedBranches, + wt_child.branch.bind, sftp_b_base) + + def test_commit_remote_bound(self): + # Make sure it is detected if the current base is bound during the + # objects lifetime, when the child goes to commit. + b_base, wt_child = self.create_branches() + + b_base.bzrdir.sprout('newbase') + + sftp_b_base = branch.Branch.open(self.get_url('base')) + sftp_b_newbase = branch.Branch.open(self.get_url('newbase')) + + sftp_b_base.bind(sftp_b_newbase) + + with open('child/a', 'wb') as f: f.write('new contents\n') + self.assertRaises(errors.CommitToDoubleBoundBranch, + wt_child.commit, 'failure', rev_id='r@c-2') + + self.assertThat(RevisionHistoryMatches(['r@b-1']), b_base) + self.assertThat(RevisionHistoryMatches(['r@b-1']), wt_child.branch) + self.assertThat(RevisionHistoryMatches(['r@b-1']), sftp_b_newbase) + + def test_bind_diverged(self): + b_base, wt_child = self.create_branches() + + wt_child.branch.unbind() + with open('child/a', 'ab') as f: f.write('child contents\n') + wt_child_rev = wt_child.commit('child', rev_id='r@c-2') + + self.assertEqual(RevisionHistoryMatches(['r@b-1', 'r@c-2']), + wt_child.branch) + self.assertEqual(RevisionHistoryMatches(['r@b-1']), b_base) + + with open('base/b', 'ab') as f: f.write('base contents\n') + b_base.bzrdir.open_workingtree().commit('base', rev_id='r@b-2') + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@b-2']), b_base) + + sftp_b_base = branch.Branch.open(self.get_url('base')) + + self.assertRaises(errors.DivergedBranches, + wt_child.branch.bind, sftp_b_base) + + wt_child.merge_from_branch(sftp_b_base) + self.assertEqual([wt_child_rev, 'r@b-2'], wt_child.get_parent_ids()) + wt_child.commit('merged', rev_id='r@c-3') + + # After a merge, trying to bind again should succeed but not push the + # new change. + wt_child.branch.bind(sftp_b_base) + + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@b-2']), b_base) + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@c-2', 'r@c-3']), + wt_child.branch) + + def test_bind_parent_ahead_preserves_parent(self): + b_base, wt_child = self.create_branches() + + wt_child.branch.unbind() + + with open('a', 'ab') as f: f.write('base changes\n') + wt_base = b_base.bzrdir.open_workingtree() + wt_base.commit('base', rev_id='r@b-2') + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@b-2']), b_base) + self.assertThat(RevisionHistoryMatches(['r@b-1']), wt_child.branch) + + sftp_b_base = branch.Branch.open(self.get_url('base')) + wt_child.branch.bind(sftp_b_base) + + self.assertThat(RevisionHistoryMatches(['r@b-1']), wt_child.branch) + + wt_child.branch.unbind() + + # Check and make sure it also works if parent is ahead multiple + wt_base.commit('base 3', rev_id='r@b-3', allow_pointless=True) + wt_base.commit('base 4', rev_id='r@b-4', allow_pointless=True) + wt_base.commit('base 5', rev_id='r@b-5', allow_pointless=True) + + self.assertThat( + RevisionHistoryMatches(['r@b-1', 'r@b-2', 'r@b-3', 'r@b-4', 'r@b-5']), + b_base) + + self.assertThat(RevisionHistoryMatches(['r@b-1']), wt_child.branch) + + wt_child.branch.bind(sftp_b_base) + self.assertThat(RevisionHistoryMatches(['r@b-1']), wt_child.branch) + + def test_bind_child_ahead_preserves_child(self): + b_base, wt_child = self.create_branches() + + wt_child.branch.unbind() + + wt_child.commit('child', rev_id='r@c-2', allow_pointless=True) + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@c-2']), wt_child.branch) + self.assertThat(RevisionHistoryMatches(['r@b-1']), b_base) + + sftp_b_base = branch.Branch.open(self.get_url('base')) + wt_child.branch.bind(sftp_b_base) + + self.assertThat(RevisionHistoryMatches(['r@b-1']), b_base) + + # Check and make sure it also works if child is ahead multiple + wt_child.branch.unbind() + wt_child.commit('child 3', rev_id='r@c-3', allow_pointless=True) + wt_child.commit('child 4', rev_id='r@c-4', allow_pointless=True) + wt_child.commit('child 5', rev_id='r@c-5', allow_pointless=True) + + self.assertThat( + RevisionHistoryMatches(['r@b-1', 'r@c-2', 'r@c-3', 'r@c-4', 'r@c-5']), + wt_child.branch) + self.assertThat(RevisionHistoryMatches(['r@b-1']), b_base) + + wt_child.branch.bind(sftp_b_base) + self.assertThat(RevisionHistoryMatches(['r@b-1']), b_base) + + def test_commit_after_merge(self): + b_base, wt_child = self.create_branches() + + # We want merge to be able to be a local only + # operation, because it does not alter the branch data. + + # But we can't fail afterwards + + wt_other = wt_child.bzrdir.sprout('other').open_workingtree() + + with open('other/c', 'wb') as f: f.write('file c\n') + wt_other.add('c') + wt_other.commit('adding c', rev_id='r@d-2') + + self.assertFalse(wt_child.branch.repository.has_revision('r@d-2')) + self.assertFalse(b_base.repository.has_revision('r@d-2')) + + wt_child.merge_from_branch(wt_other.branch) + + self.assertPathExists('child/c') + self.assertEqual(['r@d-2'], wt_child.get_parent_ids()[1:]) + self.assertTrue(wt_child.branch.repository.has_revision('r@d-2')) + self.assertFalse(b_base.repository.has_revision('r@d-2')) + + # Commit should succeed, and cause merged revisions to + # be pushed into base + wt_child.commit('merge other', rev_id='r@c-2') + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@c-2']), wt_child.branch) + self.assertThat(RevisionHistoryMatches(['r@b-1', 'r@c-2']), b_base) + self.assertTrue(b_base.repository.has_revision('r@d-2')) + + def test_commit_fails(self): + b_base, wt_child = self.create_branches() + + with open('a', 'ab') as f: f.write('child adds some text\n') + + # this deletes the branch from memory + del b_base + # and this moves it out of the way on disk + os.rename('base', 'hidden_base') + + self.assertRaises(errors.BoundBranchConnectionFailure, + wt_child.commit, 'added text', rev_id='r@c-2') + + # TODO: jam 20051231 We need invasive failure tests, so that we can show + # performance even when something fails. + + diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_branch.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_branch.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_branch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_branch.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2011 Canonical Ltd +# Copyright (C) 2005-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,11 +18,10 @@ from bzrlib import ( branch as _mod_branch, - bzrdir, + controldir, config, delta as _mod_delta, errors, - gpg, merge, osutils, urlutils, @@ -476,17 +475,6 @@ checkout = source_branch.create_checkout('c') self.assertEqual(rev_id, checkout.last_revision()) - def test_set_revision_history(self): - tree = self.make_branch_and_tree('a') - tree.commit('a commit', rev_id='rev1') - br = tree.branch - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - br.set_revision_history, ["rev1"]) - self.assertEquals(br.last_revision(), "rev1") - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - br.set_revision_history, []) - self.assertEquals(br.last_revision(), 'null:') - def test_heads_to_fetch(self): # heads_to_fetch is a method that returns a collection of revids that # need to be fetched to copy this branch into another repo. At a @@ -529,7 +517,7 @@ looked_up_format = registry.get(network_name) self.assertEqual(format.__class__, looked_up_format.__class__) - def get_get_config_calls(self): + def test_get_config_calls(self): # Smoke test that all branch succeed getting a config br = self.make_branch('.') br.get_config() @@ -709,7 +697,7 @@ self.assertIsInstance(made_branch, _mod_branch.Branch) # find it via bzrdir opening: - opened_control = bzrdir.BzrDir.open(readonly_t.base) + opened_control = controldir.ControlDir.open(readonly_t.base) direct_opened_branch = opened_control.open_branch() self.assertEqual(direct_opened_branch.__class__, made_branch.__class__) self.assertEqual(opened_control, direct_opened_branch.bzrdir) @@ -780,22 +768,6 @@ branch.unbind() self.assertEqual(None, branch.get_master_branch()) - def test_unlocked_does_not_cache_master_branch(self): - """Unlocked branches do not cache the result of get_master_branch.""" - master = self.make_branch('master') - branch1 = self.make_branch('branch') - try: - branch1.bind(master) - except errors.UpgradeRequired: - raise tests.TestNotApplicable('Format does not support binding') - # Open branch1 again - branch2 = branch1.bzrdir.open_branch() - self.assertNotEqual(None, branch1.get_master_branch()) - # Unbind the branch via branch2. branch1 isn't locked so will - # immediately return the new value for get_master_branch. - branch2.unbind() - self.assertEqual(None, branch1.get_master_branch()) - def test_bind_clears_cached_master_branch(self): """b.bind clears any cached value of b.get_master_branch.""" master1 = self.make_branch('master1') @@ -866,13 +838,13 @@ def test_fallbacks_not_opened(self): stacked = self.make_branch_with_fallback() self.get_transport('').rename('fallback', 'moved') - reopened_dir = bzrdir.BzrDir.open(stacked.base) + reopened_dir = controldir.ControlDir.open(stacked.base) reopened = reopened_dir.open_branch(ignore_fallbacks=True) self.assertEqual([], reopened.repository._fallback_repositories) def test_fallbacks_are_opened(self): stacked = self.make_branch_with_fallback() - reopened_dir = bzrdir.BzrDir.open(stacked.base) + reopened_dir = controldir.ControlDir.open(stacked.base) reopened = reopened_dir.open_branch(ignore_fallbacks=False) self.assertLength(1, reopened.repository._fallback_repositories) diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_break_lock.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_break_lock.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_break_lock.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_break_lock.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2010 Canonical Ltd +# Copyright (C) 2006-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -86,7 +86,8 @@ master.lock_write() ui.ui_factory = ui.CannedInputUIFactory([True, True]) try: - self.unused_branch.break_lock() + fresh = _mod_branch.Branch.open(self.unused_branch.base) + fresh.break_lock() except NotImplementedError: # branch does not support break_lock master.unlock() diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_check.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_check.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_check.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_check.py 2012-03-15 10:00:24.000000000 +0000 @@ -44,18 +44,9 @@ r5 = tree.commit('five') # Now, try to set an invalid history - try: - self.applyDeprecated(deprecated_in((2, 4, 0)), - tree.branch.set_revision_history, [r1, r2b, r5]) - if tree.branch.last_revision_info() != (3, r5): - # RemoteBranch silently corrects an impossible revision - # history given to set_revision_history. It can be tricked - # with set_last_revision_info though. - tree.branch.set_last_revision_info(3, r5) - except errors.NotLefthandHistory: - # Branch5 allows set_revision_history to be wrong - # Branch6 raises NotLefthandHistory, but we can force bogus stuff - # with set_last_revision_info + if getattr(tree.branch, "_set_revision_history", None) is not None: + tree.branch._set_revision_history([r1, r2b, r5]) + else: tree.branch.set_last_revision_info(3, r5) tree.lock_read() diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_create_clone.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_create_clone.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_create_clone.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_create_clone.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010 Canonical Ltd +# Copyright (C) 2009-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -133,7 +133,6 @@ trunk = tree.branch.create_clone_on_transport( self.get_transport('trunk')) revid = tree.commit('a second commit') - source = tree.branch target_transport = self.get_transport('target') self.hook_calls = [] branch.Branch.hooks.install_named_hook( diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_get_revision_id_to_revno_map.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_get_revision_id_to_revno_map.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_get_revision_id_to_revno_map.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_get_revision_id_to_revno_map.py 2012-03-15 10:00:24.000000000 +0000 @@ -81,24 +81,6 @@ finally: branch.unlock() - def test_set_revision_history_when_locked(self): - """Calling set_revision_history should reset the cache.""" - branch, calls = self.get_instrumented_branch() - branch.lock_write() - try: - self.assertEqual({'rev-1':(1,), 'rev-2':(2,), 'rev-3':(3,), - 'rev-1.1.1':(1,1,1) - }, branch.get_revision_id_to_revno_map()) - self.applyDeprecated(deprecated_in((2, 4, 0)), - branch.set_revision_history, ['rev-1', 'rev-2']) - self.assertEqual({'rev-1':(1,), 'rev-2':(2,)}, - branch.get_revision_id_to_revno_map()) - self.assertEqual({'rev-1':(1,), 'rev-2':(2,)}, - branch.get_revision_id_to_revno_map()) - self.assertEqual(['_gen_revno_map']*2, calls) - finally: - branch.unlock() - def test_set_last_revision_info_when_locked(self): """Calling set_last_revision_info should reset the cache.""" branch, calls = self.get_instrumented_branch() diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_hooks.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_hooks.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_hooks.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_hooks.py 2012-03-15 10:00:24.000000000 +0000 @@ -70,76 +70,6 @@ self.assertEqual([expected_params], hook_calls) -class TestSetRevisionHistoryHook(ChangeBranchTipTestCase): - - def setUp(self): - self.hook_calls = [] - super(TestSetRevisionHistoryHook, self).setUp() - - def capture_set_rh_hook(self, branch, rev_history): - """Capture post set-rh hook calls to self.hook_calls. - - The call is logged, as is some state of the branch. - """ - self.hook_calls.append( - ('set_rh', branch, rev_history, branch.is_locked())) - - def test_set_rh_empty_history(self): - branch = self.make_branch('source') - _mod_branch.Branch.hooks.install_named_hook( - 'set_rh', self.capture_set_rh_hook, None) - self.applyDeprecated(deprecated_in((2, 4, 0)), - branch.set_revision_history, []) - expected_params = ('set_rh', branch, [], True) - self.assertHookCalls(expected_params, branch) - - def test_set_rh_nonempty_history(self): - tree = self.make_branch_and_memory_tree('source') - tree.lock_write() - tree.add('') - tree.commit('another commit', rev_id='f\xc2\xb5') - tree.commit('empty commit', rev_id='foo') - tree.unlock() - branch = tree.branch - _mod_branch.Branch.hooks.install_named_hook( - 'set_rh', self.capture_set_rh_hook, None) - # some branches require that their history be set to a revision in the - # repository - self.applyDeprecated(deprecated_in((2, 4, 0)), - branch.set_revision_history, ['f\xc2\xb5']) - expected_params =('set_rh', branch, ['f\xc2\xb5'], True) - self.assertHookCalls(expected_params, branch) - - def test_set_rh_branch_is_locked(self): - branch = self.make_branch('source') - _mod_branch.Branch.hooks.install_named_hook( - 'set_rh', self.capture_set_rh_hook, None) - self.applyDeprecated(deprecated_in((2, 4, 0)), - branch.set_revision_history, []) - expected_params = ('set_rh', branch, [], True) - self.assertHookCalls(expected_params, branch) - - def test_set_rh_calls_all_hooks_no_errors(self): - branch = self.make_branch('source') - _mod_branch.Branch.hooks.install_named_hook( - 'set_rh', self.capture_set_rh_hook, None) - _mod_branch.Branch.hooks.install_named_hook( - 'set_rh', self.capture_set_rh_hook, None) - self.applyDeprecated(deprecated_in((2, 4, 0)), - branch.set_revision_history, []) - expected_calls = [('set_rh', branch, [], True), - ('set_rh', branch, [], True), - ] - if isinstance(branch, remote.RemoteBranch): - # For a remote branch, both the server and the client will raise - # set_rh, and the server will do so first because that is where - # the change takes place. - self.assertEqual(expected_calls, self.hook_calls[2:]) - self.assertEqual(4, len(self.hook_calls)) - else: - self.assertEqual(expected_calls, self.hook_calls) - - class TestOpen(tests.TestCaseWithMemoryTransport): def capture_hook(self, branch): @@ -389,12 +319,6 @@ self.assertEqual(length, len(self.pre_hook_calls)) self.assertEqual(length, len(self.post_hook_calls)) - def test_set_revision_history(self): - branch = self.make_branch('') - self.applyDeprecated(deprecated_in((2, 4, 0)), - branch.set_revision_history, []) - self.assertPreAndPostHooksWereInvoked(branch, True) - def test_set_last_revision_info(self): branch = self.make_branch('') branch.set_last_revision_info(0, revision.NULL_REVISION) diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_permissions.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_permissions.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_permissions.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_permissions.py 2012-03-15 10:00:24.000000000 +0000 @@ -32,7 +32,7 @@ from bzrlib import tests from bzrlib.branch import BzrBranch -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib.remote import RemoteBranchFormat from bzrlib.tests.test_permissions import check_mode_r @@ -126,7 +126,7 @@ raise tests.TestNotApplicable('Remote branches have no' ' permission logic') self.make_branch_and_tree('.') - bzrdir = BzrDir.open('.') + bzrdir = ControlDir.open('.') # Monkey patch the transport _orig_stat = bzrdir.transport.stat def null_perms_stat(*args, **kwargs): diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_pull.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_pull.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_pull.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_pull.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,7 +18,7 @@ from bzrlib import ( branch, - bzrdir, + controldir, errors, memorytree, revision, @@ -238,7 +238,7 @@ # remotebranches can't be bound. Let's instead make a new local # branch of the default type, which does allow binding. # See https://bugs.launchpad.net/bzr/+bug/112020 - local = bzrdir.BzrDir.create_branch_convenience('local2') + local = controldir.ControlDir.create_branch_convenience('local2') local.bind(target) source = self.make_branch('source') branch.Branch.hooks.install_named_hook( diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_push.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_push.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_push.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_push.py 2012-03-15 10:00:24.000000000 +0000 @@ -22,7 +22,7 @@ from bzrlib import ( branch, builtins, - bzrdir, + controldir, check, errors, memorytree, @@ -57,11 +57,6 @@ # result object contains some structured data self.assertEqual(result.old_revid, 'M1') self.assertEqual(result.new_revid, 'P2') - # and it can be treated as an integer for compatibility - self.assertEqual(self.applyDeprecated( - symbol_versioning.deprecated_in((2, 3, 0)), - result.__int__), - 0) def test_push_merged_indirect(self): # it should be possible to do a push from one branch into another @@ -173,7 +168,7 @@ if self.vfs_transport_factory is test_server.LocalURLServer: # the branch is colocated on disk, we cannot create a checkout. # hopefully callers will expect this. - local_controldir= bzrdir.BzrDir.open( + local_controldir = controldir.ControlDir.open( self.get_vfs_only_url('repo/tree')) tree = local_controldir.create_workingtree() else: @@ -355,7 +350,7 @@ # remotebranches can't be bound. Let's instead make a new local # branch of the default type, which does allow binding. # See https://bugs.launchpad.net/bzr/+bug/112020 - local = bzrdir.BzrDir.create_branch_convenience('local2') + local = controldir.ControlDir.create_branch_convenience('local2') local.bind(target) source = self.make_branch('source') branch.Branch.hooks.install_named_hook( diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_revision_history.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_revision_history.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_revision_history.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_revision_history.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,231 +0,0 @@ -# Copyright (C) 2007-2010 Canonical Ltd -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -"""Tests for Branch.revision_history and last_revision.""" - -from bzrlib import ( - branch, - errors, - revision as _mod_revision, - ) -from bzrlib.symbol_versioning import deprecated_in -from bzrlib.tests import ( - per_branch, - TestNotApplicable, - ) - - -class TestLastRevision(per_branch.TestCaseWithBranch): - """Tests for the last_revision property of the branch. - """ - - def test_set_last_revision_info(self): - # based on TestBranch.test_append_revisions, which uses the old - # append_revision api - wt = self.make_branch_and_tree('tree') - wt.commit('f', rev_id='rev1') - wt.commit('f', rev_id='rev2') - wt.commit('f', rev_id='rev3') - br = self.get_branch() - br.fetch(wt.branch) - br.set_last_revision_info(1, 'rev1') - self.assertEquals( - self.applyDeprecated(deprecated_in((2, 5, 0)), br.revision_history), - ["rev1",]) - br.set_last_revision_info(3, 'rev3') - self.assertEquals( - self.applyDeprecated(deprecated_in((2, 5, 0)), br.revision_history), - ["rev1", "rev2", "rev3"]) - # append_revision specifically prohibits some ids; - # set_last_revision_info currently does not - ## self.assertRaises(errors.ReservedId, - ## br.set_last_revision_info, 4, 'current:') - - -class TestRevisionHistoryCaching(per_branch.TestCaseWithBranch): - """Tests for the caching of branches' revision_history. - - When locked, branches should avoid regenerating or rereading - revision_history by caching the last value of it. This is safe because - the branch is locked, so nothing can change the revision_history - unexpectedly. - - When not locked, obviously the revision_history will need to be regenerated - or reread each time. - - We test if revision_history is using the cache by instrumenting the branch's - _gen_revision_history method, which is called by Branch.revision_history if - the branch does not have a cache of the revision history. - """ - - def get_instrumented_branch(self): - """Get a branch and monkey patch it to log calls to - _gen_revision_history. - - :returns: a tuple of (the branch, list that calls will be logged to) - """ - branch = self.get_branch() - calls = [] - real_gen_revision_history = branch._gen_revision_history - def fake_gen_revision_history(): - calls.append('_gen_revision_history') - return real_gen_revision_history() - branch._gen_revision_history = fake_gen_revision_history - return branch, calls - - def test_revision_history_when_unlocked(self): - """Repeated calls to revision history will call _gen_revision_history - each time when the branch is not locked. - """ - branch, calls = self.get_instrumented_branch() - # Repeatedly call revision_history. - self.applyDeprecated(deprecated_in((2, 5, 0)), branch.revision_history) - self.applyDeprecated(deprecated_in((2, 5, 0)), branch.revision_history) - self.assertEqual( - ['_gen_revision_history', '_gen_revision_history'], calls) - - def test_revision_history_when_locked(self): - """Repeated calls to revision history will only call - _gen_revision_history once while the branch is locked. - """ - branch, calls = self.get_instrumented_branch() - # Lock the branch, then repeatedly call revision_history. - branch.lock_read() - try: - self.applyDeprecated(deprecated_in((2, 5, 0)), - branch.revision_history) - self.applyDeprecated(deprecated_in((2, 5, 0)), - branch.revision_history) - self.assertEqual(['_gen_revision_history'], calls) - finally: - branch.unlock() - - def test_set_revision_history_when_locked(self): - """When the branch is locked, calling set_revision_history should cache - the revision history so that a later call to revision_history will not - need to call _gen_revision_history. - """ - branch, calls = self.get_instrumented_branch() - # Lock the branch, set the revision history, then repeatedly call - # revision_history. - branch.lock_write() - self.applyDeprecated(deprecated_in((2, 4, 0)), - branch.set_revision_history, []) - try: - self.applyDeprecated(deprecated_in((2, 5, 0)), - branch.revision_history) - self.assertEqual([], calls) - finally: - branch.unlock() - - def test_set_revision_history_when_unlocked(self): - """When the branch is not locked, calling set_revision_history will not - cause the revision history to be cached. - """ - branch, calls = self.get_instrumented_branch() - self.applyDeprecated(deprecated_in((2, 4, 0)), - branch.set_revision_history, []) - self.applyDeprecated(deprecated_in((2, 5, 0)), - branch.revision_history) - self.assertEqual(['_gen_revision_history'], calls) - - def test_set_last_revision_info_when_locked(self): - """When the branch is locked, calling set_last_revision_info should - cache the last revision info so that a later call to last_revision_info - will not need the revision_history. Thus the branch will not to call - _gen_revision_history in this situation. - """ - a_branch, calls = self.get_instrumented_branch() - # Lock the branch, set the last revision info, then call - # last_revision_info. - a_branch.lock_write() - a_branch.set_last_revision_info(0, _mod_revision.NULL_REVISION) - del calls[:] - try: - a_branch.last_revision_info() - self.assertEqual([], calls) - finally: - a_branch.unlock() - - def test_set_last_revision_info_none(self): - """Passing None to set_last_revision_info raises an exception.""" - a_branch = self.get_branch() - # Lock the branch, set the last revision info, then call - # last_revision_info. - a_branch.lock_write() - self.addCleanup(a_branch.unlock) - self.assertRaises(errors.InvalidRevisionId, - a_branch.set_last_revision_info, 0, None) - - def test_set_last_revision_info_uncaches_revision_history_for_format6(self): - """On format 6 branches, set_last_revision_info invalidates the revision - history cache. - """ - if not isinstance(self.branch_format, branch.BzrBranchFormat6): - return - a_branch, calls = self.get_instrumented_branch() - # Lock the branch, cache the revision history. - a_branch.lock_write() - self.applyDeprecated(deprecated_in((2, 5, 0)), - a_branch.revision_history) - # Set the last revision info, clearing the cache. - a_branch.set_last_revision_info(0, _mod_revision.NULL_REVISION) - del calls[:] - try: - self.applyDeprecated(deprecated_in((2, 5, 0)), - a_branch.revision_history) - self.assertEqual(['_gen_revision_history'], calls) - finally: - a_branch.unlock() - - def test_cached_revision_history_not_accidentally_mutable(self): - """When there's a cached version of the history, revision_history - returns a copy of the cached data so that callers cannot accidentally - corrupt the cache. - """ - branch = self.get_branch() - # Lock the branch, then repeatedly call revision_history, mutating the - # results. - branch.lock_read() - try: - # The first time the data returned will not be in the cache. - history = self.applyDeprecated(deprecated_in((2, 5, 0)), - branch.revision_history) - history.append('one') - # The second time the data comes from the cache. - history = self.applyDeprecated(deprecated_in((2, 5, 0)), - branch.revision_history) - history.append('two') - # The revision_history() should still be unchanged, even though - # we've mutated the return values from earlier calls. - self.assertEqual([], self.applyDeprecated( - deprecated_in((2, 5, 0)), branch.revision_history)) - finally: - branch.unlock() - - -class TestRevisionHistory(per_branch.TestCaseWithBranch): - - def test_parent_ghost(self): - tree = self.make_branch_and_tree('tree') - if not tree.branch.repository._format.supports_ghosts: - raise TestNotApplicable("repository format does not support ghosts") - tree.add_parent_tree_id('ghost-revision', - allow_leftmost_as_ghost=True) - tree.commit('first non-ghost commit', rev_id='non-ghost-revision') - self.assertEqual(['non-ghost-revision'], - self.applyDeprecated(deprecated_in((2, 5, 0)), - tree.branch.revision_history)) diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_stacking.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_stacking.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_stacking.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_stacking.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,7 +18,7 @@ from bzrlib import ( branch, - bzrdir, + controldir, check, errors, ) @@ -107,12 +107,12 @@ def assertRevisionInRepository(self, repo_path, revid): """Check that a revision is in a repository, disregarding stacking.""" - repo = bzrdir.BzrDir.open(repo_path).open_repository() + repo = controldir.ControlDir.open(repo_path).open_repository() self.assertTrue(repo.has_revision(revid)) def assertRevisionNotInRepository(self, repo_path, revid): """Check that a revision is not in a repository, disregarding stacking.""" - repo = bzrdir.BzrDir.open(repo_path).open_repository() + repo = controldir.ControlDir.open(repo_path).open_repository() self.assertFalse(repo.has_revision(revid)) def test_get_graph_stacked(self): @@ -165,7 +165,7 @@ raise TestNotApplicable(e) # Now serve the original mainline from a smart server remote_transport = self.make_smart_server('mainline') - remote_bzrdir = bzrdir.BzrDir.open_from_transport(remote_transport) + remote_bzrdir = controldir.ControlDir.open_from_transport(remote_transport) # and make branch from the smart server which is stacked new_dir = remote_bzrdir.sprout('newbranch', stacked=True) # stacked repository diff -Nru bzr-2.5.0/bzrlib/tests/per_branch/test_tags.py bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_tags.py --- bzr-2.5.0/bzrlib/tests/per_branch/test_tags.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_branch/test_tags.py 2012-03-15 10:00:24.000000000 +0000 @@ -22,7 +22,7 @@ from bzrlib import ( branch, - bzrdir as _mod_bzrdir, + controldir, errors, tests, ) @@ -170,7 +170,7 @@ b1 = self.make_branch_with_revisions('b', ['rev-1', 'rev-1-changed', 'rev-2']) b1.tags.set_tag('one', 'rev-1') - b2 = _mod_bzrdir.BzrDir.open('b').open_branch() + b2 = controldir.ControlDir.open('b').open_branch() b1.lock_read() self.assertEqual({'one': 'rev-1'}, b1.tags.get_tag_dict()) # Add a tag and modify a tag in b2. b1 is read-locked and has already diff -Nru bzr-2.5.0/bzrlib/tests/per_bzrdir/test_bzrdir.py bzr-2.6.0~beta1/bzrlib/tests/per_bzrdir/test_bzrdir.py --- bzr-2.5.0/bzrlib/tests/per_bzrdir/test_bzrdir.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_bzrdir/test_bzrdir.py 2012-03-15 10:00:24.000000000 +0000 @@ -21,8 +21,8 @@ import bzrlib.branch from bzrlib import ( - branch, bzrdir, + controldir, errors, repository, revision as _mod_revision, @@ -657,7 +657,7 @@ raise TestNotApplicable('Only relevant for stackable formats.') # Initialize a bzrdir subject to the policy. t = self.get_transport('stacked') - repo_fmt = bzrdir.format_registry.make_bzrdir('1.9') + repo_fmt = controldir.format_registry.make_bzrdir('1.9') repo_name = repo_fmt.repository_format.network_name() repo, control = self.assertInitializeEx( t, need_meta=True, repo_format_name=repo_name, stacked_on=None) diff -Nru bzr-2.5.0/bzrlib/tests/per_controldir/test_controldir.py bzr-2.6.0~beta1/bzrlib/tests/per_controldir/test_controldir.py --- bzr-2.5.0/bzrlib/tests/per_controldir/test_controldir.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_controldir/test_controldir.py 2012-03-15 10:00:24.000000000 +0000 @@ -20,18 +20,18 @@ import bzrlib.branch from bzrlib import ( - bzrdir, + bzrdir as _mod_bzrdir, check, controldir, errors, gpg, osutils, + revision as _mod_revision, transport, ui, urlutils, workingtree, ) -import bzrlib.revision from bzrlib.tests import ( fixtures, ChrootedTestCase, @@ -124,7 +124,7 @@ dir.create_repository() dir.create_branch() try: - wt = dir.create_workingtree(revision_id=bzrlib.revision.NULL_REVISION) + wt = dir.create_workingtree(revision_id=_mod_revision.NULL_REVISION) except (errors.NotLocalUrl, errors.UnsupportedOperation): raise TestSkipped("cannot make working tree with transport %r" % dir.transport) @@ -186,7 +186,7 @@ e.g. NotLocalUrl) if there is no working tree. """ dir = self.make_bzrdir('source') - vfs_dir = bzrdir.BzrDir.open(self.get_vfs_only_url('source')) + vfs_dir = controldir.ControlDir.open(self.get_vfs_only_url('source')) if vfs_dir.has_workingtree(): # This ControlDir format doesn't support ControlDirs without # working trees, so this test is irrelevant. @@ -232,7 +232,7 @@ tree.add('foo') tree.commit('revision 1', rev_id='1') tree.bzrdir.open_branch().generate_revision_history( - bzrlib.revision.NULL_REVISION) + _mod_revision.NULL_REVISION) tree.set_parent_trees([]) tree.commit('revision 2', rev_id='2') # Copy the content (i.e. revisions) from the 'commit_tree' branch's @@ -265,7 +265,7 @@ tree.add('foo') tree.commit('revision 1', rev_id='1') tree.branch.bzrdir.open_branch().generate_revision_history( - bzrlib.revision.NULL_REVISION) + _mod_revision.NULL_REVISION) tree.set_parent_trees([]) tree.commit('revision 2', rev_id='2') tree.branch.repository.copy_content_into(shared_repo) @@ -293,7 +293,7 @@ tree.add('foo') tree.commit('revision 1', rev_id='1') tree.branch.bzrdir.open_branch().generate_revision_history( - bzrlib.revision.NULL_REVISION) + _mod_revision.NULL_REVISION) tree.set_parent_trees([]) tree.commit('revision 2', rev_id='2') source = self.make_repository('source') @@ -365,7 +365,7 @@ self.assertEqual('1', target.open_branch().last_revision()) def test_clone_on_transport_preserves_repo_format(self): - if self.bzrdir_format == bzrdir.format_registry.make_bzrdir('default'): + if self.bzrdir_format == controldir.format_registry.make_bzrdir('default'): format = 'knit' else: format = None @@ -552,7 +552,7 @@ tree.add('foo') tree.commit('revision 1', rev_id='1') tree.bzrdir.open_branch().generate_revision_history( - bzrlib.revision.NULL_REVISION) + _mod_revision.NULL_REVISION) tree.set_parent_trees([]) tree.commit('revision 2', rev_id='2') source = self.make_repository('source') @@ -581,7 +581,7 @@ tree.add('foo') tree.commit('revision 1', rev_id='1') tree.bzrdir.open_branch().generate_revision_history( - bzrlib.revision.NULL_REVISION) + _mod_revision.NULL_REVISION) tree.set_parent_trees([]) tree.commit('revision 2', rev_id='2') tree.branch.repository.copy_content_into(shared_repo) @@ -606,7 +606,7 @@ tree.add('foo') tree.commit('revision 1', rev_id='1') tree.bzrdir.open_branch().generate_revision_history( - bzrlib.revision.NULL_REVISION) + _mod_revision.NULL_REVISION) tree.set_parent_trees([]) tree.commit('revision 2', rev_id='2') tree.branch.repository.copy_content_into(shared_repo) @@ -634,7 +634,7 @@ tree.add('foo') tree.commit('revision 1', rev_id='1') tree.bzrdir.open_branch().generate_revision_history( - bzrlib.revision.NULL_REVISION) + _mod_revision.NULL_REVISION) tree.set_parent_trees([]) tree.commit('revision 2', rev_id='2') source = self.make_repository('source') @@ -661,7 +661,7 @@ tree.add('foo') tree.commit('revision 1', rev_id='1') br = tree.bzrdir.open_branch() - br.set_last_revision_info(0, bzrlib.revision.NULL_REVISION) + br.set_last_revision_info(0, _mod_revision.NULL_REVISION) tree.set_parent_trees([]) tree.commit('revision 2', rev_id='2') source = self.make_repository('source') @@ -1048,7 +1048,7 @@ self.assertEqual(self.bzrdir_format, controldir.ControlDirFormat.find_format(readonly_t)) direct_opened_dir = self.bzrdir_format.open(readonly_t) - opened_dir = bzrdir.BzrDir.open(t.base) + opened_dir = controldir.ControlDir.open(t.base) self.assertEqual(made_control._format, opened_dir._format) self.assertEqual(direct_opened_dir._format, @@ -1086,7 +1086,7 @@ def test_format_initialize_on_transport_ex_force_new_repo_True(self): t = self.get_transport('repo') - repo_fmt = bzrdir.format_registry.make_bzrdir('1.9') + repo_fmt = controldir.format_registry.make_bzrdir('1.9') repo_name = repo_fmt.repository_format.network_name() repo = repo_fmt.initialize_on_transport_ex(t, repo_format_name=repo_name, shared_repo=True)[0] @@ -1097,7 +1097,7 @@ def test_format_initialize_on_transport_ex_force_new_repo_False(self): t = self.get_transport('repo') - repo_fmt = bzrdir.format_registry.make_bzrdir('1.9') + repo_fmt = controldir.format_registry.make_bzrdir('1.9') repo_name = repo_fmt.repository_format.network_name() repo = repo_fmt.initialize_on_transport_ex(t, repo_format_name=repo_name, shared_repo=True)[0] @@ -1115,7 +1115,7 @@ def test_format_initialize_on_transport_ex_repo_fmt_name_followed(self): t = self.get_transport('dir') # 1.6 is likely to never be default - fmt = bzrdir.format_registry.make_bzrdir('1.6') + fmt = controldir.format_registry.make_bzrdir('1.6') repo_name = fmt.repository_format.network_name() repo, control = self.assertInitializeEx(t, repo_format_name=repo_name) if self.bzrdir_format.fixed_components: @@ -1144,7 +1144,7 @@ self.assertTrue(repo.is_write_locked()) self.addCleanup(repo.unlock) self.assertIsInstance(control, controldir.ControlDir) - opened = bzrdir.BzrDir.open(t.base) + opened = controldir.ControlDir.open(t.base) expected_format = self.bzrdir_format if not isinstance(expected_format, RemoteBzrDirFormat): self.assertEqual(control._format.network_name(), @@ -1383,7 +1383,7 @@ except (errors.NotLocalUrl, errors.UnsupportedOperation): raise TestSkipped("Can't initialize %r on transport %r" % (self.bzrdir_format, t)) - dir = bzrdir.BzrDir.open(t.base+",branch=foo") + dir = controldir.ControlDir.open(t.base+",branch=foo") self.assertEquals({"branch": "foo"}, dir.user_transport.get_segment_parameters()) self.assertEquals("foo", dir._get_selected_branch()) @@ -1398,7 +1398,7 @@ except (errors.NotLocalUrl, errors.UnsupportedOperation): raise TestSkipped("Can't initialize %r on transport %r" % (self.bzrdir_format, t)) - dir = bzrdir.BzrDir.open(t.base) + dir = controldir.ControlDir.open(t.base) self.assertEqual(u"", dir._get_selected_branch()) def test_root_transport(self): @@ -1473,7 +1473,7 @@ raise TestNotApplicable("format does not support " "nesting repositories") child_repo = self.make_repository('childrepo') - opened_control = bzrdir.BzrDir.open(self.get_url('childrepo')) + opened_control = controldir.ControlDir.open(self.get_url('childrepo')) found_repo = opened_control.find_repository() self.assertEqual(child_repo.bzrdir.root_transport.base, found_repo.bzrdir.root_transport.base) @@ -1493,7 +1493,7 @@ self.get_transport().mkdir('childrepo') child_control = self.bzrdir_format.initialize(url) child_repo = child_control.create_repository(shared=True) - opened_control = bzrdir.BzrDir.open(self.get_url('childrepo')) + opened_control = controldir.ControlDir.open(self.get_url('childrepo')) found_repo = opened_control.find_repository() self.assertEqual(child_repo.bzrdir.root_transport.base, found_repo.bzrdir.root_transport.base) @@ -1713,14 +1713,14 @@ except errors.BzrError, e: if 'Cannot set config' in str(e): self.assertFalse( - isinstance(my_dir, (bzrdir.BzrDirMeta1, RemoteBzrDir)), + isinstance(my_dir, (_mod_bzrdir.BzrDirMeta1, RemoteBzrDir)), "%r should support configs" % my_dir) raise TestNotApplicable( 'This BzrDir format does not support configs.') else: raise self.assertEqual('http://example.com', config.get_default_stack_on()) - my_dir2 = bzrdir.BzrDir.open(self.get_url('.')) + my_dir2 = controldir.ControlDir.open(self.get_url('.')) config2 = my_dir2.get_config() self.assertEqual('http://example.com', config2.get_default_stack_on()) @@ -1748,7 +1748,7 @@ return except errors.NoRepositoryPresent: pass - made_control = bzrdir.BzrDir.open(self.get_readonly_url('subdir')) + made_control = controldir.ControlDir.open(self.get_readonly_url('subdir')) self.assertRaises(errors.NoRepositoryPresent, made_control.find_repository) diff -Nru bzr-2.5.0/bzrlib/tests/per_controldir_colo/test_supported.py bzr-2.6.0~beta1/bzrlib/tests/per_controldir_colo/test_supported.py --- bzr-2.5.0/bzrlib/tests/per_controldir_colo/test_supported.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_controldir_colo/test_supported.py 2012-03-15 10:00:24.000000000 +0000 @@ -137,7 +137,11 @@ def test_branch_name_with_slash(self): repo = self.make_repository('branch-1') - target_branch = repo.bzrdir.create_branch(name='foo/bar') + try: + target_branch = repo.bzrdir.create_branch(name='foo/bar') + except errors.InvalidBranchName: + raise tests.TestNotApplicable( + "format does not support branches with / in their name") self.assertEqual(['foo/bar'], repo.bzrdir.get_branches().keys()) self.assertEqual( target_branch.base, repo.bzrdir.open_branch(name='foo/bar').base) diff -Nru bzr-2.5.0/bzrlib/tests/per_interbranch/test_pull.py bzr-2.6.0~beta1/bzrlib/tests/per_interbranch/test_pull.py --- bzr-2.5.0/bzrlib/tests/per_interbranch/test_pull.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_interbranch/test_pull.py 2012-03-15 10:00:24.000000000 +0000 @@ -17,7 +17,7 @@ """Tests for InterBranch.pull behaviour.""" from bzrlib.branch import Branch -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib import errors from bzrlib.memorytree import MemoryTree from bzrlib.revision import NULL_REVISION @@ -175,7 +175,7 @@ # remotebranches can't be bound. Let's instead make a new local # branch of the default type, which does allow binding. # See https://bugs.launchpad.net/bzr/+bug/112020 - local = BzrDir.create_branch_convenience('local2') + local = ControlDir.create_branch_convenience('local2') local.bind(target) source = self.make_from_branch('source') Branch.hooks.install_named_hook('post_pull', diff -Nru bzr-2.5.0/bzrlib/tests/per_interbranch/test_push.py bzr-2.6.0~beta1/bzrlib/tests/per_interbranch/test_push.py --- bzr-2.5.0/bzrlib/tests/per_interbranch/test_push.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_interbranch/test_push.py 2012-03-15 10:00:24.000000000 +0000 @@ -25,8 +25,8 @@ from bzrlib import ( branch, - bzrdir, check, + controldir, errors, push, symbol_versioning, @@ -34,7 +34,7 @@ vf_repository, ) from bzrlib.branch import Branch -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib.memorytree import MemoryTree from bzrlib.revision import NULL_REVISION from bzrlib.smart.repository import SmartServerRepositoryGetParentMap @@ -64,11 +64,6 @@ # result object contains some structured data self.assertEqual(result.old_revid, 'M1') self.assertEqual(result.new_revid, 'P2') - # and it can be treated as an integer for compatibility - self.assertEqual(self.applyDeprecated( - symbol_versioning.deprecated_in((2, 3, 0)), - result.__int__), - 0) def test_push_merged_indirect(self): # it should be possible to do a push from one branch into another @@ -165,7 +160,7 @@ if self.vfs_transport_factory is test_server.LocalURLServer: # the branch is colocated on disk, we cannot create a checkout. # hopefully callers will expect this. - local_controldir = bzrdir.BzrDir.open(self.get_vfs_only_url('repo/tree')) + local_controldir = controldir.ControlDir.open(self.get_vfs_only_url('repo/tree')) tree = local_controldir.create_workingtree() else: tree = a_branch.create_checkout('repo/tree', lightweight=True) @@ -349,7 +344,7 @@ # remotebranches can't be bound. Let's instead make a new local # branch of the default type, which does allow binding. # See https://bugs.launchpad.net/bzr/+bug/112020 - local = BzrDir.create_branch_convenience('local2') + local = ControlDir.create_branch_convenience('local2') local.bind(target) source = self.make_from_branch('source') Branch.hooks.install_named_hook('post_push', diff -Nru bzr-2.5.0/bzrlib/tests/per_interrepository/test_fetch.py bzr-2.6.0~beta1/bzrlib/tests/per_interrepository/test_fetch.py --- bzr-2.5.0/bzrlib/tests/per_interrepository/test_fetch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_interrepository/test_fetch.py 2012-03-15 10:00:24.000000000 +0000 @@ -77,7 +77,7 @@ self.addCleanup(tree.unlock) tree.get_file_text('file1') for file_id in tree.all_file_ids(): - if tree.inventory[file_id].kind == "file": + if tree.kind(file_id) == "file": tree.get_file(file_id).read() # makes a target version repo @@ -234,8 +234,10 @@ (stacked_left_tree, stacked_right_tree) = stacked_branch.repository.revision_trees( ['left', 'right']) - self.assertEqual(left_tree.inventory, stacked_left_tree.inventory) - self.assertEqual(right_tree.inventory, stacked_right_tree.inventory) + self.assertEqual( + left_tree.root_inventory, stacked_left_tree.root_inventory) + self.assertEqual( + right_tree.root_inventory, stacked_right_tree.root_inventory) # Finally, it's not enough to see that the basis inventories are # present. The texts introduced in merge (and only those) should be @@ -296,7 +298,8 @@ stacked_branch.lock_read() self.addCleanup(stacked_branch.unlock) stacked_second_tree = stacked_branch.repository.revision_tree('second') - self.assertEqual(second_tree.inventory, stacked_second_tree.inventory) + self.assertEqual(second_tree.root_inventory, + stacked_second_tree.root_inventory) # Finally, it's not enough to see that the basis inventories are # present. The texts introduced in merge (and only those) should be # present, and also generating a stream should succeed without blowing @@ -380,8 +383,8 @@ (stacked_left_tree, stacked_right_tree) = new_stacked_branch.repository.revision_trees( ['left', 'right']) - self.assertEqual(left_tree.inventory, stacked_left_tree.inventory) - self.assertEqual(right_tree.inventory, stacked_right_tree.inventory) + self.assertEqual(left_tree, stacked_left_tree) + self.assertEqual(right_tree, stacked_right_tree) # Finally, it's not enough to see that the basis inventories are # present. The texts introduced in merge (and only those) should be # present, and also generating a stream should succeed without blowing diff -Nru bzr-2.5.0/bzrlib/tests/per_intertree/__init__.py bzr-2.6.0~beta1/bzrlib/tests/per_intertree/__init__.py --- bzr-2.5.0/bzrlib/tests/per_intertree/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_intertree/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -135,7 +135,7 @@ # -- vila 20090311 chk_tree_format = WorkingTreeFormat4() chk_tree_format._get_matchingbzrdir = \ - lambda:bzrlib.bzrdir.format_registry.make_bzrdir('2a') + lambda:bzrlib.controldir.format_registry.make_bzrdir('2a') test_intertree_permutations.append( (InterTree.__name__ + "(CHKInventory)", InterTree, diff -Nru bzr-2.5.0/bzrlib/tests/per_intertree/test_compare.py bzr-2.6.0~beta1/bzrlib/tests/per_intertree/test_compare.py --- bzr-2.5.0/bzrlib/tests/per_intertree/test_compare.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_intertree/test_compare.py 2012-03-15 10:00:24.000000000 +0000 @@ -542,7 +542,7 @@ (from_basename, to_basename), (kind, None), (False, False)) def deleted(self, tree, file_id): - entry = tree.inventory[file_id] + entry = tree.root_inventory[file_id] path = tree.id2path(file_id) return (file_id, (path, None), True, (True, False), (entry.parent_id, None), (entry.name, None), (entry.kind, None), diff -Nru bzr-2.5.0/bzrlib/tests/per_inventory/basics.py bzr-2.6.0~beta1/bzrlib/tests/per_inventory/basics.py --- bzr-2.5.0/bzrlib/tests/per_inventory/basics.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_inventory/basics.py 2012-03-15 10:00:24.000000000 +0000 @@ -152,10 +152,6 @@ inv = self.inv_to_test_inv(inv) self.assertEqual(inv.path2id('src'), 'src-id') self.assertEqual(inv.path2id('src/bye.c'), 'bye-id') - self.assertTrue( - self.applyDeprecated( - deprecated_in((2, 4, 0)), - inv.__contains__, 'src-id')) def test_non_directory_children(self): """Test path2id when a parent directory has no children""" diff -Nru bzr-2.5.0/bzrlib/tests/per_pack_repository.py bzr-2.6.0~beta1/bzrlib/tests/per_pack_repository.py --- bzr-2.5.0/bzrlib/tests/per_pack_repository.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_pack_repository.py 2012-03-15 10:00:24.000000000 +0000 @@ -24,7 +24,7 @@ from bzrlib.btree_index import BTreeGraphIndex from bzrlib.index import GraphIndex from bzrlib import ( - bzrdir, + controldir, errors, inventory, osutils, @@ -59,7 +59,7 @@ """ def get_format(self): - return bzrdir.format_registry.make_bzrdir(self.format_name) + return controldir.format_registry.make_bzrdir(self.format_name) def test_attribute__fetch_order(self): """Packs do not need ordered data retrieval.""" @@ -869,7 +869,7 @@ super(TestPackRepositoryStacking, self).setUp() def get_format(self): - return bzrdir.format_registry.make_bzrdir(self.format_name) + return controldir.format_registry.make_bzrdir(self.format_name) def test_stack_checks_rich_root_compatibility(self): # early versions of the packing code relied on pack internals to @@ -1000,7 +1000,7 @@ class TestKeyDependencies(TestCaseWithTransport): def get_format(self): - return bzrdir.format_registry.make_bzrdir(self.format_name) + return controldir.format_registry.make_bzrdir(self.format_name) def create_source_and_target(self): builder = self.make_branch_builder('source', format=self.get_format()) @@ -1085,7 +1085,7 @@ self.hpss_calls.append(params.method) def get_format(self): - return bzrdir.format_registry.make_bzrdir(self.format_name) + return controldir.format_registry.make_bzrdir(self.format_name) def test_autopack_or_streaming_rpc_is_used_when_using_hpss(self): # Make local and remote repos @@ -1093,7 +1093,7 @@ tree = self.make_branch_and_tree('local', format=format) self.make_branch_and_tree('remote', format=format) remote_branch_url = self.smart_server.get_url() + 'remote' - remote_branch = bzrdir.BzrDir.open(remote_branch_url).open_branch() + remote_branch = controldir.ControlDir.open(remote_branch_url).open_branch() # Make 9 local revisions, and push them one at a time to the remote # repo to produce 9 pack files. for x in range(9): diff -Nru bzr-2.5.0/bzrlib/tests/per_repository/__init__.py bzr-2.6.0~beta1/bzrlib/tests/per_repository/__init__.py --- bzr-2.5.0/bzrlib/tests/per_repository/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_repository/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -25,7 +25,6 @@ """ from bzrlib import ( - bzrdir, repository, ) from bzrlib.remote import RemoteRepositoryFormat diff -Nru bzr-2.5.0/bzrlib/tests/per_repository/test_commit_builder.py bzr-2.6.0~beta1/bzrlib/tests/per_repository/test_commit_builder.py --- bzr-2.5.0/bzrlib/tests/per_repository/test_commit_builder.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_repository/test_commit_builder.py 2012-03-15 10:00:24.000000000 +0000 @@ -49,7 +49,7 @@ if builder.record_root_entry is True: tree.lock_read() try: - ie = tree.inventory.root + ie = tree.root_inventory.root finally: tree.unlock() parent_tree = tree.branch.repository.revision_tree( @@ -264,7 +264,7 @@ if not builder.supports_record_entry_contents: raise tests.TestNotApplicable("CommitBuilder doesn't support " "record_entry_contents") - entry = tree.inventory['foo-id'] + entry = tree.root_inventory['foo-id'] self.assertRaises(errors.RootMissing, builder.record_entry_contents, entry, [], 'foo', tree, tree.path_content_summary('foo')) @@ -288,7 +288,7 @@ ie = inventory.make_entry('directory', '', None, tree.get_root_id()) delta, version_recorded, fs_hash = builder.record_entry_contents( - ie, [parent_tree.inventory], '', tree, + ie, [parent_tree.root_inventory], '', tree, tree.path_content_summary('')) # Regardless of repository root behaviour we should consider this a # pointless commit. @@ -375,10 +375,10 @@ if not builder.supports_record_entry_contents: raise tests.TestNotApplicable("CommitBuilder doesn't " "support record_entry_contents") - parent_invs = [basis.inventory] + parent_invs = [basis.root_inventory] builder.will_record_deletes() if builder.record_root_entry: - ie = basis.inventory.root.copy() + ie = basis.root_inventory.root.copy() delta, _, _ = builder.record_entry_contents(ie, parent_invs, '', tree, tree.path_content_summary('')) if delta is not None: @@ -435,9 +435,9 @@ "support record_entry_contents") builder.will_record_deletes() if builder.record_root_entry is True: - parent_invs = [basis.inventory] - del basis.inventory.root.children['foo'] - builder.record_entry_contents(basis.inventory.root, + parent_invs = [basis.root_inventory] + del basis.root_inventory.root.children['foo'] + builder.record_entry_contents(basis.root_inventory.root, parent_invs, '', tree, tree.path_content_summary('')) # the delta should be returned, and recorded in _basis_delta delta = builder.record_delete("foo", "foo-id") @@ -872,17 +872,17 @@ parent_tree = tree.basis_tree() parent_tree.lock_read() self.addCleanup(parent_tree.unlock) - parent_invs = [parent_tree.inventory] + parent_invs = [parent_tree.root_inventory] for parent_id in parent_ids[1:]: parent_invs.append(tree.branch.repository.revision_tree( - parent_id).inventory) + parent_id).root_inventory) # root builder.record_entry_contents( inventory.make_entry('directory', '', None, tree.get_root_id()), parent_invs, '', tree, tree.path_content_summary('')) def commit_id(file_id): - old_ie = tree.inventory[file_id] + old_ie = tree.root_inventory[file_id] path = tree.id2path(file_id) ie = inventory.make_entry(tree.kind(file_id), old_ie.name, old_ie.parent_id, file_id) @@ -894,7 +894,7 @@ tree, content_summary) file_id = tree.path2id(new_name) - parent_id = tree.inventory[file_id].parent_id + parent_id = tree.root_inventory[file_id].parent_id if parent_id != tree.get_root_id(): commit_id(parent_id) # because a change of some sort is meant to have occurred, @@ -999,7 +999,7 @@ else: self.assertFalse(version_recorded) - new_inventory = builder.revision_tree().inventory + new_inventory = builder.revision_tree().root_inventory new_entry = new_inventory[file_id] if delta_against_basis: expected_delta = (name, new_name, file_id, new_entry) diff -Nru bzr-2.5.0/bzrlib/tests/per_repository/test_fetch.py bzr-2.6.0~beta1/bzrlib/tests/per_repository/test_fetch.py --- bzr-2.5.0/bzrlib/tests/per_repository/test_fetch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_repository/test_fetch.py 2012-03-15 10:00:24.000000000 +0000 @@ -17,7 +17,7 @@ """Tests for fetch between repositories of the same type.""" from bzrlib import ( - bzrdir, + controldir, errors, gpg, remote, @@ -67,7 +67,7 @@ tree_a.add('foo', 'file1') tree_a.commit('rev1', rev_id='rev1') # create a knit-3 based format to fetch into - f = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree') + f = controldir.format_registry.make_bzrdir('development-subtree') try: format = tree_a.branch.repository._format format.check_conversion_target(f.repository_format) @@ -101,7 +101,9 @@ % b_bzrdir.transport) tree_b.commit('no change', rev_id='rev2') rev2_tree = knit3_repo.revision_tree('rev2') - self.assertEqual('rev1', rev2_tree.inventory.root.revision) + self.assertEqual( + 'rev1', + rev2_tree.get_file_revision(rev2_tree.get_root_id())) def do_test_fetch_to_rich_root_sets_parents_correctly(self, result, snapshots, root_id=ROOT_ID, allow_lefthand_ghost=False): diff -Nru bzr-2.5.0/bzrlib/tests/per_repository/test_has_same_location.py bzr-2.6.0~beta1/bzrlib/tests/per_repository/test_has_same_location.py --- bzr-2.5.0/bzrlib/tests/per_repository/test_has_same_location.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_repository/test_has_same_location.py 2012-03-15 10:00:24.000000000 +0000 @@ -17,7 +17,7 @@ """Tests for implementations of Repository.has_same_location.""" from bzrlib import ( - bzrdir, + controldir, transport, ) from bzrlib.remote import ( @@ -119,7 +119,7 @@ self.get_vfs_only_url()).delete_tree('other') other_repo = self.make_repository('other', format='knit') # Make sure the other_repo is not a RemoteRepository. - other_bzrdir = bzrdir.BzrDir.open(self.get_vfs_only_url('other')) + other_bzrdir = controldir.ControlDir.open(self.get_vfs_only_url('other')) other_repo = other_bzrdir.open_repository() self.assertDifferentRepo(repo, other_repo) diff -Nru bzr-2.5.0/bzrlib/tests/per_repository/test_repository.py bzr-2.6.0~beta1/bzrlib/tests/per_repository/test_repository.py --- bzr-2.5.0/bzrlib/tests/per_repository/test_repository.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_repository/test_repository.py 2012-03-15 10:00:24.000000000 +0000 @@ -343,7 +343,7 @@ # This gives metadir branches something they can convert to. # it would be nice to have a 'latest' vs 'default' concept. format = controldir.format_registry.make_bzrdir( - 'dirstate-with-subtree') + 'development-subtree') upgrade.upgrade(repo.bzrdir.root_transport.base, format=format) except errors.UpToDateFormat: # this is in the most current format already. diff -Nru bzr-2.5.0/bzrlib/tests/per_repository/test_signatures.py bzr-2.6.0~beta1/bzrlib/tests/per_repository/test_signatures.py --- bzr-2.5.0/bzrlib/tests/per_repository/test_signatures.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_repository/test_signatures.py 2012-03-15 10:00:24.000000000 +0000 @@ -126,6 +126,26 @@ (gpg.SIGNATURE_VALID, None, ), repo.verify_revision_signature('A', strategy)) + def test_verify_revision_signatures(self): + wt = self.make_branch_and_tree('.') + wt.commit("base", allow_pointless=True, rev_id='A') + wt.commit("second", allow_pointless=True, rev_id='B') + strategy = gpg.LoopbackGPGStrategy(None) + repo = wt.branch.repository + self.addCleanup(repo.lock_write().unlock) + repo.start_write_group() + repo.sign_revision('A', strategy) + repo.commit_write_group() + self.assertEqual('-----BEGIN PSEUDO-SIGNED CONTENT-----\n' + + Testament.from_revision(repo, + 'A').as_short_text() + + '-----END PSEUDO-SIGNED CONTENT-----\n', + repo.get_signature_text('A')) + self.assertEquals( + [('A', gpg.SIGNATURE_VALID, None), + ('B', gpg.SIGNATURE_NOT_SIGNED, None)], + list(repo.verify_revision_signatures(['A', 'B'], strategy))) + class TestUnsupportedSignatures(per_repository.TestCaseWithRepository): diff -Nru bzr-2.5.0/bzrlib/tests/per_repository_reference/__init__.py bzr-2.6.0~beta1/bzrlib/tests/per_repository_reference/__init__.py --- bzr-2.5.0/bzrlib/tests/per_repository_reference/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_repository_reference/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -27,7 +27,7 @@ remote, urlutils, ) -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib.tests import multiply_tests from bzrlib.tests.per_repository import ( all_repository_format_scenarios, @@ -49,7 +49,7 @@ def readonly_repository(self, repo): relpath = urlutils.basename(repo.bzrdir.user_url.rstrip('/')) - return BzrDir.open_from_transport( + return ControlDir.open_from_transport( self.get_readonly_transport(relpath)).open_repository() diff -Nru bzr-2.5.0/bzrlib/tests/per_repository_vf/test_add_inventory_by_delta.py bzr-2.6.0~beta1/bzrlib/tests/per_repository_vf/test_add_inventory_by_delta.py --- bzr-2.5.0/bzrlib/tests/per_repository_vf/test_add_inventory_by_delta.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_repository_vf/test_add_inventory_by_delta.py 2012-03-15 10:00:24.000000000 +0000 @@ -92,10 +92,9 @@ tree.basis_tree() revtree.lock_read() self.addCleanup(revtree.unlock) - new_inv = revtree.inventory - delta = self.make_inv_delta( - tree.branch.repository.revision_tree(revision.NULL_REVISION).inventory, - new_inv) + old_inv = tree.branch.repository.revision_tree(revision.NULL_REVISION).root_inventory + new_inv = revtree.root_inventory + delta = self.make_inv_delta(old_inv, new_inv) repo_direct = self._get_repo_in_write_group('direct') add_validator = repo_direct.add_inventory(revid, new_inv, []) repo_direct.commit_write_group() diff -Nru bzr-2.5.0/bzrlib/tests/per_repository_vf/test_reconcile.py bzr-2.6.0~beta1/bzrlib/tests/per_repository_vf/test_reconcile.py --- bzr-2.5.0/bzrlib/tests/per_repository_vf/test_reconcile.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_repository_vf/test_reconcile.py 2012-03-15 10:00:24.000000000 +0000 @@ -17,7 +17,10 @@ """Tests for reconciliation of repositories.""" import bzrlib -from bzrlib import errors +from bzrlib import ( + errors, + ) +from bzrlib.bzrdir import BzrDir from bzrlib.inventory import Inventory from bzrlib.reconcile import reconcile, Reconciler from bzrlib.revision import Revision @@ -135,14 +138,14 @@ # a inventory with a ghost that can be corrected now. t.copy_tree('inventory_one_ghost', 'inventory_ghost_present') bzrdir_url = self.get_url('inventory_ghost_present') - bzrdir = bzrlib.bzrdir.BzrDir.open(bzrdir_url) + bzrdir = BzrDir.open(bzrdir_url) repo = bzrdir.open_repository() add_commit(repo, 'the_ghost', []) def checkEmptyReconcile(self, **kwargs): """Check a reconcile on an empty repository.""" self.make_repository('empty') - d = bzrlib.bzrdir.BzrDir.open(self.get_url('empty')) + d = BzrDir.open(self.get_url('empty')) # calling on a empty repository should do nothing reconciler = d.find_repository().reconcile(**kwargs) # no inconsistent parents should have been found @@ -167,7 +170,7 @@ def test_convenience_reconcile_inventory_without_revision_reconcile(self): # smoke test for the all in one ui tool bzrdir_url = self.get_url('inventory_without_revision') - bzrdir = bzrlib.bzrdir.BzrDir.open(bzrdir_url) + bzrdir = BzrDir.open(bzrdir_url) repo = bzrdir.open_repository() if not repo._reconcile_does_inventory_gc: raise TestSkipped('Irrelevant test') @@ -179,7 +182,7 @@ def test_reweave_inventory_without_revision(self): # an excess inventory on its own is only reconciled by using thorough d_url = self.get_url('inventory_without_revision') - d = bzrlib.bzrdir.BzrDir.open(d_url) + d = BzrDir.open(d_url) repo = d.open_repository() if not repo._reconcile_does_inventory_gc: raise TestSkipped('Irrelevant test') @@ -232,7 +235,7 @@ # smoke test for the all in one Reconciler class, # other tests use the lower level repo.reconcile() d_url = self.get_url('inventory_without_revision_and_ghost') - d = bzrlib.bzrdir.BzrDir.open(d_url) + d = BzrDir.open(d_url) if not d.open_repository()._reconcile_does_inventory_gc: raise TestSkipped('Irrelevant test') def reconcile(): @@ -244,7 +247,7 @@ def test_reweave_inventory_without_revision_and_ghost(self): # actual low level test. d_url = self.get_url('inventory_without_revision_and_ghost') - d = bzrlib.bzrdir.BzrDir.open(d_url) + d = BzrDir.open(d_url) repo = d.open_repository() if not repo._reconcile_does_inventory_gc: raise TestSkipped('Irrelevant test') @@ -254,7 +257,7 @@ thorough=True) def test_reweave_inventory_preserves_a_revision_with_ghosts(self): - d = bzrlib.bzrdir.BzrDir.open(self.get_url('inventory_one_ghost')) + d = BzrDir.open(self.get_url('inventory_one_ghost')) reconciler = d.open_repository().reconcile(thorough=True) # no inconsistent parents should have been found: # the lack of a parent for ghost is normal @@ -267,7 +270,7 @@ self.assertThat(['ghost', 'the_ghost'], MatchesAncestry(repo, 'ghost')) def test_reweave_inventory_fixes_ancestryfor_a_present_ghost(self): - d = bzrlib.bzrdir.BzrDir.open(self.get_url('inventory_ghost_present')) + d = BzrDir.open(self.get_url('inventory_ghost_present')) repo = d.open_repository() m = MatchesAncestry(repo, 'ghost') if m.match(['the_ghost', 'ghost']) is None: diff -Nru bzr-2.5.0/bzrlib/tests/per_repository_vf/test_write_group.py bzr-2.6.0~beta1/bzrlib/tests/per_repository_vf/test_write_group.py --- bzr-2.5.0/bzrlib/tests/per_repository_vf/test_write_group.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_repository_vf/test_write_group.py 2012-03-15 10:00:24.000000000 +0000 @@ -20,7 +20,7 @@ from bzrlib import ( branch, - bzrdir, + controldir, errors, memorytree, remote, @@ -87,7 +87,8 @@ # repository, but the default format is unstackble. So explicitly # make a stackable real repository and use that. repo = self.make_repository(relpath, format='1.9') - repo = bzrdir.BzrDir.open(self.get_url(relpath)).open_repository() + dir = controldir.ControlDir.open(self.get_url(relpath)) + repo = dir.open_repository() else: repo = self.make_repository(relpath) if not repo._format.supports_external_lookups: diff -Nru bzr-2.5.0/bzrlib/tests/per_tree/__init__.py bzr-2.6.0~beta1/bzrlib/tests/per_tree/__init__.py --- bzr-2.5.0/bzrlib/tests/per_tree/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_tree/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -382,6 +382,7 @@ 'get_file_with_stat', 'get_root_id', 'get_symlink_target', + 'ids', 'inv', 'iter_search_rules', 'is_executable', diff -Nru bzr-2.5.0/bzrlib/tests/per_tree/test_ids.py bzr-2.6.0~beta1/bzrlib/tests/per_tree/test_ids.py --- bzr-2.5.0/bzrlib/tests/per_tree/test_ids.py 1970-01-01 00:00:00.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_tree/test_ids.py 2012-03-15 10:00:24.000000000 +0000 @@ -0,0 +1,51 @@ +# Copyright (C) 2012 Canonical Ltd +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +from bzrlib import ( + errors, + ) +from bzrlib.tests.per_tree import TestCaseWithTree + +class IdTests(TestCaseWithTree): + + def setUp(self): + super(IdTests, self).setUp() + work_a = self.make_branch_and_tree('wta') + self.build_tree(['wta/bla', 'wta/dir/', 'wta/dir/file']) + work_a.add(['bla', 'dir', 'dir/file'], ['bla-id', 'dir-id', 'file-id']) + work_a.commit('add files') + self.tree_a = self.workingtree_to_test_tree(work_a) + + def test_path2id(self): + self.assertEquals('bla-id', self.tree_a.path2id('bla')) + self.assertEquals('dir-id', self.tree_a.path2id('dir')) + self.assertIs(None, self.tree_a.path2id('idontexist')) + + def test_path2id_list(self): + self.assertEquals('bla-id', self.tree_a.path2id(['bla'])) + self.assertEquals('dir-id', self.tree_a.path2id(['dir'])) + self.assertEquals('file-id', self.tree_a.path2id(['dir', 'file'])) + self.assertEquals(self.tree_a.get_root_id(), + self.tree_a.path2id([])) + self.assertIs(None, self.tree_a.path2id(['idontexist'])) + self.assertIs(None, self.tree_a.path2id(['dir', 'idontexist'])) + + def test_id2path(self): + self.addCleanup(self.tree_a.lock_read().unlock) + self.assertEquals('bla', self.tree_a.id2path('bla-id')) + self.assertEquals('dir', self.tree_a.id2path('dir-id')) + self.assertEquals('dir/file', self.tree_a.id2path('file-id')) + self.assertRaises(errors.NoSuchId, self.tree_a.id2path, 'nonexistant') diff -Nru bzr-2.5.0/bzrlib/tests/per_tree/test_tree.py bzr-2.6.0~beta1/bzrlib/tests/per_tree/test_tree.py --- bzr-2.5.0/bzrlib/tests/per_tree/test_tree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_tree/test_tree.py 2012-03-15 10:00:24.000000000 +0000 @@ -105,7 +105,7 @@ tree = self.create_nested() tree.lock_read() self.addCleanup(tree.unlock) - entry = tree.inventory['sub-root'] + entry = tree.root_inventory['sub-root'] self.assertEqual([(u'subtree', 'sub-root')], list(tree.iter_references())) diff -Nru bzr-2.5.0/bzrlib/tests/per_workingtree/test_basis_inventory.py bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_basis_inventory.py --- bzr-2.5.0/bzrlib/tests/per_workingtree/test_basis_inventory.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_basis_inventory.py 2012-03-15 10:00:24.000000000 +0000 @@ -40,7 +40,7 @@ self.assertTrue(t._transport.has('basis-inventory-cache')) - basis_inv = t.basis_tree().inventory + basis_inv = t.basis_tree().root_inventory self.assertEquals('r1', basis_inv.revision_id) store_inv = b.repository.get_inventory('r1') diff -Nru bzr-2.5.0/bzrlib/tests/per_workingtree/test_commit.py bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_commit.py --- bzr-2.5.0/bzrlib/tests/per_workingtree/test_commit.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_commit.py 2012-03-15 10:00:24.000000000 +0000 @@ -19,8 +19,8 @@ from bzrlib import ( branch, - bzrdir, conflicts, + controldir, errors, mutabletree, osutils, @@ -264,7 +264,7 @@ del master # check its corrupted. self.assertRaises(errors.UnknownFormatError, - bzrdir.BzrDir.open, + controldir.ControlDir.open, 'master') tree.commit('foo', rev_id='foo', local=True) diff -Nru bzr-2.5.0/bzrlib/tests/per_workingtree/test_content_filters.py bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_content_filters.py --- bzr-2.5.0/bzrlib/tests/per_workingtree/test_content_filters.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_content_filters.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,7 +18,7 @@ import os -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib.filters import ContentFilter from bzrlib.switch import switch from bzrlib.workingtree import WorkingTree @@ -330,7 +330,7 @@ self.assertFileEqual("fOO tXT", 'checkout/file1.txt') # Switch it to branch-b and check the tree is updated - checkout_control_dir = BzrDir.open_containing('checkout')[0] + checkout_control_dir = ControlDir.open_containing('checkout')[0] switch(checkout_control_dir, source.branch) self.assertFileEqual("fOO rocks!", 'checkout/file1.txt') self.assertFileEqual("hELLO wORLD", 'checkout/file4.txt') diff -Nru bzr-2.5.0/bzrlib/tests/per_workingtree/test_executable.py bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_executable.py --- bzr-2.5.0/bzrlib/tests/per_workingtree/test_executable.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_executable.py 2012-03-15 10:00:24.000000000 +0000 @@ -58,8 +58,8 @@ tree.lock_read() if not ignore_inv: self.assertEqual( - [('', tree.inventory.root)], - list(tree.inventory.iter_entries())) + [('', tree.root_inventory.root)], + list(tree.root_inventory.iter_entries())) self.assertFalse(tree.has_id(self.a_id)) self.assertFalse(tree.has_filename('a')) self.assertFalse(tree.has_id(self.b_id)) @@ -181,8 +181,8 @@ self.wt._is_executable_from_path_and_stat_from_basis rev_id1 = self.wt.commit('one') rev_tree1 = self.wt.branch.repository.revision_tree(rev_id1) - a_executable = rev_tree1.inventory[self.a_id].executable - b_executable = rev_tree1.inventory[self.b_id].executable + a_executable = rev_tree1.root_inventory[self.a_id].executable + b_executable = rev_tree1.root_inventory[self.b_id].executable self.assertIsNot(None, a_executable) self.assertTrue(a_executable) self.assertIsNot(None, b_executable) diff -Nru bzr-2.5.0/bzrlib/tests/per_workingtree/test_inv.py bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_inv.py --- bzr-2.5.0/bzrlib/tests/per_workingtree/test_inv.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_inv.py 2012-03-15 10:00:24.000000000 +0000 @@ -56,8 +56,8 @@ inventory.InventoryFile('foo-id', 'foo', parent_id='bar-id')), (None, 'bar', 'bar-id', inventory.InventoryDirectory('bar-id', 'bar', parent_id=root_id))]) - self.assertEqual('bar/foo', wt.inventory.id2path('foo-id')) - self.assertEqual('bar', wt.inventory.id2path('bar-id')) + self.assertEqual('bar/foo', wt.id2path('foo-id')) + self.assertEqual('bar', wt.id2path('bar-id')) def test_remove(self): wt = self.make_branch_and_tree('.') diff -Nru bzr-2.5.0/bzrlib/tests/per_workingtree/test_nested_specifics.py bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_nested_specifics.py --- bzr-2.5.0/bzrlib/tests/per_workingtree/test_nested_specifics.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_nested_specifics.py 2012-03-15 10:00:24.000000000 +0000 @@ -44,7 +44,7 @@ tree.lock_read() self.addCleanup(tree.unlock) self.assertEqual('subtree-revision', - tree.inventory['subtree-id'].reference_revision) + tree.root_inventory['subtree-id'].reference_revision) def test_extract_while_locked(self): tree = self.make_branch_and_tree('.') @@ -75,8 +75,7 @@ def test_inventory_does_not_autodetect_subtree(self): tree = self.prepare_with_subtree() - ie = tree.inventory['subtree-id'] - self.assertEqual('directory', ie.kind) + self.assertEqual('directory', tree.kind('subtree-id')) def test_iter_entries_by_dir_autodetects_subtree(self): tree = self.prepare_with_subtree() diff -Nru bzr-2.5.0/bzrlib/tests/per_workingtree/test_parents.py bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_parents.py --- bzr-2.5.0/bzrlib/tests/per_workingtree/test_parents.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_parents.py 2012-03-15 10:00:24.000000000 +0000 @@ -365,7 +365,7 @@ result_basis = tree.basis_tree() result_basis.lock_read() try: - self.assertEqual(expected_inventory, result_basis.inventory) + self.assertEqual(expected_inventory, result_basis.root_inventory) finally: result_basis.unlock() @@ -396,7 +396,7 @@ self._inventory = shape def get_file_text(self, file_id, path=None): - ie = self.inventory[file_id] + ie = self.root_inventory[file_id] if ie.kind != "file": return "" return 'a' * ie.text_size diff -Nru bzr-2.5.0/bzrlib/tests/per_workingtree/test_pull.py bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_pull.py --- bzr-2.5.0/bzrlib/tests/per_workingtree/test_pull.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_pull.py 2012-03-15 10:00:24.000000000 +0000 @@ -97,7 +97,7 @@ self.workingtree_format) trunk = self.make_branch_deleting_dir('trunk') work = trunk.bzrdir.sprout('work', revision_id='2').open_workingtree() - work.branch.get_config().set_user_option( + work.branch.get_config_stack().set( 'bzr.transform.orphan_policy', 'move') # Add some unversioned files in dir self.build_tree(['work/dir/foo', diff -Nru bzr-2.5.0/bzrlib/tests/per_workingtree/test_workingtree.py bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_workingtree.py --- bzr-2.5.0/bzrlib/tests/per_workingtree/test_workingtree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/per_workingtree/test_workingtree.py 2012-03-15 10:00:24.000000000 +0000 @@ -24,6 +24,7 @@ branch, bzrdir, config, + controldir, errors, osutils, revision as _mod_revision, @@ -121,6 +122,12 @@ self.assertEqual(('filename', 'V', 'directory', 'file-id'), result[0][:4]) + def test_get_config_stack(self): + # Smoke test that all working trees succeed getting a config + wt = self.make_branch_and_tree('.') + conf = wt.get_config_stack() + self.assertIsInstance(conf, config.Stack) + def test_open_containing(self): branch = self.make_branch_and_tree('.').branch local_base = urlutils.local_path_from_url(branch.base) @@ -336,19 +343,16 @@ wt.set_last_revision('null:') wt.commit('A', allow_pointless=True, rev_id='A') self.assertEqual(['A'], wt.get_parent_ids()) - # None is aways in the branch + # null: is aways in the branch wt.set_last_revision('null:') self.assertEqual([], wt.get_parent_ids()) # and now we can set it to 'A' # because some formats mutate the branch to set it on the tree # we need to alter the branch to let this pass. - try: - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - wt.branch.set_revision_history, ['A', 'B']) - except errors.NoSuchRevision, e: - self.assertEqual('B', e.revision) + if getattr(wt.branch, "_set_revision_history", None) is None: raise TestSkipped("Branch format does not permit arbitrary" " history") + wt.branch._set_revision_history(['A', 'B']) wt.set_last_revision('A') self.assertEqual(['A'], wt.get_parent_ids()) self.assertRaises(errors.ReservedId, wt.set_last_revision, 'A:') @@ -713,7 +717,7 @@ tree.add(['bloo', 'blo']) tree.commit("blah", allow_pointless=False) base = tree.branch.repository.revision_tree(tree.last_revision()) - bzrdir.BzrDir.open("mine").sprout("other") + controldir.ControlDir.open("mine").sprout("other") with file('other/bloo', 'wb') as f: f.write('two') othertree = WorkingTree.open('other') othertree.commit('blah', allow_pointless=False) @@ -1200,7 +1204,7 @@ def test_set_in_branch(self): wt = self.make_wt_with_worth_saving_limit() - conf = config.BranchStack(wt.branch) + conf = wt.get_config_stack() conf.set('bzr.workingtree.worth_saving_limit', '20') self.assertEqual(20, wt._worth_saving_limit()) ds = wt.current_dirstate() @@ -1208,7 +1212,7 @@ def test_invalid(self): wt = self.make_wt_with_worth_saving_limit() - conf = config.BranchStack(wt.branch) + conf = wt.get_config_stack() conf.set('bzr.workingtree.worth_saving_limit', 'a') # If the config entry is invalid, default to 10 warnings = [] diff -Nru bzr-2.5.0/bzrlib/tests/test_branch.py bzr-2.6.0~beta1/bzrlib/tests/test_branch.py --- bzr-2.5.0/bzrlib/tests/test_branch.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_branch.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2011 Canonical Ltd +# Copyright (C) 2006-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ branch as _mod_branch, bzrdir, config, + controldir, errors, symbol_versioning, tests, @@ -227,29 +228,6 @@ branch = _mod_branch.Branch.open('.') self.assertEquals(branch._format.features, {}) - def test_register_unregister_format(self): - # Test the deprecated format registration functions - format = SampleBranchFormat() - # make a control dir - dir = bzrdir.BzrDirMetaFormat1().initialize(self.get_url()) - # make a branch - format.initialize(dir) - # register a format for it. - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - _mod_branch.BranchFormat.register_format, format) - # which branch.Open will refuse (not supported) - self.assertRaises(errors.UnsupportedFormatError, - _mod_branch.Branch.open, self.get_url()) - self.make_branch_and_tree('foo') - # but open_downlevel will work - self.assertEqual( - format.open(dir), - bzrdir.BzrDir.open(self.get_url()).open_branch(unsupported=True)) - # unregister the format - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - _mod_branch.BranchFormat.unregister_format, format) - self.make_branch_and_tree('bar') - class TestBranchFormatRegistry(tests.TestCase): @@ -356,29 +334,12 @@ self.assertPathDoesNotExist('a/.bzr/branch/parent') self.assertEqual('http://example.com', branch.get_parent()) branch.set_push_location('sftp://example.com') - config = branch.get_config_stack() - self.assertEqual('sftp://example.com', config.get('push_location')) + conf = branch.get_config_stack() + self.assertEqual('sftp://example.com', conf.get('push_location')) branch.set_bound_location('ftp://example.com') self.assertPathDoesNotExist('a/.bzr/branch/bound') self.assertEqual('ftp://example.com', branch.get_bound_location()) - def test_set_revision_history(self): - builder = self.make_branch_builder('.', format=self.get_format_name()) - builder.build_snapshot('foo', None, - [('add', ('', None, 'directory', None))], - message='foo') - builder.build_snapshot('bar', None, [], message='bar') - branch = builder.get_branch() - branch.lock_write() - self.addCleanup(branch.unlock) - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - branch.set_revision_history, ['foo', 'bar']) - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - branch.set_revision_history, ['foo']) - self.assertRaises(errors.NotLefthandHistory, - self.applyDeprecated, symbol_versioning.deprecated_in((2, 4, 0)), - branch.set_revision_history, ['bar']) - def do_checkout_test(self, lightweight=False): tree = self.make_branch_and_tree('source', format=self.get_format_name_subtree()) @@ -488,7 +449,7 @@ def make_branch(self, location, format=None): if format is None: - format = bzrdir.format_registry.make_bzrdir('1.9') + format = controldir.format_registry.make_bzrdir('1.9') format.set_branch_format(_mod_branch.BzrBranchFormat8()) return tests.TestCaseWithTransport.make_branch( self, location, format=format) @@ -591,7 +552,6 @@ def test_constructor(self): """Check that creating a BranchHooks instance has the right defaults.""" hooks = _mod_branch.BranchHooks() - self.assertTrue("set_rh" in hooks, "set_rh not in %s" % hooks) self.assertTrue("post_push" in hooks, "post_push not in %s" % hooks) self.assertTrue("post_commit" in hooks, "post_commit not in %s" % hooks) self.assertTrue("pre_commit" in hooks, "pre_commit not in %s" % hooks) @@ -693,21 +653,47 @@ 'Value "not-a-bool" is not valid for "append_revisions_only"', self.warnings[0]) + def test_use_fresh_values(self): + copy = _mod_branch.Branch.open(self.branch.base) + copy.lock_write() + try: + copy.get_config_stack().set('foo', 'bar') + finally: + copy.unlock() + self.assertFalse(self.branch.is_locked()) + result = self.branch.get_config_stack().get('foo') + # Bug: https://bugs.launchpad.net/bzr/+bug/948339 + self.expectFailure('Unlocked branches cache their configs', + self.assertEqual, 'bar', result) + + def test_set_from_config_get_from_config_stack(self): + self.branch.lock_write() + self.addCleanup(self.branch.unlock) + self.branch.get_config().set_user_option('foo', 'bar') + result = self.branch.get_config_stack().get('foo') + # https://bugs.launchpad.net/bzr/+bug/948344 + self.expectFailure('BranchStack uses cache after set_user_option', + self.assertEqual, 'bar', result) + + def test_set_from_config_stack_get_from_config(self): + self.branch.lock_write() + self.addCleanup(self.branch.unlock) + self.branch.get_config_stack().set('foo', 'bar') + self.assertEqual('bar', + self.branch.get_config().get_user_option('foo')) + + def test_set_delays_write(self): + self.branch.lock_write() + self.addCleanup(self.branch.unlock) + self.branch.get_config_stack().set('foo', 'bar') + copy = _mod_branch.Branch.open(self.branch.base) + result = copy.get_config_stack().get('foo') + # Bug: https://bugs.launchpad.net/bzr/+bug/948339 + self.expectFailure("Config writes are not cached.", self.assertIs, + None, result) -class TestPullResult(tests.TestCase): - def test_pull_result_to_int(self): - # to support old code, the pull result can be used as an int - r = _mod_branch.PullResult() - r.old_revno = 10 - r.new_revno = 20 - # this usage of results is not recommended for new code (because it - # doesn't describe very well what happened), but for api stability - # it's still supported - self.assertEqual(self.applyDeprecated( - symbol_versioning.deprecated_in((2, 3, 0)), - r.__int__), - 10) +class TestPullResult(tests.TestCase): def test_report_changed(self): r = _mod_branch.PullResult() diff -Nru bzr-2.5.0/bzrlib/tests/test_btree_index.py bzr-2.6.0~beta1/bzrlib/tests/test_btree_index.py --- bzr-2.5.0/bzrlib/tests/test_btree_index.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_btree_index.py 2012-03-15 10:00:24.000000000 +0000 @@ -103,6 +103,16 @@ self.overrideAttr(btree_index, '_PAGE_SIZE') btree_index._PAGE_SIZE = 2048 + def assertEqualsApproxCompressed(self, expected, actual, slop=6): + """Check a count of compressed bytes is approximately as expected + + Relying on compressed length being stable even with fixed inputs is + slightly bogus, but zlib is stable enough that this mostly works. + """ + if not expected - slop < actual < expected + slop: + self.fail("Expected around %d bytes compressed but got %d" % + (expected, actual)) + class TestBTreeBuilder(BTreeTestCase): @@ -199,7 +209,7 @@ temp_file = builder.finish() content = temp_file.read() del temp_file - self.assertEqual(9283, len(content)) + self.assertEqualsApproxCompressed(9283, len(content)) self.assertEqual( "B+Tree Graph Index 2\nnode_ref_lists=0\nkey_elements=1\nlen=400\n" "row_lengths=1,2\n", @@ -233,7 +243,7 @@ temp_file = builder.finish() content = temp_file.read() del temp_file - self.assertEqual(155, len(content)) + self.assertEqualsApproxCompressed(155, len(content)) self.assertEqual( "B+Tree Graph Index 2\nnode_ref_lists=0\nkey_elements=1\nlen=10\n" "row_lengths=1\n", @@ -255,7 +265,7 @@ temp_file = builder.finish() content = temp_file.read() del temp_file - self.assertEqual(9283, len(content)) + self.assertEqualsApproxCompressed(9283, len(content)) self.assertEqual( "B+Tree Graph Index 2\nnode_ref_lists=0\nkey_elements=1\nlen=400\n" "row_lengths=1,2\n", @@ -314,7 +324,7 @@ temp_file = builder.finish() content = temp_file.read() del temp_file - self.assertEqual(12643, len(content)) + self.assertEqualsApproxCompressed(12643, len(content)) self.assertEqual( "B+Tree Graph Index 2\nnode_ref_lists=2\nkey_elements=2\nlen=200\n" "row_lengths=1,3\n", @@ -700,7 +710,7 @@ # The entire index should have been read, as it is one page long. self.assertEqual([('readv', 'index', [(0, size)], False, None)], t._activity) - self.assertEqual(1173, size) + self.assertEqualsApproxCompressed(1173, size) def test_with_offset_no_size(self): index = self.make_index_with_offset(key_elements=1, ref_lists=1, @@ -750,7 +760,7 @@ builder.add_node(*node) t = transport.get_transport_from_url('trace+' + self.get_url('')) size = t.put_file('index', builder.finish()) - self.assertEqual(17692, size) + self.assertEqualsApproxCompressed(17692, size) index = btree_index.BTreeGraphIndex(t, 'index', size) del t._activity[:] self.assertEqual([], t._activity) @@ -773,7 +783,7 @@ # The entire index should have been read linearly. self.assertEqual([('readv', 'index', [(0, size)], False, None)], t._activity) - self.assertEqual(1488, size) + self.assertEqualsApproxCompressed(1488, size) def test_validate_two_pages(self): builder = btree_index.BTreeBuilder(key_elements=2, reference_lists=2) @@ -783,15 +793,16 @@ t = transport.get_transport_from_url('trace+' + self.get_url('')) size = t.put_file('index', builder.finish()) # Root page, 2 leaf pages - self.assertEqual(9339, size) + self.assertEqualsApproxCompressed(9339, size) index = btree_index.BTreeGraphIndex(t, 'index', size) del t._activity[:] self.assertEqual([], t._activity) index.validate() + rem = size - 8192 # Number of remaining bytes after second block # The entire index should have been read linearly. self.assertEqual( [('readv', 'index', [(0, 4096)], False, None), - ('readv', 'index', [(4096, 4096), (8192, 1147)], False, None)], + ('readv', 'index', [(4096, 4096), (8192, rem)], False, None)], t._activity) # XXX: TODO: write some badly-ordered nodes, and some pointers-to-wrong # node and make validate find them. @@ -860,8 +871,6 @@ builder.add_node(*node) t = transport.get_transport_from_url('trace+' + self.get_url('')) size = t.put_file('index', builder.finish()) - self.assertEqual(1303220, size, 'number of expected bytes in the' - ' output changed') page_size = btree_index._PAGE_SIZE del builder index = btree_index.BTreeGraphIndex(t, 'index', size) @@ -883,19 +892,19 @@ # The entire index should have been read total_pages = sum(index._row_lengths) self.assertEqual(total_pages, index._row_offsets[-1]) - self.assertEqual(1303220, size) + self.assertEqualsApproxCompressed(1303220, size) # The start of the leaves first_byte = index._row_offsets[-2] * page_size readv_request = [] for offset in range(first_byte, size, page_size): readv_request.append((offset, page_size)) # The last page is truncated - readv_request[-1] = (readv_request[-1][0], 1303220 % page_size) + readv_request[-1] = (readv_request[-1][0], size % page_size) expected = [('readv', 'index', [(0, page_size)], False, None), ('readv', 'index', readv_request, False, None)] if expected != t._activity: self.assertEqualDiff(pprint.pformat(expected), - pprint.pformat(transport._activity)) + pprint.pformat(t._activity)) def _test_iter_entries_references_resolved(self): index = self.make_index(1, nodes=[ diff -Nru bzr-2.5.0/bzrlib/tests/test_bundle.py bzr-2.6.0~beta1/bzrlib/tests/test_bundle.py --- bzr-2.5.0/bzrlib/tests/test_bundle.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_bundle.py 2012-03-15 10:00:24.000000000 +0000 @@ -75,10 +75,18 @@ self.root = InventoryDirectory(ROOT_ID, '', None) inventory = property(lambda x:x) + root_inventory = property(lambda x:x) + + def get_root_id(self): + return self.root.file_id def all_file_ids(self): return set(self.paths.keys()) + def is_executable(self, file_id): + # Not all the files are executable. + return False + def __getitem__(self, file_id): if file_id == self.root.file_id: return self.root @@ -95,7 +103,7 @@ for path, file_id in self.ids.iteritems(): yield path, self[file_id] - def get_file_kind(self, file_id): + def kind(self, file_id): if file_id in self.contents: kind = 'file' else: @@ -103,10 +111,10 @@ return kind def make_entry(self, file_id, path): - from bzrlib.inventory import (InventoryEntry, InventoryFile - , InventoryDirectory, InventoryLink) + from bzrlib.inventory import (InventoryFile , InventoryDirectory, + InventoryLink) name = os.path.basename(path) - kind = self.get_file_kind(file_id) + kind = self.kind(file_id) parent_id = self.parent_id(file_id) text_sha_1, text_size = self.contents_stats(file_id) if kind == 'directory': @@ -147,6 +155,12 @@ def get_file_revision(self, file_id): return self.inventory[file_id].revision + def get_file_size(self, file_id): + return self.inventory[file_id].text_size + + def get_file_sha1(self, file_id): + return self.inventory[file_id].text_sha1 + def contents_stats(self, file_id): if file_id not in self.contents: return None, None @@ -315,7 +329,7 @@ self.assertTrue(btree.path2id("grandparent/parent/file") is None) def sorted_ids(self, tree): - ids = list(tree) + ids = list(tree.all_file_ids()) ids.sort() return ids @@ -945,7 +959,8 @@ self.tree1.commit('message', rev_id='revid1') bundle = self.get_valid_bundle('null:', 'revid1') tree = self.get_bundle_tree(bundle, 'revid1') - self.assertEqual('revid1', tree.inventory.root.revision) + root_revision = tree.get_file_revision(tree.get_root_id()) + self.assertEqual('revid1', root_revision) def test_install_revisions(self): self.tree1 = self.make_branch_and_tree('b1') diff -Nru bzr-2.5.0/bzrlib/tests/test_bzrdir.py bzr-2.6.0~beta1/bzrlib/tests/test_bzrdir.py --- bzr-2.5.0/bzrlib/tests/test_bzrdir.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_bzrdir.py 2012-03-15 10:00:24.000000000 +0000 @@ -170,18 +170,18 @@ self.assertNotContainsRe(new, 'hidden') def test_set_default_repository(self): - default_factory = bzrdir.format_registry.get('default') - old_default = [k for k, v in bzrdir.format_registry.iteritems() + default_factory = controldir.format_registry.get('default') + old_default = [k for k, v in controldir.format_registry.iteritems() if v == default_factory and k != 'default'][0] - bzrdir.format_registry.set_default_repository('dirstate-with-subtree') + controldir.format_registry.set_default_repository('dirstate-with-subtree') try: - self.assertIs(bzrdir.format_registry.get('dirstate-with-subtree'), - bzrdir.format_registry.get('default')) + self.assertIs(controldir.format_registry.get('dirstate-with-subtree'), + controldir.format_registry.get('default')) self.assertIs( repository.format_registry.get_default().__class__, knitrepo.RepositoryFormatKnit3) finally: - bzrdir.format_registry.set_default_repository(old_default) + controldir.format_registry.set_default_repository(old_default) def test_aliases(self): a_registry = controldir.ControlDirFormatRegistry() @@ -212,21 +212,21 @@ """A sample BzrDir implementation to allow testing static methods.""" def create_repository(self, shared=False): - """See BzrDir.create_repository.""" + """See ControlDir.create_repository.""" return "A repository" def open_repository(self): - """See BzrDir.open_repository.""" + """See ControlDir.open_repository.""" return SampleRepository(self) def create_branch(self, name=None): - """See BzrDir.create_branch.""" + """See ControlDir.create_branch.""" if name is not None: raise NoColocatedBranchSupport(self) return SampleBranch(self) def create_workingtree(self): - """See BzrDir.create_workingtree.""" + """See ControlDir.create_workingtree.""" return "A tree" @@ -337,7 +337,7 @@ def test_create_branch_and_repo_under_shared(self): # creating a branch and repo in a shared repo uses the # shared repository - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') self.make_repository('.', shared=True, format=format) branch = bzrdir.BzrDir.create_branch_and_repo( self.get_url('child'), format=format) @@ -347,7 +347,7 @@ def test_create_branch_and_repo_under_shared_force_new(self): # creating a branch and repo in a shared repo can be forced to # make a new repo - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') self.make_repository('.', shared=True, format=format) branch = bzrdir.BzrDir.create_branch_and_repo(self.get_url('child'), force_new_repo=True, @@ -367,7 +367,7 @@ def test_create_standalone_working_tree_under_shared_repo(self): # create standalone working tree always makes a repo. - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') self.make_repository('.', shared=True, format=format) # note this is deliberately readonly, as this failure should # occur before any writes. @@ -380,14 +380,14 @@ def test_create_branch_convenience(self): # outside a repo the default convenience output is a repo+branch_tree - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') branch = bzrdir.BzrDir.create_branch_convenience('.', format=format) branch.bzrdir.open_workingtree() branch.bzrdir.open_repository() def test_create_branch_convenience_possible_transports(self): """Check that the optional 'possible_transports' is recognized""" - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') t = self.get_transport() branch = bzrdir.BzrDir.create_branch_convenience( '.', format=format, possible_transports=[t]) @@ -398,7 +398,7 @@ """Creating a branch at the root of a fs should work.""" self.vfs_transport_factory = memory.MemoryServer # outside a repo the default convenience output is a repo+branch_tree - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') branch = bzrdir.BzrDir.create_branch_convenience(self.get_url(), format=format) self.assertRaises(errors.NoWorkingTree, @@ -408,7 +408,7 @@ def test_create_branch_convenience_under_shared_repo(self): # inside a repo the default convenience output is a branch+ follow the # repo tree policy - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') self.make_repository('.', shared=True, format=format) branch = bzrdir.BzrDir.create_branch_convenience('child', format=format) @@ -419,7 +419,7 @@ def test_create_branch_convenience_under_shared_repo_force_no_tree(self): # inside a repo the default convenience output is a branch+ follow the # repo tree policy but we can override that - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') self.make_repository('.', shared=True, format=format) branch = bzrdir.BzrDir.create_branch_convenience('child', force_new_tree=False, format=format) @@ -431,7 +431,7 @@ def test_create_branch_convenience_under_shared_repo_no_tree_policy(self): # inside a repo the default convenience output is a branch+ follow the # repo tree policy - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') repo = self.make_repository('.', shared=True, format=format) repo.set_make_working_trees(False) branch = bzrdir.BzrDir.create_branch_convenience('child', @@ -444,7 +444,7 @@ def test_create_branch_convenience_under_shared_repo_no_tree_policy_force_tree(self): # inside a repo the default convenience output is a branch+ follow the # repo tree policy but we can override that - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') repo = self.make_repository('.', shared=True, format=format) repo.set_make_working_trees(False) branch = bzrdir.BzrDir.create_branch_convenience('child', @@ -456,7 +456,7 @@ def test_create_branch_convenience_under_shared_repo_force_new_repo(self): # inside a repo the default convenience output is overridable to give # repo+branch+tree - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') self.make_repository('.', shared=True, format=format) branch = bzrdir.BzrDir.create_branch_convenience('child', force_new_repo=True, format=format) @@ -523,7 +523,7 @@ # general case. trunk = self.make_branch('trunk', format='1.9') t = self.get_transport('stacked') - old_fmt = bzrdir.format_registry.make_bzrdir('pack-0.92') + old_fmt = controldir.format_registry.make_bzrdir('pack-0.92') repo_name = old_fmt.repository_format.network_name() # Should end up with a 1.9 format (stackable) repo, control, require_stacking, repo_policy = \ @@ -824,9 +824,9 @@ def test_sprout_recursive(self): tree = self.make_branch_and_tree('tree1', - format='dirstate-with-subtree') + format='development-subtree') sub_tree = self.make_branch_and_tree('tree1/subtree', - format='dirstate-with-subtree') + format='development-subtree') sub_tree.set_root_id('subtree-root') tree.add_reference(sub_tree) self.build_tree(['tree1/subtree/file']) @@ -849,21 +849,21 @@ def test_sprout_recursive_treeless(self): tree = self.make_branch_and_tree('tree1', - format='dirstate-with-subtree') + format='development-subtree') sub_tree = self.make_branch_and_tree('tree1/subtree', - format='dirstate-with-subtree') + format='development-subtree') tree.add_reference(sub_tree) self.build_tree(['tree1/subtree/file']) sub_tree.add('file') tree.commit('Initial commit') # The following line force the orhaning to reveal bug #634470 - tree.branch.get_config().set_user_option( + tree.branch.get_config_stack().set( 'bzr.transform.orphan_policy', 'move') tree.bzrdir.destroy_workingtree() # FIXME: subtree/.bzr is left here which allows the test to pass (or # fail :-( ) -- vila 20100909 repo = self.make_repository('repo', shared=True, - format='dirstate-with-subtree') + format='development-subtree') repo.set_make_working_trees(False) # FIXME: we just deleted the workingtree and now we want to use it ???? # At a minimum, we should use tree.branch below (but this fails too @@ -1015,13 +1015,13 @@ Metadirs should compare equal iff they have the same repo, branch and tree formats. """ - mydir = bzrdir.format_registry.make_bzrdir('knit') + mydir = controldir.format_registry.make_bzrdir('knit') self.assertEqual(mydir, mydir) self.assertFalse(mydir != mydir) - otherdir = bzrdir.format_registry.make_bzrdir('knit') + otherdir = controldir.format_registry.make_bzrdir('knit') self.assertEqual(otherdir, mydir) self.assertFalse(otherdir != mydir) - otherdir2 = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree') + otherdir2 = controldir.format_registry.make_bzrdir('development-subtree') self.assertNotEqual(otherdir2, mydir) self.assertFalse(otherdir2 == mydir) @@ -1039,14 +1039,14 @@ def test_needs_conversion_different_working_tree(self): # meta1dirs need an conversion if any element is not the default. - new_format = bzrdir.format_registry.make_bzrdir('dirstate') + new_format = controldir.format_registry.make_bzrdir('dirstate') tree = self.make_branch_and_tree('tree', format='knit') self.assertTrue(tree.bzrdir.needs_format_conversion( new_format)) def test_initialize_on_format_uses_smart_transport(self): self.setup_smart_server_with_call_log() - new_format = bzrdir.format_registry.make_bzrdir('dirstate') + new_format = controldir.format_registry.make_bzrdir('dirstate') transport = self.get_transport('target') transport.ensure_base() self.reset_smart_call_log() @@ -1070,7 +1070,7 @@ def test_create_branch_convenience(self): # outside a repo the default convenience output is a repo+branch_tree - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') branch = bzrdir.BzrDir.create_branch_convenience( self.get_url('foo'), format=format) self.assertRaises(errors.NoWorkingTree, @@ -1079,7 +1079,7 @@ def test_create_branch_convenience_force_tree_not_local_fails(self): # outside a repo the default convenience output is a repo+branch_tree - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') self.assertRaises(errors.NotLocalUrl, bzrdir.BzrDir.create_branch_convenience, self.get_url('foo'), @@ -1090,7 +1090,7 @@ def test_clone(self): # clone into a nonlocal path works - format = bzrdir.format_registry.make_bzrdir('knit') + format = controldir.format_registry.make_bzrdir('knit') branch = bzrdir.BzrDir.create_branch_convenience('local', format=format) branch.bzrdir.open_workingtree() @@ -1404,11 +1404,6 @@ possible_transports=[self._transport]) self._bzrdir = bzrdir.BzrDir.open_from_transport(self._transport) - def test_deprecated_generate_backup_name(self): - res = self.applyDeprecated( - symbol_versioning.deprecated_in((2, 3, 0)), - self._bzrdir.generate_backup_name, 'whatever') - def test_new(self): self.assertEqual("a.~1~", self._bzrdir._available_backup_name("a")) diff -Nru bzr-2.5.0/bzrlib/tests/test_clean_tree.py bzr-2.6.0~beta1/bzrlib/tests/test_clean_tree.py --- bzr-2.5.0/bzrlib/tests/test_clean_tree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_clean_tree.py 2012-03-15 10:00:24.000000000 +0000 @@ -19,11 +19,10 @@ import os import shutil import sys -import types from bzrlib import tests, ui -from bzrlib.bzrdir import ( - BzrDir, +from bzrlib.controldir import ( + ControlDir, ) from bzrlib.clean_tree import ( clean_tree, @@ -43,7 +42,7 @@ if has_symlinks() is False: return os.mkdir('branch') - BzrDir.create_standalone_workingtree('branch') + ControlDir.create_standalone_workingtree('branch') os.symlink(os.path.realpath('no-die-please'), 'branch/die-please') os.mkdir('no-die-please') self.assertPathExists('branch/die-please') @@ -56,7 +55,7 @@ def test_iter_deletable(self): """Files are selected for deletion appropriately""" os.mkdir('branch') - tree = BzrDir.create_standalone_workingtree('branch') + tree = ControlDir.create_standalone_workingtree('branch') transport = tree.bzrdir.root_transport transport.put_bytes('.bzrignore', '*~\n*.pyc\n.bzrignore\n') transport.put_bytes('file.BASE', 'contents') @@ -122,7 +121,7 @@ stderr = tests.StringIOWrapper() ui.ui_factory = tests.TestUIFactory(stdout=stdout, stderr=stderr) - BzrDir.create_standalone_workingtree('.') + ControlDir.create_standalone_workingtree('.') self.build_tree(['0foo', '1bar', '2baz', 'subdir0/']) clean_tree('.', unknown=True, no_prompt=True) self.assertContainsRe(stderr.getvalue(), diff -Nru bzr-2.5.0/bzrlib/tests/test_commands.py bzr-2.6.0~beta1/bzrlib/tests/test_commands.py --- bzr-2.5.0/bzrlib/tests/test_commands.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_commands.py 2012-03-15 10:00:24.000000000 +0000 @@ -25,6 +25,7 @@ errors, option, tests, + trace, ) from bzrlib.commands import display_command from bzrlib.tests import TestSkipped @@ -370,3 +371,81 @@ cmds = list(commands.all_command_names()) self.assertEqual(['called'], hook_calls) self.assertSubset(['foo', 'bar'], cmds) + +class TestPreAndPostCommandHooks(tests.TestCase): + class TestError(StandardError): + __doc__ = """A test exception.""" + + def test_pre_and_post_hooks(self): + hook_calls = [] + + def pre_command(cmd): + self.assertEqual([], hook_calls) + hook_calls.append('pre') + + def post_command(cmd): + self.assertEqual(['pre', 'run'], hook_calls) + hook_calls.append('post') + + def run(cmd): + self.assertEqual(['pre'], hook_calls) + hook_calls.append('run') + + self.overrideAttr(builtins.cmd_rocks, 'run', run) + commands.install_bzr_command_hooks() + commands.Command.hooks.install_named_hook( + "pre_command", pre_command, None) + commands.Command.hooks.install_named_hook( + "post_command", post_command, None) + + self.assertEqual([], hook_calls) + self.run_bzr(['rocks', '-Oxx=12', '-Oyy=foo']) + self.assertEqual(['pre', 'run', 'post'], hook_calls) + + def test_post_hook_provided_exception(self): + hook_calls = [] + + def post_command(cmd): + hook_calls.append('post') + + def run(cmd): + hook_calls.append('run') + raise self.TestError() + + self.overrideAttr(builtins.cmd_rocks, 'run', run) + commands.install_bzr_command_hooks() + commands.Command.hooks.install_named_hook( + "post_command", post_command, None) + + self.assertEqual([], hook_calls) + self.assertRaises(self.TestError, commands.run_bzr, [u'rocks']) + self.assertEqual(['run', 'post'], hook_calls) + + def test_pre_command_error(self): + """Ensure an BzrCommandError in pre_command aborts the command""" + + hook_calls = [] + + def pre_command(cmd): + hook_calls.append('pre') + # verify that all subclasses of BzrCommandError caught too + raise errors.BzrOptionError() + + def post_command(cmd, e): + self.fail('post_command should not be called') + + def run(cmd): + self.fail('command should not be called') + + self.overrideAttr(builtins.cmd_rocks, 'run', run) + commands.install_bzr_command_hooks() + commands.Command.hooks.install_named_hook( + "pre_command", pre_command, None) + commands.Command.hooks.install_named_hook( + "post_command", post_command, None) + + self.assertEqual([], hook_calls) + self.assertRaises(errors.BzrCommandError, + commands.run_bzr, [u'rocks']) + self.assertEqual(['pre'], hook_calls) + diff -Nru bzr-2.5.0/bzrlib/tests/test_commit.py bzr-2.6.0~beta1/bzrlib/tests/test_commit.py --- bzr-2.5.0/bzrlib/tests/test_commit.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_commit.py 2012-03-15 10:00:24.000000000 +0000 @@ -19,8 +19,8 @@ import bzrlib from bzrlib import ( - bzrdir, config, + controldir, errors, ) from bzrlib.branch import Branch @@ -835,7 +835,7 @@ def test_commit_with_checkout_and_branch_sharing_repo(self): repo = self.make_repository('repo', shared=True) # make_branch_and_tree ignores shared repos - branch = bzrdir.BzrDir.create_branch_convenience('repo/branch') + branch = controldir.ControlDir.create_branch_convenience('repo/branch') tree2 = branch.create_checkout('repo/tree2') tree2.commit('message', rev_id='rev1') self.assertTrue(tree2.branch.repository.has_revision('rev1')) diff -Nru bzr-2.5.0/bzrlib/tests/test_config.py bzr-2.6.0~beta1/bzrlib/tests/test_config.py --- bzr-2.5.0/bzrlib/tests/test_config.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_config.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2011 Canonical Ltd +# Copyright (C) 2005-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -27,14 +27,15 @@ #import bzrlib specific imports here from bzrlib import ( branch, - bzrdir, config, + controldir, diff, errors, osutils, mail_client, ui, urlutils, + registry as _mod_registry, remote, tests, trace, @@ -114,7 +115,7 @@ def build_control_store(test): build_backing_branch(test, 'branch') - b = bzrdir.BzrDir.open('branch') + b = controldir.ControlDir.open('branch') return config.ControlStore(b) config.test_store_builder_registry.register('control', build_control_store) @@ -475,12 +476,6 @@ def test_constructs(self): config.Config() - def test_no_default_editor(self): - self.assertRaises( - NotImplementedError, - self.applyDeprecated, deprecated_in((2, 4, 0)), - config.Config().get_editor) - def test_user_email(self): my_config = InstrumentedConfig() self.assertEqual('robert.collins@example.org', my_config.user_email()) @@ -688,63 +683,6 @@ self.assertFileEqual(content, 'test.conf') -class TestIniConfigOptionExpansionDefaultValue(tests.TestCaseInTempDir): - """What is the default value of expand for config options. - - This is an opt-in beta feature used to evaluate whether or not option - references can appear in dangerous place raising exceptions, disapearing - (and as such corrupting data) or if it's safe to activate the option by - default. - - Note that these tests relies on config._expand_default_value being already - overwritten in the parent class setUp. - """ - - def setUp(self): - super(TestIniConfigOptionExpansionDefaultValue, self).setUp() - self.config = None - self.warnings = [] - def warning(*args): - self.warnings.append(args[0] % args[1:]) - self.overrideAttr(trace, 'warning', warning) - - def get_config(self, expand): - c = config.GlobalConfig.from_string('bzr.config.expand=%s' % (expand,), - save=True) - return c - - def assertExpandIs(self, expected): - actual = config._get_expand_default_value() - #self.config.get_user_option_as_bool('bzr.config.expand') - self.assertEquals(expected, actual) - - def test_default_is_None(self): - self.assertEquals(None, config._expand_default_value) - - def test_default_is_False_even_if_None(self): - self.config = self.get_config(None) - self.assertExpandIs(False) - - def test_default_is_False_even_if_invalid(self): - self.config = self.get_config('') - self.assertExpandIs(False) - # ... - # Huh ? My choice is False ? Thanks, always happy to hear that :D - # Wait, you've been warned ! - self.assertLength(1, self.warnings) - self.assertEquals( - 'Value "" is not a boolean for "bzr.config.expand"', - self.warnings[0]) - - def test_default_is_True(self): - self.config = self.get_config(True) - self.assertExpandIs(True) - - def test_default_is_False(self): - self.config = self.get_config(False) - self.assertExpandIs(False) - - class TestIniConfigOptionExpansion(tests.TestCase): """Test option expansion from the IniConfig level. @@ -1141,7 +1079,7 @@ def test_get_config(self): """The Branch.get_config method works properly""" - b = bzrdir.BzrDir.create_standalone_workingtree('.').branch + b = controldir.ControlDir.create_standalone_workingtree('.').branch my_config = b.get_config() self.assertIs(my_config.get_user_option('wacky'), None) my_config.set_user_option('wacky', 'unlikely') @@ -1245,12 +1183,6 @@ my_config = config.GlobalConfig() self.assertEqual(None, my_config._get_user_id()) - def test_configured_editor(self): - my_config = config.GlobalConfig.from_string(sample_config_text) - editor = self.applyDeprecated( - deprecated_in((2, 4, 0)), my_config.get_editor) - self.assertEqual('vim', editor) - def test_signatures_always(self): my_config = config.GlobalConfig.from_string(sample_always_signatures) self.assertEqual(config.CHECK_NEVER, @@ -1910,48 +1842,6 @@ location='http://example.com/specific') self.assertEqual(my_config.get_user_option('option'), 'exact') - def test_get_mail_client(self): - config = self.get_branch_config() - client = config.get_mail_client() - self.assertIsInstance(client, mail_client.DefaultMail) - - # Specific clients - config.set_user_option('mail_client', 'evolution') - client = config.get_mail_client() - self.assertIsInstance(client, mail_client.Evolution) - - config.set_user_option('mail_client', 'kmail') - client = config.get_mail_client() - self.assertIsInstance(client, mail_client.KMail) - - config.set_user_option('mail_client', 'mutt') - client = config.get_mail_client() - self.assertIsInstance(client, mail_client.Mutt) - - config.set_user_option('mail_client', 'thunderbird') - client = config.get_mail_client() - self.assertIsInstance(client, mail_client.Thunderbird) - - # Generic options - config.set_user_option('mail_client', 'default') - client = config.get_mail_client() - self.assertIsInstance(client, mail_client.DefaultMail) - - config.set_user_option('mail_client', 'editor') - client = config.get_mail_client() - self.assertIsInstance(client, mail_client.Editor) - - config.set_user_option('mail_client', 'mapi') - client = config.get_mail_client() - self.assertIsInstance(client, mail_client.MAPIClient) - - config.set_user_option('mail_client', 'xdg-email') - client = config.get_mail_client() - self.assertIsInstance(client, mail_client.XDGEmail) - - config.set_user_option('mail_client', 'firebird') - self.assertRaises(errors.UnknownMailClient, config.get_mail_client) - class TestMailAddressExtraction(tests.TestCase): @@ -2244,7 +2134,7 @@ self.assertGetHook(remote_branch._get_config(), 'file', 'branch') def test_get_hook_remote_bzrdir(self): - remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree')) + remote_bzrdir = controldir.ControlDir.open(self.get_url('tree')) conf = remote_bzrdir._get_config() conf.set_option('remotedir', 'file') self.assertGetHook(conf, 'file', 'remotedir') @@ -2272,7 +2162,7 @@ def test_set_hook_remote_bzrdir(self): remote_branch = branch.Branch.open(self.get_url('tree')) self.addCleanup(remote_branch.lock_write().unlock) - remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree')) + remote_bzrdir = controldir.ControlDir.open(self.get_url('tree')) self.assertSetHook(remote_bzrdir._get_config(), 'file', 'remotedir') def assertLoadHook(self, expected_nb_calls, name, conf_class, *conf_args): @@ -2295,7 +2185,7 @@ self.assertLoadHook(1, 'file', remote.RemoteBranchConfig, remote_branch) def test_load_hook_remote_bzrdir(self): - remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree')) + remote_bzrdir = controldir.ControlDir.open(self.get_url('tree')) # The config file doesn't exist, set an option to force its creation conf = remote_bzrdir._get_config() conf.set_option('remotedir', 'file') @@ -2326,7 +2216,7 @@ def test_save_hook_remote_bzrdir(self): remote_branch = branch.Branch.open(self.get_url('tree')) self.addCleanup(remote_branch.lock_write().unlock) - remote_bzrdir = bzrdir.BzrDir.open(self.get_url('tree')) + remote_bzrdir = controldir.ControlDir.open(self.get_url('tree')) self.assertSaveHook(remote_bzrdir._get_config()) @@ -2369,6 +2259,10 @@ opt = config.Option('foo', default=bar_not_unicode) self.assertRaises(AssertionError, opt.get_default) + def test_get_help_topic(self): + opt = config.Option('foo') + self.assertEquals('foo', opt.get_help_topic()) + class TestOptionConverterMixin(object): @@ -2487,6 +2381,54 @@ self.assertConverted([u'bar'], opt, u'bar') +class TestRegistryOption(tests.TestCase, TestOptionConverterMixin): + + def get_option(self, registry): + return config.RegistryOption('foo', registry, + help='A registry option.') + + def test_convert_invalid(self): + registry = _mod_registry.Registry() + opt = self.get_option(registry) + self.assertConvertInvalid(opt, [1]) + self.assertConvertInvalid(opt, u"notregistered") + + def test_convert_valid(self): + registry = _mod_registry.Registry() + registry.register("someval", 1234) + opt = self.get_option(registry) + # Using a bare str() just in case + self.assertConverted(1234, opt, "someval") + self.assertConverted(1234, opt, u'someval') + self.assertConverted(None, opt, None) + + def test_help(self): + registry = _mod_registry.Registry() + registry.register("someval", 1234, help="some option") + registry.register("dunno", 1234, help="some other option") + opt = self.get_option(registry) + self.assertEquals( + 'A registry option.\n' + '\n' + 'The following values are supported:\n' + ' dunno - some other option\n' + ' someval - some option\n', + opt.help) + + def test_get_help_text(self): + registry = _mod_registry.Registry() + registry.register("someval", 1234, help="some option") + registry.register("dunno", 1234, help="some other option") + opt = self.get_option(registry) + self.assertEquals( + 'A registry option.\n' + '\n' + 'The following values are supported:\n' + ' dunno - some other option\n' + ' someval - some option\n', + opt.get_help_text()) + + class TestOptionRegistry(tests.TestCase): def setUp(self): @@ -2921,6 +2863,11 @@ def test_save_emptied_succeeds(self): store = self.get_store(self) store._load_from_string('foo=bar\n') + # FIXME: There should be a better way than relying on the test + # parametrization to identify branch.conf -- vila 2011-0526 + if self.store_id in ('branch', 'remote_branch'): + # branch stores requires write locked branches + self.addCleanup(store.branch.lock_write().unlock) section = store.get_mutable_section(None) section.remove('foo') store.save() @@ -2947,6 +2894,11 @@ def test_set_option_in_empty_store(self): store = self.get_store(self) + # FIXME: There should be a better way than relying on the test + # parametrization to identify branch.conf -- vila 2011-0526 + if self.store_id in ('branch', 'remote_branch'): + # branch stores requires write locked branches + self.addCleanup(store.branch.lock_write().unlock) section = store.get_mutable_section(None) section.set('foo', 'bar') store.save() @@ -2958,6 +2910,11 @@ def test_set_option_in_default_section(self): store = self.get_store(self) store._load_from_string('') + # FIXME: There should be a better way than relying on the test + # parametrization to identify branch.conf -- vila 2011-0526 + if self.store_id in ('branch', 'remote_branch'): + # branch stores requires write locked branches + self.addCleanup(store.branch.lock_write().unlock) section = store.get_mutable_section(None) section.set('foo', 'bar') store.save() @@ -2969,6 +2926,11 @@ def test_set_option_in_named_section(self): store = self.get_store(self) store._load_from_string('') + # FIXME: There should be a better way than relying on the test + # parametrization to identify branch.conf -- vila 2011-0526 + if self.store_id in ('branch', 'remote_branch'): + # branch stores requires write locked branches + self.addCleanup(store.branch.lock_write().unlock) section = store.get_mutable_section('baz') section.set('foo', 'bar') store.save() @@ -2978,8 +2940,13 @@ self.assertSectionContent(('baz', {'foo': 'bar'}), sections[0]) def test_load_hook(self): - # We first needs to ensure that the store exists + # First, we need to ensure that the store exists store = self.get_store(self) + # FIXME: There should be a better way than relying on the test + # parametrization to identify branch.conf -- vila 2011-0526 + if self.store_id in ('branch', 'remote_branch'): + # branch stores requires write locked branches + self.addCleanup(store.branch.lock_write().unlock) section = store.get_mutable_section('baz') section.set('foo', 'bar') store.save() @@ -3001,6 +2968,11 @@ config.ConfigHooks.install_named_hook('save', hook, None) self.assertLength(0, calls) store = self.get_store(self) + # FIXME: There should be a better way than relying on the test + # parametrization to identify branch.conf -- vila 2011-0526 + if self.store_id in ('branch', 'remote_branch'): + # branch stores requires write locked branches + self.addCleanup(store.branch.lock_write().unlock) section = store.get_mutable_section('baz') section.set('foo', 'bar') store.save() @@ -3637,6 +3609,41 @@ self.assertEquals('bar', conf.get('foo')) +class TestStackIterSections(tests.TestCase): + + def test_empty_stack(self): + conf = config.Stack([]) + sections = list(conf.iter_sections()) + self.assertLength(0, sections) + + def test_empty_store(self): + store = config.IniFileStore() + store._load_from_string('') + conf = config.Stack([store.get_sections]) + sections = list(conf.iter_sections()) + self.assertLength(0, sections) + + def test_simple_store(self): + store = config.IniFileStore() + store._load_from_string('foo=bar') + conf = config.Stack([store.get_sections]) + tuples = list(conf.iter_sections()) + self.assertLength(1, tuples) + (found_store, found_section) = tuples[0] + self.assertIs(store, found_store) + + def test_two_stores(self): + store1 = config.IniFileStore() + store1._load_from_string('foo=bar') + store2 = config.IniFileStore() + store2._load_from_string('bar=qux') + conf = config.Stack([store1.get_sections, store2.get_sections]) + tuples = list(conf.iter_sections()) + self.assertLength(2, tuples) + self.assertIs(store1, tuples[0][0]) + self.assertIs(store2, tuples[1][0]) + + class TestStackWithTransport(tests.TestCaseWithTransport): scenarios = [(key, {'get_stack': builder}) for key, builder @@ -3832,7 +3839,8 @@ super(TestStackExpandOptions, self).setUp() self.overrideAttr(config, 'option_registry', config.OptionRegistry()) self.registry = config.option_registry - self.conf = build_branch_stack(self) + store = config.TransportIniFileStore(self.get_transport(), 'foo.conf') + self.conf = config.Stack([store.get_sections], store) def assertExpansion(self, expected, string, env=None): self.assertEquals(expected, self.conf.expand_options(string, env)) @@ -3921,8 +3929,11 @@ baz=end list={foo} ''') - self.registry.register( - config.ListOption('list')) + self.registry.register(config.ListOption('list')) + # Register an intermediate option as a list to ensure no conversion + # happen while expanding. Conversion should only occur for the original + # option ('list' here). + self.registry.register(config.ListOption('baz')) self.assertEquals(['start', 'middle', 'end'], self.conf.get('list', expand=True)) @@ -4847,3 +4858,56 @@ self.overrideEnv('BZR_EMAIL', None) self.overrideEnv('EMAIL', 'jelmer@samba.org') self.assertEquals('jelmer@debian.org', conf.get('email')) + + +class MailClientOptionTests(tests.TestCase): + + def test_default(self): + conf = config.MemoryStack('') + client = conf.get('mail_client') + self.assertIs(client, mail_client.DefaultMail) + + def test_evolution(self): + conf = config.MemoryStack('mail_client=evolution') + client = conf.get('mail_client') + self.assertIs(client, mail_client.Evolution) + + def test_kmail(self): + conf = config.MemoryStack('mail_client=kmail') + client = conf.get('mail_client') + self.assertIs(client, mail_client.KMail) + + def test_mutt(self): + conf = config.MemoryStack('mail_client=mutt') + client = conf.get('mail_client') + self.assertIs(client, mail_client.Mutt) + + def test_thunderbird(self): + conf = config.MemoryStack('mail_client=thunderbird') + client = conf.get('mail_client') + self.assertIs(client, mail_client.Thunderbird) + + def test_explicit_default(self): + conf = config.MemoryStack('mail_client=default') + client = conf.get('mail_client') + self.assertIs(client, mail_client.DefaultMail) + + def test_editor(self): + conf = config.MemoryStack('mail_client=editor') + client = conf.get('mail_client') + self.assertIs(client, mail_client.Editor) + + def test_mapi(self): + conf = config.MemoryStack('mail_client=mapi') + client = conf.get('mail_client') + self.assertIs(client, mail_client.MAPIClient) + + def test_xdg_email(self): + conf = config.MemoryStack('mail_client=xdg-email') + client = conf.get('mail_client') + self.assertIs(client, mail_client.XDGEmail) + + def test_unknown(self): + conf = config.MemoryStack('mail_client=firebird') + self.assertRaises(errors.ConfigOptionValueError, conf.get, + 'mail_client') diff -Nru bzr-2.5.0/bzrlib/tests/test_conflicts.py bzr-2.6.0~beta1/bzrlib/tests/test_conflicts.py --- bzr-2.5.0/bzrlib/tests/test_conflicts.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_conflicts.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,7 +18,6 @@ import os from bzrlib import ( - bzrdir, conflicts, errors, option, diff -Nru bzr-2.5.0/bzrlib/tests/test_directory_service.py bzr-2.6.0~beta1/bzrlib/tests/test_directory_service.py --- bzr-2.5.0/bzrlib/tests/test_directory_service.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_directory_service.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2008, 2009, 2010 Canonical Ltd +# Copyright (C) 2008-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -65,55 +65,53 @@ class TestAliasDirectory(TestCaseWithTransport): + def setUp(self): + super(TestAliasDirectory, self).setUp() + self.branch = self.make_branch('.') + + def assertAliasFromBranch(self, setter, value, alias): + setter(value) + self.assertEquals(value, directories.dereference(alias)) + def test_lookup_parent(self): - branch = self.make_branch('.') - branch.set_parent('http://a') - self.assertEqual('http://a', directories.dereference(':parent')) + self.assertAliasFromBranch(self.branch.set_parent, 'http://a', + ':parent') def test_lookup_submit(self): - branch = self.make_branch('.') - branch.set_submit_branch('http://b') - self.assertEqual('http://b', directories.dereference(':submit')) + self.assertAliasFromBranch(self.branch.set_submit_branch, 'http://b', + ':submit') def test_lookup_public(self): - branch = self.make_branch('.') - branch.set_public_branch('http://c') - self.assertEqual('http://c', directories.dereference(':public')) + self.assertAliasFromBranch(self.branch.set_public_branch, 'http://c', + ':public') def test_lookup_bound(self): - branch = self.make_branch('.') - branch.set_bound_location('http://d') - self.assertEqual('http://d', directories.dereference(':bound')) + self.assertAliasFromBranch(self.branch.set_bound_location, 'http://d', + ':bound') def test_lookup_push(self): - branch = self.make_branch('.') - branch.set_push_location('http://e') - self.assertEqual('http://e', directories.dereference(':push')) + self.assertAliasFromBranch(self.branch.set_push_location, 'http://e', + ':push') def test_lookup_this(self): - branch = self.make_branch('.') - self.assertEqual(branch.base, directories.dereference(':this')) + self.assertEqual(self.branch.base, directories.dereference(':this')) def test_extra_path(self): - branch = self.make_branch('.') - self.assertEqual(urlutils.join(branch.base, 'arg'), + self.assertEqual(urlutils.join(self.branch.base, 'arg'), directories.dereference(':this/arg')) def test_lookup_badname(self): - branch = self.make_branch('.') e = self.assertRaises(errors.InvalidLocationAlias, directories.dereference, ':booga') self.assertEqual('":booga" is not a valid location alias.', str(e)) def test_lookup_badvalue(self): - branch = self.make_branch('.') e = self.assertRaises(errors.UnsetLocationAlias, directories.dereference, ':parent') self.assertEqual('No parent location assigned.', str(e)) def test_register_location_alias(self): - branch = self.make_branch('.') self.addCleanup(AliasDirectory.branch_aliases.remove, "booga") AliasDirectory.branch_aliases.register("booga", lambda b: "UHH?", help="Nobody knows") diff -Nru bzr-2.5.0/bzrlib/tests/test_dirstate.py bzr-2.6.0~beta1/bzrlib/tests/test_dirstate.py --- bzr-2.5.0/bzrlib/tests/test_dirstate.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_dirstate.py 2012-03-15 10:00:24.000000000 +0000 @@ -20,7 +20,7 @@ import tempfile from bzrlib import ( - bzrdir, + controldir, dirstate, errors, inventory, @@ -31,7 +31,6 @@ tests, workingtree_4, ) -from bzrlib.transport import memory from bzrlib.tests import ( features, test_osutils, @@ -756,7 +755,7 @@ def test_set_state_from_inventory_no_content_no_parents(self): # setting the current inventory is a slow but important api to support. tree1, revid1 = self.make_minimal_tree() - inv = tree1.inventory + inv = tree1.root_inventory root_id = inv.path2id('') expected_result = [], [ (('', '', root_id), [ @@ -777,7 +776,7 @@ def test_set_state_from_scratch_no_parents(self): tree1, revid1 = self.make_minimal_tree() - inv = tree1.inventory + inv = tree1.root_inventory root_id = inv.path2id('') expected_result = [], [ (('', '', root_id), [ @@ -798,7 +797,7 @@ def test_set_state_from_scratch_identical_parent(self): tree1, revid1 = self.make_minimal_tree() - inv = tree1.inventory + inv = tree1.root_inventory root_id = inv.path2id('') rev_tree1 = tree1.branch.repository.revision_tree(revid1) d_entry = ('d', '', 0, False, dirstate.DirState.NULLSTAT) @@ -856,7 +855,7 @@ tree._dirstate._get_entry(0, 'foo-id')) # extract the inventory, and add something to it - inv = tree._get_inventory() + inv = tree._get_root_inventory() # should see the file we poked in... self.assertTrue(inv.has_id('foo-id')) self.assertTrue(inv.has_filename('foo')) @@ -892,7 +891,7 @@ ['a-id', 'b-id', 'a-b-id', 'foo-id', 'bar-id']) tree1.commit('rev1', rev_id='rev1') root_id = tree1.get_root_id() - inv = tree1.inventory + inv = tree1.root_inventory finally: tree1.unlock() expected_result1 = [('', '', root_id, 'd'), @@ -1326,7 +1325,7 @@ try: tree1.add(['b'], ['b-id']) root_id = tree1.get_root_id() - inv = tree1.inventory + inv = tree1.root_inventory state = dirstate.DirState.initialize('dirstate') try: # Set the initial state with 'b' @@ -2210,9 +2209,9 @@ class TestDirstateTreeReference(TestCaseWithDirState): def test_reference_revision_is_none(self): - tree = self.make_branch_and_tree('tree', format='dirstate-with-subtree') + tree = self.make_branch_and_tree('tree', format='development-subtree') subtree = self.make_branch_and_tree('tree/subtree', - format='dirstate-with-subtree') + format='development-subtree') subtree.set_root_id('subtree') tree.add_reference(subtree) tree.add('subtree') @@ -2444,7 +2443,7 @@ """A minimal api to get InventoryRevisionTree to work.""" def __init__(self): - default_format = bzrdir.format_registry.make_bzrdir('default') + default_format = controldir.format_registry.make_bzrdir('default') self._format = default_format.repository_format def lock_read(self): @@ -2527,9 +2526,10 @@ basis_tree = self.create_tree_from_shape('basis', basis) target_tree = self.create_tree_from_shape('target', target) state = self.create_empty_dirstate() - state.set_state_from_scratch(active_tree.inventory, + state.set_state_from_scratch(active_tree.root_inventory, [('basis', basis_tree)], []) - delta = target_tree.inventory._make_delta(basis_tree.inventory) + delta = target_tree.root_inventory._make_delta( + basis_tree.root_inventory) state.update_basis_by_delta(delta, 'target') state._validate() dirstate_tree = workingtree_4.DirStateRevisionTree(state, @@ -2540,7 +2540,7 @@ # And the dirblock state should be identical to the state if we created # it from scratch. state2 = self.create_empty_dirstate() - state2.set_state_from_scratch(active_tree.inventory, + state2.set_state_from_scratch(active_tree.root_inventory, [('target', target_tree)], []) self.assertEqual(state2._dirblocks, state._dirblocks) return state @@ -2561,7 +2561,7 @@ basis_tree = self.create_tree_from_shape('basis', basis) inv_delta = self.create_inv_delta(delta, 'target') state = self.create_empty_dirstate() - state.set_state_from_scratch(active_tree.inventory, + state.set_state_from_scratch(active_tree.root_inventory, [('basis', basis_tree)], []) self.assertRaises(errors.InconsistentDelta, state.update_basis_by_delta, inv_delta, 'target') diff -Nru bzr-2.5.0/bzrlib/tests/test_errors.py bzr-2.6.0~beta1/bzrlib/tests/test_errors.py --- bzr-2.5.0/bzrlib/tests/test_errors.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_errors.py 2012-03-15 10:00:24.000000000 +0000 @@ -22,7 +22,7 @@ import sys from bzrlib import ( - bzrdir, + controldir, errors, osutils, urlutils, @@ -207,7 +207,7 @@ 'There is no public branch set for "%s".' % url, str(error)) def test_no_repo(self): - dir = bzrdir.BzrDir.create(self.get_url()) + dir = controldir.ControlDir.create(self.get_url()) error = errors.NoRepositoryPresent(dir) self.assertNotEqual(-1, str(error).find((dir.transport.clone('..').base))) self.assertEqual(-1, str(error).find((dir.transport.base))) diff -Nru bzr-2.5.0/bzrlib/tests/test_foreign.py bzr-2.6.0~beta1/bzrlib/tests/test_foreign.py --- bzr-2.5.0/bzrlib/tests/test_foreign.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_foreign.py 2012-03-15 10:00:24.000000000 +0000 @@ -205,11 +205,13 @@ rev.timezone, rev.committer, rev.properties, new_revid) try: - for path, ie in tree.inventory.iter_entries(): + parent_tree = self.target.repository.revision_tree( + parent_revid) + for path, ie in tree.iter_entries_by_dir(): new_ie = ie.copy() new_ie.revision = None builder.record_entry_contents(new_ie, - [self.target.repository.revision_tree(parent_revid).inventory], + [parent_tree.root_inventory], path, tree, (ie.kind, ie.text_size, ie.executable, ie.text_sha1)) builder.finish_inventory() @@ -328,7 +330,7 @@ def cloning_metadir(self, stacked=False): """Produce a metadir suitable for cloning with.""" - return bzrdir.format_registry.make_bzrdir("default") + return controldir.format_registry.make_bzrdir("default") def checkout_metadir(self): return self.cloning_metadir() @@ -429,7 +431,7 @@ foreign.update_workingtree_fileids(wt, target_basis) wt.lock_read() try: - self.assertEquals(set([root_id, "bla-b"]), set(wt.inventory)) + self.assertEquals(set([root_id, "bla-b"]), set(wt.all_file_ids())) finally: wt.unlock() @@ -444,7 +446,7 @@ def test_create(self): """Test we can create dummies.""" self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat()) - dir = bzrdir.BzrDir.open("d") + dir = controldir.ControlDir.open("d") self.assertEquals("A Dummy VCS Dir", dir._format.get_format_string()) dir.open_repository() dir.open_branch() @@ -453,7 +455,7 @@ def test_sprout(self): """Test we can clone dummies and that the format is not preserved.""" self.make_branch_and_tree("d", format=DummyForeignVcsDirFormat()) - dir = bzrdir.BzrDir.open("d") + dir = controldir.ControlDir.open("d") newdir = dir.sprout("e") self.assertNotEquals("A Dummy VCS Dir", newdir._format.get_format_string()) diff -Nru bzr-2.5.0/bzrlib/tests/test_gpg.py bzr-2.6.0~beta1/bzrlib/tests/test_gpg.py --- bzr-2.5.0/bzrlib/tests/test_gpg.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_gpg.py 2012-03-15 10:00:24.000000000 +0000 @@ -51,7 +51,7 @@ self.my_gpg = gpg.GPGStrategy(FakeConfig()) def test_signing_command_line(self): - self.assertEqual(['false', '--clearsign', '-u', 'amy@example.com'], + self.assertEqual(['false', '--clearsign', '-u', 'amy@example.com', '--no-tty'], self.my_gpg._command_line()) def test_signing_command_line_from_default(self): @@ -60,7 +60,7 @@ email=Amy gpg_signing_key=default gpg_signing_command=false''')) - self.assertEqual(['false', '--clearsign', '-u', 'amy@example.com'], + self.assertEqual(['false', '--clearsign', '-u', 'amy@example.com', '--no-tty'], my_gpg._command_line()) def test_signing_command_line_from_email(self): @@ -68,7 +68,7 @@ my_gpg = gpg.GPGStrategy(FakeConfig(''' email=Amy gpg_signing_command=false''')) - self.assertEqual(['false', '--clearsign', '-u', 'amy@example.com'], + self.assertEqual(['false', '--clearsign', '-u', 'amy@example.com', '--no-tty'], my_gpg._command_line()) def test_checks_return_code(self): diff -Nru bzr-2.5.0/bzrlib/tests/test_hooks.py bzr-2.6.0~beta1/bzrlib/tests/test_hooks.py --- bzr-2.5.0/bzrlib/tests/test_hooks.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_hooks.py 2012-03-15 10:00:24.000000000 +0000 @@ -29,7 +29,6 @@ install_lazy_named_hook, known_hooks, known_hooks_key_to_object, - known_hooks_key_to_parent_and_attribute, ) from bzrlib.symbol_versioning import ( deprecated_in, @@ -38,25 +37,6 @@ class TestHooks(tests.TestCase): - def test_create_hook_first(self): - hooks = Hooks("bzrlib.tests.test_hooks", "some_hooks") - doc = ("Invoked after changing the tip of a branch object. Called with" - "a bzrlib.branch.PostChangeBranchTipParams object") - hook = HookPoint("post_tip_change", doc, (0, 15), None) - self.applyDeprecated(deprecated_in((2, 4)), hooks.create_hook, hook) - self.assertEqual(hook, hooks['post_tip_change']) - - def test_create_hook_name_collision_errors(self): - hooks = Hooks("bzrlib.tests.test_hooks", "some_hooks") - doc = ("Invoked after changing the tip of a branch object. Called with" - "a bzrlib.branch.PostChangeBranchTipParams object") - hook = HookPoint("post_tip_change", doc, (0, 15), None) - hook2 = HookPoint("post_tip_change", None, None, None) - self.applyDeprecated(deprecated_in((2, 4)), hooks.create_hook, hook) - self.assertRaises(errors.DuplicateKey, self.applyDeprecated, - deprecated_in((2, 4, 0)), hooks.create_hook, hook2) - self.assertEqual(hook, hooks['post_tip_change']) - def test_docs(self): """docs() should return something reasonable about the Hooks.""" class MyHooks(Hooks): @@ -286,16 +266,6 @@ self.assertIs(branch.Branch.hooks, known_hooks_key_to_object(('bzrlib.branch', 'Branch.hooks'))) - def test_known_hooks_key_to_parent_and_attribute_deprecated(self): - self.assertEqual((branch.Branch, 'hooks'), - self.applyDeprecated(deprecated_in((2,3)), - known_hooks_key_to_parent_and_attribute, - ('bzrlib.branch', 'Branch.hooks'))) - self.assertEqual((branch, 'Branch'), - self.applyDeprecated(deprecated_in((2,3)), - known_hooks_key_to_parent_and_attribute, - ('bzrlib.branch', 'Branch'))) - def test_known_hooks_key_to_parent_and_attribute(self): self.assertEqual((branch.Branch, 'hooks'), known_hooks.key_to_parent_and_attribute( diff -Nru bzr-2.5.0/bzrlib/tests/test_http.py bzr-2.6.0~beta1/bzrlib/tests/test_http.py --- bzr-2.5.0/bzrlib/tests/test_http.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_http.py 2012-03-15 10:00:24.000000000 +0000 @@ -31,8 +31,8 @@ import bzrlib from bzrlib import ( - bzrdir, config, + controldir, debug, errors, osutils, @@ -1911,10 +1911,10 @@ server._url_protocol = self._url_protocol return server - def test_open_bzrdir(self): + def test_open_controldir(self): branch = self.make_branch('relpath') url = self.http_server.get_url() + 'relpath' - bd = bzrdir.BzrDir.open(url) + bd = controldir.ControlDir.open(url) self.addCleanup(bd.transport.disconnect) self.assertIsInstance(bd, _mod_remote.RemoteBzrDir) diff -Nru bzr-2.5.0/bzrlib/tests/test_import_tariff.py bzr-2.6.0~beta1/bzrlib/tests/test_import_tariff.py --- bzr-2.5.0/bzrlib/tests/test_import_tariff.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_import_tariff.py 2012-03-15 10:00:24.000000000 +0000 @@ -25,7 +25,7 @@ plugins as _mod_plugins, trace, ) -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib.smart import medium from bzrlib.transport import remote @@ -223,7 +223,7 @@ client_medium = medium.SmartSimplePipesClientMedium( process.stdout, process.stdin, url) transport = remote.RemoteTransport(url, medium=client_medium) - branch = BzrDir.open_from_transport(transport).open_branch() + branch = ControlDir.open_from_transport(transport).open_branch() process.stdin.close() # Hide stdin from the subprocess module, so it won't fail to close it. process.stdin = None diff -Nru bzr-2.5.0/bzrlib/tests/test_info.py bzr-2.6.0~beta1/bzrlib/tests/test_info.py --- bzr-2.5.0/bzrlib/tests/test_info.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_info.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2007-2011 Canonical Ltd +# Copyright (C) 2007-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -322,10 +322,14 @@ def test_gather_related_braches(self): branch = self.make_branch('.') - branch.set_public_branch('baz') - branch.set_push_location('bar') - branch.set_parent('foo') - branch.set_submit_branch('qux') + branch.lock_write() + try: + branch.set_public_branch('baz') + branch.set_push_location('bar') + branch.set_parent('foo') + branch.set_submit_branch('qux') + finally: + branch.unlock() self.assertEqual( [('public branch', 'baz'), ('push branch', 'bar'), ('parent branch', 'foo'), ('submit branch', 'qux')], diff -Nru bzr-2.5.0/bzrlib/tests/test_inv.py bzr-2.6.0~beta1/bzrlib/tests/test_inv.py --- bzr-2.5.0/bzrlib/tests/test_inv.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_inv.py 2012-03-15 10:00:24.000000000 +0000 @@ -127,7 +127,7 @@ self.addCleanup(tree.unlock) if not invalid_delta: tree._validate() - return tree.inventory + return tree.root_inventory def _create_repo_revisions(repo, basis, delta, invalid_delta): @@ -224,7 +224,7 @@ basis_tree = tree.basis_tree() basis_tree.lock_read() test.addCleanup(basis_tree.unlock) - basis_inv = basis_tree.inventory + basis_inv = basis_tree.root_inventory if target_entries: basis_entries = list(basis_inv.iter_entries_by_dir()) test.assertEqual(target_entries, basis_entries) @@ -1567,6 +1567,6 @@ self.assertEquals("a", inv['thefileid'].name) # The inventory should be mutable and independent of # the original tree - self.assertFalse(tree.inventory['thefileid'].executable) + self.assertFalse(tree.root_inventory['thefileid'].executable) inv['thefileid'].executable = True - self.assertFalse(tree.inventory['thefileid'].executable) + self.assertFalse(tree.root_inventory['thefileid'].executable) diff -Nru bzr-2.5.0/bzrlib/tests/test_lockdir.py bzr-2.6.0~beta1/bzrlib/tests/test_lockdir.py --- bzr-2.5.0/bzrlib/tests/test_lockdir.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_lockdir.py 2012-03-15 10:00:24.000000000 +0000 @@ -433,9 +433,9 @@ self.assertContainsRe(info_list['time_ago'], r'^\d+ seconds? ago$') def test_lock_without_email(self): - global_config = config.GlobalConfig() + global_config = config.GlobalStack() # Intentionally has no email address - global_config.set_user_option('email', 'User Identity') + global_config.set('email', 'User Identity') ld1 = self.get_lock() ld1.create() ld1.lock_write() diff -Nru bzr-2.5.0/bzrlib/tests/test_merge_core.py bzr-2.6.0~beta1/bzrlib/tests/test_merge_core.py --- bzr-2.5.0/bzrlib/tests/test_merge_core.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_merge_core.py 2012-03-15 10:00:24.000000000 +0000 @@ -19,6 +19,7 @@ import bzrlib from bzrlib import ( + controldir, errors, generate_ids, merge_directive, @@ -48,7 +49,7 @@ def wt(name): path = pathjoin(self.dir, name) os.mkdir(path) - wt = bzrlib.bzrdir.BzrDir.create_standalone_workingtree(path) + wt = controldir.ControlDir.create_standalone_workingtree(path) # the tests perform pulls, so need a branch that is writeable. wt.lock_write() wt.set_root_id(self.tree_root) diff -Nru bzr-2.5.0/bzrlib/tests/test_merge.py bzr-2.6.0~beta1/bzrlib/tests/test_merge.py --- bzr-2.5.0/bzrlib/tests/test_merge.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_merge.py 2012-03-15 10:00:24.000000000 +0000 @@ -227,9 +227,9 @@ def test_nested_merge(self): tree = self.make_branch_and_tree('tree', - format='dirstate-with-subtree') + format='development-subtree') sub_tree = self.make_branch_and_tree('tree/sub-tree', - format='dirstate-with-subtree') + format='development-subtree') sub_tree.set_root_id('sub-tree-root') self.build_tree_contents([('tree/sub-tree/file', 'text1')]) sub_tree.add('file') @@ -2634,11 +2634,11 @@ # Tested with a real WT, because BranchBuilder/MemoryTree don't handle # 'tree-reference' wt = self.make_branch_and_tree('tree', - format='dirstate-with-subtree') + format='development-subtree') wt.lock_write() self.addCleanup(wt.unlock) sub_tree = self.make_branch_and_tree('tree/sub-tree', - format='dirstate-with-subtree') + format='development-subtree') wt.set_root_id('a-root-id') sub_tree.set_root_id('sub-tree-root') self.build_tree_contents([('tree/sub-tree/file', 'text1')]) @@ -2669,11 +2669,11 @@ # Tested with a real WT, because BranchBuilder/MemoryTree don't handle # 'tree-reference' wt = self.make_branch_and_tree('tree', - format='dirstate-with-subtree') + format='development-subtree') wt.lock_write() self.addCleanup(wt.unlock) sub_tree = self.make_branch_and_tree('tree/sub', - format='dirstate-with-subtree') + format='development-subtree') wt.set_root_id('a-root-id') sub_tree.set_root_id('sub-tree-root') self.build_tree_contents([('tree/sub/file', 'text1')]) @@ -2708,11 +2708,11 @@ # Tested with a real WT, because BranchBuilder/MemoryTree don't handle # 'tree-reference' wt = self.make_branch_and_tree('tree', - format='dirstate-with-subtree') + format='development-subtree') wt.lock_write() self.addCleanup(wt.unlock) sub_tree = self.make_branch_and_tree('tree/sub', - format='dirstate-with-subtree') + format='development-subtree') wt.set_root_id('a-root-id') sub_tree.set_root_id('sub-tree-root') self.build_tree_contents([('tree/sub/file', 'text1')]) @@ -2751,11 +2751,11 @@ # Tested with a real WT, because BranchBuilder/MemoryTree don't handle # 'tree-reference' wt = self.make_branch_and_tree('tree', - format='dirstate-with-subtree') + format='development-subtree') wt.lock_write() self.addCleanup(wt.unlock) sub_tree = self.make_branch_and_tree('tree/sub', - format='dirstate-with-subtree') + format='development-subtree') wt.set_root_id('a-root-id') sub_tree.set_root_id('sub-tree-root') self.build_tree_contents([('tree/sub/file', 'text1')]) diff -Nru bzr-2.5.0/bzrlib/tests/test_mergetools.py bzr-2.6.0~beta1/bzrlib/tests/test_mergetools.py --- bzr-2.5.0/bzrlib/tests/test_mergetools.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_mergetools.py 2012-03-15 10:00:24.000000000 +0000 @@ -81,11 +81,7 @@ self.assertTrue(mergetools.check_availability(sys.executable)) def test_exe_on_path(self): - if sys.platform == 'win32': - exe = 'cmd.exe' - else: - exe = 'sh' - self.assertTrue(mergetools.check_availability(exe)) + self.assertTrue(mergetools.check_availability('python')) def test_nonexistent(self): self.assertFalse(mergetools.check_availability('DOES NOT EXIST')) @@ -112,6 +108,19 @@ ('test.txt.OTHER', 'other stuff'), )) + def test_invoke_expands_exe_path(self): + self.overrideEnv('PATH', os.path.dirname(sys.executable)) + def dummy_invoker(exe, args, cleanup): + self._exe = exe + self._args = args + cleanup(0) + return 0 + command = '%s {result}' % os.path.basename(sys.executable) + retcode = mergetools.invoke(command, 'test.txt', dummy_invoker) + self.assertEqual(0, retcode) + self.assertEqual(sys.executable, self._exe) + self.assertEqual(['test.txt'], self._args) + def test_success(self): def dummy_invoker(exe, args, cleanup): self._exe = exe diff -Nru bzr-2.5.0/bzrlib/tests/test_msgeditor.py bzr-2.6.0~beta1/bzrlib/tests/test_msgeditor.py --- bzr-2.5.0/bzrlib/tests/test_msgeditor.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_msgeditor.py 2012-03-15 10:00:24.000000000 +0000 @@ -26,7 +26,6 @@ errors, msgeditor, osutils, - tests, trace, ) from bzrlib.msgeditor import ( @@ -81,9 +80,7 @@ """) def make_multiple_pending_tree(self): - from bzrlib import config - config.GlobalConfig().set_user_option('email', - 'Bilbo Baggins ') + config.GlobalStack().set('email', 'Bilbo Baggins ') tree = self.make_branch_and_tree('a') tree.commit('Initial checkin.', timestamp=1230912900, timezone=0) tree2 = tree.bzrdir.clone('b').open_workingtree() diff -Nru bzr-2.5.0/bzrlib/tests/test_options.py bzr-2.6.0~beta1/bzrlib/tests/test_options.py --- bzr-2.5.0/bzrlib/tests/test_options.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_options.py 2012-03-15 10:00:24.000000000 +0000 @@ -160,14 +160,14 @@ def test_registry_converter(self): options = [option.RegistryOption('format', '', - bzrdir.format_registry, bzrdir.format_registry.make_bzrdir)] + controldir.format_registry, controldir.format_registry.make_bzrdir)] opts, args = self.parse(options, ['--format', 'knit']) self.assertIsInstance(opts.format.repository_format, knitrepo.RepositoryFormatKnit1) def test_lazy_registry(self): options = [option.RegistryOption('format', '', - lazy_registry=('bzrlib.bzrdir','format_registry'), + lazy_registry=('bzrlib.controldir','format_registry'), converter=str)] opts, args = self.parse(options, ['--format', 'knit']) self.assertEqual({'format': 'knit'}, opts) diff -Nru bzr-2.5.0/bzrlib/tests/test_osutils.py bzr-2.6.0~beta1/bzrlib/tests/test_osutils.py --- bzr-2.5.0/bzrlib/tests/test_osutils.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_osutils.py 2012-03-15 10:00:24.000000000 +0000 @@ -181,6 +181,15 @@ shape = sorted(os.listdir('.')) self.assertEquals(['A', 'B'], shape) + def test_rename_exception(self): + try: + osutils.rename('nonexistent_path', 'different_nonexistent_path') + except OSError, e: + self.assertEqual(e.old_filename, 'nonexistent_path') + self.assertEqual(e.new_filename, 'different_nonexistent_path') + self.assertTrue('nonexistent_path' in e.strerror) + self.assertTrue('different_nonexistent_path' in e.strerror) + class TestRandChars(tests.TestCase): @@ -2225,6 +2234,14 @@ self.assertTrue( osutils.find_executable_on_path('THIS SHOULD NOT EXIST') is None) self.assertTrue(osutils.find_executable_on_path('file.txt') is None) + + def test_windows_app_path(self): + if sys.platform != 'win32': + raise tests.TestSkipped('test requires win32') + # Override PATH env var so that exe can only be found on App Path + self.overrideEnv('PATH', '') + # Internt Explorer is always registered in the App Path + self.assertTrue(osutils.find_executable_on_path('iexplore') is not None) def test_other(self): if sys.platform == 'win32': diff -Nru bzr-2.5.0/bzrlib/tests/test_permissions.py bzr-2.6.0~beta1/bzrlib/tests/test_permissions.py --- bzr-2.5.0/bzrlib/tests/test_permissions.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_permissions.py 2012-03-15 10:00:24.000000000 +0000 @@ -35,7 +35,7 @@ from bzrlib import urlutils from bzrlib.branch import Branch -from bzrlib.bzrdir import BzrDir +from bzrlib.controldir import ControlDir from bzrlib.tests import TestCaseWithTransport, TestSkipped from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer from bzrlib.workingtree import WorkingTree @@ -199,7 +199,7 @@ os.mkdir('sftp') sftp_url = self.get_url('sftp') - b_sftp = BzrDir.create_branch_and_repo(sftp_url) + b_sftp = ControlDir.create_branch_and_repo(sftp_url) b_sftp.pull(b_local) del b_sftp diff -Nru bzr-2.5.0/bzrlib/tests/test_reconfigure.py bzr-2.6.0~beta1/bzrlib/tests/test_reconfigure.py --- bzr-2.5.0/bzrlib/tests/test_reconfigure.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_reconfigure.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2007, 2008, 2009 Canonical Ltd +# Copyright (C) 2007, 2008, 2009, 2011, 2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ from bzrlib import ( branch as _mod_branch, - bzrdir, + controldir, errors, reconfigure, repository, @@ -72,7 +72,8 @@ checkout = branch.create_checkout('checkout') reconfiguration = reconfigure.Reconfigure.to_branch(checkout.bzrdir) reconfiguration.apply() - self.assertIs(None, checkout.branch.get_bound_location()) + reconfigured = controldir.ControlDir.open('checkout').open_branch() + self.assertIs(None, reconfigured.get_bound_location()) def prepare_lightweight_checkout_to_branch(self): branch = self.make_branch('branch') @@ -147,16 +148,24 @@ self.assertRaises(errors.NoBindLocation, reconfiguration._select_bind_location) branch.set_parent('http://parent') + reconfiguration = reconfigure.Reconfigure(branch.bzrdir) self.assertEqual('http://parent', reconfiguration._select_bind_location()) branch.set_push_location('sftp://push') + reconfiguration = reconfigure.Reconfigure(branch.bzrdir) self.assertEqual('sftp://push', reconfiguration._select_bind_location()) - branch.set_bound_location('bzr://foo/old-bound') - branch.set_bound_location(None) + branch.lock_write() + try: + branch.set_bound_location('bzr://foo/old-bound') + branch.set_bound_location(None) + finally: + branch.unlock() + reconfiguration = reconfigure.Reconfigure(branch.bzrdir) self.assertEqual('bzr://foo/old-bound', reconfiguration._select_bind_location()) branch.set_bound_location('bzr://foo/cur-bound') + reconfiguration = reconfigure.Reconfigure(branch.bzrdir) self.assertEqual('bzr://foo/cur-bound', reconfiguration._select_bind_location()) reconfiguration.new_bound_location = 'ftp://user-specified' @@ -180,6 +189,7 @@ self.assertRaises(errors.NoBindLocation, reconfiguration.apply) # setting a parent allows it to become a checkout tree.branch.set_parent(parent.base) + reconfiguration = reconfigure.Reconfigure.to_checkout(tree.bzrdir) reconfiguration.apply() # supplying a location allows it to become a checkout tree2 = self.make_branch_and_tree('tree2') @@ -198,6 +208,8 @@ self.assertRaises(errors.NoBindLocation, reconfiguration.apply) # setting a parent allows it to become a checkout tree.branch.set_parent(parent.base) + reconfiguration = reconfigure.Reconfigure.to_lightweight_checkout( + tree.bzrdir) reconfiguration.apply() # supplying a location allows it to become a checkout tree2 = self.make_branch_and_tree('tree2') @@ -433,7 +445,7 @@ r"Requested reconfiguration of '.*' is not supported.") def test_lightweight_checkout_to_tree_preserves_reference_locations(self): - format = bzrdir.format_registry.make_bzrdir('1.9') + format = controldir.format_registry.make_bzrdir('1.9') format.set_branch_format(_mod_branch.BzrBranchFormat8()) tree = self.make_branch_and_tree('tree', format=format) tree.branch.set_reference_info('file_id', 'path', '../location') diff -Nru bzr-2.5.0/bzrlib/tests/test_remote.py bzr-2.6.0~beta1/bzrlib/tests/test_remote.py --- bzr-2.5.0/bzrlib/tests/test_remote.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_remote.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2011 Canonical Ltd +# Copyright (C) 2006-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -121,15 +121,6 @@ self.local_wt.commit(message='test commit', rev_id=revid) self.assertTrue(repo.has_revision(revid)) - def test_remote_branch_revision_history(self): - b = BzrDir.open_from_transport(self.transport).open_branch() - self.assertEqual([], - self.applyDeprecated(deprecated_in((2, 5, 0)), b.revision_history)) - r1 = self.local_wt.commit('1st commit') - r2 = self.local_wt.commit('1st commit', rev_id=u'\xc8'.encode('utf8')) - self.assertEqual([r1, r2], - self.applyDeprecated(deprecated_in((2, 5, 0)), b.revision_history)) - def test_find_correct_format(self): """Should open a RemoteBzrDir over a RemoteTransport""" fmt = BzrDirFormat.find_format(self.transport) @@ -349,11 +340,11 @@ class TestRemote(tests.TestCaseWithMemoryTransport): def get_branch_format(self): - reference_bzrdir_format = bzrdir.format_registry.get('default')() + reference_bzrdir_format = controldir.format_registry.get('default')() return reference_bzrdir_format.get_branch_format() def get_repo_format(self): - reference_bzrdir_format = bzrdir.format_registry.get('default')() + reference_bzrdir_format = controldir.format_registry.get('default')() return reference_bzrdir_format.repository_format def assertFinished(self, fake_client): @@ -475,7 +466,7 @@ transport = transport.clone('quack') self.make_bzrdir('quack') client = FakeClient(transport.base) - reference_bzrdir_format = bzrdir.format_registry.get('default')() + reference_bzrdir_format = controldir.format_registry.get('default')() control_name = reference_bzrdir_format.network_name() client.add_expected_call( 'BzrDir.cloning_metadir', ('quack/', 'False'), @@ -509,7 +500,7 @@ def test__get_checkout_format(self): transport = MemoryTransport() client = FakeClient(transport.base) - reference_bzrdir_format = bzrdir.format_registry.get('default')() + reference_bzrdir_format = controldir.format_registry.get('default')() control_name = reference_bzrdir_format.network_name() client.add_expected_call( 'BzrDir.checkout_metadir', ('quack/', ), @@ -546,7 +537,7 @@ def test_get_branches(self): transport = MemoryTransport() client = FakeClient(transport.base) - reference_bzrdir_format = bzrdir.format_registry.get('default')() + reference_bzrdir_format = controldir.format_registry.get('default')() branch_name = reference_bzrdir_format.get_branch_format().network_name() client.add_success_response_with_body( bencode.bencode({ @@ -854,7 +845,7 @@ transport = transport.clone('quack') self.make_repository('quack') client = FakeClient(transport.base) - reference_bzrdir_format = bzrdir.format_registry.get('default')() + reference_bzrdir_format = controldir.format_registry.get('default')() reference_format = reference_bzrdir_format.get_branch_format() network_name = reference_format.network_name() reference_repo_fmt = reference_bzrdir_format.repository_format @@ -882,7 +873,7 @@ # Client's medium rooted a transport root (not at the bzrdir) client = FakeClient(transport.base) transport = transport.clone('quack') - reference_bzrdir_format = bzrdir.format_registry.get('default')() + reference_bzrdir_format = controldir.format_registry.get('default')() reference_format = reference_bzrdir_format.get_branch_format() network_name = reference_format.network_name() reference_repo_fmt = reference_bzrdir_format.repository_format @@ -918,7 +909,7 @@ transport = transport.clone('quack') self.make_bzrdir('quack') client = FakeClient(transport.base) - reference_bzrdir_format = bzrdir.format_registry.get('default')() + reference_bzrdir_format = controldir.format_registry.get('default')() reference_format = reference_bzrdir_format.repository_format network_name = reference_format.network_name() client.add_expected_call( @@ -1296,7 +1287,7 @@ verb = 'Branch.set_parent_location' self.disable_verb(verb) branch.set_parent('http://foo/') - self.assertLength(13, self.hpss_calls) + self.assertLength(14, self.hpss_calls) class TestBranchGetTagsBytes(RemoteBranchTestCase): @@ -1455,34 +1446,31 @@ return branch def test_backwards_compatible(self): - branch = self.make_branch_with_tags() - c = branch.get_config_stack() - c.set('branch.fetch_tags', True) - self.addCleanup(branch.lock_read().unlock) + br = self.make_branch_with_tags() + br.get_config_stack().set('branch.fetch_tags', True) + self.addCleanup(br.lock_read().unlock) # Disable the heads_to_fetch verb verb = 'Branch.heads_to_fetch' self.disable_verb(verb) self.reset_smart_call_log() - result = branch.heads_to_fetch() + result = br.heads_to_fetch() self.assertEqual((set(['tip']), set(['rev-1', 'rev-2'])), result) self.assertEqual( - ['Branch.last_revision_info', 'Branch.get_config_file', - 'Branch.get_tags_bytes'], + ['Branch.last_revision_info', 'Branch.get_tags_bytes'], [call.call.method for call in self.hpss_calls]) def test_backwards_compatible_no_tags(self): - branch = self.make_branch_with_tags() - c = branch.get_config_stack() - c.set('branch.fetch_tags', False) - self.addCleanup(branch.lock_read().unlock) + br = self.make_branch_with_tags() + br.get_config_stack().set('branch.fetch_tags', False) + self.addCleanup(br.lock_read().unlock) # Disable the heads_to_fetch verb verb = 'Branch.heads_to_fetch' self.disable_verb(verb) self.reset_smart_call_log() - result = branch.heads_to_fetch() + result = br.heads_to_fetch() self.assertEqual((set(['tip']), set()), result) self.assertEqual( - ['Branch.last_revision_info', 'Branch.get_config_file'], + ['Branch.last_revision_info'], [call.call.method for call in self.hpss_calls]) @@ -2073,6 +2061,9 @@ 'Branch.get_config_file', ('memory:///', ), 'success', ('ok', ), "# line 1\n") client.add_expected_call( + 'Branch.get_config_file', ('memory:///', ), + 'success', ('ok', ), "# line 1\n") + client.add_expected_call( 'Branch.put_config_file', ('memory:///', 'branch token', 'repo token'), 'success', ('ok',)) @@ -2090,6 +2081,7 @@ [('call', 'Branch.get_stacked_on_url', ('memory:///',)), ('call', 'Branch.lock_write', ('memory:///', '', '')), ('call_expecting_body', 'Branch.get_config_file', ('memory:///',)), + ('call_expecting_body', 'Branch.get_config_file', ('memory:///',)), ('call_with_body_bytes_expecting_body', 'Branch.put_config_file', ('memory:///', 'branch token', 'repo token'), '# line 1\nemail = The Dude \n'), @@ -3963,7 +3955,7 @@ :result: The revision ids in the stream, in the order seen, the topological order of revisions in the source. """ - unordered_format = bzrdir.format_registry.get(format)() + unordered_format = controldir.format_registry.get(format)() target_repository_format = unordered_format.repository_format # Cross check self.assertEqual(order, target_repository_format._fetch_order) @@ -4272,7 +4264,7 @@ def test_single_empty(self): transport_path = 'quack' repo, client = self.setup_fake_client_and_repository(transport_path) - fmt = bzrdir.format_registry.get('2a')().repository_format + fmt = controldir.format_registry.get('2a')().repository_format repo._format = fmt stream = [('inventory-deltas', [ versionedfile.FulltextContentFactory('somerevid', None, None, diff -Nru bzr-2.5.0/bzrlib/tests/test_repository.py bzr-2.6.0~beta1/bzrlib/tests/test_repository.py --- bzr-2.5.0/bzrlib/tests/test_repository.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_repository.py 2012-03-15 10:00:24.000000000 +0000 @@ -45,6 +45,7 @@ ) from bzrlib import ( bzrdir, + controldir, errors, inventory, osutils, @@ -66,7 +67,7 @@ class TestDefaultFormat(TestCase): def test_get_set_default_format(self): - old_default = bzrdir.format_registry.get('default') + old_default = controldir.format_registry.get('default') private_default = old_default().repository_format.__class__ old_format = repository.format_registry.get_default() self.assertTrue(isinstance(old_format, private_default)) @@ -74,9 +75,9 @@ my_bzrdir = bzrdir.BzrDirMetaFormat1() my_bzrdir.repository_format = SampleRepositoryFormat() return my_bzrdir - bzrdir.format_registry.remove('default') - bzrdir.format_registry.register('sample', make_sample_bzrdir, '') - bzrdir.format_registry.set_default('sample') + controldir.format_registry.remove('default') + controldir.format_registry.register('sample', make_sample_bzrdir, '') + controldir.format_registry.set_default('sample') # creating a repository should now create an instrumented dir. try: # the default branch format is used by the meta dir format @@ -85,9 +86,9 @@ result = dir.create_repository() self.assertEqual(result, 'A bzr repository dir') finally: - bzrdir.format_registry.remove('default') - bzrdir.format_registry.remove('sample') - bzrdir.format_registry.register('default', old_default, '') + controldir.format_registry.remove('default') + controldir.format_registry.remove('sample') + controldir.format_registry.register('default', old_default, '') self.assertIsInstance(repository.format_registry.get_default(), old_format.__class__) @@ -236,13 +237,13 @@ def test_attribute__fetch_order(self): """Knits need topological data insertion.""" repo = self.make_repository('.', - format=bzrdir.format_registry.get('knit')()) + format=controldir.format_registry.get('knit')()) self.assertEqual('topological', repo._format._fetch_order) def test_attribute__fetch_uses_deltas(self): """Knits reuse deltas.""" repo = self.make_repository('.', - format=bzrdir.format_registry.get('knit')()) + format=controldir.format_registry.get('knit')()) self.assertEqual(True, repo._format._fetch_uses_deltas) def test_disk_layout(self): @@ -334,7 +335,7 @@ is valid when the api is not being abused. """ repo = self.make_repository('.', - format=bzrdir.format_registry.get('knit')()) + format=controldir.format_registry.get('knit')()) inv_xml = '\n\n' inv = repo._deserialise_inventory('test-rev-id', inv_xml) self.assertEqual('test-rev-id', inv.root.revision) @@ -342,7 +343,7 @@ def test_deserialise_uses_global_revision_id(self): """If it is set, then we re-use the global revision id""" repo = self.make_repository('.', - format=bzrdir.format_registry.get('knit')()) + format=controldir.format_registry.get('knit')()) inv_xml = ('\n' '\n') # Arguably, the deserialise_inventory should detect a mismatch, and @@ -355,7 +356,7 @@ def test_supports_external_lookups(self): repo = self.make_repository('.', - format=bzrdir.format_registry.get('knit')()) + format=controldir.format_registry.get('knit')()) self.assertFalse(repo._format.supports_external_lookups) @@ -524,7 +525,7 @@ revision_tree.lock_read() try: self.assertRaises(errors.NoSuchFile, revision_tree.get_file_lines, - revision_tree.inventory.root.file_id) + revision_tree.get_root_id()) finally: revision_tree.unlock() format = bzrdir.BzrDirMetaFormat1() @@ -534,14 +535,15 @@ revision_tree = tree.branch.repository.revision_tree('dull') revision_tree.lock_read() try: - revision_tree.get_file_lines(revision_tree.inventory.root.file_id) + revision_tree.get_file_lines(revision_tree.get_root_id()) finally: revision_tree.unlock() tree.commit("Another dull commit", rev_id='dull2') revision_tree = tree.branch.repository.revision_tree('dull2') revision_tree.lock_read() self.addCleanup(revision_tree.unlock) - self.assertEqual('dull', revision_tree.inventory.root.revision) + self.assertEqual('dull', + revision_tree.get_file_revision(revision_tree.get_root_id())) def test_supports_external_lookups(self): format = bzrdir.BzrDirMetaFormat1() @@ -993,7 +995,7 @@ class TestRepositoryPackCollection(TestCaseWithTransport): def get_format(self): - return bzrdir.format_registry.make_bzrdir('pack-0.92') + return controldir.format_registry.make_bzrdir('pack-0.92') def get_packs(self): format = self.get_format() diff -Nru bzr-2.5.0/bzrlib/tests/test_revisiontree.py bzr-2.6.0~beta1/bzrlib/tests/test_revisiontree.py --- bzr-2.5.0/bzrlib/tests/test_revisiontree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_revisiontree.py 2012-03-15 10:00:24.000000000 +0000 @@ -58,7 +58,6 @@ def test_empty_no_root(self): null_tree = self.t.branch.repository.revision_tree( revision.NULL_REVISION) - self.assertIs(None, null_tree.inventory.root) self.assertIs(None, null_tree.get_root_id()) def test_get_file_revision_root(self): @@ -76,6 +75,6 @@ def test_get_file_mtime_ghost(self): file_id = iter(self.rev_tree.all_file_ids()).next() - self.rev_tree.inventory[file_id].revision = 'ghostrev' + self.rev_tree.root_inventory[file_id].revision = 'ghostrev' self.assertRaises(errors.FileTimestampUnavailable, self.rev_tree.get_file_mtime, file_id) diff -Nru bzr-2.5.0/bzrlib/tests/test_selftest.py bzr-2.6.0~beta1/bzrlib/tests/test_selftest.py --- bzr-2.5.0/bzrlib/tests/test_selftest.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_selftest.py 2012-03-15 10:00:24.000000000 +0000 @@ -43,6 +43,7 @@ from bzrlib import ( branchbuilder, bzrdir, + controldir, errors, hooks, lockdir, @@ -609,7 +610,7 @@ # Guard against regression into MemoryTransport leaking # files to disk instead of keeping them in memory. self.assertFalse(osutils.lexists('dir')) - dir_format = bzrdir.format_registry.make_bzrdir('knit') + dir_format = controldir.format_registry.make_bzrdir('knit') self.assertEqual(dir_format.repository_format.__class__, the_branch.repository._format.__class__) self.assertEqual('Bazaar-NG Knit Repository Format 1', @@ -678,7 +679,7 @@ builder = self.make_branch_builder('dir') rev_id = builder.build_commit() self.assertPathExists('dir') - a_dir = bzrdir.BzrDir.open('dir') + a_dir = controldir.ControlDir.open('dir') self.assertRaises(errors.NoWorkingTree, a_dir.open_workingtree) a_branch = a_dir.open_branch() builder_branch = builder.get_branch() @@ -1477,13 +1478,13 @@ transport_server.start_server() self.addCleanup(transport_server.stop_server) t = transport.get_transport_from_url(transport_server.get_url()) - bzrdir.BzrDir.create(t.base) + controldir.ControlDir.create(t.base) self.assertRaises(errors.BzrError, - bzrdir.BzrDir.open_from_transport, t) + controldir.ControlDir.open_from_transport, t) # But if we declare this as safe, we can open the bzrdir. self.permit_url(t.base) self._bzr_selftest_roots.append(t.base) - bzrdir.BzrDir.open_from_transport(t) + controldir.ControlDir.open_from_transport(t) def test_requireFeature_available(self): """self.requireFeature(available) is a no-op.""" @@ -1943,7 +1944,7 @@ def test_make_branch_and_tree_with_format(self): # we should be able to supply a format to make_branch_and_tree self.make_branch_and_tree('a', format=bzrlib.bzrdir.BzrDirMetaFormat1()) - self.assertIsInstance(bzrlib.bzrdir.BzrDir.open('a')._format, + self.assertIsInstance(bzrlib.controldir.ControlDir.open('a')._format, bzrlib.bzrdir.BzrDirMetaFormat1) def test_make_branch_and_memory_tree(self): diff -Nru bzr-2.5.0/bzrlib/tests/test_sftp_transport.py bzr-2.6.0~beta1/bzrlib/tests/test_sftp_transport.py --- bzr-2.5.0/bzrlib/tests/test_sftp_transport.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_sftp_transport.py 2012-03-15 10:00:24.000000000 +0000 @@ -21,8 +21,8 @@ import time from bzrlib import ( - bzrdir, config, + controldir, errors, tests, transport as _mod_transport, @@ -191,12 +191,12 @@ def test_push_support(self): self.build_tree(['a/', 'a/foo']) - t = bzrdir.BzrDir.create_standalone_workingtree('a') + t = controldir.ControlDir.create_standalone_workingtree('a') b = t.branch t.add('foo') t.commit('foo', rev_id='a1') - b2 = bzrdir.BzrDir.create_branch_and_repo(self.get_url('/b')) + b2 = controldir.ControlDir.create_branch_and_repo(self.get_url('/b')) b2.pull(b) self.assertEquals(b2.last_revision(), 'a1') diff -Nru bzr-2.5.0/bzrlib/tests/test_smart.py bzr-2.6.0~beta1/bzrlib/tests/test_smart.py --- bzr-2.5.0/bzrlib/tests/test_smart.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_smart.py 2012-03-15 10:00:24.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2011 Canonical Ltd +# Copyright (C) 2006-2012 Canonical Ltd # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,7 +30,7 @@ from bzrlib import ( bencode, branch as _mod_branch, - bzrdir, + controldir, errors, gpg, inventory_delta, @@ -121,7 +121,7 @@ stream = [('text', [versionedfile.FulltextContentFactory(('k1',), None, None, 'foo')]),('text', [ versionedfile.FulltextContentFactory(('k2',), None, None, 'bar')])] - fmt = bzrdir.format_registry.get('pack-0.92')().repository_format + fmt = controldir.format_registry.get('pack-0.92')().repository_format bytes = smart_repo._stream_to_byte_stream(stream, fmt) streams = [] # Iterate the resulting iterable; checking that we get only one stream @@ -333,7 +333,7 @@ self.make_bzrdir('.') request_class = smart_dir.SmartServerRequestCreateRepository request = request_class(backing) - reference_bzrdir_format = bzrdir.format_registry.get('pack-0.92')() + reference_bzrdir_format = controldir.format_registry.get('pack-0.92')() reference_format = reference_bzrdir_format.repository_format network_name = reference_format.network_name() expected = smart_req.SuccessfulSmartServerResponse( @@ -419,7 +419,7 @@ backing = self.get_transport() request = self._request_class(backing) result = self._make_repository_and_result( - format='dirstate-with-subtree') + format='development-subtree') # check the test will be valid self.assertEqual('yes', result.args[2]) self.assertEqual('yes', result.args[3]) @@ -430,9 +430,9 @@ backing = self.get_transport() request = self._request_class(backing) result = self._make_repository_and_result( - format='dirstate-with-subtree') + format='development-subtree') # check the test will be valid - self.assertEqual('no', result.args[4]) + self.assertEqual('yes', result.args[4]) self.assertEqual(result, request.execute('')) @@ -493,7 +493,7 @@ request = smart_dir.SmartServerRequestInitializeBzrDir(backing) self.assertEqual(smart_req.SmartServerResponse(('ok', )), request.execute('')) - made_dir = bzrdir.BzrDir.open_from_transport(backing) + made_dir = controldir.ControlDir.open_from_transport(backing) # no branch, tree or repository is expected with the current # default formart. self.assertRaises(errors.NoWorkingTree, made_dir.open_workingtree) @@ -533,7 +533,7 @@ 'False', '', '', '')), request.execute(name, '', 'True', 'False', 'False', '', '', '', '', 'False')) - made_dir = bzrdir.BzrDir.open_from_transport(backing) + made_dir = controldir.ControlDir.open_from_transport(backing) # no branch, tree or repository is expected with the current # default format. self.assertRaises(errors.NoWorkingTree, made_dir.open_workingtree) @@ -1323,6 +1323,8 @@ finally: branch.unlock() self.assertEqual(smart_req.SuccessfulSmartServerResponse(()), response) + # Refresh branch as SetParentLocation modified it + branch = branch.bzrdir.open_branch() self.assertEqual(None, branch.get_parent()) def test_set_parent_something(self): @@ -1332,11 +1334,12 @@ branch_token, repo_token = self.get_lock_tokens(branch) try: response = request.execute('base', branch_token, repo_token, - 'http://bar/') + 'http://bar/') finally: branch.unlock() self.assertEqual(smart_req.SuccessfulSmartServerResponse(()), response) - self.assertEqual('http://bar/', branch.get_parent()) + refreshed = _mod_branch.Branch.open(branch.base) + self.assertEqual('http://bar/', refreshed.get_parent()) class TestSmartServerBranchRequestGetTagsBytes( @@ -2666,8 +2669,8 @@ class TestSmartServerRepositoryGetInventories(tests.TestCaseWithTransport): def _get_serialized_inventory_delta(self, repository, base_revid, revid): - base_inv = repository.revision_tree(base_revid).inventory - inv = repository.revision_tree(revid).inventory + base_inv = repository.revision_tree(base_revid).root_inventory + inv = repository.revision_tree(revid).root_inventory inv_delta = inv._make_delta(base_inv) serializer = inventory_delta.InventoryDeltaSerializer(True, False) return "".join(serializer.delta_to_lines(base_revid, revid, inv_delta)) @@ -2688,7 +2691,7 @@ versionedfile.FulltextContentFactory('somerev', None, None, self._get_serialized_inventory_delta( t.branch.repository, 'null:', 'somerev'))])] - fmt = bzrdir.format_registry.get('2a')().repository_format + fmt = controldir.format_registry.get('2a')().repository_format self.assertEquals( "".join(response.body_stream), "".join(smart_repo._stream_to_byte_stream(stream, fmt))) diff -Nru bzr-2.5.0/bzrlib/tests/test_smart_transport.py bzr-2.6.0~beta1/bzrlib/tests/test_smart_transport.py --- bzr-2.5.0/bzrlib/tests/test_smart_transport.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_smart_transport.py 2012-03-15 10:00:24.000000000 +0000 @@ -32,6 +32,7 @@ import bzrlib from bzrlib import ( bzrdir, + controldir, debug, errors, osutils, @@ -1628,7 +1629,8 @@ transport = self.transport t = self.backing_transport bzrdir.BzrDirFormat.get_default_format().initialize_on_transport(t) - result_dir = bzrdir.BzrDir.open_containing_from_transport(transport) + result_dir = controldir.ControlDir.open_containing_from_transport( + transport) class ReadOnlyEndToEndTests(SmartTCPTests): diff -Nru bzr-2.5.0/bzrlib/tests/test_status.py bzr-2.6.0~beta1/bzrlib/tests/test_status.py --- bzr-2.5.0/bzrlib/tests/test_status.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_status.py 2012-03-15 10:00:24.000000000 +0000 @@ -46,7 +46,7 @@ self.assertContainsRe(output.getvalue(), 'empty commit') def make_multiple_pending_tree(self): - config.GlobalConfig().set_user_option('email', 'Joe Foo ') + config.GlobalStack().set('email', 'Joe Foo ') tree = self.make_branch_and_tree('a') tree.commit('commit 1', timestamp=1196796819, timezone=0) tree2 = tree.bzrdir.clone('b').open_workingtree() @@ -102,7 +102,7 @@ def test_pending_with_ghosts(self): """Test when a pending merge's ancestry includes ghosts.""" - config.GlobalConfig().set_user_option('email', 'Joe Foo ') + config.GlobalStack().set('email', 'Joe Foo ') tree = self.make_branch_and_tree('a') tree.commit('empty commit') tree2 = tree.bzrdir.clone('b').open_workingtree() diff -Nru bzr-2.5.0/bzrlib/tests/test_subsume.py bzr-2.6.0~beta1/bzrlib/tests/test_subsume.py --- bzr-2.5.0/bzrlib/tests/test_subsume.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_subsume.py 2012-03-15 10:00:24.000000000 +0000 @@ -21,7 +21,7 @@ def make_branch_and_tree(self, relpath, format=None): if format is None: - format = 'dirstate-with-subtree' + format = 'development-subtree' return tests.TestCaseWithTransport.make_branch_and_tree(self, relpath, format) @@ -34,7 +34,7 @@ base_tree.add('file', 'file-id') base_tree.commit('first commit', rev_id='tree-1') sub_tree = self.make_branch_and_tree('tree/subtree', - format='dirstate-with-subtree') + format='development-subtree') if same_root is True: sub_tree.set_root_id(base_tree.get_root_id()) sub_tree.add('file2', 'file2-id') diff -Nru bzr-2.5.0/bzrlib/tests/test_tag.py bzr-2.6.0~beta1/bzrlib/tests/test_tag.py --- bzr-2.5.0/bzrlib/tests/test_tag.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_tag.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,7 +18,7 @@ from bzrlib import ( - bzrdir, + controldir, errors, ) from bzrlib.tag import ( @@ -69,8 +69,8 @@ class TestTagMerging(TestCaseWithTransport): def make_knit_branch(self, relpath): - old_bdf = bzrdir.format_registry.make_bzrdir('knit') - return bzrdir.BzrDir.create_branch_convenience(relpath, format=old_bdf) + old_bdf = controldir.format_registry.make_bzrdir('knit') + return controldir.ControlDir.create_branch_convenience(relpath, format=old_bdf) def make_branch_supporting_tags(self, relpath): return self.make_branch(relpath, format='dirstate-tags') diff -Nru bzr-2.5.0/bzrlib/tests/test_testament.py bzr-2.6.0~beta1/bzrlib/tests/test_testament.py --- bzr-2.5.0/bzrlib/tests/test_testament.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_testament.py 2012-03-15 10:00:24.000000000 +0000 @@ -37,7 +37,7 @@ def setUp(self): super(TestamentSetup, self).setUp() - self.wt = self.make_branch_and_tree('.', format='dirstate-with-subtree') + self.wt = self.make_branch_and_tree('.', format='development-subtree') self.wt.set_root_id('TREE_ROT') b = self.b = self.wt.branch b.nick = "test branch" diff -Nru bzr-2.5.0/bzrlib/tests/test_transform.py bzr-2.6.0~beta1/bzrlib/tests/test_transform.py --- bzr-2.5.0/bzrlib/tests/test_transform.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_transform.py 2012-03-15 10:00:24.000000000 +0000 @@ -34,7 +34,6 @@ transform, urlutils, ) -from bzrlib.bzrdir import BzrDir from bzrlib.conflicts import ( DeletingParent, DuplicateEntry, @@ -44,6 +43,7 @@ ParentLoop, UnversionedParent, ) +from bzrlib.controldir import ControlDir from bzrlib.diff import show_diff_trees from bzrlib.errors import ( DuplicateKey, @@ -88,7 +88,7 @@ def setUp(self): super(TestTreeTransform, self).setUp() - self.wt = self.make_branch_and_tree('.', format='dirstate-with-subtree') + self.wt = self.make_branch_and_tree('.', format='development-subtree') os.chdir('..') def get_transform(self): @@ -399,7 +399,7 @@ tree.lock_read() self.addCleanup(tree.unlock) self.assertEqual('subtree-revision', - tree.inventory['subtree-id'].reference_revision) + tree.root_inventory['subtree-id'].reference_revision) def test_conflicts(self): transform, root = self.get_transform() @@ -1532,8 +1532,7 @@ self.assertPathExists("foo/bar") wt.lock_read() try: - self.assertEqual(wt.inventory.get_file_kind(wt.path2id("foo")), - "directory") + self.assertEqual(wt.kind(wt.path2id("foo")), "directory") finally: wt.unlock() wt.commit("two") @@ -1555,8 +1554,7 @@ self.assertPathExists("foo") wt.lock_read() self.addCleanup(wt.unlock) - self.assertEqual(wt.inventory.get_file_kind(wt.path2id("foo")), - "symlink") + self.assertEqual(wt.kind(wt.path2id("foo")), "symlink") def test_dir_to_file(self): wt = self.make_branch_and_tree('.') @@ -1574,8 +1572,7 @@ self.assertPathExists("foo") wt.lock_read() self.addCleanup(wt.unlock) - self.assertEqual(wt.inventory.get_file_kind(wt.path2id("foo")), - "file") + self.assertEqual(wt.kind(wt.path2id("foo")), "file") def test_dir_to_hardlink(self): self.requireFeature(HardlinkFeature) @@ -1596,8 +1593,7 @@ self.assertPathExists("baz") wt.lock_read() self.addCleanup(wt.unlock) - self.assertEqual(wt.inventory.get_file_kind(wt.path2id("foo")), - "file") + self.assertEqual(wt.kind(wt.path2id("foo")), "file") def test_no_final_path(self): transform, root = self.get_transform() @@ -1649,7 +1645,7 @@ def __init__(self, dirname, root_id): self.name = dirname os.mkdir(dirname) - self.wt = BzrDir.create_standalone_workingtree(dirname) + self.wt = ControlDir.create_standalone_workingtree(dirname) self.wt.set_root_id(root_id) self.b = self.wt.branch self.tt = TreeTransform(self.wt) @@ -1885,13 +1881,13 @@ def test_build_tree_with_symlinks(self): self.requireFeature(SymlinkFeature) os.mkdir('a') - a = BzrDir.create_standalone_workingtree('a') + a = ControlDir.create_standalone_workingtree('a') os.mkdir('a/foo') with file('a/foo/bar', 'wb') as f: f.write('contents') os.symlink('a/foo/bar', 'a/foo/baz') a.add(['foo', 'foo/bar', 'foo/baz']) a.commit('initial commit') - b = BzrDir.create_standalone_workingtree('b') + b = ControlDir.create_standalone_workingtree('b') basis = a.basis_tree() basis.lock_read() self.addCleanup(basis.unlock) @@ -1902,9 +1898,9 @@ def test_build_with_references(self): tree = self.make_branch_and_tree('source', - format='dirstate-with-subtree') + format='development-subtree') subtree = self.make_branch_and_tree('source/subtree', - format='dirstate-with-subtree') + format='development-subtree') tree.add_reference(subtree) tree.commit('a revision') tree.branch.create_checkout('target') @@ -2414,31 +2410,6 @@ self.assertEqual('tree', revision.properties['branch-nick']) -class TestBackupName(tests.TestCase): - - def test_deprecations(self): - class MockTransform(object): - - def has_named_child(self, by_parent, parent_id, name): - return name in by_parent.get(parent_id, []) - - class MockEntry(object): - - def __init__(self): - object.__init__(self) - self.name = "name" - - tt = MockTransform() - name1 = self.applyDeprecated( - symbol_versioning.deprecated_in((2, 3, 0)), - transform.get_backup_name, MockEntry(), {'a':[]}, 'a', tt) - self.assertEqual('name.~1~', name1) - name2 = self.applyDeprecated( - symbol_versioning.deprecated_in((2, 3, 0)), - transform._get_backup_name, 'name', {'a':['name.~1~']}, 'a', tt) - self.assertEqual('name.~2~', name2) - - class TestFileMover(tests.TestCaseWithTransport): def test_file_mover(self): @@ -2796,7 +2767,7 @@ def test_iter_changes(self): revision_tree, preview_tree = self.get_tree_and_preview_tree() - root = revision_tree.inventory.root.file_id + root = revision_tree.get_root_id() self.assertEqual([('a-id', ('a', 'a'), True, (True, True), (root, root), ('a', 'a'), ('file', 'file'), (False, False))], @@ -2806,7 +2777,7 @@ revision_tree, preview_tree = self.get_tree_and_preview_tree() changes = preview_tree.iter_changes(revision_tree, include_unchanged=True) - root = revision_tree.inventory.root.file_id + root = revision_tree.get_root_id() self.assertEqual([ROOT_ENTRY, A_ENTRY], list(changes)) @@ -3638,7 +3609,7 @@ self.assertRaises(NotImplementedError, tt.new_orphan, 'foo', 'bar') def _set_orphan_policy(self, wt, policy): - wt.branch.get_config().set_user_option('bzr.transform.orphan_policy', + wt.branch.get_config_stack().set('bzr.transform.orphan_policy', policy) def _prepare_orphan(self, wt): @@ -3717,7 +3688,7 @@ self.assertEqual(('deleting parent', 'Not deleting', 'new-1'), remaining_conflicts.pop()) self.assertLength(1, warnings) - self.assertStartsWith(warnings[0], 'donttouchmypreciouuus') + self.assertStartsWith(warnings[0], 'Value "donttouchmypreciouuus" ') class TestTransformHooks(tests.TestCaseWithTransport): diff -Nru bzr-2.5.0/bzrlib/tests/test_upgrade.py bzr-2.6.0~beta1/bzrlib/tests/test_upgrade.py --- bzr-2.5.0/bzrlib/tests/test_upgrade.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_upgrade.py 2012-03-15 10:00:24.000000000 +0000 @@ -24,7 +24,7 @@ from bzrlib import ( branch, - bzrdir, + controldir, tests, upgrade, workingtree, @@ -45,7 +45,7 @@ b.set_parent('file:///EF') b.set_bound_location('file:///GH') b.set_push_location('file:///IJ') - target = bzrdir.format_registry.make_bzrdir('dirstate-with-subtree') + target = controldir.format_registry.make_bzrdir('dirstate-with-subtree') converter = b.bzrdir._format.get_converter(target) converter.convert(b.bzrdir, None) new_branch = branch.Branch.open(self.get_url('branch')) @@ -64,7 +64,7 @@ def test_convert_branch7_branch8(self): b = self.make_branch('branch', format='1.9') - target = bzrdir.format_registry.make_bzrdir('1.9') + target = controldir.format_registry.make_bzrdir('1.9') target.set_branch_format(branch.BzrBranchFormat8()) converter = b.bzrdir._format.get_converter(target) converter.convert(b.bzrdir, None) @@ -75,7 +75,7 @@ def test_convert_knit_dirstate_empty(self): # test that asking for an upgrade from knit to dirstate works. tree = self.make_branch_and_tree('tree', format='knit') - target = bzrdir.format_registry.make_bzrdir('dirstate') + target = controldir.format_registry.make_bzrdir('dirstate') converter = tree.bzrdir._format.get_converter(target) converter.convert(tree.bzrdir, None) new_tree = workingtree.WorkingTree.open('tree') @@ -88,7 +88,7 @@ tree = self.make_branch_and_tree('tree', format='knit') self.build_tree(['tree/file']) tree.add(['file'], ['file-id']) - target = bzrdir.format_registry.make_bzrdir('dirstate') + target = controldir.format_registry.make_bzrdir('dirstate') converter = tree.bzrdir._format.get_converter(target) converter.convert(tree.bzrdir, None) new_tree = workingtree.WorkingTree.open('tree') @@ -99,7 +99,7 @@ # test that asking for an upgrade from knit to dirstate works. tree = self.make_branch_and_tree('tree', format='knit') rev_id = tree.commit('first post') - target = bzrdir.format_registry.make_bzrdir('dirstate') + target = controldir.format_registry.make_bzrdir('dirstate') converter = tree.bzrdir._format.get_converter(target) converter.convert(tree.bzrdir, None) new_tree = workingtree.WorkingTree.open('tree') @@ -116,7 +116,7 @@ rev_id2 = tree.commit('second post') rev_id3 = merge_tree.commit('second merge post') tree.merge_from_branch(merge_tree.branch) - target = bzrdir.format_registry.make_bzrdir('dirstate') + target = controldir.format_registry.make_bzrdir('dirstate') converter = tree.bzrdir._format.get_converter(target) converter.convert(tree.bzrdir, None) new_tree = workingtree.WorkingTree.open('tree') @@ -130,8 +130,8 @@ class TestSmartUpgrade(tests.TestCaseWithTransport): - from_format = bzrdir.format_registry.make_bzrdir("pack-0.92") - to_format = bzrdir.format_registry.make_bzrdir("2a") + from_format = controldir.format_registry.make_bzrdir("pack-0.92") + to_format = controldir.format_registry.make_bzrdir("2a") def make_standalone_branch(self): wt = self.make_branch_and_tree("branch1", format=self.from_format) @@ -170,9 +170,9 @@ format=self.from_format) # Note: self.make_branch() always creates a new repo at the location # so we need to avoid using that here ... - b1 = bzrdir.BzrDir.create_branch_convenience("repo/branch1", + b1 = controldir.ControlDir.create_branch_convenience("repo/branch1", format=self.from_format) - b2 = bzrdir.BzrDir.create_branch_convenience("repo/branch2", + b2 = controldir.ControlDir.create_branch_convenience("repo/branch2", format=self.from_format) return repo.bzrdir diff -Nru bzr-2.5.0/bzrlib/tests/test_upgrade_stacked.py bzr-2.6.0~beta1/bzrlib/tests/test_upgrade_stacked.py --- bzr-2.5.0/bzrlib/tests/test_upgrade_stacked.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_upgrade_stacked.py 2012-03-15 10:00:24.000000000 +0000 @@ -18,7 +18,7 @@ """Tests for upgrades of various stacking situations.""" from bzrlib import ( - bzrdir, + controldir, check, errors, tests, @@ -71,7 +71,7 @@ self.assertTrue(stacked.open_branch().get_stacked_on_url()) # now we'll upgrade the underlying branch, then upgrade the stacked # branch, and this should still work. - new_format = bzrdir.format_registry.make_bzrdir( + new_format = controldir.format_registry.make_bzrdir( self.scenario_new_format) upgrade('base', new_format) # in some cases you'll get an error if the underlying model has @@ -81,10 +81,10 @@ stacked.open_branch) else: check.check_dwim('stacked', False, True, True) - stacked = bzrdir.BzrDir.open('stacked') + stacked = controldir.ControlDir.open('stacked') # but we can upgrade the stacked repository upgrade('stacked', new_format) # and now it opens ok - stacked = bzrdir.BzrDir.open('stacked') + stacked = controldir.ControlDir.open('stacked') # And passes check. check.check_dwim('stacked', False, True, True) diff -Nru bzr-2.5.0/bzrlib/tests/test_url_policy_open.py bzr-2.6.0~beta1/bzrlib/tests/test_url_policy_open.py --- bzr-2.5.0/bzrlib/tests/test_url_policy_open.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_url_policy_open.py 2012-03-15 10:00:24.000000000 +0000 @@ -22,10 +22,12 @@ BranchReferenceFormat, ) from bzrlib.bzrdir import ( - BzrDir, BzrProber, ) -from bzrlib.controldir import ControlDirFormat +from bzrlib.controldir import ( + ControlDir, + ControlDirFormat, + ) from bzrlib.errors import NotBranchError from bzrlib.url_policy_open import ( BadUrl, @@ -182,9 +184,9 @@ self.assertRaises(NotBranchError, opener.open, ".") self.assertEquals(1, len(TrackingProber.seen_urls)) TrackingProber.seen_urls = [] - # And make sure it's registered in such a way that BzrDir.open would + # And make sure it's registered in such a way that ControlDir.open would # use it. - self.assertRaises(NotBranchError, BzrDir.open, ".") + self.assertRaises(NotBranchError, ControlDir.open, ".") self.assertEquals(1, len(TrackingProber.seen_urls)) def test_allowed_url(self): diff -Nru bzr-2.5.0/bzrlib/tests/test_workingtree_4.py bzr-2.6.0~beta1/bzrlib/tests/test_workingtree_4.py --- bzr-2.5.0/bzrlib/tests/test_workingtree_4.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_workingtree_4.py 2012-03-15 10:00:24.000000000 +0000 @@ -212,12 +212,12 @@ rev1 = subtree.commit('commit in subdir') rev1_tree = subtree.basis_tree() rev1_tree.lock_read() - rev1_tree.inventory + rev1_tree.root_inventory self.addCleanup(rev1_tree.unlock) rev2 = subtree.commit('second commit in subdir', allow_pointless=True) rev2_tree = subtree.basis_tree() rev2_tree.lock_read() - rev2_tree.inventory + rev2_tree.root_inventory self.addCleanup(rev2_tree.unlock) tree.branch.pull(subtree.branch) @@ -516,7 +516,7 @@ def test_unique_root_id_per_tree(self): # each time you initialize a new tree, it gets a different root id - format_name = 'dirstate-with-subtree' + format_name = 'development-subtree' tree1 = self.make_branch_and_tree('tree1', format=format_name) tree2 = self.make_branch_and_tree('tree2', @@ -552,12 +552,12 @@ tree = self.make_branch_and_tree('tag', format='dirstate-tags') self.assertEqual(inventory.ROOT_ID, tree.get_root_id()) tree = self.make_branch_and_tree('subtree', - format='dirstate-with-subtree') + format='development-subtree') self.assertNotEqual(inventory.ROOT_ID, tree.get_root_id()) def test_non_subtree_with_nested_trees(self): # prior to dirstate, st/diff/commit ignored nested trees. - # dirstate, as opposed to dirstate-with-subtree, should + # dirstate, as opposed to development-subtree, should # behave the same way. tree = self.make_branch_and_tree('.', format='dirstate') self.assertFalse(tree.supports_tree_reference()) @@ -603,8 +603,8 @@ tree.unlock() def test_with_subtree_supports_tree_references(self): - # dirstate-with-subtree should support tree-references. - tree = self.make_branch_and_tree('.', format='dirstate-with-subtree') + # development-subtree should support tree-references. + tree = self.make_branch_and_tree('.', format='development-subtree') self.assertTrue(tree.supports_tree_reference()) # having checked this is on, the tree interface, and intertree # interface tests, will proceed to test the subtree support of @@ -866,7 +866,7 @@ self.addCleanup(tree.unlock) # Force access to the in memory inventory to trigger bug #494221: try # maintaining the in-memory inventory - inv = tree.inventory + inv = tree.root_inventory self.assertTrue(inv.has_id('a-id')) self.assertTrue(inv.has_id('b-id')) tree.unversion(['a-id', 'b-id']) diff -Nru bzr-2.5.0/bzrlib/tests/test_workingtree.py bzr-2.6.0~beta1/bzrlib/tests/test_workingtree.py --- bzr-2.5.0/bzrlib/tests/test_workingtree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_workingtree.py 2012-03-15 10:00:24.000000000 +0000 @@ -218,31 +218,6 @@ workingtree.WorkingTreeFormatMetaDir.find_format, dir) - def test_register_unregister_format(self): - format = SampleTreeFormat() - # make a control dir - dir = bzrdir.BzrDirMetaFormat1().initialize('.') - dir.create_repository() - dir.create_branch() - # make a branch - format.initialize(dir) - # register a format for it. - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - workingtree.WorkingTreeFormat.register_format, format) - self.assertTrue(format in - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - workingtree.WorkingTreeFormat.get_formats)) - # which branch.Open will refuse (not supported) - self.assertRaises(errors.UnsupportedFormatError, workingtree.WorkingTree.open, '.') - # but open_downlevel will work - self.assertEqual(format.open(dir), workingtree.WorkingTree.open_downlevel('.')) - # unregister the format - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - workingtree.WorkingTreeFormat.unregister_format, format) - self.assertFalse(format in - self.applyDeprecated(symbol_versioning.deprecated_in((2, 4, 0)), - workingtree.WorkingTreeFormat.get_formats)) - def test_find_format_with_features(self): tree = self.make_branch_and_tree('.', format='2a') tree.update_feature_flags({"name": "necessity"}) diff -Nru bzr-2.5.0/bzrlib/tests/test_xml.py bzr-2.6.0~beta1/bzrlib/tests/test_xml.py --- bzr-2.5.0/bzrlib/tests/test_xml.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tests/test_xml.py 2012-03-15 10:00:24.000000000 +0000 @@ -414,12 +414,6 @@ self.assertEqual('tree-root-321', inv2['nested-id'].parent_id) self.assertEqual('rev-outer', inv2['nested-id'].revision) self.assertEqual('rev-inner', inv2['nested-id'].reference_revision) - self.assertRaises(errors.UnsupportedInventoryKind, - s_v6.read_inventory_from_string, - txt.replace('format="7"', 'format="6"')) - self.assertRaises(errors.UnsupportedInventoryKind, - s_v5.read_inventory_from_string, - txt.replace('format="7"', 'format="5"')) def test_roundtrip_inventory_v8(self): inv = self.get_sample_inventory() diff -Nru bzr-2.5.0/bzrlib/transform.py bzr-2.6.0~beta1/bzrlib/transform.py --- bzr-2.5.0/bzrlib/transform.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/transform.py 2012-03-15 10:00:24.000000000 +0000 @@ -22,6 +22,7 @@ import time from bzrlib import ( + config as _mod_config, errors, lazy_import, registry, @@ -47,7 +48,7 @@ """) from bzrlib.errors import (DuplicateKey, MalformedTransform, ReusingTransform, CantMoveRoot, - ExistingLimbo, ImmortalLimbo, NoFinalPath, + ImmortalLimbo, NoFinalPath, UnableCreateSymlink) from bzrlib.filters import filtered_output_bytes, ContentFilterContext from bzrlib.mutabletree import MutableTree @@ -574,11 +575,6 @@ # ensure that all children are registered with the transaction list(self.iter_tree_children(parent_id)) - @deprecated_method(deprecated_in((2, 3, 0))) - def has_named_child(self, by_parent, parent_id, name): - return self._has_named_child( - name, parent_id, known_children=by_parent.get(parent_id, [])) - def _has_named_child(self, name, parent_id, known_children): """Does a parent already have a name child. @@ -1405,21 +1401,8 @@ delete_any(self._limbo_name(trans_id)) def new_orphan(self, trans_id, parent_id): - # FIXME: There is no tree config, so we use the branch one (it's weird - # to define it this way as orphaning can only occur in a working tree, - # but that's all we have (for now). It will find the option in - # locations.conf or bazaar.conf though) -- vila 20100916 - conf = self._tree.branch.get_config() - conf_var_name = 'bzr.transform.orphan_policy' - orphan_policy = conf.get_user_option(conf_var_name) - default_policy = orphaning_registry.default_key - if orphan_policy is None: - orphan_policy = default_policy - if orphan_policy not in orphaning_registry: - trace.warning('%s (from %s) is not a known policy, defaulting ' - 'to %s' % (orphan_policy, conf_var_name, default_policy)) - orphan_policy = default_policy - handle_orphan = orphaning_registry.get(orphan_policy) + conf = self._tree.get_config_stack() + handle_orphan = conf.get('bzr.transform.orphan_policy') handle_orphan(self, trans_id, parent_id) @@ -1488,6 +1471,12 @@ orphaning_registry._set_default_key('conflict') +opt_transform_orphan = _mod_config.RegistryOption( + 'bzr.transform.orphan_policy', orphaning_registry, + help='Policy for orphaned files during transform operations.', + invalid='warning') + + class TreeTransform(DiskTreeTransform): """Represent a tree transformation. @@ -2062,10 +2051,16 @@ pass @property + @deprecated_method(deprecated_in((2, 5, 0))) def inventory(self): """This Tree does not use inventory as its backing data.""" raise NotImplementedError(_PreviewTree.inventory) + @property + def root_inventory(self): + """This Tree does not use inventory as its backing data.""" + raise NotImplementedError(_PreviewTree.root_inventory) + def get_root_id(self): return self._transform.final_file_id(self._transform.root) @@ -2117,6 +2112,10 @@ return cur_parent def path2id(self, path): + if isinstance(path, list): + if path == []: + path = [""] + path = osutils.pathjoin(*path) return self._transform.final_file_id(self._path2trans_id(path)) def id2path(self, file_id): @@ -2825,24 +2824,6 @@ tt.set_executability(entry.executable, trans_id) -@deprecated_function(deprecated_in((2, 3, 0))) -def get_backup_name(entry, by_parent, parent_trans_id, tt): - return _get_backup_name(entry.name, by_parent, parent_trans_id, tt) - - -@deprecated_function(deprecated_in((2, 3, 0))) -def _get_backup_name(name, by_parent, parent_trans_id, tt): - """Produce a backup-style name that appears to be available""" - def name_gen(): - counter = 1 - while True: - yield "%s.~%d~" % (name, counter) - counter += 1 - for new_name in name_gen(): - if not tt.has_named_child(by_parent, parent_trans_id, new_name): - return new_name - - def revert(working_tree, target_tree, filenames, backups=False, pb=None, change_reporter=None): """Revert a working tree's contents to those of a target tree.""" diff -Nru bzr-2.5.0/bzrlib/transport/ftp/__init__.py bzr-2.6.0~beta1/bzrlib/transport/ftp/__init__.py --- bzr-2.5.0/bzrlib/transport/ftp/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/transport/ftp/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -248,7 +248,7 @@ mutter("FTP has not: %s: %s", abspath, e) return False - def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0): + def get(self, relpath, retries=0): """Get the file at the given relative path. :param relpath: The relative path to the file @@ -258,10 +258,6 @@ We're meant to return a file-like object which bzr will then read from. For now we do this via the magic of StringIO """ - if deprecated_passed(decode): - warn(deprecated_in((2,3,0)) % - '"decode" parameter to FtpTransport.get()', - DeprecationWarning, stacklevel=2) try: mutter("FTP get: %s", self._remote_path(relpath)) f = self._get_FTP() @@ -279,7 +275,7 @@ else: warning("FTP temporary error: %s. Retrying.", str(e)) self._reconnect() - return self.get(relpath, decode, retries+1) + return self.get(relpath, retries+1) except EOFError, e: if retries > _number_of_retries: raise errors.TransportError("FTP control connection closed during GET %s." @@ -289,7 +285,7 @@ warning("FTP control connection closed. Trying to reopen.") time.sleep(_sleep_between_retries) self._reconnect() - return self.get(relpath, decode, retries+1) + return self.get(relpath, retries+1) def put_file(self, relpath, fp, mode=None, retries=0): """Copy the file-like or string object into the location. diff -Nru bzr-2.5.0/bzrlib/transport/gio_transport.py bzr-2.6.0~beta1/bzrlib/transport/gio_transport.py --- bzr-2.5.0/bzrlib/transport/gio_transport.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/transport/gio_transport.py 2012-03-15 10:00:24.000000000 +0000 @@ -271,7 +271,7 @@ else: self._translate_gio_error(e, relpath) - def get(self, relpath, decode=DEPRECATED_PARAMETER, retries=0): + def get(self, relpath, retries=0): """Get the file at the given relative path. :param relpath: The relative path to the file @@ -281,10 +281,6 @@ We're meant to return a file-like object which bzr will then read from. For now we do this via the magic of StringIO """ - if deprecated_passed(decode): - warn(deprecated_in((2,3,0)) % - '"decode" parameter to GioTransport.get()', - DeprecationWarning, stacklevel=2) try: if 'gio' in debug.debug_flags: mutter("GIO get: %s" % relpath) diff -Nru bzr-2.5.0/bzrlib/transport/http/__init__.py bzr-2.6.0~beta1/bzrlib/transport/http/__init__.py --- bzr-2.5.0/bzrlib/transport/http/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/transport/http/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -21,7 +21,7 @@ from __future__ import absolute_import -from cStringIO import StringIO +import os import re import urlparse import sys @@ -119,12 +119,7 @@ :param relpath: The relative path to the file """ code, response_file = self._get(relpath, None) - # FIXME: some callers want an iterable... One step forward, three steps - # backwards :-/ And not only an iterable, but an iterable that can be - # seeked backwards, so we will never be able to do that. One such - # known client is bzrlib.bundle.serializer.v4.get_bundle_reader. At the - # time of this writing it's even the only known client -- vila20071203 - return StringIO(response_file.read()) + return response_file def _get(self, relpath, ranges, tail_amount=0): """Get a file, or part of a file. @@ -242,7 +237,7 @@ # Split the received chunk for offset, size in cur_coal.ranges: start = cur_coal.start + offset - rfile.seek(start, 0) + rfile.seek(start, os.SEEK_SET) data = rfile.read(size) data_len = len(data) if data_len != size: diff -Nru bzr-2.5.0/bzrlib/transport/http/response.py bzr-2.6.0~beta1/bzrlib/transport/http/response.py --- bzr-2.5.0/bzrlib/transport/http/response.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/transport/http/response.py 2012-03-15 10:00:24.000000000 +0000 @@ -23,6 +23,7 @@ from __future__ import absolute_import +import os import httplib from cStringIO import StringIO import rfc822 @@ -33,20 +34,64 @@ ) +class ResponseFile(object): + """A wrapper around the http socket containing the result of a GET request. + + Only read() and seek() (forward) are supported. + """ + def __init__(self, path, infile): + """Constructor. + + :param path: File url, for error reports. + + :param infile: File-like socket set at body start. + """ + self._path = path + self._file = infile + self._pos = 0 + + def close(self): + """Close this file. + + Dummy implementation for consistency with the 'file' API. + """ + + def read(self, size=-1): + """Read size bytes from the current position in the file. + + :param size: The number of bytes to read. Leave unspecified or pass + -1 to read to EOF. + """ + data = self._file.read(size) + self._pos += len(data) + return data + + def seek(self, offset, whence=os.SEEK_SET): + if whence == os.SEEK_SET: + if offset < self._pos: + raise AsserttionError( + "Can't seek backwards, pos: %s, offset: %s" + % (self._pos, offfset)) + to_discard = offset - self._pos + elif whence == os.SEEK_CUR: + to_discard = offset + else: + raise AssertionError("Can't seek backwards") + if to_discard: + # Just discard the unwanted bytes + self.read(to_discard) + # A RangeFile expects the following grammar (simplified to outline the # assumptions we rely upon). -# file: whole_file -# | single_range +# file: single_range # | multiple_range -# whole_file: [content_length_header] data - # single_range: content_range_header data # multiple_range: boundary_header boundary (content_range_header data boundary)+ -class RangeFile(object): +class RangeFile(ResponseFile): """File-like object that allow access to partial available data. All accesses should happen sequentially since the acquisition occurs during @@ -71,10 +116,10 @@ """Constructor. :param path: File url, for error reports. + :param infile: File-like socket set at body start. """ - self._path = path - self._file = infile + super(RangeFile, self).__init__(path, infile) self._boundary = None # When using multi parts response, this will be set with the headers # associated with the range currently read. @@ -298,16 +343,11 @@ :return: A file-like object that can seek()+read() the ranges indicated by the headers. """ - rfile = RangeFile(url, data) if code == 200: # A whole file - size = msg.getheader('content-length', None) - if size is None: - size = -1 - else: - size = int(size) - rfile.set_range(0, size) + rfile = ResponseFile(url, data) elif code == 206: + rfile = RangeFile(url, data) content_type = msg.getheader('content-type', None) if content_type is None: # When there is no content-type header we treat the response as diff -Nru bzr-2.5.0/bzrlib/transport/http/_urllib2_wrappers.py bzr-2.6.0~beta1/bzrlib/transport/http/_urllib2_wrappers.py --- bzr-2.5.0/bzrlib/transport/http/_urllib2_wrappers.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/transport/http/_urllib2_wrappers.py 2012-03-15 10:00:24.000000000 +0000 @@ -476,9 +476,12 @@ # FIXME JRV 2011-12-18: Use location config here? config_stack = config.GlobalStack() cert_reqs = config_stack.get('ssl.cert_reqs') + if self.proxied_host is not None: + host = self.proxied_host.split(":", 1)[0] + else: + host = self.host if cert_reqs == ssl.CERT_NONE: - trace.warning("Not checking SSL certificate for %s: %d", - self.host, self.port) + trace.warning("Not checking SSL certificate for %s", host) ca_certs = None else: if self.ca_certs is None: @@ -503,7 +506,7 @@ raise if cert_reqs == ssl.CERT_REQUIRED: peer_cert = ssl_sock.getpeercert() - match_hostname(peer_cert, self.host) + match_hostname(peer_cert, host) # Wrap the ssl socket before anybody use it self._wrap_socket_for_reporting(ssl_sock) diff -Nru bzr-2.5.0/bzrlib/transport/__init__.py bzr-2.6.0~beta1/bzrlib/transport/__init__.py --- bzr-2.5.0/bzrlib/transport/__init__.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/transport/__init__.py 2012-03-15 10:00:24.000000000 +0000 @@ -138,10 +138,11 @@ def register_lazy_transport(prefix, module, classname): if not prefix in transport_list_registry: register_transport_proto(prefix) - transport_list_registry.register_lazy_transport_provider(prefix, module, classname) + transport_list_registry.register_lazy_transport_provider( + prefix, module, classname) -def register_transport(prefix, klass, override=DEPRECATED_PARAMETER): +def register_transport(prefix, klass): if not prefix in transport_list_registry: register_transport_proto(prefix) transport_list_registry.register_transport_provider(prefix, klass) @@ -1782,15 +1783,15 @@ help="Read-only access of branches exported on the web.") register_transport_proto('https://', help="Read-only access of branches exported on the web using SSL.") -# The default http implementation is urllib, but https uses pycurl if available +# The default http implementation is urllib register_lazy_transport('http://', 'bzrlib.transport.http._pycurl', 'PyCurlTransport') register_lazy_transport('http://', 'bzrlib.transport.http._urllib', 'HttpTransport_urllib') -register_lazy_transport('https://', 'bzrlib.transport.http._urllib', - 'HttpTransport_urllib') register_lazy_transport('https://', 'bzrlib.transport.http._pycurl', 'PyCurlTransport') +register_lazy_transport('https://', 'bzrlib.transport.http._urllib', + 'HttpTransport_urllib') register_transport_proto('ftp://', help="Access using passive FTP.") register_lazy_transport('ftp://', 'bzrlib.transport.ftp', 'FtpTransport') diff -Nru bzr-2.5.0/bzrlib/transport/local.py bzr-2.6.0~beta1/bzrlib/transport/local.py --- bzr-2.5.0/bzrlib/transport/local.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/transport/local.py 2012-03-15 10:00:24.000000000 +0000 @@ -52,15 +52,7 @@ def __init__(self, base): """Set the base path where files will be stored.""" if not base.startswith('file://'): - symbol_versioning.warn( - "Instantiating LocalTransport with a filesystem path" - " is deprecated as of bzr 0.8." - " Please use bzrlib.transport.get_transport()" - " or pass in a file:// url.", - DeprecationWarning, - stacklevel=2 - ) - base = urlutils.local_path_to_url(base) + raise AssertionError("not a file:// url: %r" % base) if base[-1] != '/': base = base + '/' diff -Nru bzr-2.5.0/bzrlib/transport/remote.py bzr-2.6.0~beta1/bzrlib/transport/remote.py --- bzr-2.5.0/bzrlib/transport/remote.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/transport/remote.py 2012-03-15 10:00:24.000000000 +0000 @@ -36,9 +36,6 @@ urlutils, ) from bzrlib.smart import client, medium -from bzrlib.symbol_versioning import ( - deprecated_method, - ) class _SmartStat(object): diff -Nru bzr-2.5.0/bzrlib/tree.py bzr-2.6.0~beta1/bzrlib/tree.py --- bzr-2.5.0/bzrlib/tree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/tree.py 2012-03-15 10:00:24.000000000 +0000 @@ -532,13 +532,16 @@ return find_ids_across_trees(paths, [self] + list(trees), require_versioned) def iter_children(self, file_id): - entry = self.iter_entries_by_dir([file_id]).next()[1] - for child in getattr(entry, 'children', {}).itervalues(): - yield child.file_id + """Iterate over the file ids of the children of an entry. + + :param file_id: File id of the entry + :return: Iterator over child file ids. + """ + raise NotImplementedError(self.iter_children) def lock_read(self): """Lock this tree for multiple read only operations. - + :return: A bzrlib.lock.LogicalLockResult. """ pass @@ -768,36 +771,68 @@ yield cur_path # all done. + @deprecated_method(deprecated_in((2, 5, 0))) def _get_inventory(self): return self._inventory inventory = property(_get_inventory, doc="Inventory of this Tree") + def _get_root_inventory(self): + return self._inventory + + root_inventory = property(_get_root_inventory, + doc="Root inventory of this tree") + + def _unpack_file_id(self, file_id): + """Find the inventory and inventory file id for a tree file id. + + :param file_id: The tree file id, as bytestring or tuple + :return: Inventory and inventory file id + """ + if isinstance(file_id, tuple): + if len(file_id) != 1: + raise ValueError("nested trees not yet supported: %r" % file_id) + file_id = file_id[0] + return self.root_inventory, file_id + @needs_read_lock def path2id(self, path): """Return the id for path in this tree.""" - return self._inventory.path2id(path) + return self._path2inv_file_id(path)[1] + + def _path2inv_file_id(self, path): + """Lookup a inventory and inventory file id by path. + + :param path: Path to look up + :return: tuple with inventory and inventory file id + """ + # FIXME: Support nested trees + return self.root_inventory, self.root_inventory.path2id(path) def id2path(self, file_id): """Return the path for a file id. :raises NoSuchId: """ - return self.inventory.id2path(file_id) + inventory, file_id = self._unpack_file_id(file_id) + return inventory.id2path(file_id) def has_id(self, file_id): - return self.inventory.has_id(file_id) + inventory, file_id = self._unpack_file_id(file_id) + return inventory.has_id(file_id) def has_or_had_id(self, file_id): - return self.inventory.has_id(file_id) + inventory, file_id = self._unpack_file_id(file_id) + return inventory.has_id(file_id) def all_file_ids(self): - return set(self.inventory) + return set( + [entry.file_id for path, entry in self.iter_entries_by_dir()]) @deprecated_method(deprecated_in((2, 4, 0))) def __iter__(self): - return iter(self.inventory) + return iter(self.all_file_ids()) def filter_unversioned_files(self, paths): """Filter out paths that are versioned. @@ -807,8 +842,7 @@ # NB: we specifically *don't* call self.has_filename, because for # WorkingTrees that can indicate files that exist on disk but that # are not versioned. - pred = self.inventory.has_filename - return set((p for p in paths if not pred(p))) + return set((p for p in paths if self.path2id(p) is None)) @needs_read_lock def iter_entries_by_dir(self, specific_file_ids=None, yield_parents=False): @@ -823,13 +857,30 @@ down to specific_file_ids that have been requested. This has no impact if specific_file_ids is None. """ - return self.inventory.iter_entries_by_dir( - specific_file_ids=specific_file_ids, yield_parents=yield_parents) + if specific_file_ids is None: + inventory_file_ids = None + else: + inventory_file_ids = [] + for tree_file_id in specific_file_ids: + inventory, inv_file_id = self._unpack_file_id(tree_file_id) + if not inventory is self.root_inventory: # for now + raise AssertionError("%r != %r" % ( + inventory, self.root_inventory)) + inventory_file_ids.append(inv_file_id) + # FIXME: Handle nested trees + return self.root_inventory.iter_entries_by_dir( + specific_file_ids=inventory_file_ids, yield_parents=yield_parents) @deprecated_method(deprecated_in((2, 5, 0))) def get_file_by_path(self, path): return self.get_file(self.path2id(path), path) + def iter_children(self, file_id, path=None): + """See Tree.iter_children.""" + entry = self.iter_entries_by_dir([file_id]).next()[1] + for child in getattr(entry, 'children', {}).itervalues(): + yield child.file_id + def find_ids_across_trees(filenames, trees, require_versioned=True): """Find the ids corresponding to specified filenames. @@ -989,13 +1040,9 @@ if (self.source.get_symlink_target(file_id) != self.target.get_symlink_target(file_id)): changed_content = True - # XXX: Yes, the indentation below is wrong. But fixing it broke - # test_merge.TestMergerEntriesLCAOnDisk. - # test_nested_tree_subtree_renamed_and_modified. We'll wait for - # the fix from bzr.dev -- vila 2009026 - elif source_kind == 'tree-reference': - if (self.source.get_reference_revision(file_id, source_path) - != self.target.get_reference_revision(file_id, target_path)): + elif source_kind == 'tree-reference': + if (self.source.get_reference_revision(file_id, source_path) + != self.target.get_reference_revision(file_id, target_path)): changed_content = True parent = (source_parent, target_parent) name = (source_name, target_name) @@ -1216,7 +1263,7 @@ :param file_id: The file_id to lookup. """ try: - inventory = tree.inventory + inventory = tree.root_inventory except NotImplementedError: # No inventory available. try: @@ -1297,8 +1344,8 @@ if old_entry is None: # Reusing a discarded change. old_entry = self._get_entry(self.source, file_id) - for child in old_entry.children.values(): - precise_file_ids.add(child.file_id) + for child in self.source.iter_children(file_id): + precise_file_ids.add(child) changed_file_ids.add(result[0]) yield result @@ -1447,7 +1494,7 @@ return (None, None) else: self._out_of_order_processed.add(file_id) - cur_ie = other_tree.inventory[file_id] + cur_ie = other_tree.root_inventory[file_id] return (cur_path, cur_ie) def iter_all(self): diff -Nru bzr-2.5.0/bzrlib/vf_repository.py bzr-2.6.0~beta1/bzrlib/vf_repository.py --- bzr-2.5.0/bzrlib/vf_repository.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/vf_repository.py 2012-03-15 10:00:24.000000000 +0000 @@ -604,16 +604,17 @@ _mod_revision.NULL_REVISION)) # The basis inventory from a repository if revtrees: - basis_inv = revtrees[0].inventory + basis_tree = revtrees[0] else: - basis_inv = self.repository.revision_tree( - _mod_revision.NULL_REVISION).inventory + basis_tree = self.repository.revision_tree( + _mod_revision.NULL_REVISION) + basis_inv = basis_tree.root_inventory if len(self.parents) > 0: if basis_revision_id != self.parents[0] and not ghost_basis: raise Exception( "arbitrary basis parents not yet supported with merges") for revtree in revtrees[1:]: - for change in revtree.inventory._make_delta(basis_inv): + for change in revtree.root_inventory._make_delta(basis_inv): if change[1] is None: # Not present in this parent. continue @@ -1021,7 +1022,7 @@ # return a new inventory, but as there is no revision tree cache in # repository this is safe for now - RBC 20081013 if basis_inv is None: - basis_inv = basis_tree.inventory + basis_inv = basis_tree.root_inventory basis_inv.apply_delta(delta) basis_inv.revision_id = new_revision_id return (self.add_inventory(new_revision_id, basis_inv, parents), @@ -1647,7 +1648,7 @@ try: inv = inventory_cache[parent_id] except KeyError: - inv = self.revision_tree(parent_id).inventory + inv = self.revision_tree(parent_id).root_inventory inventory_cache[parent_id] = inv try: parent_entry = inv[text_key[0]] @@ -2441,7 +2442,7 @@ invs_sent_so_far = set([_mod_revision.NULL_REVISION]) inventory_cache = lru_cache.LRUCache(50) null_inventory = from_repo.revision_tree( - _mod_revision.NULL_REVISION).inventory + _mod_revision.NULL_REVISION).root_inventory # XXX: ideally the rich-root/tree-refs flags would be per-revision, not # per-repo (e.g. streaming a non-rich-root revision out of a rich-root # repo back into a non-rich-root repo ought to be allowed) @@ -2794,9 +2795,10 @@ """ deltas = [] # Generate deltas against each tree, to find the shortest. + # FIXME: Support nested trees texts_possibly_new_in_tree = set() for basis_id, basis_tree in possible_trees: - delta = tree.inventory._make_delta(basis_tree.inventory) + delta = tree.root_inventory._make_delta(basis_tree.root_inventory) for old_path, new_path, file_id, new_entry in delta: if new_path is None: # This file_id isn't present in the new rev, so we don't @@ -2839,7 +2841,8 @@ parents_parents = [key[-1] for key in parents_parents_keys] basis_id = _mod_revision.NULL_REVISION basis_tree = self.source.revision_tree(basis_id) - delta = parent_tree.inventory._make_delta(basis_tree.inventory) + delta = parent_tree.root_inventory._make_delta( + basis_tree.root_inventory) self.target.add_inventory_by_delta( basis_id, delta, current_revision_id, parents_parents) cache[current_revision_id] = parent_tree @@ -2904,7 +2907,7 @@ kind = entry.kind texts_possibly_new_in_tree.add((file_id, entry.revision)) for basis_id, basis_tree in possible_trees: - basis_inv = basis_tree.inventory + basis_inv = basis_tree.root_inventory for file_key in list(texts_possibly_new_in_tree): file_id, file_revision = file_key try: @@ -3142,7 +3145,8 @@ parent_trees[p_id] = repository.revision_tree( _mod_revision.NULL_REVISION) - inv = revision_tree.inventory + # FIXME: Support nested trees + inv = revision_tree.root_inventory entries = inv.iter_entries() # backwards compatibility hack: skip the root id. if not repository.supports_rich_root(): diff -Nru bzr-2.5.0/bzrlib/weave.py bzr-2.6.0~beta1/bzrlib/weave.py --- bzr-2.5.0/bzrlib/weave.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/weave.py 2012-03-15 10:00:24.000000000 +0000 @@ -920,7 +920,8 @@ self._transport = transport self._filemode = filemode try: - _read_weave_v5(self._transport.get(name + WeaveFile.WEAVE_SUFFIX), self) + f = self._transport.get(name + WeaveFile.WEAVE_SUFFIX) + _read_weave_v5(StringIO(f.read()), self) except errors.NoSuchFile: if not create: raise diff -Nru bzr-2.5.0/bzrlib/workingtree_3.py bzr-2.6.0~beta1/bzrlib/workingtree_3.py --- bzr-2.5.0/bzrlib/workingtree_3.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/workingtree_3.py 2012-03-15 10:00:24.000000000 +0000 @@ -221,7 +221,7 @@ try: basis_tree = branch.repository.revision_tree(revision_id) # only set an explicit root id if there is one to set. - if basis_tree.inventory.root is not None: + if basis_tree.get_root_id() is not None: wt.set_root_id(basis_tree.get_root_id()) if revision_id == _mod_revision.NULL_REVISION: wt.set_parent_trees([]) diff -Nru bzr-2.5.0/bzrlib/workingtree_4.py bzr-2.6.0~beta1/bzrlib/workingtree_4.py --- bzr-2.5.0/bzrlib/workingtree_4.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/workingtree_4.py 2012-03-15 10:00:24.000000000 +0000 @@ -38,6 +38,7 @@ cache_utf8, config, conflicts as _mod_conflicts, + controldir, debug, dirstate, errors, @@ -68,6 +69,10 @@ realpath, safe_unicode, ) +from bzrlib.symbol_versioning import ( + deprecated_in, + deprecated_method, + ) from bzrlib.transport.local import LocalTransport from bzrlib.tree import ( InterTree, @@ -255,8 +260,7 @@ :return: an integer. -1 means never save. """ - # FIXME: We want a WorkingTreeStack here -- vila 20110812 - conf = config.BranchStack(self.branch) + conf = self.get_config_stack() return conf.get('bzr.workingtree.worth_saving_limit') def filter_unversioned_files(self, paths): @@ -415,7 +419,7 @@ return link_or_sha1 return None - def _get_inventory(self): + def _get_root_inventory(self): """Get the inventory for the tree. This is only valid within a lock.""" if 'evil' in debug.debug_flags: trace.mutter_callsite(2, @@ -426,9 +430,16 @@ self._generate_inventory() return self._inventory + @deprecated_method(deprecated_in((2, 5, 0))) + def _get_inventory(self): + return self.root_inventory + inventory = property(_get_inventory, doc="Inventory of this Tree") + root_inventory = property(_get_root_inventory, + "Root inventory of this tree") + @needs_read_lock def get_parent_ids(self): """See Tree.get_parent_ids. @@ -681,7 +692,7 @@ if self._inventory is not None: update_inventory = True - inv = self.inventory + inv = self.root_inventory to_dir_id = to_entry[0][2] to_dir_ie = inv[to_dir_id] else: @@ -883,6 +894,10 @@ @needs_read_lock def path2id(self, path): """Return the id for path in this tree.""" + if isinstance(path, list): + if path == []: + path = [""] + path = osutils.pathjoin(*path) path = path.strip('/') entry = self._get_entry(path=path) if entry == (None, None): @@ -1036,7 +1051,7 @@ This is a meaningless operation for dirstate, but we obey it anyhow. """ - return self.inventory + return self.root_inventory @needs_read_lock def revision_tree(self, revision_id): @@ -1150,7 +1165,8 @@ # _make_delta if we can't get the RevisionTree pass else: - delta = rev_tree.inventory._make_delta(basis_tree.inventory) + delta = rev_tree.root_inventory._make_delta( + basis_tree.root_inventory) dirstate.update_basis_by_delta(delta, rev_id) updated = True if not updated: @@ -1327,7 +1343,7 @@ # being created. self._inventory = None # generate a delta, - delta = inv._make_delta(self.inventory) + delta = inv._make_delta(self.root_inventory) # and apply it. self.apply_inventory_delta(delta) if had_inventory: @@ -1353,7 +1369,7 @@ base_tree = trees[0][1] state = self.current_dirstate() # We don't support ghosts yet - state.set_state_from_scratch(base_tree.inventory, trees, []) + state.set_state_from_scratch(base_tree.root_inventory, trees, []) class ContentFilterAwareSHA1Provider(dirstate.SHA1Provider): @@ -1597,8 +1613,8 @@ def _get_matchingbzrdir(self): """Overrideable method to get a bzrdir for testing.""" # please test against something that will let us do tree references - return bzrdir.format_registry.make_bzrdir( - 'dirstate-with-subtree') + return controldir.format_registry.make_bzrdir( + 'development-subtree') _matchingbzrdir = property(__get_matchingbzrdir) @@ -1765,7 +1781,8 @@ if path is not None: path = path.encode('utf8') parent_index = self._get_parent_index() - return self._dirstate._get_entry(parent_index, fileid_utf8=file_id, path_utf8=path) + return self._dirstate._get_entry(parent_index, fileid_utf8=file_id, + path_utf8=path) def _generate_inventory(self): """Create and set self.inventory from the dirstate object. @@ -1872,21 +1889,24 @@ @needs_read_lock def get_file_revision(self, file_id): - return self.inventory[file_id].revision + inv, inv_file_id = self._unpack_file_id(file_id) + return inv[inv_file_id].revision def get_file(self, file_id, path=None): return StringIO(self.get_file_text(file_id)) def get_file_size(self, file_id): """See Tree.get_file_size""" - return self.inventory[file_id].text_size + inv, inv_file_id = self._unpack_file_id(file_id) + return inv[inv_file_id].text_size def get_file_text(self, file_id, path=None): _, content = list(self.iter_files_bytes([(file_id, None)]))[0] return ''.join(content) def get_reference_revision(self, file_id, path=None): - return self.inventory[file_id].reference_revision + inv, inv_file_id = self._unpack_file_id(file_id) + return inv[inv_file_id].reference_revision def iter_files_bytes(self, desired_files): """See Tree.iter_files_bytes. @@ -1916,13 +1936,20 @@ """Return the revision id for this tree.""" return self._revision_id - def _get_inventory(self): + def _get_root_inventory(self): if self._inventory is not None: return self._inventory self._must_be_locked() self._generate_inventory() return self._inventory + root_inventory = property(_get_root_inventory, + doc="Inventory of this Tree") + + @deprecated_method(deprecated_in((2, 5, 0))) + def _get_inventory(self): + return self.root_inventory + inventory = property(_get_inventory, doc="Inventory of this Tree") @@ -1946,10 +1973,10 @@ def path_content_summary(self, path): """See Tree.path_content_summary.""" - id = self.inventory.path2id(path) - if id is None: + inv, inv_file_id = self._path2inv_file_id(path) + if inv_file_id is None: return ('missing', None, None, None) - entry = self._inventory[id] + entry = inv[inv_file_id] kind = entry.kind if kind == 'file': return (kind, entry.text_size, entry.executable, entry.text_sha1) @@ -1959,7 +1986,8 @@ return (kind, None, None, None) def is_executable(self, file_id, path=None): - ie = self.inventory[file_id] + inv, inv_file_id = self._unpack_file_id(file_id) + ie = inv[inv_file_id] if ie.kind != "file": return False return ie.executable @@ -1970,14 +1998,15 @@ def list_files(self, include_root=False, from_dir=None, recursive=True): # We use a standard implementation, because DirStateRevisionTree is # dealing with one of the parents of the current state - inv = self._get_inventory() if from_dir is None: + inv = self.root_inventory from_dir_id = None else: - from_dir_id = inv.path2id(from_dir) + inv, from_dir_id = self._path2inv_file_id(from_dir) if from_dir_id is None: # Directory not versioned return + # FIXME: Support nested trees entries = inv.iter_entries(from_dir=from_dir_id, recursive=recursive) if inv.root is not None and not include_root and from_dir is None: entries.next() @@ -2005,6 +2034,10 @@ def path2id(self, path): """Return the id for path in this tree.""" # lookup by path: faster than splitting and walking the ivnentory. + if isinstance(path, list): + if path == []: + path = [""] + path = osutils.pathjoin(*path) entry = self._get_entry(path=path) if entry == (None, None): return None @@ -2033,7 +2066,7 @@ # So for now, we just build up the parent inventory, and extract # it the same way RevisionTree does. _directory = 'directory' - inv = self._get_inventory() + inv = self._get_root_inventory() top_id = inv.path2id(prefix) if top_id is None: pending = [] diff -Nru bzr-2.5.0/bzrlib/workingtree.py bzr-2.6.0~beta1/bzrlib/workingtree.py --- bzr-2.5.0/bzrlib/workingtree.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/workingtree.py 2012-03-15 10:00:24.000000000 +0000 @@ -261,6 +261,14 @@ def supports_views(self): return self.views.supports_views() + def get_config_stack(self): + """Retrieve the config stack for this tree. + + :return: A ``bzrlib.config.Stack`` + """ + # For the moment, just provide the branch config stack. + return self.branch.get_config_stack() + @staticmethod def open(path=None, _unsupported=False): """Open an existing working tree at path. @@ -379,10 +387,6 @@ list_current=list_current) return [tr for tr in iterator if tr is not None] - def all_file_ids(self): - """See Tree.iter_all_file_ids""" - raise NotImplementedError(self.all_file_ids) - def __repr__(self): return "<%s of %s>" % (self.__class__.__name__, getattr(self, 'basedir', None)) @@ -1946,10 +1950,6 @@ if entry.parent_id == orig_root_id: entry.parent_id = inv.root.file_id - def all_file_ids(self): - """See Tree.iter_all_file_ids""" - return set(self.inventory) - @needs_tree_write_lock def set_parent_trees(self, parents_list, allow_leftmost_as_ghost=False): """See MutableTree.set_parent_trees.""" @@ -1974,7 +1974,7 @@ # parent tree from the repository. self._cache_basis_inventory(leftmost_parent_id) else: - inv = leftmost_parent_tree.inventory + inv = leftmost_parent_tree.root_inventory xml = self._create_basis_xml_from_inventory( leftmost_parent_id, inv) self._write_basis_inventory(xml) @@ -2077,28 +2077,28 @@ def has_id(self, file_id): # files that have been deleted are excluded - inv = self.inventory - if not inv.has_id(file_id): + inv, inv_file_id = self._unpack_file_id(file_id) + if not inv.has_id(inv_file_id): return False - path = inv.id2path(file_id) + path = inv.id2path(inv_file_id) return osutils.lexists(self.abspath(path)) def has_or_had_id(self, file_id): - if file_id == self.inventory.root.file_id: + if file_id == self.get_root_id(): return True - return self.inventory.has_id(file_id) + inv, inv_file_id = self._unpack_file_id(file_id) + return inv.has_id(inv_file_id) - @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0))) - def __iter__(self): + def all_file_ids(self): """Iterate through file_ids for this tree. file_ids are in a WorkingTree if they are in the working inventory and the working file exists. """ - inv = self._inventory - for path, ie in inv.iter_entries(): - if osutils.lexists(self.abspath(path)): - yield ie.file_id + ret = set() + for path, ie in self.iter_entries_by_dir(): + ret.add(ie.file_id) + return ret @needs_tree_write_lock def set_last_revision(self, new_revision): @@ -2160,7 +2160,7 @@ _mod_revision.NULL_REVISION) else: rt = self.branch.repository.revision_tree(revision_ids[0]) - self._write_inventory(rt.inventory) + self._write_inventory(rt.root_inventory) self.set_parent_ids(revision_ids) def flush(self): @@ -2178,7 +2178,7 @@ def get_file_mtime(self, file_id, path=None): """See Tree.get_file_mtime.""" if not path: - path = self.inventory.id2path(file_id) + path = self.id2path(file_id) try: return os.lstat(self.abspath(path)).st_mtime except OSError, e: @@ -2187,12 +2187,12 @@ raise def _is_executable_from_path_and_stat_from_basis(self, path, stat_result): - file_id = self.path2id(path) + inv, file_id = self._path2inv_file_id(path) if file_id is None: # For unversioned files on win32, we just assume they are not # executable return False - return self._inventory[file_id].executable + return inv[file_id].executable def _is_executable_from_path_and_stat_from_stat(self, path, stat_result): mode = stat_result.st_mode @@ -2200,7 +2200,8 @@ def is_executable(self, file_id, path=None): if not self._supports_executable(): - return self._inventory[file_id].executable + inv, inv_file_id = self._unpack_file_id(file_id) + return inv[inv_file_id].executable else: if not path: path = self.id2path(file_id) @@ -2220,7 +2221,8 @@ # should probably put it back with the previous ID. # the read and write working inventory should not occur in this # function - they should be part of lock_write and unlock. - inv = self.inventory + # FIXME: nested trees + inv = self.root_inventory for f, file_id, kind in zip(files, ids, kinds): if file_id is None: inv.add_path(f, kind=kind) @@ -2267,15 +2269,17 @@ parent_tree = self.branch.repository.revision_tree(parent_id) parent_tree.lock_read() try: - if not parent_tree.has_id(file_id): + try: + kind = parent_tree.kind(file_id) + except errors.NoSuchId: continue - ie = parent_tree.inventory[file_id] - if ie.kind != 'file': + if kind != 'file': # Note: this is slightly unnecessary, because symlinks and # directories have a "text" which is the empty text, and we # know that won't mess up annotations. But it seems cleaner continue - parent_text_key = (file_id, ie.revision) + parent_text_key = ( + file_id, parent_tree.get_file_revision(file_id)) if parent_text_key not in maybe_file_parent_keys: maybe_file_parent_keys.append(parent_text_key) finally: @@ -2335,7 +2339,7 @@ for s in _mod_rio.RioReader(hashfile): # RioReader reads in Unicode, so convert file_ids back to utf8 file_id = osutils.safe_file_id(s.get("file_id"), warn=False) - if not self.inventory.has_id(file_id): + if not self.has_id(file_id): continue text_hash = s.get("hash") if text_hash == self.get_file_sha1(file_id): @@ -2371,12 +2375,12 @@ other_tree.lock_tree_write() try: new_parents = other_tree.get_parent_ids() - other_root = other_tree.inventory.root + other_root = other_tree.root_inventory.root other_root.parent_id = new_root_parent other_root.name = osutils.basename(other_tree_path) - self.inventory.add(other_root) - add_children(self.inventory, other_root) - self._write_inventory(self.inventory) + self.root_inventory.add(other_root) + add_children(self.root_inventory, other_root) + self._write_inventory(self.root_inventory) # normally we don't want to fetch whole repositories, but i think # here we really do want to consolidate the whole thing. for parent_id in other_tree.get_parent_ids(): @@ -2425,7 +2429,8 @@ tree_bzrdir = branch_bzrdir wt = tree_bzrdir.create_workingtree(_mod_revision.NULL_REVISION) wt.set_parent_ids(self.get_parent_ids()) - my_inv = self.inventory + # FIXME: Support nested trees + my_inv = self.root_inventory child_inv = inventory.Inventory(root_id=None) new_root = my_inv[file_id] my_inv.remove_recursive_id(file_id) @@ -2451,9 +2456,8 @@ if not self.is_locked(): raise errors.ObjectNotLocked(self) - inv = self.inventory if from_dir is None and include_root is True: - yield ('', 'V', 'directory', inv.root.file_id, inv.root) + yield ('', 'V', 'directory', self.get_root_id(), self.root_inventory.root) # Convert these into local objects to save lookup times pathjoin = osutils.pathjoin file_kind = self._kind @@ -2466,12 +2470,13 @@ # directory file_id, relative path, absolute path, reverse sorted children if from_dir is not None: - from_dir_id = inv.path2id(from_dir) + inv, from_dir_id = self._path2inv_file_id(from_dir) if from_dir_id is None: # Directory not versioned return from_dir_abspath = pathjoin(self.basedir, from_dir) else: + inv = self.root_inventory from_dir_id = inv.root.file_id from_dir_abspath = self.basedir children = os.listdir(from_dir_abspath) @@ -2600,13 +2605,14 @@ rename_entries = [] rename_tuples = [] + invs_to_write = set() + # check for deprecated use of signature if to_dir is None: raise TypeError('You must supply a target directory') # check destination directory if isinstance(from_paths, basestring): raise ValueError() - inv = self.inventory to_abs = self.abspath(to_dir) if not isdir(to_abs): raise errors.BzrMoveFailedError('',to_dir, @@ -2614,12 +2620,12 @@ if not self.has_filename(to_dir): raise errors.BzrMoveFailedError('',to_dir, errors.NotInWorkingDirectory(to_dir)) - to_dir_id = inv.path2id(to_dir) + to_inv, to_dir_id = self._path2inv_file_id(to_dir) if to_dir_id is None: raise errors.BzrMoveFailedError('',to_dir, errors.NotVersionedError(path=to_dir)) - to_dir_ie = inv[to_dir_id] + to_dir_ie = to_inv[to_dir_id] if to_dir_ie.kind != 'directory': raise errors.BzrMoveFailedError('',to_dir, errors.NotADirectory(to_abs)) @@ -2627,12 +2633,12 @@ # create rename entries and tuples for from_rel in from_paths: from_tail = splitpath(from_rel)[-1] - from_id = inv.path2id(from_rel) + from_inv, from_id = self._path2inv_file_id(from_rel) if from_id is None: raise errors.BzrMoveFailedError(from_rel,to_dir, errors.NotVersionedError(path=from_rel)) - from_entry = inv[from_id] + from_entry = from_inv[from_id] from_parent_id = from_entry.parent_id to_rel = pathjoin(to_dir, from_tail) rename_entry = InventoryWorkingTree._RenameEntry( @@ -2657,7 +2663,8 @@ # restore the inventory on error self._inventory_is_modified = original_modified raise - self._write_inventory(inv) + #FIXME: Should potentially also write the from_invs + self._write_inventory(to_inv) return rename_tuples @needs_tree_write_lock @@ -2683,12 +2690,11 @@ Everything else results in an error. """ - inv = self.inventory rename_entries = [] # create rename entries and tuples from_tail = splitpath(from_rel)[-1] - from_id = inv.path2id(from_rel) + from_inv, from_id = self._path2inv_file_id(from_rel) if from_id is None: # if file is missing in the inventory maybe it's in the basis_tree basis_tree = self.branch.basis_tree() @@ -2697,13 +2703,14 @@ raise errors.BzrRenameFailedError(from_rel,to_rel, errors.NotVersionedError(path=from_rel)) # put entry back in the inventory so we can rename it - from_entry = basis_tree.inventory[from_id].copy() - inv.add(from_entry) + from_entry = basis_tree.root_inventory[from_id].copy() + from_inv.add(from_entry) else: - from_entry = inv[from_id] + from_inv, from_inv_id = self._unpack_file_id(from_id) + from_entry = from_inv[from_inv_id] from_parent_id = from_entry.parent_id to_dir, to_tail = os.path.split(to_rel) - to_dir_id = inv.path2id(to_dir) + to_inv, to_dir_id = self._path2inv_file_id(to_dir) rename_entry = InventoryWorkingTree._RenameEntry(from_rel=from_rel, from_id=from_id, from_tail=from_tail, @@ -2731,7 +2738,7 @@ from_id, from_rel, to_rel, to_dir, to_dir_id) self._move(rename_entries) - self._write_inventory(inv) + self._write_inventory(to_inv) class _RenameEntry(object): def __init__(self, from_rel, from_id, from_tail, from_parent_id, @@ -2753,7 +2760,8 @@ Also does basic plausability tests. """ - inv = self.inventory + # FIXME: Handling of nested trees + inv = self.root_inventory for rename_entry in rename_entries: # store to local variables for easier reference @@ -2817,7 +2825,6 @@ Depending on the value of the flag 'only_change_inv', the file will be moved on the file system or not. """ - inv = self.inventory moved = [] for entry in rename_entries: @@ -2830,7 +2837,6 @@ def _rollback_move(self, moved): """Try to rollback a previous move in case of an filesystem error.""" - inv = self.inventory for entry in moved: try: self._move_entry(WorkingTree._RenameEntry( @@ -2845,7 +2851,7 @@ " Error message is: %s" % e) def _move_entry(self, entry): - inv = self.inventory + inv = self.root_inventory from_rel_abs = self.abspath(entry.from_rel) to_rel_abs = self.abspath(entry.to_rel) if from_rel_abs == to_rel_abs: @@ -2892,7 +2898,8 @@ def stored_kind(self, file_id): """See Tree.stored_kind""" - return self.inventory[file_id].kind + inv, inv_file_id = self._unpack_file_id(file_id) + return inv[inv_file_id].kind def extras(self): """Yield all unversioned files in this WorkingTree. @@ -2905,7 +2912,9 @@ This is the same order used by 'osutils.walkdirs'. """ ## TODO: Work from given directory downwards - for path, dir_entry in self.inventory.directories(): + for path, dir_entry in self.iter_entries_by_dir(): + if dir_entry.kind != 'directory': + continue # mutter("search for unknowns in %r", path) dirabs = self.abspath(path) if not isdir(dirabs): @@ -2948,8 +2957,7 @@ """ _directory = 'directory' # get the root in the inventory - inv = self.inventory - top_id = inv.path2id(prefix) + inv, top_id = self._path2inv_file_id(prefix) if top_id is None: pending = [] else: @@ -3070,13 +3078,6 @@ def __ne__(self, other): return not (self == other) - @classmethod - @symbol_versioning.deprecated_method( - symbol_versioning.deprecated_in((2, 4, 0))) - def get_default_format(klass): - """Return the current default format.""" - return format_registry.get_default() - def get_format_description(self): """Return the short description for this format.""" raise NotImplementedError(self.get_format_description) @@ -3098,42 +3099,6 @@ """True if this format supports stored views.""" return False - @classmethod - @symbol_versioning.deprecated_method( - symbol_versioning.deprecated_in((2, 4, 0))) - def register_format(klass, format): - format_registry.register(format) - - @classmethod - @symbol_versioning.deprecated_method( - symbol_versioning.deprecated_in((2, 4, 0))) - def register_extra_format(klass, format): - format_registry.register_extra(format) - - @classmethod - @symbol_versioning.deprecated_method( - symbol_versioning.deprecated_in((2, 4, 0))) - def unregister_extra_format(klass, format): - format_registry.unregister_extra(format) - - @classmethod - @symbol_versioning.deprecated_method( - symbol_versioning.deprecated_in((2, 4, 0))) - def get_formats(klass): - return format_registry._get_all() - - @classmethod - @symbol_versioning.deprecated_method( - symbol_versioning.deprecated_in((2, 4, 0))) - def set_default_format(klass, format): - format_registry.set_default(format) - - @classmethod - @symbol_versioning.deprecated_method( - symbol_versioning.deprecated_in((2, 4, 0))) - def unregister_format(klass, format): - format_registry.remove(format) - def get_controldir_for_branch(self): """Get the control directory format for creating branches. diff -Nru bzr-2.5.0/bzrlib/xml7.py bzr-2.6.0~beta1/bzrlib/xml7.py --- bzr-2.5.0/bzrlib/xml7.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/xml7.py 2012-03-15 10:00:24.000000000 +0000 @@ -30,20 +30,5 @@ supported_kinds = set(['file', 'directory', 'symlink', 'tree-reference']) format_num = '7' - def _unpack_entry(self, elt, entry_cache=None, return_from_cache=False): - kind = elt.tag - if not kind in self.supported_kinds: - raise AssertionError('unsupported entry kind %s' % kind) - if kind == 'tree-reference': - file_id = elt.attrib['file_id'] - name = elt.attrib['name'] - parent_id = elt.attrib['parent_id'] - revision = elt.get('revision') - reference_revision = elt.get('reference_revision') - return inventory.TreeReference(file_id, name, parent_id, revision, - reference_revision) - else: - return xml6.Serializer_v6._unpack_entry(self, elt, - entry_cache=entry_cache, return_from_cache=return_from_cache) serializer_v7 = Serializer_v7() diff -Nru bzr-2.5.0/bzrlib/xml_serializer.py bzr-2.6.0~beta1/bzrlib/xml_serializer.py --- bzr-2.5.0/bzrlib/xml_serializer.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/bzrlib/xml_serializer.py 2012-03-15 10:00:24.000000000 +0000 @@ -309,6 +309,14 @@ elt_get('name'), parent_id) ie.symlink_target = elt_get('symlink_target') + elif kind == 'tree-reference': + file_id = elt.attrib['file_id'] + name = elt.attrib['name'] + parent_id = elt.attrib['parent_id'] + revision = elt.get('revision') + reference_revision = elt.get('reference_revision') + ie = inventory.TreeReference(file_id, name, parent_id, revision, + reference_revision) else: raise errors.UnsupportedInventoryKind(kind) ie.revision = revision diff -Nru bzr-2.5.0/contrib/debian/default bzr-2.6.0~beta1/contrib/debian/default --- bzr-2.5.0/contrib/debian/default 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/contrib/debian/default 2012-03-15 10:00:24.000000000 +0000 @@ -16,5 +16,5 @@ # Other arguments # Add --allow-writes for RW access -# Example config listens on localhost -DAEMON_ARGS="--port=127.0.0.1:4155" +# Example config listens on localhost and default port +DAEMON_ARGS="--listen=127.0.0.1" diff -Nru bzr-2.5.0/debian/bzr-builddeb.conf bzr-2.6.0~beta1/debian/bzr-builddeb.conf --- bzr-2.5.0/debian/bzr-builddeb.conf 2012-04-04 00:16:35.000000000 +0000 +++ bzr-2.6.0~beta1/debian/bzr-builddeb.conf 2012-06-26 13:04:18.000000000 +0000 @@ -1,3 +1,3 @@ [BUILDDEB] -upstream-branch = lp:bzr/2.5 +upstream-branch = lp:bzr export-upstream-revision = tag:bzr-$UPSTREAM_VERSION diff -Nru bzr-2.5.0/debian/changelog bzr-2.6.0~beta1/debian/changelog --- bzr-2.5.0/debian/changelog 2012-04-04 00:17:36.000000000 +0000 +++ bzr-2.6.0~beta1/debian/changelog 2012-06-26 13:05:15.000000000 +0000 @@ -1,3 +1,21 @@ +bzr (2.6.0~beta1-0ubuntu1) quantal; urgency=low + + * New upstream release. + + Fixes handling of colocated branches in `bzr rmbranch`. LP: #920653 + + rmbranch now refuses to remove active branch. LP: #922953 + + Connecting with HTTPS via HTTP correctly uses host name of destination + rather than that of proxy. LP: #944696 + + No longer requires tty when GPG signing commits. LP: #847388 + + Fixes unicode erorrs when translated progress task messages + contain non-ascii text. LP: #966934 + + Fixes display of help for configuration options that overlap + with other topics. LP: #941672 + + Drop 06_spurious_test_failure: applied upstream. LP: #874153 + + Drop 05_allow_no_slash_controldirs: applied upstream. + * Drop unnecessary build conflicts with zlib. + + -- Jelmer Vernooij Fri, 08 Jun 2012 12:59:27 +0200 + bzr (2.5.0-2ubuntu2) precise; urgency=low * Add 06_spurious_test_failure: mark flapping test as known diff -Nru bzr-2.5.0/debian/control bzr-2.6.0~beta1/debian/control --- bzr-2.5.0/debian/control 2012-04-04 00:16:35.000000000 +0000 +++ bzr-2.6.0~beta1/debian/control 2012-06-26 13:04:18.000000000 +0000 @@ -7,7 +7,6 @@ Wouter van Heyst , Reinhard Tartler , Jelmer Vernooij -Build-Conflicts: python-gpgme, python-sphinx, zlib1g (>= 1:1.2.3.5) Build-Depends: cython-dbg | python-pyrex, ca-certificates, debhelper (>> 8.1.0~), diff -Nru bzr-2.5.0/debian/patches/04_apport_bytesio bzr-2.6.0~beta1/debian/patches/04_apport_bytesio --- bzr-2.5.0/debian/patches/04_apport_bytesio 1970-01-01 00:00:00.000000000 +0000 +++ bzr-2.6.0~beta1/debian/patches/04_apport_bytesio 2012-06-26 13:04:18.000000000 +0000 @@ -0,0 +1,31 @@ +=== modified file 'bzrlib/tests/test_crash.py' +--- old/bzrlib/tests/test_crash.py 2011-04-18 03:45:05 +0000 ++++ new/bzrlib/tests/test_crash.py 2012-06-08 13:25:35 +0000 +@@ -17,7 +17,7 @@ + + import doctest + import os +-from StringIO import StringIO ++from io import BytesIO + import sys + + from bzrlib import ( +@@ -46,7 +46,7 @@ + 'plugin_warnings', + {'example': ['Failed to load plugin foo']}) + +- stderr = StringIO() ++ stderr = BytesIO() + + try: + raise AssertionError("my error") +@@ -95,7 +95,7 @@ + + def test_report_bug_legacy(self): + self.setup_fake_plugins() +- err_file = StringIO() ++ err_file = BytesIO() + try: + raise AssertionError("my error") + except AssertionError, e: + diff -Nru bzr-2.5.0/debian/patches/05_allow_no_slash_controldirs bzr-2.6.0~beta1/debian/patches/05_allow_no_slash_controldirs --- bzr-2.5.0/debian/patches/05_allow_no_slash_controldirs 2012-04-04 00:16:45.000000000 +0000 +++ bzr-2.6.0~beta1/debian/patches/05_allow_no_slash_controldirs 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -Description: Allow creating branches with a slash in their name -Author: Jelmer Vernooij -Status: submitted upstream - -=== modified file 'bzrlib/tests/per_controldir_colo/test_supported.py' ---- a/bzrlib/tests/per_controldir_colo/test_supported.py 2012-02-19 14:34:22 +0000 -+++ b/bzrlib/tests/per_controldir_colo/test_supported.py 2012-03-05 23:34:55 +0000 -@@ -137,7 +137,11 @@ - - def test_branch_name_with_slash(self): - repo = self.make_repository('branch-1') -- target_branch = repo.bzrdir.create_branch(name='foo/bar') -+ try: -+ target_branch = repo.bzrdir.create_branch(name='foo/bar') -+ except errors.InvalidBranchName: -+ raise tests.TestNotApplicable( -+ "format does not support branches with / in their name") - self.assertEqual(['foo/bar'], repo.bzrdir.get_branches().keys()) - self.assertEqual( - target_branch.base, repo.bzrdir.open_branch(name='foo/bar').base) - -=== modified file 'bzrlib/errors.py' ---- a/bzrlib/errors.py 2012-02-02 12:10:04 +0000 -+++ b/bzrlib/errors.py 2012-03-05 23:50:00 +0000 -@@ -710,6 +710,15 @@ - _fmt = 'Already a branch: "%(path)s".' - - -+class InvalidBranchName(PathError): -+ -+ _fmt = "Invalid branch name: %(name)s" -+ -+ def __init__(self, name): -+ BzrError.__init__(self) -+ self.name = name -+ -+ - class ParentBranchExists(AlreadyBranchError): - - _fmt = 'Parent branch already exists: "%(path)s".' - diff -Nru bzr-2.5.0/debian/patches/05_tcp_serve_localhost bzr-2.6.0~beta1/debian/patches/05_tcp_serve_localhost --- bzr-2.5.0/debian/patches/05_tcp_serve_localhost 1970-01-01 00:00:00.000000000 +0000 +++ bzr-2.6.0~beta1/debian/patches/05_tcp_serve_localhost 2012-06-26 13:04:18.000000000 +0000 @@ -0,0 +1,13 @@ +=== modified file 'bzrlib/tests/blackbox/test_serve.py' +--- old/bzrlib/tests/blackbox/test_serve.py 2012-06-08 11:23:19 +0000 ++++ new/bzrlib/tests/blackbox/test_serve.py 2012-06-11 14:10:32 +0000 +@@ -367,7 +367,7 @@ + # Connect to the TCP server and issue some requests and see what comes + # back. + client_medium = medium.SmartTCPClientMedium( +- '127.0.0.1', self.tcp_server.port, ++ 'localhost', self.tcp_server.port, + 'bzr://localhost:%d/' % (self.tcp_server.port,)) + smart_client = client._SmartClient(client_medium) + resp = smart_client.call('mkdir', 'foo', '') + diff -Nru bzr-2.5.0/debian/patches/06_spurious_test_failure bzr-2.6.0~beta1/debian/patches/06_spurious_test_failure --- bzr-2.5.0/debian/patches/06_spurious_test_failure 2012-04-04 00:16:45.000000000 +0000 +++ bzr-2.6.0~beta1/debian/patches/06_spurious_test_failure 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -Description: Mark randomly failing test in per_interrepository using knownFailure when ConnectionReset is raised -Origin: commit, revision id: martin.packman@canonical.com-20120403144507-42m0u0k7q64kunby -Author: Martin Packman -Bug: https://launchpad.net/bugs/874153 -Last-Update: 2012-04-03 -X-Bzr-Revision-Id: martin.packman@canonical.com-20120403144507-42m0u0k7q64kunby - -=== modified file 'bzrlib/tests/per_interrepository/test_fetch.py' ---- old/bzrlib/tests/per_interrepository/test_fetch.py 2011-12-05 14:12:23 +0000 -+++ new/bzrlib/tests/per_interrepository/test_fetch.py 2012-04-03 14:45:07 +0000 -@@ -179,7 +179,10 @@ - def test_fetch_parent_inventories_at_stacking_boundary_smart_old(self): - self.setup_smart_server_with_call_log() - self.disable_verb('Repository.insert_stream_1.19') -- self.test_fetch_parent_inventories_at_stacking_boundary() -+ try: -+ self.test_fetch_parent_inventories_at_stacking_boundary() -+ except errors.ConnectionReset: -+ self.knownFailure("Random spurious failure, see bug 874153") - - def test_fetch_parent_inventories_at_stacking_boundary(self): - """Fetch to a stacked branch copies inventories for parents of - diff -Nru bzr-2.5.0/debian/patches/series bzr-2.6.0~beta1/debian/patches/series --- bzr-2.5.0/debian/patches/series 2012-04-04 00:16:45.000000000 +0000 +++ bzr-2.6.0~beta1/debian/patches/series 2012-06-26 13:04:18.000000000 +0000 @@ -1,5 +1,5 @@ 01_selftest_package 02_external_configobj 03_spurious_test_failure -05_allow_no_slash_controldirs -06_spurious_test_failure +04_apport_bytesio +05_tcp_serve_localhost diff -Nru bzr-2.5.0/doc/developers/configuration.txt bzr-2.6.0~beta1/doc/developers/configuration.txt --- bzr-2.5.0/doc/developers/configuration.txt 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/developers/configuration.txt 2012-03-15 10:00:24.000000000 +0000 @@ -213,6 +213,10 @@ If you need a list value, you should use ``ListOption`` instead. +For options that take their values from a ``Registry`` object, +``RegistryOption`` can be used. This will automatically take care of +looking up the specified values in the dictionary and documenting the +possible values in help. Sections -------- diff -Nru bzr-2.5.0/doc/developers/conf.py bzr-2.6.0~beta1/doc/developers/conf.py --- bzr-2.5.0/doc/developers/conf.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/developers/conf.py 2012-03-15 10:00:24.000000000 +0000 @@ -33,17 +33,27 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('HACKING', 'bzr-en-developer-guide.tex', u'Bazaar Developer Guide', +bzr_documents = [ + ('HACKING', 'bzr-en-developer-guide', u'Bazaar Developer Guide', u'Bazaar Developers', 'manual'), - ('testing', 'bzr-en-testing-guide.tex', u'Bazaar Testing Guide', + ('testing', 'bzr-en-testing-guide', u'Bazaar Testing Guide', u'Bazaar Developers', 'manual'), - ('overview', 'bzr-en-architecture-overview.tex', u'Bazaar Architecture Overview', + ('overview', 'bzr-en-architecture-overview', u'Bazaar Architecture Overview', u'Bazaar Developers', 'howto'), - ('integration', 'bzr-en-integration-guide.tex', u'Bazaar Integration Guide', + ('integration', 'bzr-en-integration-guide', u'Bazaar Integration Guide', u'Bazaar Developers', 'howto'), ] +latex_documents = [ + (start, target+'.tex', title, author, doc_class) + for start, target, title, author, doc_class in bzr_documents + ] + +texinfo_documents = [ + (start, target, title, author, doc_class) + for start, target, title, author, doc_class in bzr_documents + ] + # List of documents that shouldn't be included in the build. # Note: Maybe some of them *ought* to be linked in somewhere? unused_docs = [ diff -Nru bzr-2.5.0/doc/developers/HACKING.txt bzr-2.6.0~beta1/doc/developers/HACKING.txt --- bzr-2.5.0/doc/developers/HACKING.txt 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/developers/HACKING.txt 2012-03-15 10:00:24.000000000 +0000 @@ -294,7 +294,7 @@ Automatically-generated API reference information is available at -. +. See also the `Bazaar Architectural Overview `_. diff -Nru bzr-2.5.0/doc/developers/index-plain.txt bzr-2.6.0~beta1/doc/developers/index-plain.txt --- bzr-2.5.0/doc/developers/index-plain.txt 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/developers/index-plain.txt 2012-03-15 10:00:24.000000000 +0000 @@ -11,7 +11,7 @@ * `Architectural Overview `_ |--| describes some of the most important classes and concepts. -* `bzrlib API reference `_ +* `bzrlib API reference `_ (external link) |--| automatically generated API reference information diff -Nru bzr-2.5.0/doc/developers/index.txt bzr-2.6.0~beta1/doc/developers/index.txt --- bzr-2.5.0/doc/developers/index.txt 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/developers/index.txt 2012-03-15 10:00:24.000000000 +0000 @@ -63,7 +63,7 @@ * `Writing plugins for Bazaar `_ (web link) -* `bzrlib API reference `_ +* `bzrlib API reference `_ (web link) diff -Nru bzr-2.5.0/doc/developers/overview.txt bzr-2.6.0~beta1/doc/developers/overview.txt --- bzr-2.5.0/doc/developers/overview.txt 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/developers/overview.txt 2012-03-15 10:00:24.000000000 +0000 @@ -31,13 +31,69 @@ :Revision IDs: The unique identifier of a single revision, such as ``pqm@pqm.ubuntu.com-20110201161347-ao76mv267gc1b5v2`` -:File IDs: The unique identifier of a single file. It is allocated when - a user does ``bzr add`` and is unchanged by renames. +:File IDs: The unique identifier of a single file. By convention, in the bzrlib API, parameters of methods that are expected to be IDs (as opposed to keys, revision numbers, or some other handle) will end in ``id``, e.g. ``revid`` or ``file_id``. +Ids may be stored directly or they can be inferred from other +data. Native Bazaar formats store ids directly; foreign VCS +support usually generates them somehow. For example, the +Git commit with SHA ``fb235a3be6372e40ff7f7ebbcd7905a08cb04444`` +is referred to with the revision ID +``git-v1:fb235a3be6372e40ff7f7ebbcd7905a08cb04444``. IDs are expected +to be persistent + +File ids +-------- + +File ids are unique identifiers for files. There are three slightly different +categories of file ids. + +Tree file ids +~~~~~~~~~~~~~ + +Tree file ids are used in the ``Tree`` API and can either be UTF-8 encoded +bytestrings or tuples of UTF-8 encoded bytestrings. Plain bytestrings +are considered to be the equivalent of a 1-tuple containing that +bytestring. + +Tree file ids should be considered valid only for a specific tree context. +Note that this is a stricter interpretation than what the current bzr +format implementation provides - its file ids are persistent across runs +and across revisions. + +For some formats (most notably bzr's own formats) it's possible for the +implementation to specify the file id to use. In other case the tree +mandates a specific file id. + +Inventory file ids +~~~~~~~~~~~~~~~~~~ + +Inventories are specific to the bzr native format and are the main layer +below the ``Tree`` implementation of bzr. File ids in inventories can +only be UTF-8 encoded bytestrings. A single Tree object can be associated +with multiple inventories if there are nested trees. + +Tree file ids for bzr formats are a tuple of inventory file ids for the file +in question. Each non-last item in the tuple refers to the tree +reference of an inner tree. The last item in the tuple refers to the +actual file. This means that lookups of file ids doesn't scale with +the number of nested trees. + +Inventory file ids are only relevant for native Bazaar formats; foreign +formats don't use inventories. + +Transform ids +~~~~~~~~~~~~~ + +Transform ids are used during tree transform operations (used by e.g. merge). +The same transform id is expected to be used for two instances of the +same file. At the moment transform ids are directly derived from file +ids, but in the future they could be based on other data too (e.g. +automatic rename detection or format-specific rules). + Keys ==== @@ -107,6 +163,17 @@ * `Developer guide to bzrlib transports `_ * API docs for ``bzrlib.transport.Transport`` +Control directory +================= + +Each control directory (such as ".bzr/") can contain zero or one +repositories, zero or one working trees and zero or more branches. + +The ``BzrDir`` class is the ``ControlDir`` implementation that is +responsible for the ".bzr/" directory and its implementation. Plugins +that provide support for other version control systems can provide +other subclasses of ``ControlDir``. + Tree ==== @@ -121,6 +188,20 @@ Trees have an inventory and parents (an ordered list of zero or more revision IDs). +The implementation of ``Tree`` for Bazaar's own formats is based around +``Inventory`` objects which describe the shape of the tree. Each tree has +at least one inventory associated with it, which is available as the +``root_inventory`` attribute on tree. The tree can have more inventories +associated with it if there are references to other trees in it. These +references are indicated with ``tree-reference`` inventory entry at the +point where the other tree is nested. The tree reference entry contains +sufficient information for looking up the inventory associated with the +nested tree. There can be multiple layers of nesting. + +Not each ``Tree`` implementation will necessarily have an associated +``root_inventory``, as not all implementations of ``Tree`` are based +around inventories (most notably, implementations of foreign VCS file +formats). WorkingTree =========== @@ -141,7 +222,6 @@ Dependencies: * a Branch -* an MutableInventory * local access to the working tree diff -Nru bzr-2.5.0/doc/developers/releasing.txt bzr-2.6.0~beta1/doc/developers/releasing.txt --- bzr-2.5.0/doc/developers/releasing.txt 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/developers/releasing.txt 2012-03-15 10:00:24.000000000 +0000 @@ -138,6 +138,7 @@ cp template.txt bzr-x.y.txt # e.g. bzr-2.6.txt bzr add bzr-x.y.txt +#. Update ``doc/en/index.txt`` to point to the new whats-new file. At the start of a release cycle =============================== @@ -207,8 +208,8 @@ found at . #. Merge into your branch all previous stable series fixes that haven't been - merged yet. For example, if you're releasing 2.5.x, make sure the fixes - on 2.4, 2.3, etc have already been merged up:: + merged yet. For example, if you're releasing 2.6.x, make sure the fixes + on 2.5, 2.4, 2.3, etc have already been merged up:: bzr merge lp:bzr/2.4 @@ -225,33 +226,42 @@ For beta releases use:: - version_info = (2, 1, 0, 'beta', SERIAL) + version_info = (2, 6, 0, 'beta', SERIAL) - For instance 2.1b1:: + For instance 2.6b1:: - version_info = (2, 1, 0, 'beta', 1) + version_info = (2, 6, 0, 'beta', 1) For stable releases use:: - version_info = (2, 1, 2, 'final', 0) + version_info = (2, 6, 0, 'final', 0) #. Update the ``./doc/en/release-notes/`` section for this release. Check that all news entries related to this release have been added in - the right section. For example, if you're releasing 2.5b2, the following - command should display a a single chuk diff for the 2.5b2 release:: + the right section. For example, if you're releasing 2.6b1, the following + command should display a a single chuk diff for the 2.6b1 release:: - bzr diff -rbzr-2.5b1.. doc/en/release-notes/bzr-2.5.txt + bzr diff -rbzr-2.6b1.. doc/en/release-notes/bzr-2.6.txt Fill out the date and a description of the release under the existing header (the diff above will help you summarizing). If there isn't one, follow the instructions above for using the ``release-template.txt`` file and remind people that they should document their changes there ;) - See *2.1.1* or similar for an example of what this looks like. + See *2.6b1* or similar for an example of what this looks like. #. Add or check the summary of the release into the "What's New" document. + If this is the first release in a new series make sure to update the + introduction mentioning: + + * the date of this first release, + * until when the series is expected to be supported. + + Looking at ``bzr annotate`` for previous series should give you the right + hints. The ``doc/en/_templates/index.html`` file should also be updated. + #. To check that all bugs mentioned in the release notes are actually marked as closed in Launchpad, you can run ``tools/check-newsbugs.py``:: @@ -270,9 +280,9 @@ BZR_PLUGIN_PATH=-site make po/bzr.pot - This is especially important for the final beta release which is - when translations are frozen and translators are requested to make - the translations. + This is especially important for the final beta release which is when + translations are frozen and translators are requested (see `The final + beta - branching and translations`_) to make the translations. #. For stable releases update the translations:: @@ -352,7 +362,7 @@ #. Tag the new release:: - bzr tag bzr-2.3.1 + bzr tag bzr-2.6.0 #. Push those changes to a bzr branch that is public and accessible on the Internet. PQM will pull from this branch when it attempts to merge your @@ -360,7 +370,7 @@ release branch:: bzr push - bzr pqm-submit -m "(vila) Release 2.3.1 (Vincent Ladeuil)" + bzr pqm-submit -m "(vila) Release 2.6.0 (Vincent Ladeuil)" Note that ``bzr push`` should mention updating one tag (which you just created). If it doesn't, double-check that you created (and pushed) this @@ -450,7 +460,7 @@ the *last* beta for a given ``x.y`` series (from trunk aka lp:bzr), you need to setup *two* branches for the next cycle: -#. ``lp:bzr`` needs to be opened for the next *series* ``x.(y+1)`` +#. ``lp:bzr`` needs to be opened for the next *series* ``x.(y+1)``. #. ``lp:bzr/x.y`` needs to be opened for the next *release* ``x.y.0`` in the series. Since this is first real use of ``lp:bzr/x.y``, this is also the @@ -466,19 +476,23 @@ In a nutshell: -#. Create or update the ``x.y`` PQM branch based on whatever - revision you want to release - #. Open ``lp:bzr`` for ``x.(y+1)`` +#. Create or update the ``x.y`` PQM branch based on whatever revision you + want to release. Since it takes time to create the PQM branch for the new + series you should plan to get it created a few days before you need it + and seed it with the revision from trunk you want to base your release of + (ask a LOSA for pulling this revision from trunk and pushing it to the + series branch (``lp:bzr/x.y``) when you're ready). + #. Release ``x.y.0`` from ``lp:bzr/x.y`` #. Open ``lp:bzr/x.y`` for bug fixes -You also need to ensure Launchpad is set up to import/export -translations for the new branch and inform translators. +You also need to ensure Launchpad is set up to import/export translations +for the new branch and inform translators. -#. Push a branch:: +#. Push the last beta release to a new branch:: bzr push lp:~bzr-core/bzr/bzr-translations-export-x.y @@ -513,7 +527,7 @@ control the process as tightly so guessing the date is not appropriate. For the final beta release include in your announcement a notice of - API and translation freezes nothing that public methods should not + API and translation freezes noting that public methods should not be removed or changed and strings should not be added or changed. #. Pause for a few days. @@ -523,7 +537,7 @@ ---------------------- There is normally a delay of a few days after the source freeze to allow -for binaries to be built on various platforms. Once they have been built, +for binaries to be built for various platforms. Once they have been built, we have a releasable product. The next step is to make it generally available to the world. @@ -534,10 +548,22 @@ pushed to this branch are refreshed by a cron job on escudero.) #. Check that the documentation for this release is available in - . It should be automatically build when the - branch is created, by a cron script ``update-bzr-docs`` on - ``escudero``. - + . It should be automatically build when + the branch is created, by a cron script ``update-bzr-docs`` on + ``escudero``. When the first release is created in a new series, a branch + needs to be created on escudero:: + + ssh escudero.canonical.com + sudo -u bzr-web -s + cd /srv/doc.bazaar.canonical.com/ + bzr branch http://bazaar.launchpad.net/~bzr-pqm/bzr/2.5 bzr.2.5 + + And the ``update-bzr-docs`` needs to refer to it. + + The ``lp:bzr-alldocs`` branch also needs to be updated when a new series + is introduced, see the ``README`` file there for more instructions + (looking at the branch history is also a good way to understand what + needs to be done and to document any policy changes). Announcing the release ---------------------- @@ -581,6 +607,8 @@ Feel free to tweak this to your taste. #. Make an announcement through + mentioning the milestone URL + so people get an easy access to details. #. Announce on http://freecode.com/projects/bazaar-vcs @@ -609,10 +637,6 @@ series, create these links again. Check all links when doing other kinds of release. - * Set direct download: When releasing a new stable release, this should - point to the corresponding launchpad page: - - #. Update ``_ -- this should be done for the stable and beta releases. diff -Nru bzr-2.5.0/doc/en/conf.py bzr-2.6.0~beta1/doc/en/conf.py --- bzr-2.5.0/doc/en/conf.py 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/en/conf.py 2012-03-15 10:00:24.000000000 +0000 @@ -47,35 +47,45 @@ # Output file base name for HTML help builder. htmlhelp_basename = 'bzr-%s' % (bzr_locale,) -# Grouping the document tree into LaTeX files. List of tuples +# Grouping the document tree into files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ +bzr_documents = [ # Manuals - ('user-guide/index', 'bzr-%s-user-guide.tex' % (bzr_locale,), + ('user-guide/index', 'bzr-%s-user-guide' % (bzr_locale,), bzr_title(u'Bazaar User Guide'), bzr_team, 'manual'), - ('user-reference/index', 'bzr-%s-user-reference.tex' % (bzr_locale,), + ('user-reference/index', 'bzr-%s-user-reference' % (bzr_locale,), bzr_title(u'Bazaar User Reference'), bzr_team, 'manual'), - ('release-notes/index', 'bzr-%s-release-notes.tex' % (bzr_locale,), + ('release-notes/index', 'bzr-%s-release-notes' % (bzr_locale,), bzr_title(u'Bazaar Release Notes'), bzr_team, 'manual'), - ('upgrade-guide/index', 'bzr-%s-upgrade-guide.tex' % (bzr_locale,), + ('upgrade-guide/index', 'bzr-%s-upgrade-guide' % (bzr_locale,), bzr_title(u'Bazaar Upgrade Guide'), bzr_team, 'manual'), - ('admin-guide/index', 'bzr-%s-admin-guide.tex' % (bzr_locale,), + ('admin-guide/index', 'bzr-%s-admin-guide' % (bzr_locale,), bzr_title(u"Bazaar System Administrator's Guide"), bzr_team, 'manual'), # Tutorials - ('mini-tutorial/index', 'bzr-%s-tutorial-mini.tex' % (bzr_locale,), + ('mini-tutorial/index', 'bzr-%s-tutorial-mini' % (bzr_locale,), bzr_title(u'Bazaar in five minutes'), bzr_team, 'howto'), - ('tutorials/tutorial', 'bzr-%s-tutorial.tex' % (bzr_locale,), + ('tutorials/tutorial', 'bzr-%s-tutorial' % (bzr_locale,), bzr_title(u'Bazaar Tutorial'), bzr_team, 'howto'), ('tutorials/using_bazaar_with_launchpad', - 'bzr-%s-tutorial-with-launchpad.tex' % (bzr_locale,), + 'bzr-%s-tutorial-with-launchpad' % (bzr_locale,), bzr_title(u'Using Bazaar With Launchpad'), bzr_team, 'howto'), ('tutorials/centralized_workflow', - 'bzr-%s-tutorial-centralized.tex' % (bzr_locale,), + 'bzr-%s-tutorial-centralized' % (bzr_locale,), bzr_title(u'Centralized Workflow Tutorial'), bzr_team, 'howto'), - ('whats-new/whats-new-in-2.1', 'bzr-%s-whats-new.tex' % (bzr_locale,), + ('whats-new/whats-new-in-2.1', 'bzr-%s-whats-new' % (bzr_locale,), bzr_title(u"What's New in Bazaar 2.1?"), bzr_team, 'howto'), ] +latex_documents = [ + (start, target+'.tex', title, author, doc_class) + for start, target, title, author, doc_class in bzr_documents + ] + +texinfo_documents = [ + (start, target, title, author, doc_class) + for start, target, title, author, doc_class in bzr_documents + ] + # List of documents that shouldn't be included in the build. unused_docs = [ # Subtopics that get included diff -Nru bzr-2.5.0/doc/en/index.txt bzr-2.6.0~beta1/doc/en/index.txt --- bzr-2.5.0/doc/en/index.txt 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/en/index.txt 2012-03-15 10:00:24.000000000 +0000 @@ -10,7 +10,7 @@ .. toctree:: :maxdepth: 1 - whats-new/whats-new-in-2.5 + whats-new/whats-new-in-2.6 user-guide/index tutorials/index quick-reference/index diff -Nru bzr-2.5.0/doc/en/Makefile bzr-2.6.0~beta1/doc/en/Makefile --- bzr-2.5.0/doc/en/Makefile 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/en/Makefile 2012-03-15 10:00:24.000000000 +0000 @@ -114,5 +114,8 @@ "results in _build/doctest/output.txt." texinfo: + $(make_output_dirs) $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) _build/texinfo + # Now build the info files using the Makefile provided by Sphinx + $(MAKE) -C _build/texinfo diff -Nru bzr-2.5.0/doc/en/release-notes/bzr-2.4.txt bzr-2.6.0~beta1/doc/en/release-notes/bzr-2.4.txt --- bzr-2.5.0/doc/en/release-notes/bzr-2.4.txt 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/en/release-notes/bzr-2.4.txt 2012-03-15 10:00:24.000000000 +0000 @@ -79,6 +79,9 @@ suite. This can include new facilities for writing tests, fixes to spurious test failures and changes to the way things should be tested. +* Account for slightly improved compression with newer versions of zlib in + ``bt.test_btree_index`` tests. (Martin Packman, #940453) + bzr 2.4.2 ######### diff -Nru bzr-2.5.0/doc/en/release-notes/bzr-2.5.txt bzr-2.6.0~beta1/doc/en/release-notes/bzr-2.5.txt --- bzr-2.5.0/doc/en/release-notes/bzr-2.5.txt 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/en/release-notes/bzr-2.5.txt 2012-03-15 10:00:24.000000000 +0000 @@ -5,6 +5,76 @@ .. toctree:: :maxdepth: 1 +bzr 2.5.1 +######### + +:2.5.1: NOT RELEASED YET + +External Compatibility Breaks +***************************** + +.. These may require users to change the way they use Bazaar. + +New Features +************ + +.. New commands, options, etc that users may wish to try out. + +Improvements +************ + +.. Improvements to existing commands, especially improved performance + or memory usage, or better results. + +* ``bzr branches`` will now also list sibling branches when + the current location is a lightweight checkout of a branch in + a shared repository. (Jelmer Vernooij) + +Bug Fixes +********* + +.. Fixes for situations where bzr would previously crash or give incorrect + or undesirable results. + +* Connecting with HTTPS via HTTP now correctly uses the host name of the + destination rather than the proxy when checking certificates. + (Martin Packman, #944696) + +* Fixed merge tool availability checking and invocation to search the + Windows App Path registry in addition to the PATH. (Gordon Tyler, #939605) + +* Make sure configuration options can provide their own help topic. + (Jelmer Vernooij, #941672) + +Documentation +************* + +* The alpha-quality texinfo sphinx builder has been deprecated. Sphinx >= + 1.1.2 now provides a better one. Most of the documentation can now be + generated to the texinfo format with ``make texinfo-sphinx``. This will + generate both the ``.texi`` files and the ``.info`` ones. + (Vincent Ladeuil, #940164) + +API Changes +*********** + +.. Changes that may require updates in plugins or other code that uses + bzrlib. + +Internals +********* + +.. Major internal changes, unlikely to be visible to users or plugin + developers, but interesting for bzr developers. + +Testing +******* + +.. Fixes and changes that are only relevant to bzr's test framework and + suite. This can include new facilities for writing tests, fixes to + spurious test failures and changes to the way things should be tested. + + bzr 2.5.0 ######### @@ -102,14 +172,14 @@ a control directory (but no branch or working tree). (Jelmer Vernooij, #913980) +* Checkouts of colocated branches are now always lightweight. + (Jelmer Vernooij, #918828) + * Colocated branches can now have names including forward slashes, to allow for namespaces. (Jelmer Vernooij, #907980) * New HPSS call for ``BzrDir.get_branches``. (Jelmer Vernooij, #894460) -* Checkouts of colocated branches are now always lightweight. - (Jelmer Vernooij, #918828) - Bug Fixes ********* @@ -1020,6 +1090,9 @@ operations that use it, like merge, can now create trees without a root. (Aaron Bentley) +* Fixed problem with getting errors about failing to open /dev/tty when using + Bazaar Explorer to sign commits. (Mark Grandi, #847388) + Documentation ************* diff -Nru bzr-2.5.0/doc/en/release-notes/bzr-2.6.txt bzr-2.6.0~beta1/doc/en/release-notes/bzr-2.6.txt --- bzr-2.5.0/doc/en/release-notes/bzr-2.6.txt 1970-01-01 00:00:00.000000000 +0000 +++ bzr-2.6.0~beta1/doc/en/release-notes/bzr-2.6.txt 2012-03-15 10:00:24.000000000 +0000 @@ -0,0 +1,141 @@ +#################### +Bazaar Release Notes +#################### + +.. toctree:: + :maxdepth: 1 + +bzr 2.6b1 +######### + +:2.6b1: 2012-03-15 + +This is the first beta for the 2.6 series, leading up to a 2.6.0 release in +August 2012. + +This release includes ssl certificates verification from the urllib-based +http implementation turned on by default, fixes some UI issues around +colocated branches, documentation fixes and more. + +This release includes all bugs fixed in previous series known at the time of +this release. + +Beta releases are suitable for everyday use but may cause some +incompatibilities with plugins. Some plugins may need small updates to work +with 2.6b1. + +External Compatibility Breaks +***************************** + +None. + +Improvements +************ + +* Access to HTTPS URLs now uses the urrllib implementation by default. + For the old pycurl-based implementation, specify ``https+pycurl://`` as + the URL scheme when accessing a HTTPS location. + (Jelmer Vernooij, #125055) + +* Add short option alias ``-N`` for ``--no-recurse``. + (Jelmer Vernooij, #945904) + +* Avoid 'Invalid range access' errors when whole files are retrieved with + transport.http.get() . (Vincent Ladeuil, #924746) + +* ``bzr rmbranch`` now supports removing colocated branches. + (Jelmer Vernooij, #920653) + +* ``bzr rmbranch`` no longer removes active branches unless ``--force`` + is specified. (Jelmer Vernooij, #922953) + +* ``bzr verify-signatures`` now shows a progress bar. + (Jelmer Vernooij) + +* Two new command hooks, ``pre_command`` and ``post_command``, + provide notification before and after a command has been run. + (Brian de Alwis, Jelmer Vernooij) + +Bug Fixes +********* + +* Fix ``bzr config`` display for ``RegistryOption`` values. + (Vincent Ladeuil, #930182) + +Documentation +************* + +* Prevent lines of command descriptions starting with a dot to + accidentally be interpreted as a roff macro in bzr(1). + (Jelmer Vernooij, #711079) + +* Properly format apostrophes in manual page. (Jelmer Vernooij, #234771) + +API Changes +*********** + +* ``GPGStrategy.do_verifications`` has been deprecated. + (Jelmer Vernooij) + +* File ids in the ``Tree`` API can now be bytestring as previously, + or tuples of bytestrings. + (Jelmer Vernooij) + +* ``mail_client`` now accepts a configuration stack object rather than + an old style Config object. (Jelmer Vernooij) + +* New method ``Repository.verify_revision_signatures``. + (Jelmer Vernooij) + +* New configuration option class ``RegistryOption`` which is backed + onto a registry. (Jelmer Vernooij) + +* New convenience API method ``WorkingTree.get_config_stack``. + (Jelmer Vernooij) + +* Remove deprecated ``Branch.set_revision_history`` and + ``Branch.revision_history`` methods and the ``set_rh`` + hook on ``Branch``. (Jelmer Vernooij) + +* Remove + ``branch.PullResult.__int__`` deprecated in 2.3.0, + ``branch.PushResult.__int__`` deprecated in 2.3.0, + ``branch.BranchFormat.get_default_format`` deprecated in 2.4.0, + ``branch.BranchFormat.get_formats`` deprecated in 2.4.0, + ``branch.BranchFormat.set_default_format`` deprecated in 2.4.0, + ``branch.BranchFormat.register_format`` deprecated in 2.4.0, + ``branch.BranchFormat.unregister_format`` deprecated in 2.4.0, + ``bzrdir.BzrDir.generate_backup_name`` deprecated in 2.3.0, + ``bzrdir.BzrProber.register_bzrdir_format`` deprecated in 2.4.0, + ``bzrdir.BzrProber.unregister_bzrdir_format`` deprecated in 2.4.0, + ``config.Config.get_editor`` deprecated in 2.4.0, + ``hooks.known_hooks_key_to_parent_and_attribute`` deprecated in 2.3, + ``hooks.Hooks.create_hook`` deprecated in 2.4, + ``inventory.Inventory.__contains__`` deprecated in 2.4.0, + ``merge.Merge3Merger.scalar_three_way`` deprecated in 2.2.0, + ``merge.Merge3Merger.fix_root`` deprecated in 2.4.0, + ``transform.TreeTransformBase.has_named_child`` deprecated in 2.3.0, + ``transform.get_backup_name`` deprecated in 2.3.0, + ``transform._get_backup_name`` deprecated in 2.3.0, + ``workingtree.WorkingTreeFormat.get_default_format`` deprecated in 2.4.0, + ``workingtree.WorkingTreeFormat.register_format`` deprecated in 2.4.0, + ``workingtree.WorkingTreeFormat.register_extra_format`` deprecated in 2.4.0, + ``workingtree.WorkingTreeFormat.unregister_extra_format`` deprecated in 2.4.0, + ``workingtree.WorkingTreeFormat.get_formats`` deprecated in 2.4.0, + ``workingtree.WorkingTreeFormat.set_default_format`` deprecated in 2.4.0, + ``workingtree.WorkingTreeFormat.unregister_format`` deprecated in 2.4.0, + (Vincent Ladeuil) + +Internals +********* + +* ``Tree.path2id`` now once again accepts a list of path elements + in addition to a path. (Jelmer Vernooij) + +* Turn config option expansion on by default. The only options for which + this should be disabled are templates which should already have used + conf.get(option, expand=False) or conf.get_user_option(option, + expand=False). (Vincent Ladeuil) + +.. + vim: tw=74 ft=rst ff=unix diff -Nru bzr-2.5.0/doc/en/_templates/index.html bzr-2.6.0~beta1/doc/en/_templates/index.html --- bzr-2.5.0/doc/en/_templates/index.html 2012-02-24 10:42:19.000000000 +0000 +++ bzr-2.6.0~beta1/doc/en/_templates/index.html 2012-03-15 10:00:24.000000000 +0000 @@ -7,7 +7,7 @@
-