/* Generated by Cython 0.14.1 on Mon Jan 16 15:59:29 2012 */

#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 <stddef.h> /* 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

#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)
#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)
#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 <math.h>
#define __PYX_HAVE_API__bzrlib___dirstate_helpers_pyx
#include "python-compat.h"
#include "_dirstate_helpers_pyx.h"
#include "stdlib.h"
#include "sys/stat.h"
#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__)
    #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[] = {
  "_dirstate_helpers_pyx.pyx",
  "_static_tuple_c.pxd",
};

/* Type declarations */

/* "bzrlib/_dirstate_helpers_pyx.pyx":1020
 * 
 * 
 * cdef class ProcessEntryC:             # <<<<<<<<<<<<<<
 * 
 *     cdef int doing_consistency_expansion
 */

struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC {
  PyObject_HEAD
  struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_vtab;
  int doing_consistency_expansion;
  PyObject *old_dirname_to_file_id;
  PyObject *new_dirname_to_file_id;
  PyObject *last_source_parent;
  PyObject *last_target_parent;
  int include_unchanged;
  int partial;
  PyObject *use_filesystem_for_exec;
  PyObject *utf8_decode;
  PyObject *searched_specific_files;
  PyObject *searched_exact_paths;
  PyObject *search_specific_files;
  PyObject *search_specific_file_parents;
  PyObject *state;
  PyObject *current_root;
  PyObject *current_root_unicode;
  PyObject *root_entries;
  int root_entries_pos;
  int root_entries_len;
  PyObject *root_abspath;
  int source_index;
  int target_index;
  int want_unversioned;
  PyObject *tree;
  PyObject *dir_iterator;
  int block_index;
  PyObject *current_block;
  int current_block_pos;
  PyObject *current_block_list;
  PyObject *current_dir_info;
  PyObject *current_dir_list;
  PyObject *_pending_consistent_entries;
  int path_index;
  PyObject *root_dir_info;
  PyObject *bisect_left;
  PyObject *pathjoin;
  PyObject *fstat;
  PyObject *seen_ids;
  PyObject *sha_file;
};

/* "bzrlib/_dirstate_helpers_pyx.pyx":532
 * 
 * 
 * cdef class Reader:             # <<<<<<<<<<<<<<
 *     """Maintain the current location, and return fields as you parse them."""
 * 
 */

struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader {
  PyObject_HEAD
  struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *__pyx_vtab;
  PyObject *state;
  PyObject *text;
  char *text_cstr;
  int text_size;
  char *end_cstr;
  char *cur_cstr;
  char *next;
};


/* "bzrlib/_dirstate_helpers_pyx.pyx":1020
 * 
 * 
 * cdef class ProcessEntryC:             # <<<<<<<<<<<<<<
 * 
 *     cdef int doing_consistency_expansion
 */

struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC {
  PyObject *(*_process_entry)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *, PyObject *, PyObject *);
  int (*_gather_result_for_consistency)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *, PyObject *);
  int (*_update_current_block)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *);
  PyObject *(*_iter_next)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *);
  PyObject *(*_maybe_tree_ref)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *, PyObject *);
  PyObject *(*_loop_one_block)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *);
  PyObject *(*_next_consistent_entries)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *);
  PyObject *(*_path_info)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_vtabptr_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC;


/* "bzrlib/_dirstate_helpers_pyx.pyx":532
 * 
 * 
 * cdef class Reader:             # <<<<<<<<<<<<<<
 *     """Maintain the current location, and return fields as you parse them."""
 * 
 */

struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader {
  char *(*get_next)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *, int *);
  PyObject *(*get_next_str)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *);
  int (*_init)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *);
  PyObject *(*_get_entry)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *, int, void **, int *);
};
static struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *__pyx_vtabptr_6bzrlib_21_dirstate_helpers_pyx_Reader;

#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 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_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static CYTHON_INLINE long __Pyx_div_long(long, long); /* 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;
}

#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_SetItemInt_Fast(o, i, v) : \
                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))

static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
    int r;
    if (!j) return -1;
    r = PyObject_SetItem(o, j, v);
    Py_DECREF(j);
    return r;
}

static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) {
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        Py_INCREF(v);
        Py_DECREF(PyList_GET_ITEM(o, i));
        PyList_SET_ITEM(o, i, v);
        return 1;
    }
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0)))
        return PySequence_SetItem(o, i, v);
    else {
        PyObject *j = PyInt_FromSsize_t(i);
        return __Pyx_SetItemInt_Generic(o, j, v);
    }
}

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*/

#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 int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

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 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);
}

#define __Pyx_DelItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_DelItemInt_Fast(o, i) : \
                                                    __Pyx_DelItem_Generic(o, to_py_func(i)))

static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
    int r;
    if (!j) return -1;
    r = PyObject_DelItem(o, j);
    Py_DECREF(j);
    return r;
}

static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i) {
    if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && likely(i >= 0))
        return PySequence_DelItem(o, i);
    else {
        PyObject *j = PyInt_FromSsize_t(i);
        return __Pyx_DelItem_Generic(o, j);
    }
}

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 void __Pyx_WriteUnraisable(const char *name); /*proto*/

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*/

static void __Pyx_AddTraceback(const char *funcname); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from bzrlib._static_tuple_c */

/* Module declarations from bzrlib._static_tuple_c */

static PyTypeObject *__pyx_ptype_6bzrlib_15_static_tuple_c_StaticTuple = 0;
/* Module declarations from bzrlib._dirstate_helpers_pyx */

static PyTypeObject *__pyx_ptype_6bzrlib_21_dirstate_helpers_pyx_Reader = 0;
static PyTypeObject *__pyx_ptype_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC = 0;
static int __pyx_v_6bzrlib_21_dirstate_helpers_pyx_ERROR_PATH_NOT_FOUND;
static int __pyx_v_6bzrlib_21_dirstate_helpers_pyx_ERROR_DIRECTORY;
static PyObject *__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_absent = 0;
static PyObject *__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_file = 0;
static PyObject *__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_directory = 0;
static PyObject *__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_symlink = 0;
static PyObject *__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_relocated = 0;
static PyObject *__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_tree_reference = 0;
static void *__pyx_f_6bzrlib_21_dirstate_helpers_pyx__my_memrchr(void *, int, size_t); /*proto*/
static PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_safe_string_from_size(char *, Py_ssize_t); /*proto*/
static int __pyx_f_6bzrlib_21_dirstate_helpers_pyx__is_aligned(void *); /*proto*/
static int __pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_by_dirs(char *, int, char *, int); /*proto*/
static int __pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_path_by_dirblock_intern(char *, int, char *, int); /*proto*/
static int __pyx_f_6bzrlib_21_dirstate_helpers_pyx_minikind_from_mode(int); /*proto*/
static PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx__pack_stat(PyObject *); /*proto*/
static PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx__update_entry(PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static char __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_from_string(PyObject *); /*proto*/
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;

/* Implementation of bzrlib._dirstate_helpers_pyx */
static PyObject *__pyx_builtin_AssertionError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_OSError;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_cmp;
static PyObject *__pyx_builtin_UnicodeDecodeError;
static char __pyx_k_1[] = "Must be a single character string, not %s";
static char __pyx_k_2[] = "tried to create a string with an invalid size: %d";
static char __pyx_k_3[] = "'path1' must be a plain string, not %s: %r";
static char __pyx_k_4[] = "'path2' must be a plain string, not %s: %r";
static char __pyx_k_5[] = "";
static char __pyx_k_6[] = "you must pass a python list for 'paths' not: %s %r";
static char __pyx_k_7[] = "you must pass a string for 'path' not: %s %r";
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_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__a[] = "a";
static char __pyx_k__c[] = "c";
static char __pyx_k__d[] = "d";
static char __pyx_k__f[] = "f";
static char __pyx_k__l[] = "l";
static char __pyx_k__r[] = "r";
static char __pyx_k__s[] = "s";
static char __pyx_k__ar[] = "ar";
static char __pyx_k__hi[] = "hi";
static char __pyx_k__lo[] = "lo";
static char __pyx_k__os[] = "os";
static char __pyx_k__add[] = "add";
static char __pyx_k__cmp[] = "cmp";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__file[] = "file";
static char __pyx_k__next[] = "next";
static char __pyx_k__path[] = "path";
static char __pyx_k__read[] = "read";
static char __pyx_k__seek[] = "seek";
static char __pyx_k__self[] = "self";
static char __pyx_k__stat[] = "stat";
static char __pyx_k__text[] = "text";
static char __pyx_k__tree[] = "tree";
static char __pyx_k__utf8[] = "utf8";
static char __pyx_k___init[] = "_init";
static char __pyx_k__cache[] = "cache";
static char __pyx_k__entry[] = "entry";
static char __pyx_k__errno[] = "errno";
static char __pyx_k__fstat[] = "fstat";
static char __pyx_k__lstat[] = "lstat";
static char __pyx_k__path1[] = "path1";
static char __pyx_k__path2[] = "path2";
static char __pyx_k__paths[] = "paths";
static char __pyx_k__split[] = "split";
static char __pyx_k__state[] = "state";
static char __pyx_k__win32[] = "win32";
static char __pyx_k__EINVAL[] = "EINVAL";
static char __pyx_k__ENOENT[] = "ENOENT";
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";
static char __pyx_k__encode[] = "encode";
static char __pyx_k__errors[] = "errors";
static char __pyx_k__prefix[] = "prefix";
static char __pyx_k__rsplit[] = "rsplit";
static char __pyx_k__st_dev[] = "st_dev";
static char __pyx_k__st_ino[] = "st_ino";
static char __pyx_k__update[] = "update";
static char __pyx_k__ENOTDIR[] = "ENOTDIR";
static char __pyx_k__OSError[] = "OSError";
static char __pyx_k__S_IEXEC[] = "S_IEXEC";
static char __pyx_k__S_ISREG[] = "S_ISREG";
static char __pyx_k___encode[] = "_encode";
static char __pyx_k___fs_enc[] = "_fs_enc";
static char __pyx_k__abspath[] = "abspath";
static char __pyx_k__dirname[] = "dirname";
static char __pyx_k__osutils[] = "osutils";
static char __pyx_k__partial[] = "partial";
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__BzrError[] = "BzrError";
static char __pyx_k__DirState[] = "DirState";
static char __pyx_k__KeyError[] = "KeyError";
static char __pyx_k__NULLSTAT[] = "NULLSTAT";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__binascii[] = "binascii";
static char __pyx_k__cur_cstr[] = "cur_cstr";
static char __pyx_k__end_cstr[] = "end_cstr";
static char __pyx_k__get_next[] = "get_next";
static char __pyx_k__pathjoin[] = "pathjoin";
static char __pyx_k__platform[] = "platform";
static char __pyx_k__seen_ids[] = "seen_ids";
static char __pyx_k__sha_file[] = "sha_file";
static char __pyx_k__st_ctime[] = "st_ctime";
static char __pyx_k__st_mtime[] = "st_mtime";
static char __pyx_k__winerror[] = "winerror";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k___filename[] = "_filename";
static char __pyx_k__dirblocks[] = "dirblocks";
static char __pyx_k__directory[] = "directory";
static char __pyx_k__is_inside[] = "is_inside";
static char __pyx_k__pack_stat[] = "pack_stat";
static char __pyx_k__path_utf8[] = "path_utf8";
static char __pyx_k__relocated[] = "relocated";
static char __pyx_k__splitpath[] = "splitpath";
static char __pyx_k__text_cstr[] = "text_cstr";
static char __pyx_k__text_size[] = "text_size";
static char __pyx_k___dirblocks[] = "_dirblocks";
static char __pyx_k___get_entry[] = "_get_entry";
static char __pyx_k___iter_next[] = "_iter_next";
static char __pyx_k___path_info[] = "_path_info";
static char __pyx_k___read_link[] = "_read_link";
static char __pyx_k___sha1_file[] = "_sha1_file";
static char __pyx_k__b2a_base64[] = "b2a_base64";
static char __pyx_k__cache_utf8[] = "cache_utf8";
static char __pyx_k__path_index[] = "path_index";
static char __pyx_k__stat_value[] = "stat_value";
static char __pyx_k___py_memrchr[] = "_py_memrchr";
static char __pyx_k___state_file[] = "_state_file";
static char __pyx_k__bisect_left[] = "bisect_left";
static char __pyx_k__block_index[] = "block_index";
static char __pyx_k__cmp_by_dirs[] = "cmp_by_dirs";
static char __pyx_k__utf8_decode[] = "utf8_decode";
static char __pyx_k___cutoff_time[] = "_cutoff_time";
static char __pyx_k___num_entries[] = "_num_entries";
static char __pyx_k___utf8_decode[] = "_utf8_decode";
static char __pyx_k__current_root[] = "current_root";
static char __pyx_k__dir_iterator[] = "dir_iterator";
static char __pyx_k__get_next_str[] = "get_next_str";
static char __pyx_k__root_abspath[] = "root_abspath";
static char __pyx_k__root_entries[] = "root_entries";
static char __pyx_k__source_index[] = "source_index";
static char __pyx_k__target_index[] = "target_index";
static char __pyx_k__update_entry[] = "update_entry";
static char __pyx_k__StopIteration[] = "StopIteration";
static char __pyx_k___ensure_block[] = "_ensure_block";
static char __pyx_k__current_block[] = "current_block";
static char __pyx_k__is_inside_any[] = "is_inside_any";
static char __pyx_k__root_dir_info[] = "root_dir_info";
static char __pyx_k__stat_and_sha1[] = "stat_and_sha1";
static char __pyx_k__AssertionError[] = "AssertionError";
static char __pyx_k__AttributeError[] = "AttributeError";
static char __pyx_k___end_of_header[] = "_end_of_header";
static char __pyx_k___is_executable[] = "_is_executable";
static char __pyx_k___mark_modified[] = "_mark_modified";
static char __pyx_k___observed_sha1[] = "_observed_sha1";
static char __pyx_k___process_entry[] = "_process_entry";
static char __pyx_k___sha1_provider[] = "_sha1_provider";
static char __pyx_k___walkdirs_utf8[] = "_walkdirs_utf8";
static char __pyx_k__CorruptDirstate[] = "CorruptDirstate";
static char __pyx_k__DirstateCorrupt[] = "DirstateCorrupt";
static char __pyx_k___dirblock_state[] = "_dirblock_state";
static char __pyx_k___loop_one_block[] = "_loop_one_block";
static char __pyx_k___maybe_tree_ref[] = "_maybe_tree_ref";
static char __pyx_k___read_dirblocks[] = "_read_dirblocks";
static char __pyx_k__bisect_dirblock[] = "bisect_dirblock";
static char __pyx_k__BadFileKindError[] = "BadFileKindError";
static char __pyx_k___parse_dirblocks[] = "_parse_dirblocks";
static char __pyx_k___sha_cutoff_time[] = "_sha_cutoff_time";
static char __pyx_k__current_dir_info[] = "current_dir_info";
static char __pyx_k__current_dir_list[] = "current_dir_list";
static char __pyx_k__root_entries_len[] = "root_entries_len";
static char __pyx_k__root_entries_pos[] = "root_entries_pos";
static char __pyx_k__want_unversioned[] = "want_unversioned";
static char __pyx_k___bisect_path_left[] = "_bisect_path_left";
static char __pyx_k___entries_for_path[] = "_entries_for_path";
static char __pyx_k__current_block_pos[] = "current_block_pos";
static char __pyx_k__include_unchanged[] = "include_unchanged";
static char __pyx_k__UnicodeDecodeError[] = "UnicodeDecodeError";
static char __pyx_k___bisect_path_right[] = "_bisect_path_right";
static char __pyx_k__current_block_list[] = "current_block_list";
static char __pyx_k__last_source_parent[] = "last_source_parent";
static char __pyx_k__last_target_parent[] = "last_target_parent";
static char __pyx_k__parent_directories[] = "parent_directories";
static char __pyx_k__BadFilenameEncoding[] = "BadFilenameEncoding";
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_12;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_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_19;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_n_s_20;
static PyObject *__pyx_n_s_21;
static PyObject *__pyx_n_s_22;
static PyObject *__pyx_n_s_23;
static PyObject *__pyx_n_s_24;
static PyObject *__pyx_n_s_25;
static PyObject *__pyx_n_s_26;
static PyObject *__pyx_n_s_27;
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_32;
static PyObject *__pyx_kp_s_34;
static PyObject *__pyx_kp_s_36;
static PyObject *__pyx_kp_s_37;
static PyObject *__pyx_kp_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_49;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_52;
static PyObject *__pyx_n_s_54;
static PyObject *__pyx_n_s_55;
static PyObject *__pyx_n_s_58;
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_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;
static PyObject *__pyx_n_s__AttributeError;
static PyObject *__pyx_n_s__BadFileKindError;
static PyObject *__pyx_n_s__BadFilenameEncoding;
static PyObject *__pyx_n_s__BzrError;
static PyObject *__pyx_n_s__CorruptDirstate;
static PyObject *__pyx_n_s__DirState;
static PyObject *__pyx_n_s__DirstateCorrupt;
static PyObject *__pyx_n_s__EINVAL;
static PyObject *__pyx_n_s__ENOENT;
static PyObject *__pyx_n_s__ENOTDIR;
static PyObject *__pyx_n_s__KeyError;
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__S_IEXEC;
static PyObject *__pyx_n_s__S_ISREG;
static PyObject *__pyx_n_s__StopIteration;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__UnicodeDecodeError;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____ne__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___bisect_path_left;
static PyObject *__pyx_n_s___bisect_path_right;
static PyObject *__pyx_n_s___cutoff_time;
static PyObject *__pyx_n_s___dirblock_state;
static PyObject *__pyx_n_s___dirblocks;
static PyObject *__pyx_n_s___encode;
static PyObject *__pyx_n_s___end_of_header;
static PyObject *__pyx_n_s___ensure_block;
static PyObject *__pyx_n_s___entries_for_path;
static PyObject *__pyx_n_s___filename;
static PyObject *__pyx_n_s___fs_enc;
static PyObject *__pyx_n_s___get_entry;
static PyObject *__pyx_n_s___init;
static PyObject *__pyx_n_s___is_executable;
static PyObject *__pyx_n_s___iter_next;
static PyObject *__pyx_n_s___loop_one_block;
static PyObject *__pyx_n_s___mark_modified;
static PyObject *__pyx_n_s___maybe_tree_ref;
static PyObject *__pyx_n_s___num_entries;
static PyObject *__pyx_n_s___observed_sha1;
static PyObject *__pyx_n_s___parse_dirblocks;
static PyObject *__pyx_n_s___path_info;
static PyObject *__pyx_n_s___process_entry;
static PyObject *__pyx_n_s___py_memrchr;
static PyObject *__pyx_n_s___read_dirblocks;
static PyObject *__pyx_n_s___read_link;
static PyObject *__pyx_n_s___sha1_file;
static PyObject *__pyx_n_s___sha1_provider;
static PyObject *__pyx_n_s___sha_cutoff_time;
static PyObject *__pyx_n_s___state_file;
static PyObject *__pyx_n_s___utf8_decode;
static PyObject *__pyx_n_s___walkdirs_utf8;
static PyObject *__pyx_n_s__a;
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;
static PyObject *__pyx_n_s__bisect;
static PyObject *__pyx_n_s__bisect_dirblock;
static PyObject *__pyx_n_s__bisect_left;
static PyObject *__pyx_n_s__block_index;
static PyObject *__pyx_n_s__bzrlib;
static PyObject *__pyx_n_s__c;
static PyObject *__pyx_n_s__cache;
static PyObject *__pyx_n_s__cache_utf8;
static PyObject *__pyx_n_s__cmp;
static PyObject *__pyx_n_s__cmp_by_dirs;
static PyObject *__pyx_n_s__cur_cstr;
static PyObject *__pyx_n_s__current_block;
static PyObject *__pyx_n_s__current_block_list;
static PyObject *__pyx_n_s__current_block_pos;
static PyObject *__pyx_n_s__current_dir_info;
static PyObject *__pyx_n_s__current_dir_list;
static PyObject *__pyx_n_s__current_root;
static PyObject *__pyx_n_s__d;
static PyObject *__pyx_n_s__decode;
static PyObject *__pyx_n_s__dir_iterator;
static PyObject *__pyx_n_s__dirblocks;
static PyObject *__pyx_n_s__directory;
static PyObject *__pyx_n_s__dirname;
static PyObject *__pyx_n_s__encode;
static PyObject *__pyx_n_s__end_cstr;
static PyObject *__pyx_n_s__entry;
static PyObject *__pyx_n_s__errno;
static PyObject *__pyx_n_s__errors;
static PyObject *__pyx_n_s__f;
static PyObject *__pyx_n_s__file;
static PyObject *__pyx_n_s__fstat;
static PyObject *__pyx_n_s__get_next;
static PyObject *__pyx_n_s__get_next_str;
static PyObject *__pyx_n_s__hi;
static PyObject *__pyx_n_s__include_unchanged;
static PyObject *__pyx_n_s__is_inside;
static PyObject *__pyx_n_s__is_inside_any;
static PyObject *__pyx_n_s__l;
static PyObject *__pyx_n_s__last_source_parent;
static PyObject *__pyx_n_s__last_target_parent;
static PyObject *__pyx_n_s__lo;
static PyObject *__pyx_n_s__lstat;
static PyObject *__pyx_n_s__next;
static PyObject *__pyx_n_s__os;
static PyObject *__pyx_n_s__osutils;
static PyObject *__pyx_n_s__pack_stat;
static PyObject *__pyx_n_s__parent_directories;
static PyObject *__pyx_n_s__partial;
static PyObject *__pyx_n_s__path;
static PyObject *__pyx_n_s__path1;
static PyObject *__pyx_n_s__path2;
static PyObject *__pyx_n_s__path_index;
static PyObject *__pyx_n_s__path_utf8;
static PyObject *__pyx_n_s__pathjoin;
static PyObject *__pyx_n_s__paths;
static PyObject *__pyx_n_s__platform;
static PyObject *__pyx_n_s__prefix;
static PyObject *__pyx_n_s__r;
static PyObject *__pyx_n_s__read;
static PyObject *__pyx_n_s__relocated;
static PyObject *__pyx_n_s__root_abspath;
static PyObject *__pyx_n_s__root_dir_info;
static PyObject *__pyx_n_s__root_entries;
static PyObject *__pyx_n_s__root_entries_len;
static PyObject *__pyx_n_s__root_entries_pos;
static PyObject *__pyx_n_s__rsplit;
static PyObject *__pyx_n_s__s;
static PyObject *__pyx_n_s__seek;
static PyObject *__pyx_n_s__seen_ids;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__sha_file;
static PyObject *__pyx_n_s__source_index;
static PyObject *__pyx_n_s__split;
static PyObject *__pyx_n_s__splitpath;
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__stat;
static PyObject *__pyx_n_s__stat_and_sha1;
static PyObject *__pyx_n_s__stat_value;
static PyObject *__pyx_n_s__state;
static PyObject *__pyx_n_s__symlink;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__target_index;
static PyObject *__pyx_n_s__text;
static PyObject *__pyx_n_s__text_cstr;
static PyObject *__pyx_n_s__text_size;
static PyObject *__pyx_n_s__tree;
static PyObject *__pyx_n_s__update;
static PyObject *__pyx_n_s__update_entry;
static PyObject *__pyx_n_s__utf8;
static PyObject *__pyx_n_s__utf8_decode;
static PyObject *__pyx_n_s__want_unversioned;
static PyObject *__pyx_n_s__win32;
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
 * import_static_tuple_c()
 * 
 * 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_21_dirstate_helpers_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");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":133
 *     cdef char *start
 * 
 *     start = <char*>s             # <<<<<<<<<<<<<<
 *     pos = start + n - 1
 *     while pos >= start:
 */
  __pyx_v_start = ((char *)__pyx_v_s);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":134
 * 
 *     start = <char*>s
 *     pos = start + n - 1             # <<<<<<<<<<<<<<
 *     while pos >= start:
 *         if pos[0] == c:
 */
  __pyx_v_pos = ((__pyx_v_start + __pyx_v_n) - 1);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":135
 *     start = <char*>s
 *     pos = start + n - 1
 *     while pos >= start:             # <<<<<<<<<<<<<<
 *         if pos[0] == c:
 *             return <void*>pos
 */
  while (1) {
    __pyx_t_1 = (__pyx_v_pos >= __pyx_v_start);
    if (!__pyx_t_1) break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":136
 *     pos = start + n - 1
 *     while pos >= start:
 *         if pos[0] == c:             # <<<<<<<<<<<<<<
 *             return <void*>pos
 *         pos = pos - 1
 */
    __pyx_t_1 = ((__pyx_v_pos[0]) == __pyx_v_c);
    if (__pyx_t_1) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":137
 *     while pos >= start:
 *         if pos[0] == c:
 *             return <void*>pos             # <<<<<<<<<<<<<<
 *         pos = pos - 1
 *     return NULL
 */
      __pyx_r = ((void *)__pyx_v_pos);
      goto __pyx_L0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":138
 *         if pos[0] == c:
 *             return <void*>pos
 *         pos = pos - 1             # <<<<<<<<<<<<<<
 *     return NULL
 * 
 */
    __pyx_v_pos = (__pyx_v_pos - 1);
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":139
 *             return <void*>pos
 *         pos = pos - 1
 *     return NULL             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = NULL;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":142
 * 
 * 
 * def _py_memrchr(s, c):             # <<<<<<<<<<<<<<
 *     """Just to expose _my_memrchr for testing.
 * 
 */

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;
  void *__pyx_v__s;
  void *__pyx_v_found;
  int __pyx_v_length;
  char *__pyx_v__c;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__s,&__pyx_n_s__c,0};
  __Pyx_RefNannySetupContext("_py_memrchr");
  __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__s);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__c);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("_py_memrchr", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __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), "_py_memrchr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_s = values[0];
    __pyx_v_c = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_s = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_c = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_py_memrchr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._py_memrchr");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":154
 *     cdef char *_c
 * 
 *     _s = PyString_AsString(s)             # <<<<<<<<<<<<<<
 *     length = PyString_Size(s)
 * 
 */
  __pyx_v__s = PyString_AsString(__pyx_v_s);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":155
 * 
 *     _s = PyString_AsString(s)
 *     length = PyString_Size(s)             # <<<<<<<<<<<<<<
 * 
 *     _c = PyString_AsString(c)
 */
  __pyx_v_length = PyString_Size(__pyx_v_s);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":157
 *     length = PyString_Size(s)
 * 
 *     _c = PyString_AsString(c)             # <<<<<<<<<<<<<<
 *     assert PyString_Size(c) == 1,\
 *         'Must be a single character string, not %s' % (c,)
 */
  __pyx_v__c = PyString_AsString(__pyx_v_c);

  /* "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
  if (unlikely(!(PyString_Size(__pyx_v_c) == 1))) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":159
 *     _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)
 *     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_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_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_DECREF(((PyObject *)__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
 *     assert PyString_Size(c) == 1,\
 *         'Must be a single character string, not %s' % (c,)
 *     found = _my_memrchr(_s, _c[0], length)             # <<<<<<<<<<<<<<
 *     if found == NULL:
 *         return None
 */
  __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
 *         'Must be a single character string, not %s' % (c,)
 *     found = _my_memrchr(_s, _c[0], length)
 *     if found == NULL:             # <<<<<<<<<<<<<<
 *         return None
 *     return <char*>found - <char*>_s
 */
  __pyx_t_3 = (__pyx_v_found == NULL);
  if (__pyx_t_3) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":162
 *     found = _my_memrchr(_s, _c[0], length)
 *     if found == NULL:
 *         return None             # <<<<<<<<<<<<<<
 *     return <char*>found - <char*>_s
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":163
 *     if found == NULL:
 *         return None
 *     return <char*>found - <char*>_s             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong((((char *)__pyx_v_found) - ((char *)__pyx_v__s))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __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);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._py_memrchr");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":166
 * 
 * 
 * cdef object safe_string_from_size(char *s, Py_ssize_t size):             # <<<<<<<<<<<<<<
 *     if size < 0:
 *         raise AssertionError(
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_safe_string_from_size(char *__pyx_v_s, Py_ssize_t __pyx_v_size) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("safe_string_from_size");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":167
 * 
 * cdef object safe_string_from_size(char *s, Py_ssize_t size):
 *     if size < 0:             # <<<<<<<<<<<<<<
 *         raise AssertionError(
 *             'tried to create a string with an invalid size: %d'
 */
  __pyx_t_1 = (__pyx_v_size < 0);
  if (__pyx_t_1) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":170
 *         raise AssertionError(
 *             'tried to create a string with an invalid size: %d'
 *             % (size))             # <<<<<<<<<<<<<<
 *     return PyString_FromStringAndSize(s, size)
 * 
 */
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __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 = 168; __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 = 168; __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 = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":171
 *             'tried to create a string with an invalid size: %d'
 *             % (size))
 *     return PyString_FromStringAndSize(s, size)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_s, __pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.safe_string_from_size");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":174
 * 
 * 
 * cdef int _is_aligned(void *ptr): # cannot_raise             # <<<<<<<<<<<<<<
 *     """Is this pointer aligned to an integer size offset?
 * 
 */

static  int __pyx_f_6bzrlib_21_dirstate_helpers_pyx__is_aligned(void *__pyx_v_ptr) {
  int __pyx_r;
  __Pyx_RefNannySetupContext("_is_aligned");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":179
 *     :return: 1 if this pointer is aligned, 0 otherwise.
 *     """
 *     return ((<intptr_t>ptr) & ((sizeof(int))-1)) == 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((((intptr_t)__pyx_v_ptr) & ((sizeof(int)) - 1)) == 0);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":182
 * 
 * 
 * cdef int _cmp_by_dirs(char *path1, int size1, char *path2, int size2): # cannot_raise             # <<<<<<<<<<<<<<
 *     cdef unsigned char *cur1
 *     cdef unsigned char *cur2
 */

static  int __pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_by_dirs(char *__pyx_v_path1, int __pyx_v_size1, char *__pyx_v_path2, int __pyx_v_size2) {
  unsigned char *__pyx_v_cur1;
  unsigned char *__pyx_v_cur2;
  unsigned char *__pyx_v_end1;
  unsigned char *__pyx_v_end2;
  int *__pyx_v_cur_int1;
  int *__pyx_v_cur_int2;
  int *__pyx_v_end_int1;
  int *__pyx_v_end_int2;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  size_t __pyx_t_6;
  __Pyx_RefNannySetupContext("_cmp_by_dirs");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":192
 *     cdef int *end_int2
 * 
 *     if path1 == path2 and size1 == size2:             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_t_1 = (__pyx_v_path1 == __pyx_v_path2);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_size1 == __pyx_v_size2);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":193
 * 
 *     if path1 == path2 and size1 == size2:
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     end1 = <unsigned char*>path1+size1
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":195
 *         return 0
 * 
 *     end1 = <unsigned char*>path1+size1             # <<<<<<<<<<<<<<
 *     end2 = <unsigned char*>path2+size2
 * 
 */
  __pyx_v_end1 = (((unsigned char *)__pyx_v_path1) + __pyx_v_size1);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":196
 * 
 *     end1 = <unsigned char*>path1+size1
 *     end2 = <unsigned char*>path2+size2             # <<<<<<<<<<<<<<
 * 
 *     # Use 32-bit comparisons for the matching portion of the string.
 */
  __pyx_v_end2 = (((unsigned char *)__pyx_v_path2) + __pyx_v_size2);

  /* "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):             # <<<<<<<<<<<<<<
 *         cur_int1 = <int*>path1
 *         cur_int2 = <int*>path2
 */
  __pyx_t_4 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__is_aligned(__pyx_v_path1);
  if (__pyx_t_4) {
    __pyx_t_5 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__is_aligned(__pyx_v_path2);
    __pyx_t_3 = __pyx_t_5;
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  if (__pyx_t_3) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":204
 *     # this loop
 *     if _is_aligned(path1) and _is_aligned(path2):
 *         cur_int1 = <int*>path1             # <<<<<<<<<<<<<<
 *         cur_int2 = <int*>path2
 *         end_int1 = <int*>(path1 + size1 - (size1 % sizeof(int)))
 */
    __pyx_v_cur_int1 = ((int *)__pyx_v_path1);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":205
 *     if _is_aligned(path1) and _is_aligned(path2):
 *         cur_int1 = <int*>path1
 *         cur_int2 = <int*>path2             # <<<<<<<<<<<<<<
 *         end_int1 = <int*>(path1 + size1 - (size1 % sizeof(int)))
 *         end_int2 = <int*>(path2 + size2 - (size2 % sizeof(int)))
 */
    __pyx_v_cur_int2 = ((int *)__pyx_v_path2);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":206
 *         cur_int1 = <int*>path1
 *         cur_int2 = <int*>path2
 *         end_int1 = <int*>(path1 + size1 - (size1 % sizeof(int)))             # <<<<<<<<<<<<<<
 *         end_int2 = <int*>(path2 + size2 - (size2 % sizeof(int)))
 * 
 */
    __pyx_t_6 = (sizeof(int));
    if (unlikely(__pyx_t_6 == 0)) {
      PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_end_int1 = ((int *)((__pyx_v_path1 + __pyx_v_size1) - (__pyx_v_size1 % __pyx_t_6)));

    /* "bzrlib/_dirstate_helpers_pyx.pyx":207
 *         cur_int2 = <int*>path2
 *         end_int1 = <int*>(path1 + size1 - (size1 % sizeof(int)))
 *         end_int2 = <int*>(path2 + size2 - (size2 % sizeof(int)))             # <<<<<<<<<<<<<<
 * 
 *         while cur_int1 < end_int1 and cur_int2 < end_int2:
 */
    __pyx_t_6 = (sizeof(int));
    if (unlikely(__pyx_t_6 == 0)) {
      PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_v_end_int2 = ((int *)((__pyx_v_path2 + __pyx_v_size2) - (__pyx_v_size2 % __pyx_t_6)));

    /* "bzrlib/_dirstate_helpers_pyx.pyx":209
 *         end_int2 = <int*>(path2 + size2 - (size2 % sizeof(int)))
 * 
 *         while cur_int1 < end_int1 and cur_int2 < end_int2:             # <<<<<<<<<<<<<<
 *             if cur_int1[0] != cur_int2[0]:
 *                 break
 */
    while (1) {
      __pyx_t_3 = (__pyx_v_cur_int1 < __pyx_v_end_int1);
      if (__pyx_t_3) {
        __pyx_t_1 = (__pyx_v_cur_int2 < __pyx_v_end_int2);
        __pyx_t_2 = __pyx_t_1;
      } else {
        __pyx_t_2 = __pyx_t_3;
      }
      if (!__pyx_t_2) break;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":210
 * 
 *         while cur_int1 < end_int1 and cur_int2 < end_int2:
 *             if cur_int1[0] != cur_int2[0]:             # <<<<<<<<<<<<<<
 *                 break
 *             cur_int1 = cur_int1 + 1
 */
      __pyx_t_2 = ((__pyx_v_cur_int1[0]) != (__pyx_v_cur_int2[0]));
      if (__pyx_t_2) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":211
 *         while cur_int1 < end_int1 and cur_int2 < end_int2:
 *             if cur_int1[0] != cur_int2[0]:
 *                 break             # <<<<<<<<<<<<<<
 *             cur_int1 = cur_int1 + 1
 *             cur_int2 = cur_int2 + 1
 */
        goto __pyx_L6_break;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":212
 *             if cur_int1[0] != cur_int2[0]:
 *                 break
 *             cur_int1 = cur_int1 + 1             # <<<<<<<<<<<<<<
 *             cur_int2 = cur_int2 + 1
 * 
 */
      __pyx_v_cur_int1 = (__pyx_v_cur_int1 + 1);

      /* "bzrlib/_dirstate_helpers_pyx.pyx":213
 *                 break
 *             cur_int1 = cur_int1 + 1
 *             cur_int2 = cur_int2 + 1             # <<<<<<<<<<<<<<
 * 
 *         cur1 = <unsigned char*>cur_int1
 */
      __pyx_v_cur_int2 = (__pyx_v_cur_int2 + 1);
    }
    __pyx_L6_break:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":215
 *             cur_int2 = cur_int2 + 1
 * 
 *         cur1 = <unsigned char*>cur_int1             # <<<<<<<<<<<<<<
 *         cur2 = <unsigned char*>cur_int2
 *     else:
 */
    __pyx_v_cur1 = ((unsigned char *)__pyx_v_cur_int1);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":216
 * 
 *         cur1 = <unsigned char*>cur_int1
 *         cur2 = <unsigned char*>cur_int2             # <<<<<<<<<<<<<<
 *     else:
 *         cur1 = <unsigned char*>path1
 */
    __pyx_v_cur2 = ((unsigned char *)__pyx_v_cur_int2);
    goto __pyx_L4;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":218
 *         cur2 = <unsigned char*>cur_int2
 *     else:
 *         cur1 = <unsigned char*>path1             # <<<<<<<<<<<<<<
 *         cur2 = <unsigned char*>path2
 * 
 */
    __pyx_v_cur1 = ((unsigned char *)__pyx_v_path1);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":219
 *     else:
 *         cur1 = <unsigned char*>path1
 *         cur2 = <unsigned char*>path2             # <<<<<<<<<<<<<<
 * 
 *     while cur1 < end1 and cur2 < end2:
 */
    __pyx_v_cur2 = ((unsigned char *)__pyx_v_path2);
  }
  __pyx_L4:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":221
 *         cur2 = <unsigned char*>path2
 * 
 *     while cur1 < end1 and cur2 < end2:             # <<<<<<<<<<<<<<
 *         if cur1[0] == cur2[0]:
 *             # This character matches, just go to the next one
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_cur1 < __pyx_v_end1);
    if (__pyx_t_2) {
      __pyx_t_3 = (__pyx_v_cur2 < __pyx_v_end2);
      __pyx_t_1 = __pyx_t_3;
    } else {
      __pyx_t_1 = __pyx_t_2;
    }
    if (!__pyx_t_1) break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":222
 * 
 *     while cur1 < end1 and cur2 < end2:
 *         if cur1[0] == cur2[0]:             # <<<<<<<<<<<<<<
 *             # This character matches, just go to the next one
 *             cur1 = cur1 + 1
 */
    __pyx_t_1 = ((__pyx_v_cur1[0]) == (__pyx_v_cur2[0]));
    if (__pyx_t_1) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":224
 *         if cur1[0] == cur2[0]:
 *             # This character matches, just go to the next one
 *             cur1 = cur1 + 1             # <<<<<<<<<<<<<<
 *             cur2 = cur2 + 1
 *             continue
 */
      __pyx_v_cur1 = (__pyx_v_cur1 + 1);

      /* "bzrlib/_dirstate_helpers_pyx.pyx":225
 *             # This character matches, just go to the next one
 *             cur1 = cur1 + 1
 *             cur2 = cur2 + 1             # <<<<<<<<<<<<<<
 *             continue
 *         # The current characters do not match
 */
      __pyx_v_cur2 = (__pyx_v_cur2 + 1);

      /* "bzrlib/_dirstate_helpers_pyx.pyx":226
 *             cur1 = cur1 + 1
 *             cur2 = cur2 + 1
 *             continue             # <<<<<<<<<<<<<<
 *         # The current characters do not match
 *         if cur1[0] == c'/':
 */
      goto __pyx_L8_continue;
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":228
 *             continue
 *         # The current characters do not match
 *         if cur1[0] == c'/':             # <<<<<<<<<<<<<<
 *             return -1 # Reached the end of path1 segment first
 *         elif cur2[0] == c'/':
 */
    __pyx_t_1 = ((__pyx_v_cur1[0]) == '/');
    if (__pyx_t_1) {

      /* "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             # <<<<<<<<<<<<<<
 *         elif cur2[0] == c'/':
 *             return 1 # Reached the end of path2 segment first
 */
      __pyx_r = -1;
      goto __pyx_L0;
      goto __pyx_L11;
    }

    /* "bzrlib/_dirstate_helpers_pyx.pyx":230
 *         if cur1[0] == c'/':
 *             return -1 # Reached the end of path1 segment first
 *         elif cur2[0] == c'/':             # <<<<<<<<<<<<<<
 *             return 1 # Reached the end of path2 segment first
 *         elif cur1[0] < cur2[0]:
 */
    __pyx_t_1 = ((__pyx_v_cur2[0]) == '/');
    if (__pyx_t_1) {

      /* "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             # <<<<<<<<<<<<<<
 *         elif cur1[0] < cur2[0]:
 *             return -1
 */
      __pyx_r = 1;
      goto __pyx_L0;
      goto __pyx_L11;
    }

    /* "bzrlib/_dirstate_helpers_pyx.pyx":232
 *         elif cur2[0] == c'/':
 *             return 1 # Reached the end of path2 segment first
 *         elif cur1[0] < cur2[0]:             # <<<<<<<<<<<<<<
 *             return -1
 *         else:
 */
    __pyx_t_1 = ((__pyx_v_cur1[0]) < (__pyx_v_cur2[0]));
    if (__pyx_t_1) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":233
 *             return 1 # Reached the end of path2 segment first
 *         elif cur1[0] < cur2[0]:
 *             return -1             # <<<<<<<<<<<<<<
 *         else:
 *             return 1
 */
      __pyx_r = -1;
      goto __pyx_L0;
      goto __pyx_L11;
    }
    /*else*/ {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":235
 *             return -1
 *         else:
 *             return 1             # <<<<<<<<<<<<<<
 * 
 *     # We reached the end of at least one of the strings
 */
      __pyx_r = 1;
      goto __pyx_L0;
    }
    __pyx_L11:;
    __pyx_L8_continue:;
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":238
 * 
 *     # 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
 *     if cur2 < end2:
 */
  __pyx_t_1 = (__pyx_v_cur1 < __pyx_v_end1);
  if (__pyx_t_1) {

    /* "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             # <<<<<<<<<<<<<<
 *     if cur2 < end2:
 *         return -1 # At the end of cur1, but not at cur2
 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "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:             # <<<<<<<<<<<<<<
 *         return -1 # At the end of cur1, but not at cur2
 *     # We reached the end of both strings
 */
  __pyx_t_1 = (__pyx_v_cur2 < __pyx_v_end2);
  if (__pyx_t_1) {

    /* "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             # <<<<<<<<<<<<<<
 *     # We reached the end of both strings
 *     return 0
 */
    __pyx_r = -1;
    goto __pyx_L0;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "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             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("bzrlib._dirstate_helpers_pyx._cmp_by_dirs");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":246
 * 
 * 
 * def cmp_by_dirs(path1, path2):             # <<<<<<<<<<<<<<
 *     """Compare two paths directory by directory.
 * 
 */

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) {
  PyObject *__pyx_v_path1 = 0;
  PyObject *__pyx_v_path2 = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path1,&__pyx_n_s__path2,0};
  __Pyx_RefNannySetupContext("cmp_by_dirs");
  __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__path1);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path2);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("cmp_by_dirs", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __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), "cmp_by_dirs") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_path1 = values[0];
    __pyx_v_path2 = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_path1 = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_path2 = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cmp_by_dirs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.cmp_by_dirs");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":263
 *         and positive number if ``path2`` sorts first
 *     """
 *     if not PyString_CheckExact(path1):             # <<<<<<<<<<<<<<
 *         raise TypeError("'path1' must be a plain string, not %s: %r"
 *                         % (type(path1), path1))
 */
  __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path1));
  if (__pyx_t_1) {

    /* "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))             # <<<<<<<<<<<<<<
 *     if not PyString_CheckExact(path2):
 *         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_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_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 = 264; __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 = 264; __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 = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "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):             # <<<<<<<<<<<<<<
 *         raise TypeError("'path2' must be a plain string, not %s: %r"
 *                         % (type(path2), path2))
 */
  __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path2));
  if (__pyx_t_1) {

    /* "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))             # <<<<<<<<<<<<<<
 *     return _cmp_by_dirs(PyString_AsString(path1),
 *                         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_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_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 = 267; __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 = 267; __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 = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "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),             # <<<<<<<<<<<<<<
 *                         PyString_Size(path1),
 *                         PyString_AsString(path2),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":272
 *                         PyString_Size(path1),
 *                         PyString_AsString(path2),
 *                         PyString_Size(path2))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyInt_FromLong(__pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_by_dirs(PyString_AsString(__pyx_v_path1), PyString_Size(__pyx_v_path1), PyString_AsString(__pyx_v_path2), PyString_Size(__pyx_v_path2))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.cmp_by_dirs");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":275
 * 
 * 
 * def _cmp_path_by_dirblock(path1, path2):             # <<<<<<<<<<<<<<
 *     """Compare two paths based on what directory they are in.
 * 
 */

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) {
  PyObject *__pyx_v_path1 = 0;
  PyObject *__pyx_v_path2 = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path1,&__pyx_n_s__path2,0};
  __Pyx_RefNannySetupContext("_cmp_path_by_dirblock");
  __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__path1);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path2);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("_cmp_path_by_dirblock", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __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), "_cmp_path_by_dirblock") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_path1 = values[0];
    __pyx_v_path2 = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_path1 = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_path2 = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_cmp_path_by_dirblock", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._cmp_path_by_dirblock");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":291
 *         and a positive number if ``path2`` sorts first
 *     """
 *     if not PyString_CheckExact(path1):             # <<<<<<<<<<<<<<
 *         raise TypeError("'path1' must be a plain string, not %s: %r"
 *                         % (type(path1), path1))
 */
  __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path1));
  if (__pyx_t_1) {

    /* "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))             # <<<<<<<<<<<<<<
 *     if not PyString_CheckExact(path2):
 *         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_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_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 = 292; __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 = 292; __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 = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "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):             # <<<<<<<<<<<<<<
 *         raise TypeError("'path2' must be a plain string, not %s: %r"
 *                         % (type(path2), path2))
 */
  __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path2));
  if (__pyx_t_1) {

    /* "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))             # <<<<<<<<<<<<<<
 *     return _cmp_path_by_dirblock_intern(PyString_AsString(path1),
 *                                         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_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_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 = 295; __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 = 295; __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 = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "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),             # <<<<<<<<<<<<<<
 *                                         PyString_Size(path1),
 *                                         PyString_AsString(path2),
 */
  __Pyx_XDECREF(__pyx_r);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":300
 *                                         PyString_Size(path1),
 *                                         PyString_AsString(path2),
 *                                         PyString_Size(path2))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyInt_FromLong(__pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_path_by_dirblock_intern(PyString_AsString(__pyx_v_path1), PyString_Size(__pyx_v_path1), PyString_AsString(__pyx_v_path2), PyString_Size(__pyx_v_path2))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._cmp_path_by_dirblock");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":303
 * 
 * 
 * cdef int _cmp_path_by_dirblock_intern(char *path1, int path1_len,             # <<<<<<<<<<<<<<
 *                                       char *path2, int path2_len): # cannot_raise
 *     """Compare two paths by what directory they are in.
 */

static  int __pyx_f_6bzrlib_21_dirstate_helpers_pyx__cmp_path_by_dirblock_intern(char *__pyx_v_path1, int __pyx_v_path1_len, char *__pyx_v_path2, int __pyx_v_path2_len) {
  char *__pyx_v_dirname1;
  int __pyx_v_dirname1_len;
  char *__pyx_v_dirname2;
  int __pyx_v_dirname2_len;
  char *__pyx_v_basename1;
  int __pyx_v_basename1_len;
  char *__pyx_v_basename2;
  int __pyx_v_basename2_len;
  int __pyx_v_cur_len;
  int __pyx_v_cmp_val;
  int __pyx_r;
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("_cmp_path_by_dirblock_intern");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":320
 *     cdef int cmp_val
 * 
 *     if path1_len == 0 and path2_len == 0:             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_t_1 = (__pyx_v_path1_len == 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_path2_len == 0);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":321
 * 
 *     if path1_len == 0 and path2_len == 0:
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     if path1 == path2 and path1_len == path2_len:
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":323
 *         return 0
 * 
 *     if path1 == path2 and path1_len == path2_len:             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
  __pyx_t_3 = (__pyx_v_path1 == __pyx_v_path2);
  if (__pyx_t_3) {
    __pyx_t_1 = (__pyx_v_path1_len == __pyx_v_path2_len);
    __pyx_t_2 = __pyx_t_1;
  } else {
    __pyx_t_2 = __pyx_t_3;
  }
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":324
 * 
 *     if path1 == path2 and path1_len == path2_len:
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     if path1_len == 0:
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":326
 *         return 0
 * 
 *     if path1_len == 0:             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */
  __pyx_t_2 = (__pyx_v_path1_len == 0);
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":327
 * 
 *     if path1_len == 0:
 *         return -1             # <<<<<<<<<<<<<<
 * 
 *     if path2_len == 0:
 */
    __pyx_r = -1;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":329
 *         return -1
 * 
 *     if path2_len == 0:             # <<<<<<<<<<<<<<
 *         return 1
 * 
 */
  __pyx_t_2 = (__pyx_v_path2_len == 0);
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":330
 * 
 *     if path2_len == 0:
 *         return 1             # <<<<<<<<<<<<<<
 * 
 *     basename1 = <char*>_my_memrchr(path1, c'/', path1_len)
 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":332
 *         return 1
 * 
 *     basename1 = <char*>_my_memrchr(path1, c'/', path1_len)             # <<<<<<<<<<<<<<
 * 
 *     if basename1 == NULL:
 */
  __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
 *     basename1 = <char*>_my_memrchr(path1, c'/', path1_len)
 * 
 *     if basename1 == NULL:             # <<<<<<<<<<<<<<
 *         basename1 = path1
 *         basename1_len = path1_len
 */
  __pyx_t_2 = (__pyx_v_basename1 == NULL);
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":335
 * 
 *     if basename1 == NULL:
 *         basename1 = path1             # <<<<<<<<<<<<<<
 *         basename1_len = path1_len
 *         dirname1 = ''
 */
    __pyx_v_basename1 = __pyx_v_path1;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":336
 *     if basename1 == NULL:
 *         basename1 = path1
 *         basename1_len = path1_len             # <<<<<<<<<<<<<<
 *         dirname1 = ''
 *         dirname1_len = 0
 */
    __pyx_v_basename1_len = __pyx_v_path1_len;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":337
 *         basename1 = path1
 *         basename1_len = path1_len
 *         dirname1 = ''             # <<<<<<<<<<<<<<
 *         dirname1_len = 0
 *     else:
 */
    __pyx_v_dirname1 = __pyx_k_5;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":338
 *         basename1_len = path1_len
 *         dirname1 = ''
 *         dirname1_len = 0             # <<<<<<<<<<<<<<
 *     else:
 *         dirname1 = path1
 */
    __pyx_v_dirname1_len = 0;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":340
 *         dirname1_len = 0
 *     else:
 *         dirname1 = path1             # <<<<<<<<<<<<<<
 *         dirname1_len = basename1 - path1
 *         basename1 = basename1 + 1
 */
    __pyx_v_dirname1 = __pyx_v_path1;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":341
 *     else:
 *         dirname1 = path1
 *         dirname1_len = basename1 - path1             # <<<<<<<<<<<<<<
 *         basename1 = basename1 + 1
 *         basename1_len = path1_len - dirname1_len - 1
 */
    __pyx_v_dirname1_len = (__pyx_v_basename1 - __pyx_v_path1);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":342
 *         dirname1 = path1
 *         dirname1_len = basename1 - path1
 *         basename1 = basename1 + 1             # <<<<<<<<<<<<<<
 *         basename1_len = path1_len - dirname1_len - 1
 * 
 */
    __pyx_v_basename1 = (__pyx_v_basename1 + 1);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":343
 *         dirname1_len = basename1 - path1
 *         basename1 = basename1 + 1
 *         basename1_len = path1_len - dirname1_len - 1             # <<<<<<<<<<<<<<
 * 
 *     basename2 = <char*>_my_memrchr(path2, c'/', path2_len)
 */
    __pyx_v_basename1_len = ((__pyx_v_path1_len - __pyx_v_dirname1_len) - 1);
  }
  __pyx_L7:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":345
 *         basename1_len = path1_len - dirname1_len - 1
 * 
 *     basename2 = <char*>_my_memrchr(path2, c'/', path2_len)             # <<<<<<<<<<<<<<
 * 
 *     if basename2 == NULL:
 */
  __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
 *     basename2 = <char*>_my_memrchr(path2, c'/', path2_len)
 * 
 *     if basename2 == NULL:             # <<<<<<<<<<<<<<
 *         basename2 = path2
 *         basename2_len = path2_len
 */
  __pyx_t_2 = (__pyx_v_basename2 == NULL);
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":348
 * 
 *     if basename2 == NULL:
 *         basename2 = path2             # <<<<<<<<<<<<<<
 *         basename2_len = path2_len
 *         dirname2 = ''
 */
    __pyx_v_basename2 = __pyx_v_path2;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":349
 *     if basename2 == NULL:
 *         basename2 = path2
 *         basename2_len = path2_len             # <<<<<<<<<<<<<<
 *         dirname2 = ''
 *         dirname2_len = 0
 */
    __pyx_v_basename2_len = __pyx_v_path2_len;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":350
 *         basename2 = path2
 *         basename2_len = path2_len
 *         dirname2 = ''             # <<<<<<<<<<<<<<
 *         dirname2_len = 0
 *     else:
 */
    __pyx_v_dirname2 = __pyx_k_5;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":351
 *         basename2_len = path2_len
 *         dirname2 = ''
 *         dirname2_len = 0             # <<<<<<<<<<<<<<
 *     else:
 *         dirname2 = path2
 */
    __pyx_v_dirname2_len = 0;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":353
 *         dirname2_len = 0
 *     else:
 *         dirname2 = path2             # <<<<<<<<<<<<<<
 *         dirname2_len = basename2 - path2
 *         basename2 = basename2 + 1
 */
    __pyx_v_dirname2 = __pyx_v_path2;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":354
 *     else:
 *         dirname2 = path2
 *         dirname2_len = basename2 - path2             # <<<<<<<<<<<<<<
 *         basename2 = basename2 + 1
 *         basename2_len = path2_len - dirname2_len - 1
 */
    __pyx_v_dirname2_len = (__pyx_v_basename2 - __pyx_v_path2);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":355
 *         dirname2 = path2
 *         dirname2_len = basename2 - path2
 *         basename2 = basename2 + 1             # <<<<<<<<<<<<<<
 *         basename2_len = path2_len - dirname2_len - 1
 * 
 */
    __pyx_v_basename2 = (__pyx_v_basename2 + 1);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":356
 *         dirname2_len = basename2 - path2
 *         basename2 = basename2 + 1
 *         basename2_len = path2_len - dirname2_len - 1             # <<<<<<<<<<<<<<
 * 
 *     cmp_val = _cmp_by_dirs(dirname1, dirname1_len,
 */
    __pyx_v_basename2_len = ((__pyx_v_path2_len - __pyx_v_dirname2_len) - 1);
  }
  __pyx_L8:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":359
 * 
 *     cmp_val = _cmp_by_dirs(dirname1, dirname1_len,
 *                            dirname2, dirname2_len)             # <<<<<<<<<<<<<<
 *     if cmp_val != 0:
 *         return cmp_val
 */
  __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
 *     cmp_val = _cmp_by_dirs(dirname1, dirname1_len,
 *                            dirname2, dirname2_len)
 *     if cmp_val != 0:             # <<<<<<<<<<<<<<
 *         return cmp_val
 * 
 */
  __pyx_t_2 = (__pyx_v_cmp_val != 0);
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":361
 *                            dirname2, dirname2_len)
 *     if cmp_val != 0:
 *         return cmp_val             # <<<<<<<<<<<<<<
 * 
 *     cur_len = basename1_len
 */
    __pyx_r = __pyx_v_cmp_val;
    goto __pyx_L0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":363
 *         return cmp_val
 * 
 *     cur_len = basename1_len             # <<<<<<<<<<<<<<
 *     if basename2_len < basename1_len:
 *         cur_len = basename2_len
 */
  __pyx_v_cur_len = __pyx_v_basename1_len;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":364
 * 
 *     cur_len = basename1_len
 *     if basename2_len < basename1_len:             # <<<<<<<<<<<<<<
 *         cur_len = basename2_len
 * 
 */
  __pyx_t_2 = (__pyx_v_basename2_len < __pyx_v_basename1_len);
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":365
 *     cur_len = basename1_len
 *     if basename2_len < basename1_len:
 *         cur_len = basename2_len             # <<<<<<<<<<<<<<
 * 
 *     cmp_val = memcmp(basename1, basename2, cur_len)
 */
    __pyx_v_cur_len = __pyx_v_basename2_len;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":367
 *         cur_len = basename2_len
 * 
 *     cmp_val = memcmp(basename1, basename2, cur_len)             # <<<<<<<<<<<<<<
 *     if cmp_val != 0:
 *         return cmp_val
 */
  __pyx_v_cmp_val = memcmp(__pyx_v_basename1, __pyx_v_basename2, __pyx_v_cur_len);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":368
 * 
 *     cmp_val = memcmp(basename1, basename2, cur_len)
 *     if cmp_val != 0:             # <<<<<<<<<<<<<<
 *         return cmp_val
 *     if basename1_len == basename2_len:
 */
  __pyx_t_2 = (__pyx_v_cmp_val != 0);
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":369
 *     cmp_val = memcmp(basename1, basename2, cur_len)
 *     if cmp_val != 0:
 *         return cmp_val             # <<<<<<<<<<<<<<
 *     if basename1_len == basename2_len:
 *         return 0
 */
    __pyx_r = __pyx_v_cmp_val;
    goto __pyx_L0;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":370
 *     if cmp_val != 0:
 *         return cmp_val
 *     if basename1_len == basename2_len:             # <<<<<<<<<<<<<<
 *         return 0
 *     if basename1_len < basename2_len:
 */
  __pyx_t_2 = (__pyx_v_basename1_len == __pyx_v_basename2_len);
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":371
 *         return cmp_val
 *     if basename1_len == basename2_len:
 *         return 0             # <<<<<<<<<<<<<<
 *     if basename1_len < basename2_len:
 *         return -1
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":372
 *     if basename1_len == basename2_len:
 *         return 0
 *     if basename1_len < basename2_len:             # <<<<<<<<<<<<<<
 *         return -1
 *     return 1
 */
  __pyx_t_2 = (__pyx_v_basename1_len < __pyx_v_basename2_len);
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":373
 *         return 0
 *     if basename1_len < basename2_len:
 *         return -1             # <<<<<<<<<<<<<<
 *     return 1
 * 
 */
    __pyx_r = -1;
    goto __pyx_L0;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":374
 *     if basename1_len < basename2_len:
 *         return -1
 *     return 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 1;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":377
 * 
 * 
 * def _bisect_path_left(paths, path):             # <<<<<<<<<<<<<<
 *     """Return the index where to insert path into paths.
 * 
 */

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) {
  PyObject *__pyx_v_paths = 0;
  PyObject *__pyx_v_path = 0;
  int __pyx_v__lo;
  int __pyx_v__hi;
  int __pyx_v__mid;
  char *__pyx_v_path_cstr;
  int __pyx_v_path_size;
  char *__pyx_v_cur_cstr;
  int __pyx_v_cur_size;
  void *__pyx_v_cur;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__paths,&__pyx_n_s__path,0};
  __Pyx_RefNannySetupContext("_bisect_path_left");
  __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__paths);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("_bisect_path_left", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __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), "_bisect_path_left") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_paths = values[0];
    __pyx_v_path = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_paths = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_bisect_path_left", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._bisect_path_left");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":404
 *     cdef void *cur
 * 
 *     if not PyList_CheckExact(paths):             # <<<<<<<<<<<<<<
 *         raise TypeError("you must pass a python list for 'paths' not: %s %r"
 *                         % (type(paths), paths))
 */
  __pyx_t_1 = (!PyList_CheckExact(__pyx_v_paths));
  if (__pyx_t_1) {

    /* "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))             # <<<<<<<<<<<<<<
 *     if not PyString_CheckExact(path):
 *         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_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_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 = 405; __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 = 405; __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 = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "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):             # <<<<<<<<<<<<<<
 *         raise TypeError("you must pass a string for 'path' not: %s %r"
 *                         % (type(path), path))
 */
  __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path));
  if (__pyx_t_1) {

    /* "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))             # <<<<<<<<<<<<<<
 * 
 *     _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_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_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 = 408; __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 = 408; __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 = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":411
 *                         % (type(path), path))
 * 
 *     _hi = len(paths)             # <<<<<<<<<<<<<<
 *     _lo = 0
 * 
 */
  __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
 * 
 *     _hi = len(paths)
 *     _lo = 0             # <<<<<<<<<<<<<<
 * 
 *     path_cstr = PyString_AsString(path)
 */
  __pyx_v__lo = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":414
 *     _lo = 0
 * 
 *     path_cstr = PyString_AsString(path)             # <<<<<<<<<<<<<<
 *     path_size = PyString_Size(path)
 * 
 */
  __pyx_v_path_cstr = PyString_AsString(__pyx_v_path);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":415
 * 
 *     path_cstr = PyString_AsString(path)
 *     path_size = PyString_Size(path)             # <<<<<<<<<<<<<<
 * 
 *     while _lo < _hi:
 */
  __pyx_v_path_size = PyString_Size(__pyx_v_path);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":417
 *     path_size = PyString_Size(path)
 * 
 *     while _lo < _hi:             # <<<<<<<<<<<<<<
 *         _mid = (_lo + _hi) / 2
 *         cur = PyList_GetItem_object_void(paths, _mid)
 */
  while (1) {
    __pyx_t_1 = (__pyx_v__lo < __pyx_v__hi);
    if (!__pyx_t_1) break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":418
 * 
 *     while _lo < _hi:
 *         _mid = (_lo + _hi) / 2             # <<<<<<<<<<<<<<
 *         cur = PyList_GetItem_object_void(paths, _mid)
 *         cur_cstr = PyString_AS_STRING_void(cur)
 */
    __pyx_v__mid = __Pyx_div_long((__pyx_v__lo + __pyx_v__hi), 2);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":419
 *     while _lo < _hi:
 *         _mid = (_lo + _hi) / 2
 *         cur = PyList_GetItem_object_void(paths, _mid)             # <<<<<<<<<<<<<<
 *         cur_cstr = PyString_AS_STRING_void(cur)
 *         cur_size = PyString_GET_SIZE_void(cur)
 */
    __pyx_v_cur = PyList_GET_ITEM(__pyx_v_paths, __pyx_v__mid);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":420
 *         _mid = (_lo + _hi) / 2
 *         cur = PyList_GetItem_object_void(paths, _mid)
 *         cur_cstr = PyString_AS_STRING_void(cur)             # <<<<<<<<<<<<<<
 *         cur_size = PyString_GET_SIZE_void(cur)
 *         if _cmp_path_by_dirblock_intern(cur_cstr, cur_size,
 */
    __pyx_v_cur_cstr = PyString_AS_STRING(__pyx_v_cur);

    /* "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)             # <<<<<<<<<<<<<<
 *         if _cmp_path_by_dirblock_intern(cur_cstr, cur_size,
 *                                         path_cstr, path_size) < 0:
 */
    __pyx_v_cur_size = PyString_GET_SIZE(__pyx_v_cur);

    /* "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:             # <<<<<<<<<<<<<<
 *             _lo = _mid + 1
 *         else:
 */
    __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
 *         if _cmp_path_by_dirblock_intern(cur_cstr, cur_size,
 *                                         path_cstr, path_size) < 0:
 *             _lo = _mid + 1             # <<<<<<<<<<<<<<
 *         else:
 *             _hi = _mid
 */
      __pyx_v__lo = (__pyx_v__mid + 1);
      goto __pyx_L10;
    }
    /*else*/ {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":426
 *             _lo = _mid + 1
 *         else:
 *             _hi = _mid             # <<<<<<<<<<<<<<
 *     return _lo
 * 
 */
      __pyx_v__hi = __pyx_v__mid;
    }
    __pyx_L10:;
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":427
 *         else:
 *             _hi = _mid
 *     return _lo             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong(__pyx_v__lo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._bisect_path_left");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":430
 * 
 * 
 * def _bisect_path_right(paths, path):             # <<<<<<<<<<<<<<
 *     """Return the index where to insert path into paths.
 * 
 */

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) {
  PyObject *__pyx_v_paths = 0;
  PyObject *__pyx_v_path = 0;
  int __pyx_v__lo;
  int __pyx_v__hi;
  int __pyx_v__mid;
  char *__pyx_v_path_cstr;
  int __pyx_v_path_size;
  char *__pyx_v_cur_cstr;
  int __pyx_v_cur_size;
  void *__pyx_v_cur;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__paths,&__pyx_n_s__path,0};
  __Pyx_RefNannySetupContext("_bisect_path_right");
  __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__paths);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("_bisect_path_right", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __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), "_bisect_path_right") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_paths = values[0];
    __pyx_v_path = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_paths = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_bisect_path_right", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._bisect_path_right");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":457
 *     cdef void *cur
 * 
 *     if not PyList_CheckExact(paths):             # <<<<<<<<<<<<<<
 *         raise TypeError("you must pass a python list for 'paths' not: %s %r"
 *                         % (type(paths), paths))
 */
  __pyx_t_1 = (!PyList_CheckExact(__pyx_v_paths));
  if (__pyx_t_1) {

    /* "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))             # <<<<<<<<<<<<<<
 *     if not PyString_CheckExact(path):
 *         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_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_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 = 458; __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 = 458; __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 = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "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):             # <<<<<<<<<<<<<<
 *         raise TypeError("you must pass a string for 'path' not: %s %r"
 *                         % (type(path), path))
 */
  __pyx_t_1 = (!PyString_CheckExact(__pyx_v_path));
  if (__pyx_t_1) {

    /* "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))             # <<<<<<<<<<<<<<
 * 
 *     _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_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_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 = 461; __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 = 461; __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 = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":464
 *                         % (type(path), path))
 * 
 *     _hi = len(paths)             # <<<<<<<<<<<<<<
 *     _lo = 0
 * 
 */
  __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
 * 
 *     _hi = len(paths)
 *     _lo = 0             # <<<<<<<<<<<<<<
 * 
 *     path_cstr = PyString_AsString(path)
 */
  __pyx_v__lo = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":467
 *     _lo = 0
 * 
 *     path_cstr = PyString_AsString(path)             # <<<<<<<<<<<<<<
 *     path_size = PyString_Size(path)
 * 
 */
  __pyx_v_path_cstr = PyString_AsString(__pyx_v_path);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":468
 * 
 *     path_cstr = PyString_AsString(path)
 *     path_size = PyString_Size(path)             # <<<<<<<<<<<<<<
 * 
 *     while _lo < _hi:
 */
  __pyx_v_path_size = PyString_Size(__pyx_v_path);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":470
 *     path_size = PyString_Size(path)
 * 
 *     while _lo < _hi:             # <<<<<<<<<<<<<<
 *         _mid = (_lo + _hi) / 2
 *         cur = PyList_GetItem_object_void(paths, _mid)
 */
  while (1) {
    __pyx_t_1 = (__pyx_v__lo < __pyx_v__hi);
    if (!__pyx_t_1) break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":471
 * 
 *     while _lo < _hi:
 *         _mid = (_lo + _hi) / 2             # <<<<<<<<<<<<<<
 *         cur = PyList_GetItem_object_void(paths, _mid)
 *         cur_cstr = PyString_AS_STRING_void(cur)
 */
    __pyx_v__mid = __Pyx_div_long((__pyx_v__lo + __pyx_v__hi), 2);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":472
 *     while _lo < _hi:
 *         _mid = (_lo + _hi) / 2
 *         cur = PyList_GetItem_object_void(paths, _mid)             # <<<<<<<<<<<<<<
 *         cur_cstr = PyString_AS_STRING_void(cur)
 *         cur_size = PyString_GET_SIZE_void(cur)
 */
    __pyx_v_cur = PyList_GET_ITEM(__pyx_v_paths, __pyx_v__mid);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":473
 *         _mid = (_lo + _hi) / 2
 *         cur = PyList_GetItem_object_void(paths, _mid)
 *         cur_cstr = PyString_AS_STRING_void(cur)             # <<<<<<<<<<<<<<
 *         cur_size = PyString_GET_SIZE_void(cur)
 *         if _cmp_path_by_dirblock_intern(path_cstr, path_size,
 */
    __pyx_v_cur_cstr = PyString_AS_STRING(__pyx_v_cur);

    /* "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)             # <<<<<<<<<<<<<<
 *         if _cmp_path_by_dirblock_intern(path_cstr, path_size,
 *                                         cur_cstr, cur_size) < 0:
 */
    __pyx_v_cur_size = PyString_GET_SIZE(__pyx_v_cur);

    /* "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:             # <<<<<<<<<<<<<<
 *             _hi = _mid
 *         else:
 */
    __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
 *         if _cmp_path_by_dirblock_intern(path_cstr, path_size,
 *                                         cur_cstr, cur_size) < 0:
 *             _hi = _mid             # <<<<<<<<<<<<<<
 *         else:
 *             _lo = _mid + 1
 */
      __pyx_v__hi = __pyx_v__mid;
      goto __pyx_L10;
    }
    /*else*/ {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":479
 *             _hi = _mid
 *         else:
 *             _lo = _mid + 1             # <<<<<<<<<<<<<<
 *     return _lo
 * 
 */
      __pyx_v__lo = (__pyx_v__mid + 1);
    }
    __pyx_L10:;
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":480
 *         else:
 *             _lo = _mid + 1
 *     return _lo             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong(__pyx_v__lo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._bisect_path_right");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "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.
 * 
 */

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) {
  PyObject *__pyx_v_dirblocks = 0;
  PyObject *__pyx_v_dirname = 0;
  PyObject *__pyx_v_lo = 0;
  PyObject *__pyx_v_hi = 0;
  PyObject *__pyx_v_cache = 0;
  int __pyx_v__lo;
  int __pyx_v__hi;
  int __pyx_v__mid;
  char *__pyx_v_dirname_cstr;
  int __pyx_v_dirname_size;
  char *__pyx_v_cur_cstr;
  int __pyx_v_cur_size;
  void *__pyx_v_cur;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dirblocks,&__pyx_n_s__dirname,&__pyx_n_s__lo,&__pyx_n_s__hi,&__pyx_n_s__cache,0};
  __Pyx_RefNannySetupContext("bisect_dirblock");
  __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};
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject *)Py_None);
    values[4] = ((PyObject *)Py_None);
    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__dirblocks);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dirname);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("bisect_dirblock", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lo);
        if (value) { values[2] = value; kw_args--; }
      }
      case  3:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__hi);
        if (value) { values[3] = value; kw_args--; }
      }
      case  4:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cache);
        if (value) { values[4] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "bisect_dirblock") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_dirblocks = values[0];
    __pyx_v_dirname = values[1];
    __pyx_v_lo = values[2];
    __pyx_v_hi = values[3];
    __pyx_v_cache = values[4];
  } else {
    __pyx_v_lo = ((PyObject *)__pyx_int_0);
    __pyx_v_hi = ((PyObject *)Py_None);
    __pyx_v_cache = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5:
      __pyx_v_cache = PyTuple_GET_ITEM(__pyx_args, 4);
      case  4:
      __pyx_v_hi = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3:
      __pyx_v_lo = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2:
      __pyx_v_dirname = PyTuple_GET_ITEM(__pyx_args, 1);
      __pyx_v_dirblocks = 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("bisect_dirblock", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.bisect_dirblock");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":502
 *     cdef void *cur
 * 
 *     if not PyList_CheckExact(dirblocks):             # <<<<<<<<<<<<<<
 *         raise TypeError("you must pass a python list for 'dirblocks' not: %s %r"
 *                         % (type(dirblocks), dirblocks))
 */
  __pyx_t_1 = (!PyList_CheckExact(__pyx_v_dirblocks));
  if (__pyx_t_1) {

    /* "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))             # <<<<<<<<<<<<<<
 *     if not PyString_CheckExact(dirname):
 *         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_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_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 = 503; __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 = 503; __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 = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "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):             # <<<<<<<<<<<<<<
 *         raise TypeError("you must pass a string for dirname not: %s %r"
 *                         % (type(dirname), dirname))
 */
  __pyx_t_1 = (!PyString_CheckExact(__pyx_v_dirname));
  if (__pyx_t_1) {

    /* "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))             # <<<<<<<<<<<<<<
 *     if hi is None:
 *         _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_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_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 = 506; __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 = 506; __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 = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "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:             # <<<<<<<<<<<<<<
 *         _hi = len(dirblocks)
 *     else:
 */
  __pyx_t_1 = (__pyx_v_hi == Py_None);
  if (__pyx_t_1) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":509
 *                         % (type(dirname), dirname))
 *     if hi is None:
 *         _hi = len(dirblocks)             # <<<<<<<<<<<<<<
 *     else:
 *         _hi = hi
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_dirblocks); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v__hi = __pyx_t_4;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":511
 *         _hi = len(dirblocks)
 *     else:
 *         _hi = hi             # <<<<<<<<<<<<<<
 * 
 *     _lo = lo
 */
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_hi); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v__hi = __pyx_t_5;
  }
  __pyx_L8:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":513
 *         _hi = hi
 * 
 *     _lo = lo             # <<<<<<<<<<<<<<
 *     dirname_cstr = PyString_AsString(dirname)
 *     dirname_size = PyString_Size(dirname)
 */
  __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
 * 
 *     _lo = lo
 *     dirname_cstr = PyString_AsString(dirname)             # <<<<<<<<<<<<<<
 *     dirname_size = PyString_Size(dirname)
 * 
 */
  __pyx_v_dirname_cstr = PyString_AsString(__pyx_v_dirname);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":515
 *     _lo = lo
 *     dirname_cstr = PyString_AsString(dirname)
 *     dirname_size = PyString_Size(dirname)             # <<<<<<<<<<<<<<
 * 
 *     while _lo < _hi:
 */
  __pyx_v_dirname_size = PyString_Size(__pyx_v_dirname);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":517
 *     dirname_size = PyString_Size(dirname)
 * 
 *     while _lo < _hi:             # <<<<<<<<<<<<<<
 *         _mid = (_lo + _hi) / 2
 *         # Grab the dirname for the current dirblock
 */
  while (1) {
    __pyx_t_1 = (__pyx_v__lo < __pyx_v__hi);
    if (!__pyx_t_1) break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":518
 * 
 *     while _lo < _hi:
 *         _mid = (_lo + _hi) / 2             # <<<<<<<<<<<<<<
 *         # Grab the dirname for the current dirblock
 *         # cur = dirblocks[_mid][0]
 */
    __pyx_v__mid = __Pyx_div_long((__pyx_v__lo + __pyx_v__hi), 2);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":522
 *         # cur = dirblocks[_mid][0]
 *         cur = PyTuple_GetItem_void_void(
 *                 PyList_GetItem_object_void(dirblocks, _mid), 0)             # <<<<<<<<<<<<<<
 *         cur_cstr = PyString_AS_STRING_void(cur)
 *         cur_size = PyString_GET_SIZE_void(cur)
 */
    __pyx_v_cur = PyTuple_GET_ITEM(PyList_GET_ITEM(__pyx_v_dirblocks, __pyx_v__mid), 0);

    /* "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)             # <<<<<<<<<<<<<<
 *         cur_size = PyString_GET_SIZE_void(cur)
 *         if _cmp_by_dirs(cur_cstr, cur_size, dirname_cstr, dirname_size) < 0:
 */
    __pyx_v_cur_cstr = PyString_AS_STRING(__pyx_v_cur);

    /* "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)             # <<<<<<<<<<<<<<
 *         if _cmp_by_dirs(cur_cstr, cur_size, dirname_cstr, dirname_size) < 0:
 *             _lo = _mid + 1
 */
    __pyx_v_cur_size = PyString_GET_SIZE(__pyx_v_cur);

    /* "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:             # <<<<<<<<<<<<<<
 *             _lo = _mid + 1
 *         else:
 */
    __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
 *         cur_size = PyString_GET_SIZE_void(cur)
 *         if _cmp_by_dirs(cur_cstr, cur_size, dirname_cstr, dirname_size) < 0:
 *             _lo = _mid + 1             # <<<<<<<<<<<<<<
 *         else:
 *             _hi = _mid
 */
      __pyx_v__lo = (__pyx_v__mid + 1);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":528
 *             _lo = _mid + 1
 *         else:
 *             _hi = _mid             # <<<<<<<<<<<<<<
 *     return _lo
 * 
 */
      __pyx_v__hi = __pyx_v__mid;
    }
    __pyx_L11:;
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":529
 *         else:
 *             _hi = _mid
 *     return _lo             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong(__pyx_v__lo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.bisect_dirblock");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":544
 *     cdef char *next # Pointer to the end of this record
 * 
 *     def __init__(self, text, state):             # <<<<<<<<<<<<<<
 *         self.state = state
 *         self.text = text
 */

static int __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6Reader___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_6Reader___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_text = 0;
  PyObject *__pyx_v_state = 0;
  int __pyx_r;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__text,&__pyx_n_s__state,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__text);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__state);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __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 = 544; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_text = values[0];
    __pyx_v_state = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_text = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_state = 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 = 544; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.Reader.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":545
 * 
 *     def __init__(self, text, state):
 *         self.state = state             # <<<<<<<<<<<<<<
 *         self.text = text
 *         self.text_cstr = PyString_AsString(text)
 */
  __Pyx_INCREF(__pyx_v_state);
  __Pyx_GIVEREF(__pyx_v_state);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state);
  __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
 *     def __init__(self, text, state):
 *         self.state = state
 *         self.text = text             # <<<<<<<<<<<<<<
 *         self.text_cstr = PyString_AsString(text)
 *         self.text_size = PyString_Size(text)
 */
  __Pyx_INCREF(__pyx_v_text);
  __Pyx_GIVEREF(__pyx_v_text);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->text);
  __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
 *         self.state = state
 *         self.text = text
 *         self.text_cstr = PyString_AsString(text)             # <<<<<<<<<<<<<<
 *         self.text_size = PyString_Size(text)
 *         self.end_cstr = self.text_cstr + self.text_size
 */
  ((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
 *         self.text = text
 *         self.text_cstr = PyString_AsString(text)
 *         self.text_size = PyString_Size(text)             # <<<<<<<<<<<<<<
 *         self.end_cstr = self.text_cstr + self.text_size
 *         self.cur_cstr = self.text_cstr
 */
  ((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
 *         self.text_cstr = PyString_AsString(text)
 *         self.text_size = PyString_Size(text)
 *         self.end_cstr = self.text_cstr + self.text_size             # <<<<<<<<<<<<<<
 *         self.cur_cstr = self.text_cstr
 * 
 */
  ((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
 *         self.text_size = PyString_Size(text)
 *         self.end_cstr = self.text_cstr + self.text_size
 *         self.cur_cstr = self.text_cstr             # <<<<<<<<<<<<<<
 * 
 *     cdef char *get_next(self, int *size) except NULL:
 */
  ((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)->text_cstr;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":552
 *         self.cur_cstr = self.text_cstr
 * 
 *     cdef char *get_next(self, int *size) except NULL:             # <<<<<<<<<<<<<<
 *         """Return a pointer to the start of the next field."""
 *         cdef char *next
 */

static  char *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader_get_next(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *__pyx_v_self, int *__pyx_v_size) {
  char *__pyx_v_next;
  Py_ssize_t __pyx_v_extra_len;
  char *__pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("get_next");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":557
 *         cdef Py_ssize_t extra_len
 * 
 *         if self.cur_cstr == NULL:             # <<<<<<<<<<<<<<
 *             raise AssertionError('get_next() called when cur_str is NULL')
 *         elif self.cur_cstr >= self.end_cstr:
 */
  __pyx_t_1 = (__pyx_v_self->cur_cstr == NULL);
  if (__pyx_t_1) {

    /* "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_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 = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }

  /* "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:             # <<<<<<<<<<<<<<
 *             raise AssertionError('get_next() called when there are no chars'
 *                                  ' left')
 */
  __pyx_t_1 = (__pyx_v_self->cur_cstr >= __pyx_v_self->end_cstr);
  if (__pyx_t_1) {

    /* "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_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 = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":562
 *             raise AssertionError('get_next() called when there are no chars'
 *                                  ' left')
 *         next = self.cur_cstr             # <<<<<<<<<<<<<<
 *         self.cur_cstr = <char*>memchr(next, c'\0', self.end_cstr - next)
 *         if self.cur_cstr == NULL:
 */
  __pyx_v_next = __pyx_v_self->cur_cstr;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":563
 *                                  ' left')
 *         next = self.cur_cstr
 *         self.cur_cstr = <char*>memchr(next, c'\0', self.end_cstr - next)             # <<<<<<<<<<<<<<
 *         if self.cur_cstr == NULL:
 *             extra_len = self.end_cstr - next
 */
  __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
 *         next = self.cur_cstr
 *         self.cur_cstr = <char*>memchr(next, c'\0', self.end_cstr - next)
 *         if self.cur_cstr == NULL:             # <<<<<<<<<<<<<<
 *             extra_len = self.end_cstr - next
 *             raise errors.DirstateCorrupt(self.state,
 */
  __pyx_t_1 = (__pyx_v_self->cur_cstr == NULL);
  if (__pyx_t_1) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":565
 *         self.cur_cstr = <char*>memchr(next, c'\0', self.end_cstr - next)
 *         if self.cur_cstr == NULL:
 *             extra_len = self.end_cstr - next             # <<<<<<<<<<<<<<
 *             raise errors.DirstateCorrupt(self.state,
 *                 'failed to find trailing NULL (\\0).'
 */
    __pyx_v_extra_len = (__pyx_v_self->end_cstr - __pyx_v_next);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":566
 *         if self.cur_cstr == NULL:
 *             extra_len = self.end_cstr - next
 *             raise errors.DirstateCorrupt(self.state,             # <<<<<<<<<<<<<<
 *                 'failed to find trailing NULL (\\0).'
 *                 ' Trailing garbage: %r'
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__DirstateCorrupt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":569
 *                 'failed to find trailing NULL (\\0).'
 *                 ' Trailing garbage: %r'
 *                 % safe_string_from_size(next, extra_len))             # <<<<<<<<<<<<<<
 *         size[0] = self.cur_cstr - next
 *         self.cur_cstr = self.cur_cstr + 1
 */
    __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_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_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_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __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 = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":570
 *                 ' Trailing garbage: %r'
 *                 % safe_string_from_size(next, extra_len))
 *         size[0] = self.cur_cstr - next             # <<<<<<<<<<<<<<
 *         self.cur_cstr = self.cur_cstr + 1
 *         return next
 */
  (__pyx_v_size[0]) = (__pyx_v_self->cur_cstr - __pyx_v_next);

  /* "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             # <<<<<<<<<<<<<<
 *         return next
 * 
 */
  __pyx_v_self->cur_cstr = (__pyx_v_self->cur_cstr + 1);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":572
 *         size[0] = self.cur_cstr - next
 *         self.cur_cstr = self.cur_cstr + 1
 *         return next             # <<<<<<<<<<<<<<
 * 
 *     cdef object get_next_str(self):
 */
  __pyx_r = __pyx_v_next;
  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_AddTraceback("bzrlib._dirstate_helpers_pyx.Reader.get_next");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":574
 *         return next
 * 
 *     cdef object get_next_str(self):             # <<<<<<<<<<<<<<
 *         """Get the next field as a Python string."""
 *         cdef int size
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader_get_next_str(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *__pyx_v_self) {
  int __pyx_v_size;
  char *__pyx_v_next;
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_next_str");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":578
 *         cdef int size
 *         cdef char *next
 *         next = self.get_next(&size)             # <<<<<<<<<<<<<<
 *         return safe_string_from_size(next, size)
 * 
 */
  __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
 *         cdef char *next
 *         next = self.get_next(&size)
 *         return safe_string_from_size(next, size)             # <<<<<<<<<<<<<<
 * 
 *     cdef int _init(self) except -1:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx_safe_string_from_size(__pyx_v_next, __pyx_v_size); 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_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_2);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.Reader.get_next_str");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":581
 *         return safe_string_from_size(next, size)
 * 
 *     cdef int _init(self) except -1:             # <<<<<<<<<<<<<<
 *         """Get the pointer ready.
 * 
 */

static  int __pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader__init(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *__pyx_v_self) {
  char *__pyx_v_first;
  int __pyx_v_size;
  int __pyx_r;
  char *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("_init");

  /* "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)             # <<<<<<<<<<<<<<
 *         if first[0] != c'\0' and size == 0:
 *             raise AssertionError('First character should be null not: %s'
 */
  __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
 *         # 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:             # <<<<<<<<<<<<<<
 *             raise AssertionError('First character should be null not: %s'
 *                                  % (first,))
 */
  __pyx_t_2 = ((__pyx_v_first[0]) != '\x00');
  if (__pyx_t_2) {
    __pyx_t_3 = (__pyx_v_size == 0);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":595
 *         if first[0] != c'\0' and size == 0:
 *             raise AssertionError('First character should be null not: %s'
 *                                  % (first,))             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    __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));
    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_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 = 594; __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_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_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 = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":596
 *             raise AssertionError('First character should be null not: %s'
 *                                  % (first,))
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cdef object _get_entry(self, int num_trees, void **p_current_dirname,
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.Reader._init");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":598
 *         return 0
 * 
 *     cdef object _get_entry(self, int num_trees, void **p_current_dirname,             # <<<<<<<<<<<<<<
 *                            int *new_block):
 *         """Extract the next entry.
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_6Reader__get_entry(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *__pyx_v_self, int __pyx_v_num_trees, void **__pyx_v_p_current_dirname, int *__pyx_v_new_block) {
  StaticTuple *__pyx_v_path_name_file_id_key;
  StaticTuple *__pyx_v_tmp;
  char *__pyx_v_entry_size_cstr;
  unsigned long __pyx_v_entry_size;
  char *__pyx_v_executable_cstr;
  int __pyx_v_is_executable;
  char *__pyx_v_dirname_cstr;
  char *__pyx_v_trailing;
  int __pyx_v_cur_size;
  int __pyx_v_i;
  PyObject *__pyx_v_minikind;
  PyObject *__pyx_v_fingerprint;
  PyObject *__pyx_v_info;
  PyObject *__pyx_v_dirname;
  PyObject *__pyx_v_cur_dirname;
  PyObject *__pyx_v_cur_basename;
  PyObject *__pyx_v_cur_file_id;
  PyObject *__pyx_v_trees;
  PyObject *__pyx_v_ret;
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  void *__pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("_get_entry");
  __pyx_v_path_name_file_id_key = ((StaticTuple *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_tmp = ((StaticTuple *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_minikind = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_fingerprint = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_info = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_dirname = Py_None; __Pyx_INCREF(Py_None);
  __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);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":634
 * 
 *         # Read the 'key' information (dirname, name, file_id)
 *         dirname_cstr = self.get_next(&cur_size)             # <<<<<<<<<<<<<<
 *         # Check to see if we have started a new directory block.
 *         # If so, then we need to create a new dirname PyString, so that it can
 */
  __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
 *         # 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])             # <<<<<<<<<<<<<<
 *             or strncmp(dirname_cstr,
 *                        # Extract the char* from our current dirname string.  We
 */
  __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
 *                        # <object>
 *                        PyString_AS_STRING_void(p_current_dirname[0]),
 *                        cur_size+1) != 0):             # <<<<<<<<<<<<<<
 *             dirname = safe_string_from_size(dirname_cstr, cur_size)
 *             p_current_dirname[0] = <void*>dirname
 */
    __pyx_t_3 = (strncmp(__pyx_v_dirname_cstr, PyString_AS_STRING((__pyx_v_p_current_dirname[0])), (__pyx_v_cur_size + 1)) != 0);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  if (__pyx_t_4) {

    /* "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)             # <<<<<<<<<<<<<<
 *             p_current_dirname[0] = <void*>dirname
 *             new_block[0] = 1
 */
    __pyx_t_5 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx_safe_string_from_size(__pyx_v_dirname_cstr, __pyx_v_cur_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_v_dirname);
    __pyx_v_dirname = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":652
 *                        cur_size+1) != 0):
 *             dirname = safe_string_from_size(dirname_cstr, cur_size)
 *             p_current_dirname[0] = <void*>dirname             # <<<<<<<<<<<<<<
 *             new_block[0] = 1
 *         else:
 */
    (__pyx_v_p_current_dirname[0]) = ((void *)__pyx_v_dirname);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":653
 *             dirname = safe_string_from_size(dirname_cstr, cur_size)
 *             p_current_dirname[0] = <void*>dirname
 *             new_block[0] = 1             # <<<<<<<<<<<<<<
 *         else:
 *             new_block[0] = 0
 */
    (__pyx_v_new_block[0]) = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":655
 *             new_block[0] = 1
 *         else:
 *             new_block[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         # Build up the key that will be used.
 */
    (__pyx_v_new_block[0]) = 0;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":660
 *         # By using <object>(void *) Pyrex will automatically handle the
 *         # Py_INCREF that we need.
 *         cur_dirname = <object>p_current_dirname[0]             # <<<<<<<<<<<<<<
 *         # Use StaticTuple_New to pre-allocate, rather than creating a regular
 *         # tuple and passing it to the StaticTuple constructor.
 */
  __pyx_t_6 = (__pyx_v_p_current_dirname[0]);
  __Pyx_INCREF(((PyObject *)__pyx_t_6));
  __Pyx_DECREF(__pyx_v_cur_dirname);
  __pyx_v_cur_dirname = ((PyObject *)__pyx_t_6);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":667
 *         #                          self.get_next_str(),
 *         #                         )
 *         tmp = StaticTuple_New(3)             # <<<<<<<<<<<<<<
 *         Py_INCREF(cur_dirname); StaticTuple_SET_ITEM(tmp, 0, cur_dirname)
 *         cur_basename = self.get_next_str()
 */
  __pyx_t_5 = ((PyObject *)StaticTuple_New(3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_v_tmp));
  __pyx_v_tmp = ((StaticTuple *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":668
 *         #                         )
 *         tmp = StaticTuple_New(3)
 *         Py_INCREF(cur_dirname); StaticTuple_SET_ITEM(tmp, 0, cur_dirname)             # <<<<<<<<<<<<<<
 *         cur_basename = self.get_next_str()
 *         cur_file_id = self.get_next_str()
 */
  Py_INCREF(__pyx_v_cur_dirname);
  StaticTuple_SET_ITEM(__pyx_v_tmp, 0, __pyx_v_cur_dirname);

  /* "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()             # <<<<<<<<<<<<<<
 *         cur_file_id = self.get_next_str()
 *         Py_INCREF(cur_basename); StaticTuple_SET_ITEM(tmp, 1, cur_basename)
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next_str(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_v_cur_basename);
  __pyx_v_cur_basename = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "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()             # <<<<<<<<<<<<<<
 *         Py_INCREF(cur_basename); StaticTuple_SET_ITEM(tmp, 1, cur_basename)
 *         Py_INCREF(cur_file_id); StaticTuple_SET_ITEM(tmp, 2, cur_file_id)
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next_str(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_v_cur_file_id);
  __pyx_v_cur_file_id = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "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)             # <<<<<<<<<<<<<<
 *         Py_INCREF(cur_file_id); StaticTuple_SET_ITEM(tmp, 2, cur_file_id)
 *         path_name_file_id_key = tmp
 */
  Py_INCREF(__pyx_v_cur_basename);
  StaticTuple_SET_ITEM(__pyx_v_tmp, 1, __pyx_v_cur_basename);

  /* "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)             # <<<<<<<<<<<<<<
 *         path_name_file_id_key = tmp
 * 
 */
  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
 *         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             # <<<<<<<<<<<<<<
 * 
 *         # Parse all of the per-tree information. current has the information in
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_tmp));
  __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
 *         #       Especially since this code is pretty much fixed at a max of
 *         #       4GB.
 *         trees = []             # <<<<<<<<<<<<<<
 *         for i from 0 <= i < num_trees:
 *             minikind = self.get_next_str()
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __Pyx_DECREF(((PyObject *)__pyx_v_trees));
  __pyx_v_trees = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":689
 *         #       4GB.
 *         trees = []
 *         for i from 0 <= i < num_trees:             # <<<<<<<<<<<<<<
 *             minikind = self.get_next_str()
 *             fingerprint = self.get_next_str()
 */
  __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
 *         trees = []
 *         for i from 0 <= i < num_trees:
 *             minikind = self.get_next_str()             # <<<<<<<<<<<<<<
 *             fingerprint = self.get_next_str()
 *             entry_size_cstr = self.get_next(&cur_size)
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next_str(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_v_minikind);
    __pyx_v_minikind = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":691
 *         for i from 0 <= i < num_trees:
 *             minikind = self.get_next_str()
 *             fingerprint = self.get_next_str()             # <<<<<<<<<<<<<<
 *             entry_size_cstr = self.get_next(&cur_size)
 *             entry_size = strtoul(entry_size_cstr, NULL, 10)
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next_str(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_v_fingerprint);
    __pyx_v_fingerprint = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":692
 *             minikind = self.get_next_str()
 *             fingerprint = self.get_next_str()
 *             entry_size_cstr = self.get_next(&cur_size)             # <<<<<<<<<<<<<<
 *             entry_size = strtoul(entry_size_cstr, NULL, 10)
 *             executable_cstr = self.get_next(&cur_size)
 */
    __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
 *             fingerprint = self.get_next_str()
 *             entry_size_cstr = self.get_next(&cur_size)
 *             entry_size = strtoul(entry_size_cstr, NULL, 10)             # <<<<<<<<<<<<<<
 *             executable_cstr = self.get_next(&cur_size)
 *             is_executable = (executable_cstr[0] == c'y')
 */
    __pyx_v_entry_size = strtoul(__pyx_v_entry_size_cstr, NULL, 10);

    /* "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)             # <<<<<<<<<<<<<<
 *             is_executable = (executable_cstr[0] == c'y')
 *             info = self.get_next_str()
 */
    __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
 *             entry_size = strtoul(entry_size_cstr, NULL, 10)
 *             executable_cstr = self.get_next(&cur_size)
 *             is_executable = (executable_cstr[0] == c'y')             # <<<<<<<<<<<<<<
 *             info = self.get_next_str()
 *             # TODO: If we want to use StaticTuple_New here we need to be pretty
 */
    __pyx_v_is_executable = ((__pyx_v_executable_cstr[0]) == 'y');

    /* "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()             # <<<<<<<<<<<<<<
 *             # TODO: If we want to use StaticTuple_New here we need to be pretty
 *             #       careful. We are relying on a bit of Pyrex
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self->__pyx_vtab)->get_next_str(__pyx_v_self); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_v_info);
    __pyx_v_info = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":713
 *                 minikind,     # minikind
 *                 fingerprint,  # fingerprint
 *                 entry_size,   # size             # <<<<<<<<<<<<<<
 *                 is_executable,# executable
 *                 info,         # packed_stat or revision_id
 */
    __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
 *                 fingerprint,  # fingerprint
 *                 entry_size,   # size
 *                 is_executable,# executable             # <<<<<<<<<<<<<<
 *                 info,         # packed_stat or revision_id
 *             ))
 */
    __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
 *                 entry_size,   # size
 *                 is_executable,# executable
 *                 info,         # packed_stat or revision_id             # <<<<<<<<<<<<<<
 *             ))
 * 
 */
    __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_INCREF(__pyx_v_minikind);
    PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_minikind);
    __Pyx_GIVEREF(__pyx_v_minikind);
    __Pyx_INCREF(__pyx_v_fingerprint);
    PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_fingerprint);
    __Pyx_GIVEREF(__pyx_v_fingerprint);
    PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_8);
    __Pyx_INCREF(__pyx_v_info);
    PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_info);
    __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_GOTREF(__pyx_t_8);
    __Pyx_DECREF(((PyObject *)__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
 * 
 *         # The returned tuple is (key, [trees])
 *         ret = (path_name_file_id_key, trees)             # <<<<<<<<<<<<<<
 *         # Ignore the trailing newline, but assert that it does exist, this
 *         # 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_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));
  __Pyx_DECREF(((PyObject *)__pyx_v_ret));
  __pyx_v_ret = __pyx_t_8;
  __pyx_t_8 = 0;

  /* "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)             # <<<<<<<<<<<<<<
 *         if cur_size != 1 or trailing[0] != c'\n':
 *             raise errors.DirstateCorrupt(self.state,
 */
  __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
 *         # marker.
 *         trailing = self.get_next(&cur_size)
 *         if cur_size != 1 or trailing[0] != c'\n':             # <<<<<<<<<<<<<<
 *             raise errors.DirstateCorrupt(self.state,
 *                 'Bad parse, we expected to end on \\n, not: %d %s: %s'
 */
  __pyx_t_4 = (__pyx_v_cur_size != 1);
  if (!__pyx_t_4) {
    __pyx_t_2 = ((__pyx_v_trailing[0]) != '\n');
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  if (__pyx_t_3) {

    /* "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,             # <<<<<<<<<<<<<<
 *                 'Bad parse, we expected to end on \\n, not: %d %s: %s'
 *                 % (cur_size, safe_string_from_size(trailing, cur_size),
 */
    __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__DirstateCorrupt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "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),             # <<<<<<<<<<<<<<
 *                    ret))
 *         return ret
 */
    __pyx_t_8 = PyInt_FromLong(__pyx_v_cur_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_8);
    __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
 *                 'Bad parse, we expected to end on \\n, not: %d %s: %s'
 *                 % (cur_size, safe_string_from_size(trailing, cur_size),
 *                    ret))             # <<<<<<<<<<<<<<
 *         return ret
 * 
 */
    __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));
    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);
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)__pyx_v_ret));
    PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_v_ret));
    __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_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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_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_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(((PyObject *)__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;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":729
 *                 % (cur_size, safe_string_from_size(trailing, cur_size),
 *                    ret))
 *         return ret             # <<<<<<<<<<<<<<
 * 
 *     def _parse_dirblocks(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ret));
  __pyx_r = ((PyObject *)__pyx_v_ret);
  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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.Reader._get_entry");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_path_name_file_id_key);
  __Pyx_DECREF((PyObject *)__pyx_v_tmp);
  __Pyx_DECREF(__pyx_v_minikind);
  __Pyx_DECREF(__pyx_v_fingerprint);
  __Pyx_DECREF(__pyx_v_info);
  __Pyx_DECREF(__pyx_v_dirname);
  __Pyx_DECREF(__pyx_v_cur_dirname);
  __Pyx_DECREF(__pyx_v_cur_basename);
  __Pyx_DECREF(__pyx_v_cur_file_id);
  __Pyx_DECREF(__pyx_v_trees);
  __Pyx_DECREF(__pyx_v_ret);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":731
 *         return ret
 * 
 *     def _parse_dirblocks(self):             # <<<<<<<<<<<<<<
 *         """Parse all dirblocks in the state file."""
 *         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) {
  int __pyx_v_num_trees;
  PyObject *__pyx_v_current_block;
  PyObject *__pyx_v_entry;
  void *__pyx_v_current_dirname;
  int __pyx_v_new_block;
  int __pyx_v_expected_entry_count;
  int __pyx_v_entry_count;
  PyObject *__pyx_v_dirblocks;
  PyObject *__pyx_v_obj;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __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_obj = Py_None; __Pyx_INCREF(Py_None);

  /* "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_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);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_trees = __pyx_t_3;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":742
 * 
 *         num_trees = self.state._num_present_parents() + 1
 *         expected_entry_count = self.state._num_entries             # <<<<<<<<<<<<<<
 * 
 *         # Ignore the first record
 */
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->state, __pyx_n_s___num_entries); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_expected_entry_count = __pyx_t_3;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":745
 * 
 *         # Ignore the first record
 *         self._init()             # <<<<<<<<<<<<<<
 * 
 *         current_block = []
 */
  __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
 *         self._init()
 * 
 *         current_block = []             # <<<<<<<<<<<<<<
 *         dirblocks = [('', current_block), ('', [])]
 *         self.state._dirblocks = dirblocks
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_current_block);
  __pyx_v_current_block = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":748
 * 
 *         current_block = []
 *         dirblocks = [('', current_block), ('', [])]             # <<<<<<<<<<<<<<
 *         self.state._dirblocks = dirblocks
 *         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_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));
  __Pyx_INCREF(__pyx_v_current_block);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_current_block);
  __Pyx_GIVEREF(__pyx_v_current_block);
  __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_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));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __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));
  __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
 *         current_block = []
 *         dirblocks = [('', current_block), ('', [])]
 *         self.state._dirblocks = dirblocks             # <<<<<<<<<<<<<<
 *         obj = ''
 *         current_dirname = <void*>obj
 */
  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
 *         dirblocks = [('', current_block), ('', [])]
 *         self.state._dirblocks = dirblocks
 *         obj = ''             # <<<<<<<<<<<<<<
 *         current_dirname = <void*>obj
 *         new_block = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
  __Pyx_DECREF(__pyx_v_obj);
  __pyx_v_obj = ((PyObject *)__pyx_kp_s_5);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":751
 *         self.state._dirblocks = dirblocks
 *         obj = ''
 *         current_dirname = <void*>obj             # <<<<<<<<<<<<<<
 *         new_block = 0
 *         entry_count = 0
 */
  __pyx_v_current_dirname = ((void *)__pyx_v_obj);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":752
 *         obj = ''
 *         current_dirname = <void*>obj
 *         new_block = 0             # <<<<<<<<<<<<<<
 *         entry_count = 0
 * 
 */
  __pyx_v_new_block = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":753
 *         current_dirname = <void*>obj
 *         new_block = 0
 *         entry_count = 0             # <<<<<<<<<<<<<<
 * 
 *         # TODO: jam 2007-05-07 Consider pre-allocating some space for the
 */
  __pyx_v_entry_count = 0;

  /* "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:             # <<<<<<<<<<<<<<
 *             entry = self._get_entry(num_trees, &current_dirname, &new_block)
 *             if new_block:
 */
  while (1) {
    __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
 *         #       rather than lots of reallocs.
 *         while self.cur_cstr < self.end_cstr:
 *             entry = self._get_entry(num_trees, &current_dirname, &new_block)             # <<<<<<<<<<<<<<
 *             if new_block:
 *                 # new block - different dirname
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_Reader *)((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self)->__pyx_vtab)->_get_entry(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)__pyx_v_self), __pyx_v_num_trees, (&__pyx_v_current_dirname), (&__pyx_v_new_block)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __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/_dirstate_helpers_pyx.pyx":764
 *         while self.cur_cstr < self.end_cstr:
 *             entry = self._get_entry(num_trees, &current_dirname, &new_block)
 *             if new_block:             # <<<<<<<<<<<<<<
 *                 # new block - different dirname
 *                 current_block = []
 */
    if (__pyx_v_new_block) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":766
 *             if new_block:
 *                 # new block - different dirname
 *                 current_block = []             # <<<<<<<<<<<<<<
 *                 PyList_Append(dirblocks,
 *                               (<object>current_dirname, current_block))
 */
      __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(__pyx_v_current_block);
      __pyx_v_current_block = ((PyObject *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":768
 *                 current_block = []
 *                 PyList_Append(dirblocks,
 *                               (<object>current_dirname, current_block))             # <<<<<<<<<<<<<<
 *             PyList_Append(current_block, entry)
 *             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_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;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":769
 *                 PyList_Append(dirblocks,
 *                               (<object>current_dirname, current_block))
 *             PyList_Append(current_block, entry)             # <<<<<<<<<<<<<<
 *             entry_count = entry_count + 1
 *         if entry_count != expected_entry_count:
 */
    __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
 *                               (<object>current_dirname, current_block))
 *             PyList_Append(current_block, entry)
 *             entry_count = entry_count + 1             # <<<<<<<<<<<<<<
 *         if entry_count != expected_entry_count:
 *             raise errors.DirstateCorrupt(self.state,
 */
    __pyx_v_entry_count = (__pyx_v_entry_count + 1);
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":771
 *             PyList_Append(current_block, entry)
 *             entry_count = entry_count + 1
 *         if entry_count != expected_entry_count:             # <<<<<<<<<<<<<<
 *             raise errors.DirstateCorrupt(self.state,
 *                     'We read the wrong number of entries.'
 */
  __pyx_t_5 = (__pyx_v_entry_count != __pyx_v_expected_entry_count);
  if (__pyx_t_5) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":772
 *             entry_count = entry_count + 1
 *         if entry_count != expected_entry_count:
 *             raise errors.DirstateCorrupt(self.state,             # <<<<<<<<<<<<<<
 *                     'We read the wrong number of entries.'
 *                     ' We expected to read %s, but read %s'
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__DirstateCorrupt); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "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))             # <<<<<<<<<<<<<<
 *         self.state._split_root_dirblock_into_contents()
 * 
 */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_expected_entry_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __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));
    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_GOTREF(((PyObject *)__pyx_t_1));
    __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 = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__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_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__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;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "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_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);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.Reader._parse_dirblocks");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_current_block);
  __Pyx_DECREF(__pyx_v_entry);
  __Pyx_DECREF(__pyx_v_dirblocks);
  __Pyx_DECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":779
 * 
 * 
 * def _read_dirblocks(state):             # <<<<<<<<<<<<<<
 *     """Read in the dirblocks for the given DirState object.
 * 
 */

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) {
  PyObject *__pyx_v_text;
  struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *__pyx_v_reader;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_read_dirblocks");
  __pyx_self = __pyx_self;
  __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
 *         the DirState object.
 *     """
 *     state._state_file.seek(state._end_of_header)             # <<<<<<<<<<<<<<
 *     text = state._state_file.read()
 *     # TODO: check the crc checksums. crc_measured = zlib.crc32(text)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s___state_file); 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_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__seek); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __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_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));
  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_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_1); __pyx_t_1 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":792
 *     """
 *     state._state_file.seek(state._end_of_header)
 *     text = state._state_file.read()             # <<<<<<<<<<<<<<
 *     # TODO: check the crc checksums. crc_measured = zlib.crc32(text)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_state, __pyx_n_s___state_file); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__read); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_text);
  __pyx_v_text = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":795
 *     # TODO: check the crc checksums. crc_measured = zlib.crc32(text)
 * 
 *     reader = Reader(text, state)             # <<<<<<<<<<<<<<
 * 
 *     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_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_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__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
 *     reader = Reader(text, state)
 * 
 *     reader._parse_dirblocks()             # <<<<<<<<<<<<<<
 *     state._dirblock_state = DirState.IN_MEMORY_UNMODIFIED
 * 
 */
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_reader), __pyx_n_s___parse_dirblocks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __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_1); __pyx_t_1 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":798
 * 
 *     reader._parse_dirblocks()
 *     state._dirblock_state = DirState.IN_MEMORY_UNMODIFIED             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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_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;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_3);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._read_dirblocks");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_text);
  __Pyx_DECREF((PyObject *)__pyx_v_reader);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":801
 * 
 * 
 * cdef int minikind_from_mode(int mode): # cannot_raise             # <<<<<<<<<<<<<<
 *     # in order of frequency:
 *     if S_ISREG(mode):
 */

static  int __pyx_f_6bzrlib_21_dirstate_helpers_pyx_minikind_from_mode(int __pyx_v_mode) {
  int __pyx_r;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("minikind_from_mode");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":803
 * cdef int minikind_from_mode(int mode): # cannot_raise
 *     # in order of frequency:
 *     if S_ISREG(mode):             # <<<<<<<<<<<<<<
 *         return c"f"
 *     if S_ISDIR(mode):
 */
  __pyx_t_1 = S_ISREG(__pyx_v_mode);
  if (__pyx_t_1) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":804
 *     # in order of frequency:
 *     if S_ISREG(mode):
 *         return c"f"             # <<<<<<<<<<<<<<
 *     if S_ISDIR(mode):
 *         return c"d"
 */
    __pyx_r = 'f';
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":805
 *     if S_ISREG(mode):
 *         return c"f"
 *     if S_ISDIR(mode):             # <<<<<<<<<<<<<<
 *         return c"d"
 *     if S_ISLNK(mode):
 */
  __pyx_t_1 = S_ISDIR(__pyx_v_mode);
  if (__pyx_t_1) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":806
 *         return c"f"
 *     if S_ISDIR(mode):
 *         return c"d"             # <<<<<<<<<<<<<<
 *     if S_ISLNK(mode):
 *         return c"l"
 */
    __pyx_r = 'd';
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":807
 *     if S_ISDIR(mode):
 *         return c"d"
 *     if S_ISLNK(mode):             # <<<<<<<<<<<<<<
 *         return c"l"
 *     return 0
 */
  __pyx_t_1 = S_ISLNK(__pyx_v_mode);
  if (__pyx_t_1) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":808
 *         return c"d"
 *     if S_ISLNK(mode):
 *         return c"l"             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
    __pyx_r = 'l';
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":809
 *     if S_ISLNK(mode):
 *         return c"l"
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":815
 * 
 * 
 * cdef _pack_stat(stat_value):             # <<<<<<<<<<<<<<
 *     """return a string representing the stat value's key fields.
 * 
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx__pack_stat(PyObject *__pyx_v_stat_value) {
  char __pyx_v_result[(6 * 4)];
  int *__pyx_v_aliased;
  PyObject *__pyx_v_packed;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  unsigned long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_pack_stat");
  __pyx_v_packed = Py_None; __Pyx_INCREF(Py_None);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":823
 *     cdef char result[6*4] # 6 long ints
 *     cdef int *aliased
 *     aliased = <int *>result             # <<<<<<<<<<<<<<
 *     aliased[0] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_size))
 *     # mtime and ctime will often be floats but get converted to PyInt within
 */
  __pyx_v_aliased = ((int *)__pyx_v_result);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":824
 *     cdef int *aliased
 *     aliased = <int *>result
 *     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))
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsUnsignedLongMask(__pyx_t_1); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (__pyx_v_aliased[0]) = htonl(__pyx_t_2);

  /* "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))             # <<<<<<<<<<<<<<
 *     aliased[2] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_ctime))
 *     aliased[3] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_dev))
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_mtime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsUnsignedLongMask(__pyx_t_1); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (__pyx_v_aliased[1]) = htonl(__pyx_t_2);

  /* "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))             # <<<<<<<<<<<<<<
 *     aliased[3] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_dev))
 *     aliased[4] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_ino))
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_ctime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsUnsignedLongMask(__pyx_t_1); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (__pyx_v_aliased[2]) = htonl(__pyx_t_2);

  /* "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))             # <<<<<<<<<<<<<<
 *     aliased[4] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_ino))
 *     aliased[5] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_mode))
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_dev); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsUnsignedLongMask(__pyx_t_1); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (__pyx_v_aliased[3]) = htonl(__pyx_t_2);

  /* "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))             # <<<<<<<<<<<<<<
 *     aliased[5] = htonl(PyInt_AsUnsignedLongMask(stat_value.st_mode))
 *     packed = PyString_FromStringAndSize(result, 6*4)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_ino); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsUnsignedLongMask(__pyx_t_1); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (__pyx_v_aliased[4]) = htonl(__pyx_t_2);

  /* "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))             # <<<<<<<<<<<<<<
 *     packed = PyString_FromStringAndSize(result, 6*4)
 *     return _encode(packed)[:-1]
 */
  __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 = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_AsUnsignedLongMask(__pyx_t_1); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (__pyx_v_aliased[5]) = htonl(__pyx_t_2);

  /* "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)             # <<<<<<<<<<<<<<
 *     return _encode(packed)[:-1]
 * 
 */
  __pyx_t_1 = PyString_FromStringAndSize(__pyx_v_result, 24); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_packed);
  __pyx_v_packed = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "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]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __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_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_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_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._pack_stat");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_packed);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "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)
 */

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) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pack_stat");
  __pyx_self = __pyx_self;

  /* "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)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__pack_stat(__pyx_v_stat_value); 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_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._dirstate_helpers_pyx.pack_stat");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":840
 * 
 * 
 * def update_entry(self, entry, abspath, stat_value):             # <<<<<<<<<<<<<<
 *     """Update the entry based on what is actually on disk.
 * 
 */

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) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_entry = 0;
  PyObject *__pyx_v_abspath = 0;
  PyObject *__pyx_v_stat_value = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__entry,&__pyx_n_s__abspath,&__pyx_n_s__stat_value,0};
  __Pyx_RefNannySetupContext("update_entry");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[4] = {0,0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      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__entry);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("update_entry", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__abspath);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("update_entry", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  3:
      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__stat_value);
      if (likely(values[3])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("update_entry", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __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_entry") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_self = values[0];
    __pyx_v_entry = values[1];
    __pyx_v_abspath = values[2];
    __pyx_v_stat_value = values[3];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_entry = PyTuple_GET_ITEM(__pyx_args, 1);
    __pyx_v_abspath = PyTuple_GET_ITEM(__pyx_args, 2);
    __pyx_v_stat_value = PyTuple_GET_ITEM(__pyx_args, 3);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("update_entry", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.update_entry");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":854
 *         target of a symlink.
 *     """
 *     return _update_entry(self, entry, abspath, stat_value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__update_entry(__pyx_v_self, __pyx_v_entry, __pyx_v_abspath, __pyx_v_stat_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __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._dirstate_helpers_pyx.update_entry");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":857
 * 
 * 
 * cdef _update_entry(self, entry, abspath, stat_value):             # <<<<<<<<<<<<<<
 *     """Update the entry based on what is actually on disk.
 * 
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx__update_entry(PyObject *__pyx_v_self, PyObject *__pyx_v_entry, PyObject *__pyx_v_abspath, PyObject *__pyx_v_stat_value) {
  int __pyx_v_minikind;
  int __pyx_v_saved_minikind;
  void *__pyx_v_details;
  int __pyx_v_worth_saving;
  PyObject *__pyx_v_packed_stat;
  PyObject *__pyx_v_saved_link_or_sha1;
  PyObject *__pyx_v_saved_file_size;
  PyObject *__pyx_v_saved_executable;
  PyObject *__pyx_v_saved_packed_stat;
  PyObject *__pyx_v_link_or_sha1;
  PyObject *__pyx_v_executable;
  PyObject *__pyx_v_block_index;
  PyObject *__pyx_v_entry_index;
  PyObject *__pyx_v_dir_present;
  PyObject *__pyx_v_file_present;
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("_update_entry");
  __pyx_v_packed_stat = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_saved_link_or_sha1 = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_saved_file_size = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_saved_executable = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_saved_packed_stat = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_link_or_sha1 = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_executable = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_block_index = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_entry_index = Py_None; __Pyx_INCREF(Py_None);
  __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
 *     cdef void * details
 *     cdef int worth_saving
 *     minikind = minikind_from_mode(stat_value.st_mode)             # <<<<<<<<<<<<<<
 *     if 0 == minikind:
 *         return None
 */
  __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 = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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
 *     cdef int worth_saving
 *     minikind = minikind_from_mode(stat_value.st_mode)
 *     if 0 == minikind:             # <<<<<<<<<<<<<<
 *         return None
 *     packed_stat = _pack_stat(stat_value)
 */
  __pyx_t_3 = (0 == __pyx_v_minikind);
  if (__pyx_t_3) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":878
 *     minikind = minikind_from_mode(stat_value.st_mode)
 *     if 0 == minikind:
 *         return None             # <<<<<<<<<<<<<<
 *     packed_stat = _pack_stat(stat_value)
 *     details = PyList_GetItem_void_void(PyTuple_GetItem_void_void(<void *>entry, 1), 0)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":879
 *     if 0 == minikind:
 *         return None
 *     packed_stat = _pack_stat(stat_value)             # <<<<<<<<<<<<<<
 *     details = PyList_GetItem_void_void(PyTuple_GetItem_void_void(<void *>entry, 1), 0)
 *     saved_minikind = PyString_AsString_obj(<PyObject *>PyTuple_GetItem_void_void(details, 0))[0]
 */
  __pyx_t_1 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__pack_stat(__pyx_v_stat_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_packed_stat);
  __pyx_v_packed_stat = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":880
 *         return None
 *     packed_stat = _pack_stat(stat_value)
 *     details = PyList_GetItem_void_void(PyTuple_GetItem_void_void(<void *>entry, 1), 0)             # <<<<<<<<<<<<<<
 *     saved_minikind = PyString_AsString_obj(<PyObject *>PyTuple_GetItem_void_void(details, 0))[0]
 *     if minikind == c'd' and saved_minikind == c't':
 */
  __pyx_v_details = PyList_GET_ITEM(PyTuple_GET_ITEM(((void *)__pyx_v_entry), 1), 0);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":881
 *     packed_stat = _pack_stat(stat_value)
 *     details = PyList_GetItem_void_void(PyTuple_GetItem_void_void(<void *>entry, 1), 0)
 *     saved_minikind = PyString_AsString_obj(<PyObject *>PyTuple_GetItem_void_void(details, 0))[0]             # <<<<<<<<<<<<<<
 *     if minikind == c'd' and saved_minikind == c't':
 *         minikind = c't'
 */
  __pyx_v_saved_minikind = (PyString_AsString(((PyObject *)PyTuple_GET_ITEM(__pyx_v_details, 0)))[0]);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":882
 *     details = PyList_GetItem_void_void(PyTuple_GetItem_void_void(<void *>entry, 1), 0)
 *     saved_minikind = PyString_AsString_obj(<PyObject *>PyTuple_GetItem_void_void(details, 0))[0]
 *     if minikind == c'd' and saved_minikind == c't':             # <<<<<<<<<<<<<<
 *         minikind = c't'
 *     saved_link_or_sha1 = PyTuple_GetItem_void_object(details, 1)
 */
  __pyx_t_3 = (__pyx_v_minikind == 'd');
  if (__pyx_t_3) {
    __pyx_t_4 = (__pyx_v_saved_minikind == 't');
    __pyx_t_5 = __pyx_t_4;
  } else {
    __pyx_t_5 = __pyx_t_3;
  }
  if (__pyx_t_5) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":883
 *     saved_minikind = PyString_AsString_obj(<PyObject *>PyTuple_GetItem_void_void(details, 0))[0]
 *     if minikind == c'd' and saved_minikind == c't':
 *         minikind = c't'             # <<<<<<<<<<<<<<
 *     saved_link_or_sha1 = PyTuple_GetItem_void_object(details, 1)
 *     saved_file_size = PyTuple_GetItem_void_object(details, 2)
 */
    __pyx_v_minikind = 't';
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "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)             # <<<<<<<<<<<<<<
 *     saved_file_size = PyTuple_GetItem_void_object(details, 2)
 *     saved_executable = PyTuple_GetItem_void_object(details, 3)
 */
  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_details, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_saved_link_or_sha1);
  __pyx_v_saved_link_or_sha1 = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "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)             # <<<<<<<<<<<<<<
 *     saved_executable = PyTuple_GetItem_void_object(details, 3)
 *     saved_packed_stat = PyTuple_GetItem_void_object(details, 4)
 */
  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_details, 2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_saved_file_size);
  __pyx_v_saved_file_size = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "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)             # <<<<<<<<<<<<<<
 *     saved_packed_stat = PyTuple_GetItem_void_object(details, 4)
 *     # Deal with pyrex decrefing the objects
 */
  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_details, 3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_saved_executable);
  __pyx_v_saved_executable = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "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)             # <<<<<<<<<<<<<<
 *     # Deal with pyrex decrefing the objects
 *     Py_INCREF(saved_link_or_sha1)
 */
  __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_details, 4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_saved_packed_stat);
  __pyx_v_saved_packed_stat = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "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)             # <<<<<<<<<<<<<<
 *     Py_INCREF(saved_file_size)
 *     Py_INCREF(saved_executable)
 */
  Py_INCREF(__pyx_v_saved_link_or_sha1);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":890
 *     # Deal with pyrex decrefing the objects
 *     Py_INCREF(saved_link_or_sha1)
 *     Py_INCREF(saved_file_size)             # <<<<<<<<<<<<<<
 *     Py_INCREF(saved_executable)
 *     Py_INCREF(saved_packed_stat)
 */
  Py_INCREF(__pyx_v_saved_file_size);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":891
 *     Py_INCREF(saved_link_or_sha1)
 *     Py_INCREF(saved_file_size)
 *     Py_INCREF(saved_executable)             # <<<<<<<<<<<<<<
 *     Py_INCREF(saved_packed_stat)
 *     #(saved_minikind, saved_link_or_sha1, saved_file_size,
 */
  Py_INCREF(__pyx_v_saved_executable);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":892
 *     Py_INCREF(saved_file_size)
 *     Py_INCREF(saved_executable)
 *     Py_INCREF(saved_packed_stat)             # <<<<<<<<<<<<<<
 *     #(saved_minikind, saved_link_or_sha1, saved_file_size,
 *     # saved_executable, saved_packed_stat) = entry[1][0]
 */
  Py_INCREF(__pyx_v_saved_packed_stat);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":897
 * 
 *     if (minikind == saved_minikind
 *         and packed_stat == saved_packed_stat):             # <<<<<<<<<<<<<<
 *         # The stat hasn't changed since we saved, so we can re-use the
 *         # saved sha hash.
 */
  __pyx_t_5 = (__pyx_v_minikind == __pyx_v_saved_minikind);
  if (__pyx_t_5) {
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_packed_stat, __pyx_v_saved_packed_stat, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; __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 = 897; __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_5;
  }
  if (__pyx_t_4) {

    /* "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':             # <<<<<<<<<<<<<<
 *             return None
 * 
 */
    __pyx_t_4 = (__pyx_v_minikind == 'd');
    if (__pyx_t_4) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":901
 *         # saved sha hash.
 *         if minikind == c'd':
 *             return None             # <<<<<<<<<<<<<<
 * 
 *         # size should also be in packed_stat
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_None);
      __pyx_r = Py_None;
      goto __pyx_L0;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":904
 * 
 *         # size should also be in packed_stat
 *         if saved_file_size == stat_value.st_size:             # <<<<<<<<<<<<<<
 *             return saved_link_or_sha1
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_RichCompare(__pyx_v_saved_file_size, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_4) {

      /* "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             # <<<<<<<<<<<<<<
 * 
 *     # If we have gotten this far, that means that we need to actually
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_saved_link_or_sha1);
      __pyx_r = __pyx_v_saved_link_or_sha1;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "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             # <<<<<<<<<<<<<<
 *     worth_saving = 1
 *     if minikind == c'f':
 */
  __Pyx_INCREF(Py_None);
  __Pyx_DECREF(__pyx_v_link_or_sha1);
  __pyx_v_link_or_sha1 = Py_None;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":910
 *     # process this entry.
 *     link_or_sha1 = None
 *     worth_saving = 1             # <<<<<<<<<<<<<<
 *     if minikind == c'f':
 *         executable = self._is_executable(stat_value.st_mode,
 */
  __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
 *     link_or_sha1 = None
 *     worth_saving = 1
 *     if minikind == c'f':             # <<<<<<<<<<<<<<
 *         executable = self._is_executable(stat_value.st_mode,
 *                                          saved_executable)
 */
    case 'f':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":912
 *     worth_saving = 1
 *     if minikind == c'f':
 *         executable = self._is_executable(stat_value.st_mode,             # <<<<<<<<<<<<<<
 *                                          saved_executable)
 *         if self._cutoff_time is None:
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___is_executable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __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
 *     if minikind == c'f':
 *         executable = self._is_executable(stat_value.st_mode,
 *                                          saved_executable)             # <<<<<<<<<<<<<<
 *         if self._cutoff_time is None:
 *             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));
    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_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_v_executable);
    __pyx_v_executable = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":914
 *         executable = self._is_executable(stat_value.st_mode,
 *                                          saved_executable)
 *         if self._cutoff_time is None:             # <<<<<<<<<<<<<<
 *             self._sha_cutoff_time()
 *         if (stat_value.st_mtime < self._cutoff_time
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___cutoff_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = (__pyx_t_1 == Py_None);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":915
 *                                          saved_executable)
 *         if self._cutoff_time is None:
 *             self._sha_cutoff_time()             # <<<<<<<<<<<<<<
 *         if (stat_value.st_mtime < self._cutoff_time
 *             and stat_value.st_ctime < self._cutoff_time
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___sha_cutoff_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __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_7); __pyx_t_7 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":916
 *         if self._cutoff_time is None:
 *             self._sha_cutoff_time()
 *         if (stat_value.st_mtime < self._cutoff_time             # <<<<<<<<<<<<<<
 *             and stat_value.st_ctime < self._cutoff_time
 *             and len(entry[1]) > 1
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_mtime); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___cutoff_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_1, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_4) {

      /* "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             # <<<<<<<<<<<<<<
 *             and len(entry[1]) > 1
 *             and entry[1][1][0] != 'a'):
 */
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_ctime); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___cutoff_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_1, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; __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_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 = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (__pyx_t_5) {

        /* "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             # <<<<<<<<<<<<<<
 *             and entry[1][1][0] != 'a'):
 *                 # Could check for size changes for further optimised
 */
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_3 = (__pyx_t_8 > 1);
        if (__pyx_t_3) {

          /* "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'):             # <<<<<<<<<<<<<<
 *                 # Could check for size changes for further optimised
 *                 # avoidance of sha1's. However the most prominent case of
 */
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __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 = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __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_RichCompare(__pyx_t_7, ((PyObject *)__pyx_n_s__a), Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_10 = __pyx_t_9;
        } else {
          __pyx_t_10 = __pyx_t_3;
        }
        __pyx_t_3 = __pyx_t_10;
      } else {
        __pyx_t_3 = __pyx_t_5;
      }
      __pyx_t_5 = __pyx_t_3;
    } else {
      __pyx_t_5 = __pyx_t_4;
    }
    if (__pyx_t_5) {

      /* "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)             # <<<<<<<<<<<<<<
 *             entry[1][0] = ('f', link_or_sha1, stat_value.st_size,
 *                            executable, packed_stat)
 */
      __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_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_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_v_link_or_sha1);
      __pyx_v_link_or_sha1 = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "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,             # <<<<<<<<<<<<<<
 *                            executable, packed_stat)
 *         else:
 */
      __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
 *             link_or_sha1 = self._sha1_file(abspath)
 *             entry[1][0] = ('f', link_or_sha1, stat_value.st_size,
 *                            executable, packed_stat)             # <<<<<<<<<<<<<<
 *         else:
 *             # 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_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));
      __Pyx_INCREF(__pyx_v_link_or_sha1);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_link_or_sha1);
      __Pyx_GIVEREF(__pyx_v_link_or_sha1);
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_v_executable);
      PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_executable);
      __Pyx_GIVEREF(__pyx_v_executable);
      __Pyx_INCREF(__pyx_v_packed_stat);
      PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_packed_stat);
      __Pyx_GIVEREF(__pyx_v_packed_stat);
      __pyx_t_6 = 0;

      /* "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,             # <<<<<<<<<<<<<<
 *                            executable, packed_stat)
 *         else:
 */
      __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;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "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,             # <<<<<<<<<<<<<<
 *                            DirState.NULLSTAT)
 *             worth_saving = 0
 */
      __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
 *             # updated values if there is *other* data worth saving.)
 *             entry[1][0] = ('f', '', stat_value.st_size, executable,
 *                            DirState.NULLSTAT)             # <<<<<<<<<<<<<<
 *             worth_saving = 0
 *     elif minikind == c'd':
 */
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__DirState); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__NULLSTAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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_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));
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
      PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_kp_s_5));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_v_executable);
      PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_executable);
      __Pyx_GIVEREF(__pyx_v_executable);
      PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_7 = 0;
      __pyx_t_1 = 0;

      /* "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,             # <<<<<<<<<<<<<<
 *                            DirState.NULLSTAT)
 *             worth_saving = 0
 */
      __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;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":934
 *             entry[1][0] = ('f', '', stat_value.st_size, executable,
 *                            DirState.NULLSTAT)
 *             worth_saving = 0             # <<<<<<<<<<<<<<
 *     elif minikind == c'd':
 *         entry[1][0] = ('d', '', 0, False, packed_stat)
 */
      __pyx_v_worth_saving = 0;
    }
    __pyx_L9:;
    break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":935
 *                            DirState.NULLSTAT)
 *             worth_saving = 0
 *     elif minikind == c'd':             # <<<<<<<<<<<<<<
 *         entry[1][0] = ('d', '', 0, False, packed_stat)
 *         if saved_minikind != c'd':
 */
    case 'd':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":936
 *             worth_saving = 0
 *     elif minikind == c'd':
 *         entry[1][0] = ('d', '', 0, False, packed_stat)             # <<<<<<<<<<<<<<
 *         if saved_minikind != c'd':
 *             # This changed from something into a directory. Make sure we
 */
    __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_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));
    __Pyx_INCREF(((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(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_packed_stat);
    PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_packed_stat);
    __Pyx_GIVEREF(__pyx_v_packed_stat);
    __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;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":937
 *     elif minikind == c'd':
 *         entry[1][0] = ('d', '', 0, False, packed_stat)
 *         if saved_minikind != c'd':             # <<<<<<<<<<<<<<
 *             # This changed from something into a directory. Make sure we
 *             # have a directory block for it. This doesn't happen very
 */
    __pyx_t_5 = (__pyx_v_saved_minikind != 'd');
    if (__pyx_t_5) {

      /* "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_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);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __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 = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__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_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));
      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);
      __Pyx_GIVEREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_int_0);
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_int_0);
      __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_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(((PyObject *)__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);
        __pyx_t_1 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_1);
        __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
 *             # 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 = \             # <<<<<<<<<<<<<<
 *                 self._get_block_entry_index(entry[0][0], entry[0][1], 0)
 *             self._ensure_block(block_index, entry_index,
 */
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_v_block_index);
        __pyx_v_block_index = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_entry_index);
        __pyx_v_entry_index = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_v_dir_present);
        __pyx_v_dir_present = __pyx_t_7;
        __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_v_file_present);
        __pyx_v_file_present = __pyx_t_12;
        __pyx_t_12 = 0;
      } else {
        __pyx_t_13 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_13, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_13, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_13, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_12 = __Pyx_UnpackItem(__pyx_t_13, 3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_EndUnpack(__pyx_t_13, 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_v_block_index);
        __pyx_v_block_index = __pyx_t_6;
        __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_v_entry_index);
        __pyx_v_entry_index = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_v_dir_present);
        __pyx_v_dir_present = __pyx_t_7;
        __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_v_file_present);
        __pyx_v_file_present = __pyx_t_12;
        __pyx_t_12 = 0;
      }

      /* "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,             # <<<<<<<<<<<<<<
 *                                pathjoin(entry[0][0], entry[0][1]))
 *         else:
 */
      __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
 *                 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]))             # <<<<<<<<<<<<<<
 *         else:
 *             # Any changes are derived trivially from the stat object, not worth
 */
      __pyx_t_12 = __Pyx_GetName(__pyx_m, __pyx_n_s__pathjoin); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_entry, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __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 = 944; __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 = 944; __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 = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__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_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(((PyObject *)__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_INCREF(__pyx_v_block_index);
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_block_index);
      __Pyx_GIVEREF(__pyx_v_block_index);
      __Pyx_INCREF(__pyx_v_entry_index);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_entry_index);
      __Pyx_GIVEREF(__pyx_v_entry_index);
      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_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_6); __pyx_t_6 = 0;
      goto __pyx_L10;
    }
    /*else*/ {

      /* "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             # <<<<<<<<<<<<<<
 *     elif minikind == c'l':
 *         if saved_minikind == c'l':
 */
      __pyx_v_worth_saving = 0;
    }
    __pyx_L10:;
    break;

    /* "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
 */
    case 'l':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":950
 *             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
 *             # dirstate just for a symlink. The default is 'fast symlinks' which
 */
    __pyx_t_5 = (__pyx_v_saved_minikind == 'l');
    if (__pyx_t_5) {

      /* "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             # <<<<<<<<<<<<<<
 *         link_or_sha1 = self._read_link(abspath, saved_link_or_sha1)
 *         if self._cutoff_time is None:
 */
      __pyx_v_worth_saving = 0;
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "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)             # <<<<<<<<<<<<<<
 *         if self._cutoff_time is None:
 *             self._sha_cutoff_time()
 */
    __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_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_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_v_link_or_sha1);
    __pyx_v_link_or_sha1 = __pyx_t_11;
    __pyx_t_11 = 0;

    /* "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:             # <<<<<<<<<<<<<<
 *             self._sha_cutoff_time()
 *         if (stat_value.st_mtime < self._cutoff_time
 */
    __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___cutoff_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_5 = (__pyx_t_11 == Py_None);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    if (__pyx_t_5) {

      /* "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()             # <<<<<<<<<<<<<<
 *         if (stat_value.st_mtime < self._cutoff_time
 *             and stat_value.st_ctime < self._cutoff_time):
 */
      __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___sha_cutoff_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_7 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L12;
    }
    __pyx_L12:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":959
 *         if self._cutoff_time is None:
 *             self._sha_cutoff_time()
 *         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,
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_mtime); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___cutoff_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_11, Py_LT); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_5) {

      /* "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):             # <<<<<<<<<<<<<<
 *             entry[1][0] = ('l', link_or_sha1, stat_value.st_size,
 *                            False, packed_stat)
 */
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_stat_value, __pyx_n_s__st_ctime); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___cutoff_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_11, Py_LT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __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_11); __pyx_t_11 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_3 = __pyx_t_4;
    } else {
      __pyx_t_3 = __pyx_t_5;
    }
    if (__pyx_t_3) {

      /* "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,             # <<<<<<<<<<<<<<
 *                            False, packed_stat)
 *         else:
 */
      __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
 *             and stat_value.st_ctime < self._cutoff_time):
 *             entry[1][0] = ('l', link_or_sha1, stat_value.st_size,
 *                            False, packed_stat)             # <<<<<<<<<<<<<<
 *         else:
 *             entry[1][0] = ('l', '', stat_value.st_size,
 */
      __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_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));
      __Pyx_INCREF(__pyx_v_link_or_sha1);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_link_or_sha1);
      __Pyx_GIVEREF(__pyx_v_link_or_sha1);
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_v_packed_stat);
      PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_v_packed_stat);
      __Pyx_GIVEREF(__pyx_v_packed_stat);
      __pyx_t_7 = 0;
      __pyx_t_11 = 0;

      /* "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,             # <<<<<<<<<<<<<<
 *                            False, packed_stat)
 *         else:
 */
      __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;}
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      goto __pyx_L13;
    }
    /*else*/ {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":964
 *                            False, packed_stat)
 *         else:
 *             entry[1][0] = ('l', '', stat_value.st_size,             # <<<<<<<<<<<<<<
 *                            False, DirState.NULLSTAT)
 *     if worth_saving:
 */
      __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
 *         else:
 *             entry[1][0] = ('l', '', stat_value.st_size,
 *                            False, DirState.NULLSTAT)             # <<<<<<<<<<<<<<
 *     if worth_saving:
 *         # Note, even though _mark_modified will only set
 */
      __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__DirState); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__NULLSTAT); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __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_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));
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
      PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_kp_s_5));
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
      PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_t_12);
      __Pyx_GIVEREF(__pyx_t_12);
      __pyx_t_6 = 0;
      __pyx_t_11 = 0;
      __pyx_t_12 = 0;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":964
 *                            False, packed_stat)
 *         else:
 *             entry[1][0] = ('l', '', stat_value.st_size,             # <<<<<<<<<<<<<<
 *                            False, DirState.NULLSTAT)
 *     if worth_saving:
 */
      __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;}
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
    }
    __pyx_L13:;
    break;
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":966
 *             entry[1][0] = ('l', '', stat_value.st_size,
 *                            False, DirState.NULLSTAT)
 *     if worth_saving:             # <<<<<<<<<<<<<<
 *         # Note, even though _mark_modified will only set
 *         # IN_MEMORY_HASH_MODIFIED, it still isn't worth
 */
  if (__pyx_v_worth_saving) {

    /* "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])             # <<<<<<<<<<<<<<
 *     return link_or_sha1
 * 
 */
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___mark_modified); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = PyList_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_12));
    __Pyx_INCREF(__pyx_v_entry);
    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));
    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_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_12); __pyx_t_12 = 0;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":970
 *         # IN_MEMORY_HASH_MODIFIED, it still isn't worth
 *         self._mark_modified([entry])
 *     return link_or_sha1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_link_or_sha1);
  __pyx_r = __pyx_v_link_or_sha1;
  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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._update_entry");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_packed_stat);
  __Pyx_DECREF(__pyx_v_saved_link_or_sha1);
  __Pyx_DECREF(__pyx_v_saved_file_size);
  __Pyx_DECREF(__pyx_v_saved_executable);
  __Pyx_DECREF(__pyx_v_saved_packed_stat);
  __Pyx_DECREF(__pyx_v_link_or_sha1);
  __Pyx_DECREF(__pyx_v_executable);
  __Pyx_DECREF(__pyx_v_block_index);
  __Pyx_DECREF(__pyx_v_entry_index);
  __Pyx_DECREF(__pyx_v_dir_present);
  __Pyx_DECREF(__pyx_v_file_present);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":974
 * 
 * # TODO: Do we want to worry about exceptions here?
 * cdef char _minikind_from_string(object string) except? -1:             # <<<<<<<<<<<<<<
 *     """Convert a python string to a char."""
 *     return PyString_AsString(string)[0]
 */

static  char __pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_from_string(PyObject *__pyx_v_string) {
  char __pyx_r;
  __Pyx_RefNannySetupContext("_minikind_from_string");

  /* "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]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (PyString_AsString(__pyx_v_string)[0]);
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":993
 * 
 * 
 * cdef object _minikind_to_kind(char minikind):             # <<<<<<<<<<<<<<
 *     """Create a string kind for minikind."""
 *     cdef char _minikind[1]
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx__minikind_to_kind(char __pyx_v_minikind) {
  char __pyx_v__minikind[1];
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  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
 *     """Create a string kind for minikind."""
 *     cdef char _minikind[1]
 *     if minikind == c'f':             # <<<<<<<<<<<<<<
 *         return _kind_file
 *     elif minikind == c'd':
 */
    case 'f':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":997
 *     cdef char _minikind[1]
 *     if minikind == c'f':
 *         return _kind_file             # <<<<<<<<<<<<<<
 *     elif minikind == c'd':
 *         return _kind_directory
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_file);
    __pyx_r = __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_file;
    goto __pyx_L0;
    break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":998
 *     if minikind == c'f':
 *         return _kind_file
 *     elif minikind == c'd':             # <<<<<<<<<<<<<<
 *         return _kind_directory
 *     elif minikind == c'a':
 */
    case 'd':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":999
 *         return _kind_file
 *     elif minikind == c'd':
 *         return _kind_directory             # <<<<<<<<<<<<<<
 *     elif minikind == c'a':
 *         return _kind_absent
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_directory);
    __pyx_r = __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_directory;
    goto __pyx_L0;
    break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1000
 *     elif minikind == c'd':
 *         return _kind_directory
 *     elif minikind == c'a':             # <<<<<<<<<<<<<<
 *         return _kind_absent
 *     elif minikind == c'r':
 */
    case 'a':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1001
 *         return _kind_directory
 *     elif minikind == c'a':
 *         return _kind_absent             # <<<<<<<<<<<<<<
 *     elif minikind == c'r':
 *         return _kind_relocated
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_absent);
    __pyx_r = __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_absent;
    goto __pyx_L0;
    break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1002
 *     elif minikind == c'a':
 *         return _kind_absent
 *     elif minikind == c'r':             # <<<<<<<<<<<<<<
 *         return _kind_relocated
 *     elif minikind == c'l':
 */
    case 'r':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1003
 *         return _kind_absent
 *     elif minikind == c'r':
 *         return _kind_relocated             # <<<<<<<<<<<<<<
 *     elif minikind == c'l':
 *         return _kind_symlink
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_relocated);
    __pyx_r = __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_relocated;
    goto __pyx_L0;
    break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1004
 *     elif minikind == c'r':
 *         return _kind_relocated
 *     elif minikind == c'l':             # <<<<<<<<<<<<<<
 *         return _kind_symlink
 *     elif minikind == c't':
 */
    case 'l':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1005
 *         return _kind_relocated
 *     elif minikind == c'l':
 *         return _kind_symlink             # <<<<<<<<<<<<<<
 *     elif minikind == c't':
 *         return _kind_tree_reference
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_symlink);
    __pyx_r = __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_symlink;
    goto __pyx_L0;
    break;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1006
 *     elif minikind == c'l':
 *         return _kind_symlink
 *     elif minikind == c't':             # <<<<<<<<<<<<<<
 *         return _kind_tree_reference
 *     _minikind[0] = minikind
 */
    case 't':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1007
 *         return _kind_symlink
 *     elif minikind == c't':
 *         return _kind_tree_reference             # <<<<<<<<<<<<<<
 *     _minikind[0] = minikind
 *     raise KeyError(PyString_FromStringAndSize(_minikind, 1))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_tree_reference);
    __pyx_r = __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_tree_reference;
    goto __pyx_L0;
    break;
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1008
 *     elif minikind == c't':
 *         return _kind_tree_reference
 *     _minikind[0] = minikind             # <<<<<<<<<<<<<<
 *     raise KeyError(PyString_FromStringAndSize(_minikind, 1))
 * 
 */
  (__pyx_v__minikind[0]) = __pyx_v_minikind;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1009
 *         return _kind_tree_reference
 *     _minikind[0] = minikind
 *     raise KeyError(PyString_FromStringAndSize(_minikind, 1))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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));
  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_GOTREF(__pyx_t_1);
  __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 = 1009; __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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx._minikind_to_kind");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":1012
 * 
 * 
 * cdef int _versioned_minikind(char minikind): # cannot_raise             # <<<<<<<<<<<<<<
 *     """Return non-zero if minikind is in fltd"""
 *     return (minikind == c'f' or
 */

static  int __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(char __pyx_v_minikind) {
  int __pyx_r;
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_versioned_minikind");

  /* "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             # <<<<<<<<<<<<<<
 *             minikind == c'd' or
 *             minikind == c'l' or
 */
  switch (__pyx_v_minikind) {
    case 'f':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1015
 *     """Return non-zero if minikind is in fltd"""
 *     return (minikind == c'f' or
 *             minikind == c'd' or             # <<<<<<<<<<<<<<
 *             minikind == c'l' or
 *             minikind == c't')
 */
    case 'd':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1016
 *     return (minikind == c'f' or
 *             minikind == c'd' or
 *             minikind == c'l' or             # <<<<<<<<<<<<<<
 *             minikind == c't')
 * 
 */
    case 'l':

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1017
 *             minikind == c'd' or
 *             minikind == c'l' or
 *             minikind == c't')             # <<<<<<<<<<<<<<
 * 
 * 
 */
    case 't':

    /* "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             # <<<<<<<<<<<<<<
 *             minikind == c'd' or
 *             minikind == c'l' or
 */
    __pyx_t_1 = 1;
    break;
    default:
    __pyx_t_1 = 0;
    break;
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":1064
 *     cdef object sha_file
 * 
 *     def __init__(self, include_unchanged, use_filesystem_for_exec,             # <<<<<<<<<<<<<<
 *         search_specific_files, state, source_index, target_index,
 *         want_unversioned, tree):
 */

static int __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_include_unchanged = 0;
  PyObject *__pyx_v_use_filesystem_for_exec = 0;
  PyObject *__pyx_v_search_specific_files = 0;
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v_source_index = 0;
  PyObject *__pyx_v_target_index = 0;
  PyObject *__pyx_v_want_unversioned = 0;
  PyObject *__pyx_v_tree = 0;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__include_unchanged,&__pyx_n_s_22,&__pyx_n_s_23,&__pyx_n_s__state,&__pyx_n_s__source_index,&__pyx_n_s__target_index,&__pyx_n_s__want_unversioned,&__pyx_n_s__tree,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
      case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
      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__include_unchanged);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_22);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_23);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  3:
      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__state);
      if (likely(values[3])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  4:
      values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__source_index);
      if (likely(values[4])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  5:
      values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__target_index);
      if (likely(values[5])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  6:
      values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__want_unversioned);
      if (likely(values[6])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  7:
      values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tree);
      if (likely(values[7])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __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 = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_include_unchanged = values[0];
    __pyx_v_use_filesystem_for_exec = values[1];
    __pyx_v_search_specific_files = values[2];
    __pyx_v_state = values[3];
    __pyx_v_source_index = values[4];
    __pyx_v_target_index = values[5];
    __pyx_v_want_unversioned = values[6];
    __pyx_v_tree = values[7];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_include_unchanged = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_use_filesystem_for_exec = PyTuple_GET_ITEM(__pyx_args, 1);
    __pyx_v_search_specific_files = PyTuple_GET_ITEM(__pyx_args, 2);
    __pyx_v_state = PyTuple_GET_ITEM(__pyx_args, 3);
    __pyx_v_source_index = PyTuple_GET_ITEM(__pyx_args, 4);
    __pyx_v_target_index = PyTuple_GET_ITEM(__pyx_args, 5);
    __pyx_v_want_unversioned = PyTuple_GET_ITEM(__pyx_args, 6);
    __pyx_v_tree = PyTuple_GET_ITEM(__pyx_args, 7);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1067
 *         search_specific_files, state, source_index, target_index,
 *         want_unversioned, tree):
 *         self.doing_consistency_expansion = 0             # <<<<<<<<<<<<<<
 *         self.old_dirname_to_file_id = {}
 *         self.new_dirname_to_file_id = {}
 */
  ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->doing_consistency_expansion = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1068
 *         want_unversioned, tree):
 *         self.doing_consistency_expansion = 0
 *         self.old_dirname_to_file_id = {}             # <<<<<<<<<<<<<<
 *         self.new_dirname_to_file_id = {}
 *         # Are we doing a partial iter_changes?
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __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_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->old_dirname_to_file_id);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->old_dirname_to_file_id);
  ((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
 *         self.doing_consistency_expansion = 0
 *         self.old_dirname_to_file_id = {}
 *         self.new_dirname_to_file_id = {}             # <<<<<<<<<<<<<<
 *         # Are we doing a partial iter_changes?
 *         self.partial = set(['']).__ne__(search_specific_files)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __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_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->new_dirname_to_file_id);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->new_dirname_to_file_id);
  ((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
 *         self.new_dirname_to_file_id = {}
 *         # Are we doing a partial iter_changes?
 *         self.partial = set(['']).__ne__(search_specific_files)             # <<<<<<<<<<<<<<
 *         # Using a list so that we can access the values and change them in
 *         # nested scope. Each one is [path, file_id, entry]
 */
  __pyx_t_1 = PyList_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_INCREF(((PyObject *)__pyx_kp_s_5));
  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));
  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_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____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_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_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_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
 *         # 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]             # <<<<<<<<<<<<<<
 *         self.last_target_parent = [None, None]
 *         if include_unchanged is None:
 */
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_3, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_3, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->last_source_parent);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->last_source_parent);
  ((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
 *         # nested scope. Each one is [path, file_id, entry]
 *         self.last_source_parent = [None, None]
 *         self.last_target_parent = [None, None]             # <<<<<<<<<<<<<<
 *         if include_unchanged is None:
 *             self.include_unchanged = False
 */
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_3, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyList_SET_ITEM(__pyx_t_3, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->last_target_parent);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->last_target_parent);
  ((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
 *         self.last_source_parent = [None, None]
 *         self.last_target_parent = [None, None]
 *         if include_unchanged is None:             # <<<<<<<<<<<<<<
 *             self.include_unchanged = False
 *         else:
 */
  __pyx_t_5 = (__pyx_v_include_unchanged == Py_None);
  if (__pyx_t_5) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1077
 *         self.last_target_parent = [None, None]
 *         if include_unchanged is None:
 *             self.include_unchanged = False             # <<<<<<<<<<<<<<
 *         else:
 *             self.include_unchanged = int(include_unchanged)
 */
    ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->include_unchanged = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1079
 *             self.include_unchanged = False
 *         else:
 *             self.include_unchanged = int(include_unchanged)             # <<<<<<<<<<<<<<
 *         self.use_filesystem_for_exec = use_filesystem_for_exec
 *         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_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_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__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
 *         else:
 *             self.include_unchanged = int(include_unchanged)
 *         self.use_filesystem_for_exec = use_filesystem_for_exec             # <<<<<<<<<<<<<<
 *         self.utf8_decode = cache_utf8._utf8_decode
 *         # for all search_indexs in each path at or under each element of
 */
  __Pyx_INCREF(__pyx_v_use_filesystem_for_exec);
  __Pyx_GIVEREF(__pyx_v_use_filesystem_for_exec);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->use_filesystem_for_exec);
  __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
 *             self.include_unchanged = int(include_unchanged)
 *         self.use_filesystem_for_exec = use_filesystem_for_exec
 *         self.utf8_decode = cache_utf8._utf8_decode             # <<<<<<<<<<<<<<
 *         # for all search_indexs in each path at or under each element of
 *         # search_specific_files, if the detail is relocated: add the id, and
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__cache_utf8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s___utf8_decode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->utf8_decode);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->utf8_decode);
  ((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
 *         # 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()             # <<<<<<<<<<<<<<
 *         # When we search exact paths without expanding downwards, we record
 *         # that here.
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_specific_files);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_specific_files);
  ((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
 *         # When we search exact paths without expanding downwards, we record
 *         # that here.
 *         self.searched_exact_paths = set()             # <<<<<<<<<<<<<<
 *         self.search_specific_files = search_specific_files
 *         # The parents up to the root of the paths we are searching.
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_exact_paths);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->searched_exact_paths);
  ((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
 *         # that here.
 *         self.searched_exact_paths = set()
 *         self.search_specific_files = search_specific_files             # <<<<<<<<<<<<<<
 *         # The parents up to the root of the paths we are searching.
 *         # After all normal paths are returned, these specific items are returned.
 */
  __Pyx_INCREF(__pyx_v_search_specific_files);
  __Pyx_GIVEREF(__pyx_v_search_specific_files);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->search_specific_files);
  __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
 *         # 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()             # <<<<<<<<<<<<<<
 *         # The ids we've sent out in the delta.
 *         self.seen_ids = set()
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->search_specific_file_parents);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->search_specific_file_parents);
  ((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
 *         self.search_specific_file_parents = set()
 *         # The ids we've sent out in the delta.
 *         self.seen_ids = set()             # <<<<<<<<<<<<<<
 *         self.state = state
 *         self.current_root = None
 */
  __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->seen_ids);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->seen_ids);
  ((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
 *         # The ids we've sent out in the delta.
 *         self.seen_ids = set()
 *         self.state = state             # <<<<<<<<<<<<<<
 *         self.current_root = None
 *         self.current_root_unicode = None
 */
  __Pyx_INCREF(__pyx_v_state);
  __Pyx_GIVEREF(__pyx_v_state);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->state);
  __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
 *         self.seen_ids = set()
 *         self.state = state
 *         self.current_root = None             # <<<<<<<<<<<<<<
 *         self.current_root_unicode = None
 *         self.root_entries = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_root);
  __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
 *         self.state = state
 *         self.current_root = None
 *         self.current_root_unicode = None             # <<<<<<<<<<<<<<
 *         self.root_entries = None
 *         self.root_entries_pos = 0
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_root_unicode);
  __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
 *         self.current_root = None
 *         self.current_root_unicode = None
 *         self.root_entries = None             # <<<<<<<<<<<<<<
 *         self.root_entries_pos = 0
 *         self.root_entries_len = 0
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_entries);
  __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
 *         self.current_root_unicode = None
 *         self.root_entries = None
 *         self.root_entries_pos = 0             # <<<<<<<<<<<<<<
 *         self.root_entries_len = 0
 *         self.root_abspath = None
 */
  ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_entries_pos = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1101
 *         self.root_entries = None
 *         self.root_entries_pos = 0
 *         self.root_entries_len = 0             # <<<<<<<<<<<<<<
 *         self.root_abspath = None
 *         if source_index is None:
 */
  ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_entries_len = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1102
 *         self.root_entries_pos = 0
 *         self.root_entries_len = 0
 *         self.root_abspath = None             # <<<<<<<<<<<<<<
 *         if source_index is None:
 *             self.source_index = -1
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_abspath);
  __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
 *         self.root_entries_len = 0
 *         self.root_abspath = None
 *         if source_index is None:             # <<<<<<<<<<<<<<
 *             self.source_index = -1
 *         else:
 */
  __pyx_t_5 = (__pyx_v_source_index == Py_None);
  if (__pyx_t_5) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1104
 *         self.root_abspath = None
 *         if source_index is None:
 *             self.source_index = -1             # <<<<<<<<<<<<<<
 *         else:
 *             self.source_index = source_index
 */
    ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->source_index = -1;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1106
 *             self.source_index = -1
 *         else:
 *             self.source_index = source_index             # <<<<<<<<<<<<<<
 *         self.target_index = target_index
 *         self.want_unversioned = want_unversioned
 */
    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_source_index); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->source_index = __pyx_t_4;
  }
  __pyx_L7:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1107
 *         else:
 *             self.source_index = source_index
 *         self.target_index = target_index             # <<<<<<<<<<<<<<
 *         self.want_unversioned = want_unversioned
 *         self.tree = tree
 */
  __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
 *             self.source_index = source_index
 *         self.target_index = target_index
 *         self.want_unversioned = want_unversioned             # <<<<<<<<<<<<<<
 *         self.tree = tree
 *         self.dir_iterator = None
 */
  __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
 *         self.target_index = target_index
 *         self.want_unversioned = want_unversioned
 *         self.tree = tree             # <<<<<<<<<<<<<<
 *         self.dir_iterator = None
 *         self.block_index = -1
 */
  __Pyx_INCREF(__pyx_v_tree);
  __Pyx_GIVEREF(__pyx_v_tree);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->tree);
  __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
 *         self.want_unversioned = want_unversioned
 *         self.tree = tree
 *         self.dir_iterator = None             # <<<<<<<<<<<<<<
 *         self.block_index = -1
 *         self.current_block = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->dir_iterator);
  __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
 *         self.tree = tree
 *         self.dir_iterator = None
 *         self.block_index = -1             # <<<<<<<<<<<<<<
 *         self.current_block = None
 *         self.current_block_list = None
 */
  ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->block_index = -1;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1112
 *         self.dir_iterator = None
 *         self.block_index = -1
 *         self.current_block = None             # <<<<<<<<<<<<<<
 *         self.current_block_list = None
 *         self.current_block_pos = -1
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_block);
  __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
 *         self.block_index = -1
 *         self.current_block = None
 *         self.current_block_list = None             # <<<<<<<<<<<<<<
 *         self.current_block_pos = -1
 *         self.current_dir_info = None
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_block_list);
  __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
 *         self.current_block = None
 *         self.current_block_list = None
 *         self.current_block_pos = -1             # <<<<<<<<<<<<<<
 *         self.current_dir_info = None
 *         self.current_dir_list = None
 */
  ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_block_pos = -1;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1115
 *         self.current_block_list = None
 *         self.current_block_pos = -1
 *         self.current_dir_info = None             # <<<<<<<<<<<<<<
 *         self.current_dir_list = None
 *         self._pending_consistent_entries = []
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_dir_info);
  __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
 *         self.current_block_pos = -1
 *         self.current_dir_info = None
 *         self.current_dir_list = None             # <<<<<<<<<<<<<<
 *         self._pending_consistent_entries = []
 *         self.path_index = 0
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->current_dir_list);
  __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
 *         self.current_dir_info = None
 *         self.current_dir_list = None
 *         self._pending_consistent_entries = []             # <<<<<<<<<<<<<<
 *         self.path_index = 0
 *         self.root_dir_info = None
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->_pending_consistent_entries);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->_pending_consistent_entries);
  ((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
 *         self.current_dir_list = None
 *         self._pending_consistent_entries = []
 *         self.path_index = 0             # <<<<<<<<<<<<<<
 *         self.root_dir_info = None
 *         self.bisect_left = bisect.bisect_left
 */
  ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->path_index = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1119
 *         self._pending_consistent_entries = []
 *         self.path_index = 0
 *         self.root_dir_info = None             # <<<<<<<<<<<<<<
 *         self.bisect_left = bisect.bisect_left
 *         self.pathjoin = osutils.pathjoin
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->root_dir_info);
  __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
 *         self.path_index = 0
 *         self.root_dir_info = None
 *         self.bisect_left = bisect.bisect_left             # <<<<<<<<<<<<<<
 *         self.pathjoin = osutils.pathjoin
 *         self.fstat = os.fstat
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__bisect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__bisect_left); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->bisect_left);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->bisect_left);
  ((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
 *         self.root_dir_info = None
 *         self.bisect_left = bisect.bisect_left
 *         self.pathjoin = osutils.pathjoin             # <<<<<<<<<<<<<<
 *         self.fstat = os.fstat
 *         self.sha_file = osutils.sha_file
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__pathjoin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->pathjoin);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->pathjoin);
  ((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
 *         self.bisect_left = bisect.bisect_left
 *         self.pathjoin = osutils.pathjoin
 *         self.fstat = os.fstat             # <<<<<<<<<<<<<<
 *         self.sha_file = osutils.sha_file
 *         if target_index != 0:
 */
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__fstat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->fstat);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->fstat);
  ((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
 *         self.pathjoin = osutils.pathjoin
 *         self.fstat = os.fstat
 *         self.sha_file = osutils.sha_file             # <<<<<<<<<<<<<<
 *         if target_index != 0:
 *             # A lot of code in here depends on target_index == 0
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__sha_file); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->sha_file);
  __Pyx_DECREF(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->sha_file);
  ((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
 *         self.fstat = os.fstat
 *         self.sha_file = osutils.sha_file
 *         if target_index != 0:             # <<<<<<<<<<<<<<
 *             # A lot of code in here depends on target_index == 0
 *             raise errors.BzrError('unsupported target index')
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_target_index, __pyx_int_0, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __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 = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "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_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); 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_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_GOTREF(__pyx_t_3);
    __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_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  __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_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":1128
 *             raise errors.BzrError('unsupported target index')
 * 
 *     cdef _process_entry(self, entry, path_info):             # <<<<<<<<<<<<<<
 *         """Compare an entry and real disk to generate delta information.
 * 
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__process_entry(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_v_self, PyObject *__pyx_v_entry, PyObject *__pyx_v_path_info) {
  char __pyx_v_target_minikind;
  char __pyx_v_source_minikind;
  PyObject *__pyx_v_file_id;
  int __pyx_v_content_change;
  PyObject *__pyx_v_details_list;
  PyObject *__pyx_v_source_details;
  PyObject *__pyx_v_target_details;
  PyObject *__pyx_v_link_or_sha1;
  PyObject *__pyx_v_old_dirname;
  PyObject *__pyx_v_old_basename;
  PyObject *__pyx_v_old_path;
  PyObject *__pyx_v_path;
  PyObject *__pyx_v_old_entry;
  PyObject *__pyx_v_target_kind;
  PyObject *__pyx_v_target_exec;
  PyObject *__pyx_v_statvalue;
  PyObject *__pyx_v_source_parent_id;
  PyObject *__pyx_v__;
  PyObject *__pyx_v_source_parent_entry;
  PyObject *__pyx_v_new_dirname;
  PyObject *__pyx_v_target_parent_id;
  PyObject *__pyx_v_target_parent_entry;
  PyObject *__pyx_v_source_exec;
  PyObject *__pyx_v_changed;
  PyObject *__pyx_v_old_path_u;
  PyObject *__pyx_v_path_u;
  PyObject *__pyx_v_source_kind;
  PyObject *__pyx_v_parent_entry;
  PyObject *__pyx_v_parent_id;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  char __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("_process_entry");
  __pyx_v_file_id = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_details_list = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_source_details = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_target_details = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_link_or_sha1 = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_old_dirname = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_old_basename = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_old_path = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_path = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_old_entry = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_target_kind = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_target_exec = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_statvalue = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_source_parent_id = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v__ = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_source_parent_entry = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_new_dirname = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_target_parent_id = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_target_parent_entry = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_source_exec = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_changed = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_old_path_u = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_path_u = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_source_kind = Py_None; __Pyx_INCREF(Py_None);
  __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
 *         cdef int content_change
 *         cdef object details_list
 *         file_id = None             # <<<<<<<<<<<<<<
 *         details_list = entry[1]
 *         if -1 == self.source_index:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_DECREF(__pyx_v_file_id);
  __pyx_v_file_id = Py_None;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1151
 *         cdef object details_list
 *         file_id = None
 *         details_list = entry[1]             # <<<<<<<<<<<<<<
 *         if -1 == self.source_index:
 *             source_details = DirState.NULL_PARENT_DETAILS
 */
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_details_list);
  __pyx_v_details_list = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1152
 *         file_id = None
 *         details_list = entry[1]
 *         if -1 == self.source_index:             # <<<<<<<<<<<<<<
 *             source_details = DirState.NULL_PARENT_DETAILS
 *         else:
 */
  __pyx_t_2 = (-1 == __pyx_v_self->source_index);
  if (__pyx_t_2) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1153
 *         details_list = entry[1]
 *         if -1 == self.source_index:
 *             source_details = DirState.NULL_PARENT_DETAILS             # <<<<<<<<<<<<<<
 *         else:
 *             source_details = details_list[self.source_index]
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__DirState); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__NULL_PARENT_DETAILS); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __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_source_details);
    __pyx_v_source_details = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1155
 *             source_details = DirState.NULL_PARENT_DETAILS
 *         else:
 *             source_details = details_list[self.source_index]             # <<<<<<<<<<<<<<
 *         target_details = details_list[self.target_index]
 *         target_minikind = _minikind_from_string(target_details[0])
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_details_list, __pyx_v_self->source_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_v_source_details);
    __pyx_v_source_details = __pyx_t_3;
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1156
 *         else:
 *             source_details = details_list[self.source_index]
 *         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):
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_details_list, __pyx_v_self->target_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_v_target_details);
  __pyx_v_target_details = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "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])             # <<<<<<<<<<<<<<
 *         if path_info is not None and _versioned_minikind(target_minikind):
 *             if self.target_index != 0:
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_target_details, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __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 = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_target_minikind = __pyx_t_4;

  /* "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):             # <<<<<<<<<<<<<<
 *             if self.target_index != 0:
 *                 raise AssertionError("Unsupported target index %d" %
 */
  __pyx_t_2 = (__pyx_v_path_info != Py_None);
  if (__pyx_t_2) {
    __pyx_t_5 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_target_minikind);
  } else {
    __pyx_t_5 = __pyx_t_2;
  }
  if (__pyx_t_5) {

    /* "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:             # <<<<<<<<<<<<<<
 *                 raise AssertionError("Unsupported target index %d" %
 *                                      self.target_index)
 */
    __pyx_t_5 = (__pyx_v_self->target_index != 0);
    if (__pyx_t_5) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1161
 *             if self.target_index != 0:
 *                 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
 */
      __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_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));
      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_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__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;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "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_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_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;

    /* "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_DECREF(__pyx_v_target_details);
    __pyx_v_target_details = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "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_v_target_minikind = __pyx_t_4;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1167
 *             target_minikind = _minikind_from_string(target_details[0])
 *         else:
 *             link_or_sha1 = None             # <<<<<<<<<<<<<<
 *         # the rest of this function is 0.3 seconds on 50K paths, or
 *         # 0.000006 seconds per call.
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF(__pyx_v_link_or_sha1);
    __pyx_v_link_or_sha1 = Py_None;
  }
  __pyx_L4:;

  /* "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_v_source_minikind = __pyx_t_4;

  /* "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')             # <<<<<<<<<<<<<<
 *             and _versioned_minikind(target_minikind)):
 *             # claimed content in both: diff
 */
  if (!__pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_source_minikind)) {
    __pyx_t_5 = (__pyx_v_source_minikind == 'r');
    __pyx_t_2 = __pyx_t_5;
  } else {
    __pyx_t_2 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_source_minikind);
  }
  if (__pyx_t_2) {

    /* "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)):             # <<<<<<<<<<<<<<
 *             # claimed content in both: diff
 *             #   r    | fdlt   |      | add source to search, add id path move and perform
 */
    __pyx_t_5 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_target_minikind);
  } else {
    __pyx_t_5 = __pyx_t_2;
  }
  if (__pyx_t_5) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1178
 *             #   r    | fdlt   |  a   | dangling file that was present in the basis.
 *             #        |        |      | ???
 *             if source_minikind != c'r':             # <<<<<<<<<<<<<<
 *                 old_dirname = entry[0][0]
 *                 old_basename = entry[0][1]
 */
    __pyx_t_5 = (__pyx_v_source_minikind != 'r');
    if (__pyx_t_5) {

      /* "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_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_v_old_dirname);
      __pyx_v_old_dirname = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "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_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_v_old_basename);
      __pyx_v_old_basename = __pyx_t_7;
      __pyx_t_7 = 0;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1181
 *                 old_dirname = entry[0][0]
 *                 old_basename = entry[0][1]
 *                 old_path = path = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # add the source to the search path to find any children it
 */
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_v_old_path);
      __pyx_v_old_path = Py_None;
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_v_path);
      __pyx_v_path = Py_None;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "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             # <<<<<<<<<<<<<<
 *                     not osutils.is_inside_any(self.searched_specific_files,
 *                                              source_details[1])):
 */
      __pyx_t_5 = (!__pyx_v_self->doing_consistency_expansion);
      if (__pyx_t_5) {

        /* "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_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "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_INCREF(__pyx_v_self->searched_specific_files);
        PyTuple_SET_ITEM(__pyx_t_3, 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);
        __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;
      } else {
        __pyx_t_2 = __pyx_t_5;
      }
      if (__pyx_t_2) {

        /* "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_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "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_DECREF(__pyx_v_old_path);
      __pyx_v_old_path = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "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_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_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_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);
      __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_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;
        __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_t_3 = 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_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_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_t_3 = 0;
      }

      /* "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_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_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);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __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_DECREF(__pyx_v_path);
      __pyx_v_path = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "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_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));

      /* "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;
      __Pyx_DECREF(__pyx_v_old_entry);
      __pyx_v_old_entry = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "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;
      if (__pyx_t_2) {

        /* "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);

        /* "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_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_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_GIVEREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_v_old_path);
        PyTuple_SET_ITEM(__pyx_t_3, 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);
        __Pyx_GIVEREF(__pyx_v_entry);
        __pyx_t_6 = 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_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_GIVEREF(((PyObject *)__pyx_t_9));
        __pyx_t_1 = 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_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 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;}
        goto __pyx_L9;
      }
      __pyx_L9:;

      /* "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]             # <<<<<<<<<<<<<<
 *                 source_minikind = _minikind_from_string(source_details[0])
 *             if path_info is None:
 */
      __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_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;

      /* "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_v_source_minikind = __pyx_t_4;
    }
    __pyx_L7:;

    /* "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:             # <<<<<<<<<<<<<<
 *                 # the file is missing on disk, show as removed.
 *                 content_change = 1
 */
    __pyx_t_2 = (__pyx_v_path_info == Py_None);
    if (__pyx_t_2) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1209
 *             if path_info is None:
 *                 # the file is missing on disk, show as removed.
 *                 content_change = 1             # <<<<<<<<<<<<<<
 *                 target_kind = None
 *                 target_exec = False
 */
      __pyx_v_content_change = 1;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1210
 *                 # the file is missing on disk, show as removed.
 *                 content_change = 1
 *                 target_kind = None             # <<<<<<<<<<<<<<
 *                 target_exec = False
 *             else:
 */
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_v_target_kind);
      __pyx_v_target_kind = Py_None;

      /* "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_DECREF(__pyx_v_target_exec);
      __pyx_v_target_exec = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L10;
    }
    /*else*/ {

      /* "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_DECREF(__pyx_v_target_kind);
      __pyx_v_target_kind = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "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;
      if (__pyx_t_2) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1216
 *                 target_kind = path_info[2]
 *                 if target_kind == 'directory':
 *                     if path is None:             # <<<<<<<<<<<<<<
 *                         old_path = path = self.pathjoin(old_dirname, old_basename)
 *                     file_id = entry[0][2]
 */
        __pyx_t_2 = (__pyx_v_path == Py_None);
        if (__pyx_t_2) {

          /* "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_INCREF(__pyx_v_old_dirname);
          PyTuple_SET_ITEM(__pyx_t_3, 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);
          __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_GOTREF(__pyx_t_9);
          __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_v_old_path);
          __pyx_v_old_path = __pyx_t_9;
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_v_path);
          __pyx_v_path = __pyx_t_9;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L12;
        }
        __pyx_L12:;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1218
 *                     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
 *                     if source_minikind != c'd':
 */
        __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_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;

        /* "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             # <<<<<<<<<<<<<<
 *                     if source_minikind != c'd':
 *                         content_change = 1
 */
        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
 *                     file_id = entry[0][2]
 *                     self.new_dirname_to_file_id[path] = file_id
 *                     if source_minikind != c'd':             # <<<<<<<<<<<<<<
 *                         content_change = 1
 *                     else:
 */
        __pyx_t_2 = (__pyx_v_source_minikind != 'd');
        if (__pyx_t_2) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1221
 *                     self.new_dirname_to_file_id[path] = file_id
 *                     if source_minikind != c'd':
 *                         content_change = 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         # directories have no fingerprint
 */
          __pyx_v_content_change = 1;
          goto __pyx_L13;
        }
        /*else*/ {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1224
 *                     else:
 *                         # directories have no fingerprint
 *                         content_change = 0             # <<<<<<<<<<<<<<
 *                     target_exec = False
 *                 elif target_kind == 'file':
 */
          __pyx_v_content_change = 0;
        }
        __pyx_L13:;

        /* "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_DECREF(__pyx_v_target_exec);
        __pyx_v_target_exec = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L11;
      }

      /* "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;
      if (__pyx_t_2) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1227
 *                     target_exec = False
 *                 elif target_kind == 'file':
 *                     if source_minikind != c'f':             # <<<<<<<<<<<<<<
 *                         content_change = 1
 *                     else:
 */
        __pyx_t_2 = (__pyx_v_source_minikind != 'f');
        if (__pyx_t_2) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1228
 *                 elif target_kind == 'file':
 *                     if source_minikind != c'f':
 *                         content_change = 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         # Check the sha. We can't just rely on the size as
 */
          __pyx_v_content_change = 1;
          goto __pyx_L14;
        }
        /*else*/ {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1233
 *                         # content filtering may mean differ sizes actually
 *                         # map to the same content
 *                         if link_or_sha1 is None:             # <<<<<<<<<<<<<<
 *                             # Stat cache miss:
 *                             statvalue, link_or_sha1 = \
 */
          __pyx_t_2 = (__pyx_v_link_or_sha1 == Py_None);
          if (__pyx_t_2) {

            /* "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_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "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_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_t_9 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_9);

              /* "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_v_statvalue);
              __pyx_v_statvalue = __pyx_t_7;
              __pyx_t_7 = 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF(__pyx_v_statvalue);
              __pyx_v_statvalue = __pyx_t_7;
              __pyx_t_7 = 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
 *                                 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);

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1239
 *                                 path_info[4])
 *                             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
 */
            __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_INCREF(__pyx_v_entry);
            PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_entry);
            __Pyx_GIVEREF(__pyx_v_entry);
            __Pyx_INCREF(__pyx_v_link_or_sha1);
            PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_link_or_sha1);
            __Pyx_GIVEREF(__pyx_v_link_or_sha1);
            __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;
            goto __pyx_L15;
          }
          __pyx_L15:;

          /* "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_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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
 *                         content_change = (link_or_sha1 != source_details[1])
 *                     # Target details is updated at update_entry time
 *                     if self.use_filesystem_for_exec:             # <<<<<<<<<<<<<<
 *                         # We don't need S_ISREG here, because we are sure
 *                         # we are dealing with a file.
 */
        __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
 *                         # 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)             # <<<<<<<<<<<<<<
 *                     else:
 *                         target_exec = target_details[3]
 */
          __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_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_v_target_exec);
          __pyx_v_target_exec = __pyx_t_7;
          __pyx_t_7 = 0;
          goto __pyx_L16;
        }
        /*else*/ {

          /* "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_DECREF(__pyx_v_target_exec);
          __pyx_v_target_exec = __pyx_t_7;
          __pyx_t_7 = 0;
        }
        __pyx_L16:;
        goto __pyx_L11;
      }

      /* "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;
      if (__pyx_t_2) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1249
 *                         target_exec = target_details[3]
 *                 elif target_kind == 'symlink':
 *                     if source_minikind != c'l':             # <<<<<<<<<<<<<<
 *                         content_change = 1
 *                     else:
 */
        __pyx_t_2 = (__pyx_v_source_minikind != 'l');
        if (__pyx_t_2) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1250
 *                 elif target_kind == 'symlink':
 *                     if source_minikind != c'l':
 *                         content_change = 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         content_change = (link_or_sha1 != source_details[1])
 */
          __pyx_v_content_change = 1;
          goto __pyx_L17;
        }
        /*else*/ {

          /* "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_v_content_change = __pyx_t_10;
        }
        __pyx_L17:;

        /* "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_DECREF(__pyx_v_target_exec);
        __pyx_v_target_exec = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L11;
      }

      /* "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;
      if (__pyx_t_2) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1255
 *                     target_exec = False
 *                 elif target_kind == 'tree-reference':
 *                     if source_minikind != c't':             # <<<<<<<<<<<<<<
 *                         content_change = 1
 *                     else:
 */
        __pyx_t_2 = (__pyx_v_source_minikind != 't');
        if (__pyx_t_2) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1256
 *                 elif target_kind == 'tree-reference':
 *                     if source_minikind != c't':
 *                         content_change = 1             # <<<<<<<<<<<<<<
 *                     else:
 *                         content_change = 0
 */
          __pyx_v_content_change = 1;
          goto __pyx_L18;
        }
        /*else*/ {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1258
 *                         content_change = 1
 *                     else:
 *                         content_change = 0             # <<<<<<<<<<<<<<
 *                     target_exec = False
 *                 else:
 */
          __pyx_v_content_change = 0;
        }
        __pyx_L18:;

        /* "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_DECREF(__pyx_v_target_exec);
        __pyx_v_target_exec = __pyx_t_3;
        __pyx_t_3 = 0;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1261
 *                     target_exec = False
 *                 else:
 *                     if path is None:             # <<<<<<<<<<<<<<
 *                         path = self.pathjoin(old_dirname, old_basename)
 *                     raise errors.BadFileKindError(path, path_info[2])
 */
        __pyx_t_2 = (__pyx_v_path == Py_None);
        if (__pyx_t_2) {

          /* "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_INCREF(__pyx_v_old_dirname);
          PyTuple_SET_ITEM(__pyx_t_3, 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);
          __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_DECREF(__pyx_v_path);
          __pyx_v_path = __pyx_t_7;
          __pyx_t_7 = 0;
          goto __pyx_L19;
        }
        __pyx_L19:;

        /* "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_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_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;
        {__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
 *                         path = self.pathjoin(old_dirname, old_basename)
 *                     raise errors.BadFileKindError(path, path_info[2])
 *             if source_minikind == c'd':             # <<<<<<<<<<<<<<
 *                 if path is None:
 *                     old_path = path = self.pathjoin(old_dirname, old_basename)
 */
    __pyx_t_2 = (__pyx_v_source_minikind == 'd');
    if (__pyx_t_2) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1265
 *                     raise errors.BadFileKindError(path, path_info[2])
 *             if source_minikind == c'd':
 *                 if path is None:             # <<<<<<<<<<<<<<
 *                     old_path = path = self.pathjoin(old_dirname, old_basename)
 *                 if file_id is None:
 */
      __pyx_t_2 = (__pyx_v_path == Py_None);
      if (__pyx_t_2) {

        /* "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_INCREF(__pyx_v_old_dirname);
        PyTuple_SET_ITEM(__pyx_t_7, 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);
        __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_GOTREF(__pyx_t_9);
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_v_old_path);
        __pyx_v_old_path = __pyx_t_9;
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_v_path);
        __pyx_v_path = __pyx_t_9;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L21;
      }
      __pyx_L21:;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1267
 *                 if path is None:
 *                     old_path = path = self.pathjoin(old_dirname, old_basename)
 *                 if file_id is None:             # <<<<<<<<<<<<<<
 *                     file_id = entry[0][2]
 *                 self.old_dirname_to_file_id[old_path] = file_id
 */
      __pyx_t_2 = (__pyx_v_file_id == Py_None);
      if (__pyx_t_2) {

        /* "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]             # <<<<<<<<<<<<<<
 *                 self.old_dirname_to_file_id[old_path] = file_id
 *             # parent id is the entry for the path in the target tree
 */
        __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_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;
        goto __pyx_L22;
      }
      __pyx_L22:;

      /* "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             # <<<<<<<<<<<<<<
 *             # parent id is the entry for the path in the target tree
 *             if old_basename and old_dirname == self.last_source_parent[0]:
 */
      if (PyObject_SetItem(__pyx_v_self->old_dirname_to_file_id, __pyx_v_old_path, __pyx_v_file_id) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L20;
    }
    __pyx_L20:;

    /* "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]:             # <<<<<<<<<<<<<<
 *                 # use a cached hit for non-root source entries.
 *                 source_parent_id = self.last_source_parent[1]
 */
    __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_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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;
    } else {
      __pyx_t_8 = __pyx_t_2;
    }
    if (__pyx_t_8) {

      /* "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]             # <<<<<<<<<<<<<<
 *             else:
 *                 try:
 */
      __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_self->last_source_parent, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_v_source_parent_id);
      __pyx_v_source_parent_id = __pyx_t_9;
      __pyx_t_9 = 0;
      goto __pyx_L23;
    }
    /*else*/ {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1275
 *                 source_parent_id = self.last_source_parent[1]
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     source_parent_id = self.old_dirname_to_file_id[old_dirname]
 *                 except KeyError, _:
 */
      {
        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/_dirstate_helpers_pyx.pyx":1276
 *             else:
 *                 try:
 *                     source_parent_id = self.old_dirname_to_file_id[old_dirname]             # <<<<<<<<<<<<<<
 *                 except KeyError, _:
 *                     source_parent_entry = self.state._get_entry(self.source_index,
 */
          __pyx_t_9 = PyObject_GetItem(__pyx_v_self->old_dirname_to_file_id, __pyx_v_old_dirname); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L24_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_v_source_parent_id);
          __pyx_v_source_parent_id = __pyx_t_9;
          __pyx_t_9 = 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_L31_try_end;
        __pyx_L24_error:;
        __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_9); __pyx_t_9 = 0;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1277
 *                 try:
 *                     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)
 */
        __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;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_v__);
          __pyx_v__ = __pyx_t_7;

          /* "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_GOTREF(__pyx_t_6);
          __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));

          /* "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;}
          __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_v_source_parent_entry);
          __pyx_v_source_parent_entry = __pyx_t_12;
          __pyx_t_12 = 0;

          /* "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]             # <<<<<<<<<<<<<<
 *                 if source_parent_id == entry[0][2]:
 *                     # This is the root, so the parent is None
 */
          __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_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_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;
          goto __pyx_L25_exception_handled;
        }
        __pyx_L26_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_L25_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_L31_try_end:;
      }

      /* "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) {

        /* "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             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.last_source_parent[0] = old_dirname
 */
        __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_v_source_parent_id);
        __pyx_v_source_parent_id = Py_None;
        goto __pyx_L34;
      }
      /*else*/ {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1285
 *                     source_parent_id = None
 *                 else:
 *                     self.last_source_parent[0] = old_dirname             # <<<<<<<<<<<<<<
 *                     self.last_source_parent[1] = source_parent_id
 *             new_dirname = entry[0][0]
 */
        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
 *                 else:
 *                     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]:
 */
        if (__Pyx_SetItemInt(__pyx_v_self->last_source_parent, 1, __pyx_v_source_parent_id, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L34:;
    }
    __pyx_L23:;

    /* "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_DECREF(__pyx_v_new_dirname);
    __pyx_v_new_dirname = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "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_5 = __pyx_t_2;
    } else {
      __pyx_t_5 = __pyx_t_8;
    }
    if (__pyx_t_5) {

      /* "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_DECREF(__pyx_v_target_parent_id);
      __pyx_v_target_parent_id = __pyx_t_7;
      __pyx_t_7 = 0;
      goto __pyx_L35;
    }
    /*else*/ {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1292
 *                 target_parent_id = self.last_target_parent[1]
 *             else:
 *                 try:             # <<<<<<<<<<<<<<
 *                     target_parent_id = self.new_dirname_to_file_id[new_dirname]
 *                 except KeyError, _:
 */
      {
        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/_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_DECREF(__pyx_v_target_parent_id);
          __pyx_v_target_parent_id = __pyx_t_7;
          __pyx_t_7 = 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_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;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1294
 *                 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
 *                     #       parent entry will be the same as the source entry.
 */
        __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);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_v__);
          __pyx_v__ = __pyx_t_3;

          /* "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_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));
          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
 *                     #       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):
 *                         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_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;

          /* "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;
          if (__pyx_t_5) {

            /* "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_INCREF(__pyx_v_new_dirname);
            PyTuple_SET_ITEM(__pyx_t_1, 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);
            __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_GOTREF(__pyx_t_12);
            __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
            __Pyx_Raise(__pyx_t_12, 0, 0);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 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
 *                             "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_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_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_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L37_exception_handled;
        }
        __pyx_L38_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_L37_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_L43_try_end:;
      }

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1304
 *                             % (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
 *                     target_parent_id = None
 */
      __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_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_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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
 *                 if target_parent_id == entry[0][2]:
 *                     # This is the root, so the parent is None
 *                     target_parent_id = None             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.last_target_parent[0] = new_dirname
 */
        __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_v_target_parent_id);
        __pyx_v_target_parent_id = Py_None;
        goto __pyx_L47;
      }
      /*else*/ {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1308
 *                     target_parent_id = None
 *                 else:
 *                     self.last_target_parent[0] = new_dirname             # <<<<<<<<<<<<<<
 *                     self.last_target_parent[1] = target_parent_id
 * 
 */
        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
 *                 else:
 *                     self.last_target_parent[0] = new_dirname
 *                     self.last_target_parent[1] = target_parent_id             # <<<<<<<<<<<<<<
 * 
 *             source_exec = source_details[3]
 */
        if (__Pyx_SetItemInt(__pyx_v_self->last_target_parent, 1, __pyx_v_target_parent_id, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L47:;
    }
    __pyx_L35:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1311
 *                     self.last_target_parent[1] = target_parent_id
 * 
 *             source_exec = source_details[3]             # <<<<<<<<<<<<<<
 *             changed = (content_change
 *                 or source_parent_id != target_parent_id
 */
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_source_details, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_v_source_exec);
    __pyx_v_source_exec = __pyx_t_9;
    __pyx_t_9 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1313
 *             source_exec = source_details[3]
 *             changed = (content_change
 *                 or source_parent_id != target_parent_id             # <<<<<<<<<<<<<<
 *                 or old_basename != entry[0][1]
 *                 or source_exec != target_exec
 */
    __pyx_t_9 = PyInt_FromLong(__pyx_v_content_change); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_5) {
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "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;}
      if (!__pyx_t_5) {
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

        /* "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;}
        if (!__pyx_t_5) {
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

          /* "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;
        } else {
          __pyx_t_12 = __pyx_t_7;
          __pyx_t_7 = 0;
        }
        __pyx_t_7 = __pyx_t_12;
        __pyx_t_12 = 0;
      } else {
        __pyx_t_7 = __pyx_t_3;
        __pyx_t_3 = 0;
      }
      __pyx_t_3 = __pyx_t_7;
      __pyx_t_7 = 0;
    } else {
      __pyx_t_3 = __pyx_t_9;
      __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_v_changed);
    __pyx_v_changed = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1317
 *                 or source_exec != target_exec
 *                 )
 *             if not changed and not self.include_unchanged:             # <<<<<<<<<<<<<<
 *                 return None, False
 *             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_5 = (!__pyx_v_self->include_unchanged);
      __pyx_t_2 = __pyx_t_5;
    } else {
      __pyx_t_2 = __pyx_t_8;
    }
    if (__pyx_t_2) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1318
 *                 )
 *             if not changed and not self.include_unchanged:
 *                 return None, False             # <<<<<<<<<<<<<<
 *             else:
 *                 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_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_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);
      __pyx_t_9 = 0;
      goto __pyx_L0;
      goto __pyx_L48;
    }
    /*else*/ {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1320
 *                 return None, False
 *             else:
 *                 if old_path is None:             # <<<<<<<<<<<<<<
 *                     path = self.pathjoin(old_dirname, old_basename)
 *                     old_path = path
 */
      __pyx_t_2 = (__pyx_v_old_path == Py_None);
      if (__pyx_t_2) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1321
 *             else:
 *                 if old_path is None:
 *                     path = self.pathjoin(old_dirname, old_basename)             # <<<<<<<<<<<<<<
 *                     old_path = path
 *                     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_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_DECREF(__pyx_v_path);
        __pyx_v_path = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1322
 *                 if old_path is None:
 *                     path = self.pathjoin(old_dirname, old_basename)
 *                     old_path = path             # <<<<<<<<<<<<<<
 *                     old_path_u = self.utf8_decode(old_path)[0]
 *                     path_u = old_path_u
 */
        __Pyx_INCREF(__pyx_v_path);
        __Pyx_DECREF(__pyx_v_old_path);
        __pyx_v_old_path = __pyx_v_path;

        /* "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_INCREF(__pyx_v_old_path);
        PyTuple_SET_ITEM(__pyx_t_3, 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_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_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_v_old_path_u);
        __pyx_v_old_path_u = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1324
 *                     old_path = path
 *                     old_path_u = self.utf8_decode(old_path)[0]
 *                     path_u = old_path_u             # <<<<<<<<<<<<<<
 *                 else:
 *                     old_path_u = self.utf8_decode(old_path)[0]
 */
        __Pyx_INCREF(__pyx_v_old_path_u);
        __Pyx_DECREF(__pyx_v_path_u);
        __pyx_v_path_u = __pyx_v_old_path_u;
        goto __pyx_L49;
      }
      /*else*/ {

        /* "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_INCREF(__pyx_v_old_path);
        PyTuple_SET_ITEM(__pyx_t_3, 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_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_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_v_old_path_u);
        __pyx_v_old_path_u = __pyx_t_3;
        __pyx_t_3 = 0;

        /* "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;
        if (__pyx_t_2) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1328
 *                     old_path_u = self.utf8_decode(old_path)[0]
 *                     if old_path == path:
 *                         path_u = old_path_u             # <<<<<<<<<<<<<<
 *                     else:
 *                         path_u = self.utf8_decode(path)[0]
 */
          __Pyx_INCREF(__pyx_v_old_path_u);
          __Pyx_DECREF(__pyx_v_path_u);
          __pyx_v_path_u = __pyx_v_old_path_u;
          goto __pyx_L50;
        }
        /*else*/ {

          /* "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_INCREF(__pyx_v_path);
          PyTuple_SET_ITEM(__pyx_t_3, 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_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_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_v_path_u);
          __pyx_v_path_u = __pyx_t_3;
          __pyx_t_3 = 0;
        }
        __pyx_L50:;
      }
      __pyx_L49:;

      /* "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_DECREF(__pyx_v_source_kind);
      __pyx_v_source_kind = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1332
 *                         path_u = self.utf8_decode(path)[0]
 *                 source_kind = _minikind_to_kind(source_minikind)
 *                 return (entry[0][2],             # <<<<<<<<<<<<<<
 *                        (old_path_u, path_u),
 *                        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_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "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_INCREF(__pyx_v_old_path_u);
      PyTuple_SET_ITEM(__pyx_t_3, 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);
      __Pyx_GIVEREF(__pyx_v_path_u);

      /* "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);

      /* "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_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_GIVEREF(__pyx_t_12);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_12 = 0;
      __pyx_t_1 = 0;

      /* "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_INCREF(__pyx_v_source_parent_id);
      PyTuple_SET_ITEM(__pyx_t_1, 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);
      __Pyx_GIVEREF(__pyx_v_target_parent_id);

      /* "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_INCREF(__pyx_v_old_basename);
      PyTuple_SET_ITEM(__pyx_t_12, 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_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_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_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_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_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_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_GIVEREF(__pyx_t_6);
      __pyx_t_12 = 0;
      __pyx_t_6 = 0;

      /* "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_INCREF(__pyx_v_source_kind);
      PyTuple_SET_ITEM(__pyx_t_6, 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);
      __Pyx_GIVEREF(__pyx_v_target_kind);

      /* "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_INCREF(__pyx_v_source_exec);
      PyTuple_SET_ITEM(__pyx_t_12, 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);
      __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));
      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));
      __pyx_t_9 = 0;
      __pyx_t_3 = 0;
      __pyx_t_7 = 0;
      __pyx_t_11 = 0;
      __pyx_t_1 = 0;
      __pyx_t_13 = 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_INCREF(__pyx_v_changed);
      PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_changed);
      __Pyx_GIVEREF(__pyx_v_changed);
      __pyx_t_14 = 0;
      __pyx_r = ((PyObject *)__pyx_t_12);
      __pyx_t_12 = 0;
      goto __pyx_L0;
    }
    __pyx_L48:;
    goto __pyx_L6;
  }

  /* "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):             # <<<<<<<<<<<<<<
 *             # looks like a new file
 *             path = self.pathjoin(entry[0][0], entry[0][1])
 */
  __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);
  } else {
    __pyx_t_8 = __pyx_t_2;
  }
  if (__pyx_t_8) {

    /* "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_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_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_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __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_DECREF(__pyx_v_path);
    __pyx_v_path = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "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_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));

    /* "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])             # <<<<<<<<<<<<<<
 *             if parent_entry is None:
 *                 raise errors.DirstateCorrupt(self.state,
 */
    __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_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;
    __Pyx_DECREF(__pyx_v_parent_entry);
    __pyx_v_parent_entry = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "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) {

      /* "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_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "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_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_GIVEREF(__pyx_t_14);
      __pyx_t_1 = 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_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_INCREF(__pyx_v_self->state);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_self->state);
      __Pyx_GIVEREF(__pyx_v_self->state);
      PyTuple_SET_ITEM(__pyx_t_6, 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_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 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;}
      goto __pyx_L51;
    }
    __pyx_L51:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1352
 *                     " for the entry: %s"
 *                     % (self.target_index, entry[0]))
 *             parent_id = parent_entry[0][2]             # <<<<<<<<<<<<<<
 *             if parent_id == entry[0][2]:
 *                 parent_id = None
 */
    __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_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;

    /* "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_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_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) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1354
 *             parent_id = parent_entry[0][2]
 *             if parent_id == entry[0][2]:
 *                 parent_id = None             # <<<<<<<<<<<<<<
 *             if path_info is not None:
 *                 # Present on disk:
 */
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_v_parent_id);
      __pyx_v_parent_id = Py_None;
      goto __pyx_L52;
    }
    __pyx_L52:;

    /* "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) {

      /* "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) {

        /* "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_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (__pyx_t_8) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1362
 *                     target_exec = bool(
 *                         S_ISREG(path_info[3].st_mode)
 *                         and S_IXUSR & path_info[3].st_mode)             # <<<<<<<<<<<<<<
 *                 else:
 *                     target_exec = target_details[3]
 */
          __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_GOTREF(__pyx_t_6);
          __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_5 = __pyx_t_2;
        } else {
          __pyx_t_5 = __pyx_t_8;
        }
        __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_DECREF(__pyx_v_target_exec);
        __pyx_v_target_exec = __pyx_t_6;
        __pyx_t_6 = 0;
        goto __pyx_L54;
      }
      /*else*/ {

        /* "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_DECREF(__pyx_v_target_exec);
        __pyx_v_target_exec = __pyx_t_6;
        __pyx_t_6 = 0;
      }
      __pyx_L54:;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1365
 *                 else:
 *                     target_exec = target_details[3]
 *                 return (entry[0][2],             # <<<<<<<<<<<<<<
 *                        (None, self.utf8_decode(path)[0]),
 *                        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_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;

      /* "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_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_6, 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_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_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_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;

      /* "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);

      /* "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_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);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_1 = 0;
      __pyx_t_13 = 0;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1369
 *                        True,
 *                        (False, True),
 *                        (None, parent_id),             # <<<<<<<<<<<<<<
 *                        (None, self.utf8_decode(entry[0][1])[0]),
 *                        (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_INCREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_13, 0, Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_INCREF(__pyx_v_parent_id);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_parent_id);
      __Pyx_GIVEREF(__pyx_v_parent_id);

      /* "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_INCREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_7, 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;

      /* "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_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);
      __Pyx_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;

      /* "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_INCREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_INCREF(__pyx_v_target_exec);
      PyTuple_SET_ITEM(__pyx_t_1, 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_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;
      __pyx_t_6 = 0;
      __pyx_t_11 = 0;
      __pyx_t_13 = 0;
      __pyx_t_7 = 0;
      __pyx_t_3 = 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_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);
      __pyx_t_9 = 0;
      __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
 *             else:
 *                 # Its a missing file, report it as such.
 *                 return (entry[0][2],             # <<<<<<<<<<<<<<
 *                        (None, self.utf8_decode(path)[0]),
 *                        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_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "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_INCREF(__pyx_v_path);
      PyTuple_SET_ITEM(__pyx_t_3, 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_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_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_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;

      /* "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);

      /* "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_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);
      PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
      __Pyx_GIVEREF(__pyx_t_13);
      __pyx_t_7 = 0;
      __pyx_t_13 = 0;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1379
 *                        False,
 *                        (False, True),
 *                        (None, parent_id),             # <<<<<<<<<<<<<<
 *                        (None, self.utf8_decode(entry[0][1])[0]),
 *                        (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_INCREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_13, 0, Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_INCREF(__pyx_v_parent_id);
      PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_v_parent_id);
      __Pyx_GIVEREF(__pyx_v_parent_id);

      /* "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_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_7);
      __Pyx_GIVEREF(__pyx_t_7);
      __pyx_t_7 = 0;

      /* "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_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_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);
      __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);
      __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;
      __pyx_t_9 = 0;
      __pyx_t_3 = 0;
      __pyx_t_11 = 0;
      __pyx_t_13 = 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_GIVEREF(__pyx_t_14);
      __pyx_t_7 = 0;
      __pyx_t_14 = 0;
      __pyx_r = ((PyObject *)__pyx_t_6);
      __pyx_t_6 = 0;
      goto __pyx_L0;
    }
    __pyx_L53:;
    goto __pyx_L6;
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1383
 *                        (None, None),
 *                        (None, False)), True
 *         elif _versioned_minikind(source_minikind) and target_minikind == c'a':             # <<<<<<<<<<<<<<
 *             # unversioned, possibly, or possibly not deleted: we dont care.
 *             # if its still on disk, *and* theres no other entry at this
 */
  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;
  } else {
    __pyx_t_8 = __pyx_f_6bzrlib_21_dirstate_helpers_pyx__versioned_minikind(__pyx_v_source_minikind);
  }
  if (__pyx_t_8) {

    /* "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_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_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_GIVEREF(__pyx_t_14);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_7);
    __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_DECREF(__pyx_v_old_path);
    __pyx_v_old_path = __pyx_t_7;
    __pyx_t_7 = 0;

    /* "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_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;}
    __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_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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_v_parent_id);
    __pyx_v_parent_id = __pyx_t_11;
    __pyx_t_11 = 0;

    /* "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) {

      /* "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             # <<<<<<<<<<<<<<
 *             return (entry[0][2],
 *                    (self.utf8_decode(old_path)[0], None),
 */
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_v_parent_id);
      __pyx_v_parent_id = Py_None;
      goto __pyx_L55;
    }
    __pyx_L55:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1393
 *             if parent_id == entry[0][2]:
 *                 parent_id = None
 *             return (entry[0][2],             # <<<<<<<<<<<<<<
 *                    (self.utf8_decode(old_path)[0], None),
 *                    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;

    /* "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_INCREF(__pyx_v_old_path);
    PyTuple_SET_ITEM(__pyx_t_11, 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_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_14, 1, Py_None);
    __Pyx_GIVEREF(Py_None);
    __pyx_t_11 = 0;

    /* "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);

    /* "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;

    /* "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_INCREF(__pyx_v_parent_id);
    PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_parent_id);
    __Pyx_GIVEREF(__pyx_v_parent_id);
    __Pyx_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_13, 1, Py_None);
    __Pyx_GIVEREF(Py_None);

    /* "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_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_9, 1, Py_None);
    __Pyx_GIVEREF(Py_None);
    __pyx_t_7 = 0;

    /* "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_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
    __Pyx_GIVEREF(Py_None);
    __pyx_t_7 = 0;

    /* "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_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_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_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);
    __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));
    __pyx_t_6 = 0;
    __pyx_t_14 = 0;
    __pyx_t_11 = 0;
    __pyx_t_3 = 0;
    __pyx_t_13 = 0;
    __pyx_t_9 = 0;
    __pyx_t_1 = 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_GIVEREF(__pyx_t_12);
    __pyx_t_7 = 0;
    __pyx_t_12 = 0;
    __pyx_r = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L6;
  }

  /* "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':             # <<<<<<<<<<<<<<
 *             # a rename; could be a true rename, or a rename inherited from
 *             # 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;
  } 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
 *             # common case to rename dirs though, so a correct but slow
 *             # implementation will do.
 *             if (not self.doing_consistency_expansion and             # <<<<<<<<<<<<<<
 *                 not osutils.is_inside_any(self.searched_specific_files,
 *                     target_details[1])):
 */
    __pyx_t_5 = (!__pyx_v_self->doing_consistency_expansion);
    if (__pyx_t_5) {

      /* "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_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "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_INCREF(__pyx_v_self->searched_specific_files);
      PyTuple_SET_ITEM(__pyx_t_7, 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);
      __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;
    } else {
      __pyx_t_8 = __pyx_t_5;
    }
    if (__pyx_t_8) {

      /* "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_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;
      goto __pyx_L56;
    }
    __pyx_L56:;
    goto __pyx_L6;
  }

  /* "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             # <<<<<<<<<<<<<<
 *               (target_minikind == c'r' or target_minikind == c'a')):
 *             # neither of the selected trees contain this path,
 */
  switch (__pyx_v_source_minikind) {
    case 'r':
    case 'a':
    __pyx_t_8 = 1;
    break;
    default:
    __pyx_t_8 = 0;
    break;
  }
  if (__pyx_t_8) {

    /* "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')):             # <<<<<<<<<<<<<<
 *             # neither of the selected trees contain this path,
 *             # so skip over it. This is not currently directly tested, but
 */
    switch (__pyx_v_target_minikind) {
      case 'r':
      case 'a':
      __pyx_t_5 = 1;
      break;
      default:
      __pyx_t_5 = 0;
      break;
    }
    __pyx_t_2 = __pyx_t_5;
  } else {
    __pyx_t_2 = __pyx_t_8;
  }
  if (__pyx_t_2) {
    goto __pyx_L6;
  }
  /*else*/ {

    /* "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_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_GIVEREF(__pyx_t_12);
    __pyx_t_7 = 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_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_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_GOTREF(__pyx_t_12);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 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
 *                 % (source_minikind, target_minikind))
 *             ## import pdb;pdb.set_trace()
 *         return None, None             # <<<<<<<<<<<<<<
 * 
 *     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_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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._process_entry");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_file_id);
  __Pyx_DECREF(__pyx_v_details_list);
  __Pyx_DECREF(__pyx_v_source_details);
  __Pyx_DECREF(__pyx_v_target_details);
  __Pyx_DECREF(__pyx_v_link_or_sha1);
  __Pyx_DECREF(__pyx_v_old_dirname);
  __Pyx_DECREF(__pyx_v_old_basename);
  __Pyx_DECREF(__pyx_v_old_path);
  __Pyx_DECREF(__pyx_v_path);
  __Pyx_DECREF(__pyx_v_old_entry);
  __Pyx_DECREF(__pyx_v_target_kind);
  __Pyx_DECREF(__pyx_v_target_exec);
  __Pyx_DECREF(__pyx_v_statvalue);
  __Pyx_DECREF(__pyx_v_source_parent_id);
  __Pyx_DECREF(__pyx_v__);
  __Pyx_DECREF(__pyx_v_source_parent_entry);
  __Pyx_DECREF(__pyx_v_new_dirname);
  __Pyx_DECREF(__pyx_v_target_parent_id);
  __Pyx_DECREF(__pyx_v_target_parent_entry);
  __Pyx_DECREF(__pyx_v_source_exec);
  __Pyx_DECREF(__pyx_v_changed);
  __Pyx_DECREF(__pyx_v_old_path_u);
  __Pyx_DECREF(__pyx_v_path_u);
  __Pyx_DECREF(__pyx_v_source_kind);
  __Pyx_DECREF(__pyx_v_parent_entry);
  __Pyx_DECREF(__pyx_v_parent_id);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":1426
 *         return None, None
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("__iter__");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1427
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def iter_changes(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  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":1429
 *         return self
 * 
 *     def iter_changes(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("iter_changes");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1430
 * 
 *     def iter_changes(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef int _gather_result_for_consistency(self, result) except -1:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  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":1432
 *         return self
 * 
 *     cdef int _gather_result_for_consistency(self, result) except -1:             # <<<<<<<<<<<<<<
 *         """Check a result we will yield to make sure we are consistent later.
 * 
 */

static  int __pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__gather_result_for_consistency(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_v_self, PyObject *__pyx_v_result) {
  PyObject *__pyx_v_new_path;
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("_gather_result_for_consistency");
  __pyx_v_new_path = Py_None; __Pyx_INCREF(Py_None);

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1439
 *         :param result: A result tuple.
 *         """
 *         if not self.partial or not result[0]:             # <<<<<<<<<<<<<<
 *             return 0
 *         self.seen_ids.add(result[0])
 */
  __pyx_t_1 = (!__pyx_v_self->partial);
  if (!__pyx_t_1) {
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_result, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1439; __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 = 1439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (!__pyx_t_3);
    __pyx_t_3 = __pyx_t_4;
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1440
 *         """
 *         if not self.partial or not result[0]:
 *             return 0             # <<<<<<<<<<<<<<
 *         self.seen_ids.add(result[0])
 *         new_path = result[1][1]
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1441
 *         if not self.partial or not result[0]:
 *             return 0
 *         self.seen_ids.add(result[0])             # <<<<<<<<<<<<<<
 *         new_path = result[1][1]
 *         if new_path:
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self->seen_ids, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __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));
  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_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_5); __pyx_t_5 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1442
 *             return 0
 *         self.seen_ids.add(result[0])
 *         new_path = result[1][1]             # <<<<<<<<<<<<<<
 *         if new_path:
 *             # Not the root and not a delete: queue up the parents of the path.
 */
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_result, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_v_new_path);
  __pyx_v_new_path = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1443
 *         self.seen_ids.add(result[0])
 *         new_path = result[1][1]
 *         if new_path:             # <<<<<<<<<<<<<<
 *             # Not the root and not a delete: queue up the parents of the path.
 *             self.search_specific_file_parents.update(
 */
  __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
 *         if new_path:
 *             # 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
 */
    __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
 *             # 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_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); 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_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__parent_directories); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __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_GOTREF(__pyx_t_7);
    __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_GOTREF(__pyx_t_7);
    __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_GOTREF(__pyx_t_7);
    __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;

    /* "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_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_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1450
 *             # provide.
 *             self.search_specific_file_parents.add('')
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     cdef int _update_current_block(self) except -1:
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._gather_result_for_consistency");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_new_path);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":1452
 *         return 0
 * 
 *     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])):
 */

static  int __pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__update_current_block(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_v_self) {
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_update_current_block");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1453
 * 
 *     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])):
 *             self.current_block = self.state._dirblocks[self.block_index]
 */
  __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 = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_v_self->block_index < __pyx_t_2);
  if (__pyx_t_3) {

    /* "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])):             # <<<<<<<<<<<<<<
 *             self.current_block = self.state._dirblocks[self.block_index]
 *             self.current_block_list = self.current_block[1]
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); 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_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__is_inside); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __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 = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->block_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__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_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_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_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__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;
  } else {
    __pyx_t_7 = __pyx_t_3;
  }
  if (__pyx_t_7) {

    /* "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]             # <<<<<<<<<<<<<<
 *             self.current_block_list = self.current_block[1]
 *             self.current_block_pos = 0
 */
    __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 = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->block_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->current_block);
    __Pyx_DECREF(__pyx_v_self->current_block);
    __pyx_v_self->current_block = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "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]             # <<<<<<<<<<<<<<
 *             self.current_block_pos = 0
 *         else:
 */
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->current_block, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_v_self->current_block_list);
    __Pyx_DECREF(__pyx_v_self->current_block_list);
    __pyx_v_self->current_block_list = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "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             # <<<<<<<<<<<<<<
 *         else:
 *             self.current_block = None
 */
    __pyx_v_self->current_block_pos = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1459
 *             self.current_block_pos = 0
 *         else:
 *             self.current_block = None             # <<<<<<<<<<<<<<
 *             self.current_block_list = None
 *         return 0
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->current_block);
    __Pyx_DECREF(__pyx_v_self->current_block);
    __pyx_v_self->current_block = Py_None;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1460
 *         else:
 *             self.current_block = None
 *             self.current_block_list = None             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->current_block_list);
    __Pyx_DECREF(__pyx_v_self->current_block_list);
    __pyx_v_self->current_block_list = Py_None;
  }
  __pyx_L3:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1461
 *             self.current_block = None
 *             self.current_block_list = None
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._update_current_block");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":1463
 *         return 0
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         # Simple thunk to allow tail recursion without pyrex confusion
 *         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) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__next__");

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1465
 *     def __next__(self):
 *         # Simple thunk to allow tail recursion without pyrex confusion
 *         return self._iter_next()             # <<<<<<<<<<<<<<
 * 
 *     cdef _iter_next(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)->__pyx_vtab)->_iter_next(((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; __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._dirstate_helpers_pyx.ProcessEntryC.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":1467
 *         return self._iter_next()
 * 
 *     cdef _iter_next(self):             # <<<<<<<<<<<<<<
 *         """Iterate over the changes."""
 *         # This function single steps through an iterator. As such while loops
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__iter_next(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_v_self) {
  PyObject *__pyx_v_current_dirname;
  PyObject *__pyx_v_current_blockname;
  char *__pyx_v_current_dirname_c;
  char *__pyx_v_current_blockname_c;
  int __pyx_v_path_handled;
  PyObject *__pyx_v_searched_specific_files;
  PyObject *__pyx_v_entry;
  PyObject *__pyx_v_result;
  PyObject *__pyx_v_changed;
  PyObject *__pyx_v__;
  PyObject *__pyx_v_root_stat;
  PyObject *__pyx_v_e;
  PyObject *__pyx_v_new_executable;
  PyObject *__pyx_v_e_winerror;
  PyObject *__pyx_v_win_errors;
  PyObject *__pyx_v_bzr_index;
  PyObject *__pyx_v_initial_key;
  PyObject *__pyx_v_current_path_info;
  PyObject *__pyx_v_current_entry;
  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;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("_iter_next");
  __pyx_v_current_dirname = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_current_blockname = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_searched_specific_files = 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__ = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_root_stat = Py_None; __Pyx_INCREF(Py_None);
  __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_bzr_index = 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
 *         cdef int advance_entry, advance_path
 *         cdef int path_handled
 *         searched_specific_files = self.searched_specific_files             # <<<<<<<<<<<<<<
 *         # Are we walking a root?
 *         while self.root_entries_pos < self.root_entries_len:
 */
  __Pyx_INCREF(__pyx_v_self->searched_specific_files);
  __Pyx_DECREF(__pyx_v_searched_specific_files);
  __pyx_v_searched_specific_files = __pyx_v_self->searched_specific_files;

  /* "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:             # <<<<<<<<<<<<<<
 *             entry = self.root_entries[self.root_entries_pos]
 *             self.root_entries_pos = self.root_entries_pos + 1
 */
  while (1) {
    __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
 *         # Are we walking a root?
 *         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
 *             result, changed = self._process_entry(entry, self.root_dir_info)
 */
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->root_entries, __pyx_v_self->root_entries_pos, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __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/_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             # <<<<<<<<<<<<<<
 *             result, changed = self._process_entry(entry, self.root_dir_info)
 *             if changed is not None:
 */
    __pyx_v_self->root_entries_pos = (__pyx_v_self->root_entries_pos + 1);

    /* "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_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_2;
      __pyx_t_2 = 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_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_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_DECREF(__pyx_v_changed);
      __pyx_v_changed = __pyx_t_4;
      __pyx_t_4 = 0;
    }

    /* "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:             # <<<<<<<<<<<<<<
 *                 if changed:
 *                     self._gather_result_for_consistency(result)
 */
    __pyx_t_1 = (__pyx_v_changed != Py_None);
    if (__pyx_t_1) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1526
 *             result, changed = self._process_entry(entry, self.root_dir_info)
 *             if changed is not None:
 *                 if changed:             # <<<<<<<<<<<<<<
 *                     self._gather_result_for_consistency(result)
 *                 if changed or self.include_unchanged:
 */
      __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
 *             if changed is not None:
 *                 if changed:
 *                     self._gather_result_for_consistency(result)             # <<<<<<<<<<<<<<
 *                 if changed or self.include_unchanged:
 *                     return result
 */
        __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 = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L6;
      }
      __pyx_L6:;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1528
 *                 if changed:
 *                     self._gather_result_for_consistency(result)
 *                 if changed or self.include_unchanged:             # <<<<<<<<<<<<<<
 *                     return result
 *         # Have we finished the prior root, or never started one ?
 */
      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_1) {
        __pyx_t_7 = __pyx_v_self->include_unchanged;
      } else {
        __pyx_t_7 = __pyx_t_1;
      }
      if (__pyx_t_7) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1529
 *                     self._gather_result_for_consistency(result)
 *                 if changed or self.include_unchanged:
 *                     return result             # <<<<<<<<<<<<<<
 *         # Have we finished the prior root, or never started one ?
 *         if self.current_root is None:
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_result);
        __pyx_r = __pyx_v_result;
        goto __pyx_L0;
        goto __pyx_L7;
      }
      __pyx_L7:;
      goto __pyx_L5;
    }
    __pyx_L5:;
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1531
 *                     return result
 *         # Have we finished the prior root, or never started one ?
 *         if self.current_root is None:             # <<<<<<<<<<<<<<
 *             # TODO: the pending list should be lexically sorted?  the
 *             # interface doesn't require it.
 */
  __pyx_t_7 = (__pyx_v_self->current_root == Py_None);
  if (__pyx_t_7) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1534
 *             # TODO: the pending list should be lexically sorted?  the
 *             # interface doesn't require it.
 *             try:             # <<<<<<<<<<<<<<
 *                 self.current_root = self.search_specific_files.pop()
 *             except KeyError, _:
 */
    {
      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/_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_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_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_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;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1536
 *             try:
 *                 self.current_root = self.search_specific_files.pop()
 *             except KeyError, _:             # <<<<<<<<<<<<<<
 *                 raise StopIteration()
 *             self.searched_specific_files.add(self.current_root)
 */
      __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);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_v__);
        __pyx_v__ = __pyx_t_4;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1537
 *                 self.current_root = self.search_specific_files.pop()
 *             except KeyError, _:
 *                 raise StopIteration()             # <<<<<<<<<<<<<<
 *             self.searched_specific_files.add(self.current_root)
 *             # process the entries for this containing directory: the rest will be
 */
        __pyx_t_5 = PyObject_Call(__pyx_builtin_StopIteration, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L11_except_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 = 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;
        goto __pyx_L10_exception_handled;
      }
      __pyx_L11_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_L10_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_L16_try_end:;
    }

    /* "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_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_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_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "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_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_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_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;

    /* "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_v_self->root_entries_len = __pyx_t_8;

    /* "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_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __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;

    /* "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_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);
    __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_GOTREF(__pyx_t_3);
    __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
 *             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)
 *             except OSError, e:
 */
    {
      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/_dirstate_helpers_pyx.pyx":1546
 *             self.root_abspath = self.tree.abspath(self.current_root_unicode)
 *             try:
 *                 root_stat = os.lstat(self.root_abspath)             # <<<<<<<<<<<<<<
 *             except OSError, e:
 *                 if e.errno == errno.ENOENT:
 */
        __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_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_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_DECREF(__pyx_v_root_stat);
        __pyx_v_root_stat = __pyx_t_4;
        __pyx_t_4 = 0;
      }
      /*else:*/ {

        /* "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_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_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

        /* "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_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_INCREF(__pyx_v_self->current_root);
        PyTuple_SET_ITEM(__pyx_t_2, 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);
        __Pyx_INCREF(__pyx_v_root_stat);
        PyTuple_SET_ITEM(__pyx_t_2, 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);
        __Pyx_GIVEREF(__pyx_v_self->root_abspath);
        __pyx_t_4 = 0;

        /* "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_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;

        /* "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_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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_7) {

          /* "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);

          /* "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_INCREF(__pyx_v_self->current_root_unicode);
          PyTuple_SET_ITEM(__pyx_t_2, 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_GOTREF(__pyx_t_3);
          __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
 *                     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_GOTREF(__pyx_t_3);

            /* "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_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_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "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_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;
            goto __pyx_L28;
          }
          __pyx_L28:;
          goto __pyx_L27;
        }
        __pyx_L27:;
      }
      __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_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;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1547
 *             try:
 *                 root_stat = os.lstat(self.root_abspath)
 *             except OSError, e:             # <<<<<<<<<<<<<<
 *                 if e.errno == errno.ENOENT:
 *                     # the path does not exist: let _process_entry know that.
 */
      __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);
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_v_e);
        __pyx_v_e = __pyx_t_3;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1548
 *                 root_stat = os.lstat(self.root_abspath)
 *             except OSError, e:
 *                 if e.errno == errno.ENOENT:             # <<<<<<<<<<<<<<
 *                     # the path does not exist: let _process_entry know that.
 *                     self.root_dir_info = None
 */
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__errno); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L21_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 = 1548; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_EQ); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1548; __pyx_clineno = __LINE__; goto __pyx_L21_except_error;}
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (__pyx_t_7) {

          /* "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             # <<<<<<<<<<<<<<
 *                 else:
 *                     # some other random error: hand it up.
 */
          __Pyx_INCREF(Py_None);
          __Pyx_GIVEREF(Py_None);
          __Pyx_GOTREF(__pyx_v_self->root_dir_info);
          __Pyx_DECREF(__pyx_v_self->root_dir_info);
          __pyx_v_self->root_dir_info = Py_None;
          goto __pyx_L31;
        }
        /*else*/ {

          /* "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_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_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_2); __pyx_t_2 = 0;
        goto __pyx_L20_exception_handled;
      }
      __pyx_L21_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_L20_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_L26_try_end:;
    }

    /* "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:             # <<<<<<<<<<<<<<
 *                 # this specified path is not present at all, skip it.
 *                 # (tail recursion, can do a loop once the full structure is
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->root_entries); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_1 = (!__pyx_t_7);
    if (__pyx_t_1) {
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->root_dir_info); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_11 = (!__pyx_t_7);
      __pyx_t_7 = __pyx_t_11;
    } else {
      __pyx_t_7 = __pyx_t_1;
    }
    if (__pyx_t_7) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1567
 *                 # (tail recursion, can do a loop once the full structure is
 *                 # known).
 *                 return self._iter_next()             # <<<<<<<<<<<<<<
 *             path_handled = 0
 *             self.root_entries_pos = 0
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_iter_next(__pyx_v_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;
      goto __pyx_L32;
    }
    __pyx_L32:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1568
 *                 # known).
 *                 return self._iter_next()
 *             path_handled = 0             # <<<<<<<<<<<<<<
 *             self.root_entries_pos = 0
 *             # XXX Clarity: This loop is duplicated a out the self.current_root
 */
    __pyx_v_path_handled = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1569
 *                 return self._iter_next()
 *             path_handled = 0
 *             self.root_entries_pos = 0             # <<<<<<<<<<<<<<
 *             # XXX Clarity: This loop is duplicated a out the self.current_root
 *             # is None guard above: if we return from it, it completes there
 */
    __pyx_v_self->root_entries_pos = 0;

    /* "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:             # <<<<<<<<<<<<<<
 *                 entry = self.root_entries[self.root_entries_pos]
 *                 self.root_entries_pos = self.root_entries_pos + 1
 */
    while (1) {
      __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
 *             # 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]             # <<<<<<<<<<<<<<
 *                 self.root_entries_pos = self.root_entries_pos + 1
 *                 result, changed = self._process_entry(entry, self.root_dir_info)
 */
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_self->root_entries, __pyx_v_self->root_entries_pos, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; __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/_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             # <<<<<<<<<<<<<<
 *                 result, changed = self._process_entry(entry, self.root_dir_info)
 *                 if changed is not None:
 */
      __pyx_v_self->root_entries_pos = (__pyx_v_self->root_entries_pos + 1);

      /* "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_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_t_4 = 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_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_GOTREF(__pyx_t_4);
        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_t_4 = 0;
      }

      /* "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:             # <<<<<<<<<<<<<<
 *                     path_handled = -1
 *                     if changed:
 */
      __pyx_t_7 = (__pyx_v_changed != Py_None);
      if (__pyx_t_7) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1579
 *                 result, changed = self._process_entry(entry, self.root_dir_info)
 *                 if changed is not None:
 *                     path_handled = -1             # <<<<<<<<<<<<<<
 *                     if changed:
 *                         self._gather_result_for_consistency(result)
 */
        __pyx_v_path_handled = -1;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1580
 *                 if changed is not None:
 *                     path_handled = -1
 *                     if changed:             # <<<<<<<<<<<<<<
 *                         self._gather_result_for_consistency(result)
 *                     if changed or self.include_unchanged:
 */
        __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
 *                     path_handled = -1
 *                     if changed:
 *                         self._gather_result_for_consistency(result)             # <<<<<<<<<<<<<<
 *                     if changed or self.include_unchanged:
 *                         return result
 */
          __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 = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          goto __pyx_L36;
        }
        __pyx_L36:;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1582
 *                     if changed:
 *                         self._gather_result_for_consistency(result)
 *                     if changed or self.include_unchanged:             # <<<<<<<<<<<<<<
 *                         return result
 *             # handle unversioned specified paths:
 */
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (!__pyx_t_7) {
          __pyx_t_1 = __pyx_v_self->include_unchanged;
        } else {
          __pyx_t_1 = __pyx_t_7;
        }
        if (__pyx_t_1) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1583
 *                         self._gather_result_for_consistency(result)
 *                     if changed or self.include_unchanged:
 *                         return result             # <<<<<<<<<<<<<<
 *             # handle unversioned specified paths:
 *             if self.want_unversioned and not path_handled and self.root_dir_info:
 */
          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(__pyx_v_result);
          __pyx_r = __pyx_v_result;
          goto __pyx_L0;
          goto __pyx_L37;
        }
        __pyx_L37:;
        goto __pyx_L35;
      }
      __pyx_L35:;
    }

    /* "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:             # <<<<<<<<<<<<<<
 *                 new_executable = bool(
 *                     stat.S_ISREG(self.root_dir_info[3].st_mode)
 */
    if (__pyx_v_self->want_unversioned) {
      __pyx_t_1 = (!__pyx_v_path_handled);
      if (__pyx_t_1) {
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_self->root_dir_info); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_11 = __pyx_t_7;
      } else {
        __pyx_t_11 = __pyx_t_1;
      }
      __pyx_t_1 = __pyx_t_11;
    } else {
      __pyx_t_1 = __pyx_v_self->want_unversioned;
    }
    if (__pyx_t_1) {

      /* "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_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_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_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 = 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;
      if (__pyx_t_1) {

        /* "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_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_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_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_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_DECREF(__pyx_v_new_executable);
      __pyx_v_new_executable = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "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,             # <<<<<<<<<<<<<<
 *                        (None, self.current_root_unicode),
 *                        True,
 */
      __Pyx_XDECREF(__pyx_r);

      /* "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_INCREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_2, 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);
      __Pyx_GIVEREF(__pyx_v_self->current_root_unicode);

      /* "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);

      /* "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_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);
      PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
      __Pyx_GIVEREF(__pyx_t_9);
      __pyx_t_3 = 0;
      __pyx_t_9 = 0;

      /* "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_INCREF(__pyx_v_self->current_root_unicode);
      PyTuple_SET_ITEM(__pyx_t_3, 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_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_INCREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_5, 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;

      /* "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_GIVEREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;

      /* "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_INCREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_INCREF(__pyx_v_new_executable);
      PyTuple_SET_ITEM(__pyx_t_3, 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_INCREF(Py_None);
      PyTuple_SET_ITEM(__pyx_t_12, 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);
      __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;
      __pyx_t_4 = 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;
      goto __pyx_L0;
      goto __pyx_L38;
    }
    __pyx_L38:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "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             # <<<<<<<<<<<<<<
 *             self.doing_consistency_expansion):
 *             # setup iteration of this root:
 */
  __pyx_t_7 = (__pyx_v_self->current_dir_info == Py_None);
  if (__pyx_t_7) {
    __pyx_t_1 = (__pyx_v_self->current_block == Py_None);
    if (__pyx_t_1) {

      /* "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):             # <<<<<<<<<<<<<<
 *             # setup iteration of this root:
 *             self.current_dir_list = None
 */
      __pyx_t_11 = (!__pyx_v_self->doing_consistency_expansion);
      __pyx_t_13 = __pyx_t_11;
    } else {
      __pyx_t_13 = __pyx_t_1;
    }
    __pyx_t_1 = __pyx_t_13;
  } else {
    __pyx_t_1 = __pyx_t_7;
  }
  if (__pyx_t_1) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1603
 *             self.doing_consistency_expansion):
 *             # setup iteration of this root:
 *             self.current_dir_list = None             # <<<<<<<<<<<<<<
 *             if self.root_dir_info and self.root_dir_info[2] == 'tree-reference':
 *                 self.current_dir_info = None
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->current_dir_list);
    __Pyx_DECREF(__pyx_v_self->current_dir_list);
    __pyx_v_self->current_dir_list = Py_None;

    /* "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':             # <<<<<<<<<<<<<<
 *                 self.current_dir_info = None
 *             else:
 */
    __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;
    } else {
      __pyx_t_13 = __pyx_t_1;
    }
    if (__pyx_t_13) {

      /* "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             # <<<<<<<<<<<<<<
 *             else:
 *                 self.dir_iterator = osutils._walkdirs_utf8(self.root_abspath,
 */
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->current_dir_info);
      __Pyx_DECREF(__pyx_v_self->current_dir_info);
      __pyx_v_self->current_dir_info = Py_None;
      goto __pyx_L40;
    }
    /*else*/ {

      /* "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_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_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));

      /* "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;

      /* "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_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;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1609
 *                 self.dir_iterator = osutils._walkdirs_utf8(self.root_abspath,
 *                     prefix=self.current_root)
 *                 self.path_index = 0             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.current_dir_info = self.dir_iterator.next()
 */
      __pyx_v_self->path_index = 0;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1610
 *                     prefix=self.current_root)
 *                 self.path_index = 0
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.current_dir_info = self.dir_iterator.next()
 *                     self.current_dir_list = self.current_dir_info[1]
 */
      {
        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/_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_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;

          /* "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_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;
        }
        /*else:*/ {

          /* "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) {

            /* "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_INCREF(__pyx_v_self->current_dir_list);
            PyTuple_SET_ITEM(__pyx_t_9, 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;
            __Pyx_DECREF(__pyx_v_bzr_index);
            __pyx_v_bzr_index = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "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) {

              /* "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_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
 *                         if self.current_dir_list[bzr_index][0] != '.bzr':
 *                             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 (PyObject_DelItem(__pyx_v_self->current_dir_list, __pyx_v_bzr_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;}
            goto __pyx_L49;
          }
          __pyx_L49:;
        }
        __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_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_9); __pyx_t_9 = 0;

        /* "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:             # <<<<<<<<<<<<<<
 *                     # there may be directories in the inventory even though
 *                     # this path is not a file on disk: so mark it as end of
 */
        __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;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_v_e);
          __pyx_v_e = __pyx_t_9;

          /* "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_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_10); __pyx_t_10 = 0;
          __pyx_t_1 = __pyx_t_13;
          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_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_10); __pyx_t_10 = 0;
            __pyx_t_7 = __pyx_t_13;
            __pyx_t_13 = __pyx_t_7;
          } else {
            __pyx_t_13 = __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;}
            __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_10); __pyx_t_10 = 0;
            __pyx_t_7 = __pyx_t_1;
            __pyx_t_1 = __pyx_t_7;
          } else {
            __pyx_t_1 = __pyx_t_13;
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_13 = __pyx_t_1;
          if (__pyx_t_13) {

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1618
 *                     # iterator
 *                     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
 */
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            __Pyx_GOTREF(__pyx_v_self->current_dir_info);
            __Pyx_DECREF(__pyx_v_self->current_dir_info);
            __pyx_v_self->current_dir_info = Py_None;
            goto __pyx_L53;
          }

          /* "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) {

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1623
 *                         # python 2.5 has e.errno == EINVAL,
 *                         #            and e.winerror == ERROR_DIRECTORY
 *                         try:             # <<<<<<<<<<<<<<
 *                             e_winerror = e.winerror
 *                         except AttributeError, _:
 */
            {
              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/_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_DECREF(__pyx_v_e_winerror);
                __pyx_v_e_winerror = __pyx_t_12;
                __pyx_t_12 = 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_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;

              /* "bzrlib/_dirstate_helpers_pyx.pyx":1625
 *                         try:
 *                             e_winerror = e.winerror
 *                         except AttributeError, _:             # <<<<<<<<<<<<<<
 *                             e_winerror = None
 *                         win_errors = (ERROR_DIRECTORY, ERROR_PATH_NOT_FOUND)
 */
              __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);
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_GOTREF(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_10);
                __Pyx_DECREF(__pyx_v__);
                __pyx_v__ = __pyx_t_10;

                /* "bzrlib/_dirstate_helpers_pyx.pyx":1626
 *                             e_winerror = e.winerror
 *                         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):
 */
                __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_10); __pyx_t_10 = 0;
                __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                goto __pyx_L55_exception_handled;
              }
              __pyx_L56_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_L43_except_error;
              __pyx_L55_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_L61_try_end:;
            }

            /* "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_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_GIVEREF(__pyx_t_10);
            __pyx_t_4 = 0;
            __pyx_t_10 = 0;
            __Pyx_DECREF(((PyObject *)__pyx_v_win_errors));
            __pyx_v_win_errors = __pyx_t_12;
            __pyx_t_12 = 0;

            /* "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_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;
            }
            if (__pyx_t_7) {

              /* "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             # <<<<<<<<<<<<<<
 *                         else:
 *                             # Will this really raise the right exception ?
 */
              __Pyx_INCREF(Py_None);
              __Pyx_GIVEREF(Py_None);
              __Pyx_GOTREF(__pyx_v_self->current_dir_info);
              __Pyx_DECREF(__pyx_v_self->current_dir_info);
              __pyx_v_self->current_dir_info = Py_None;
              goto __pyx_L64;
            }
            /*else*/ {

              /* "bzrlib/_dirstate_helpers_pyx.pyx":1632
 *                         else:
 *                             # Will this really raise the right exception ?
 *                             raise             # <<<<<<<<<<<<<<
 *                     else:
 *                         raise
 */
              __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_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;}
            }
            __pyx_L64:;
            goto __pyx_L53;
          }
          /*else*/ {

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1634
 *                             raise
 *                     else:
 *                         raise             # <<<<<<<<<<<<<<
 *                 else:
 *                     if self.current_dir_info[0][0] == '':
 */
            __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_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L43_except_error;}
          }
          __pyx_L53:;
          __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:;
        __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_L42_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_L48_try_end:;
      }
    }
    __pyx_L40:;

    /* "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_INCREF(__pyx_v_self->current_root);
    PyTuple_SET_ITEM(__pyx_t_3, 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));
    __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));
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
    __Pyx_DECREF(((PyObject *)__pyx_v_initial_key));
    __pyx_v_initial_key = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "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_INCREF(((PyObject *)__pyx_v_initial_key));
    PyTuple_SET_ITEM(__pyx_t_9, 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_v_self->block_index = __pyx_t_6;
      __Pyx_DECREF(__pyx_v__);
      __pyx_v__ = __pyx_t_3;
      __pyx_t_3 = 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_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_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_self->block_index = __pyx_t_6;
      __Pyx_DECREF(__pyx_v__);
      __pyx_v__ = __pyx_t_3;
      __pyx_t_3 = 0;
    }

    /* "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:             # <<<<<<<<<<<<<<
 *                 # we have processed the total root already, but because the
 *                 # initial key matched it we should skip it here.
 */
    __pyx_t_7 = (__pyx_v_self->block_index == 0);
    if (__pyx_t_7) {

      /* "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             # <<<<<<<<<<<<<<
 *             self._update_current_block()
 *         # walk until both the directory listing and the versioned metadata
 */
      __pyx_v_self->block_index = (__pyx_v_self->block_index + 1);
      goto __pyx_L65;
    }
    __pyx_L65:;

    /* "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()             # <<<<<<<<<<<<<<
 *         # walk until both the directory listing and the versioned metadata
 *         # are exhausted.
 */
    __pyx_t_6 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_update_current_block(__pyx_v_self); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L39;
  }
  __pyx_L39:;

  /* "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             # <<<<<<<<<<<<<<
 *             or self.current_block is not None):
 *             # Uncommon case - a missing directory or an unversioned directory:
 */
  while (1) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1652
 *         # are exhausted.
 *         while (self.current_dir_info is not None
 *             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
 */
    __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;
    } else {
      __pyx_t_1 = __pyx_t_7;
    }
    if (!__pyx_t_1) break;

    /* "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             # <<<<<<<<<<<<<<
 *                 and self.current_dir_info[0][0] != self.current_block[0]):
 *                 # Work around pyrex broken heuristic - current_dirname has
 */
    __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
 *             # 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]):             # <<<<<<<<<<<<<<
 *                 # Work around pyrex broken heuristic - current_dirname has
 *                 # the same scope as current_dirname_c
 */
      __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_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_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;
      } else {
        __pyx_t_11 = __pyx_t_7;
      }
      __pyx_t_7 = __pyx_t_11;
    } else {
      __pyx_t_7 = __pyx_t_1;
    }
    if (__pyx_t_7) {

      /* "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(
 *                     <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_DECREF(__pyx_v_current_dirname);
      __pyx_v_current_dirname = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1660
 *                 current_dirname = self.current_dir_info[0][0]
 *                 current_dirname_c = PyString_AS_STRING_void(
 *                     <void *>current_dirname)             # <<<<<<<<<<<<<<
 *                 current_blockname = self.current_block[0]
 *                 current_blockname_c = PyString_AS_STRING_void(
 */
      __pyx_v_current_dirname_c = PyString_AS_STRING(((void *)__pyx_v_current_dirname));

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1661
 *                 current_dirname_c = PyString_AS_STRING_void(
 *                     <void *>current_dirname)
 *                 current_blockname = self.current_block[0]             # <<<<<<<<<<<<<<
 *                 current_blockname_c = PyString_AS_STRING_void(
 *                     <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_DECREF(__pyx_v_current_blockname);
      __pyx_v_current_blockname = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1663
 *                 current_blockname = self.current_block[0]
 *                 current_blockname_c = PyString_AS_STRING_void(
 *                     <void *>current_blockname)             # <<<<<<<<<<<<<<
 *                 # In the python generator we evaluate this if block once per
 *                 # dir+block; because we reenter in the pyrex version its being
 */
      __pyx_v_current_blockname_c = PyString_AS_STRING(((void *)__pyx_v_current_blockname));

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1671
 *                     PyString_Size(current_dirname),
 *                     current_blockname_c,
 *                     PyString_Size(current_blockname)) < 0:             # <<<<<<<<<<<<<<
 *                     # filesystem data refers to paths not covered by the
 *                     # dirblock.  this has two possibilities:
 */
      __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
 *                     # recurse into unknown directories.
 *                     # 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
 */
        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_7 = (__pyx_v_self->path_index < __pyx_t_8);
          if (!__pyx_t_7) break;

          /* "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_DECREF(__pyx_v_current_path_info);
          __pyx_v_current_path_info = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "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_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_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_t_1 = __pyx_t_7;
          if (__pyx_t_1) {

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1688
 *                         if current_path_info[2] in ('directory',
 *                                                     'tree-reference'):
 *                             del self.current_dir_list[self.path_index]             # <<<<<<<<<<<<<<
 *                             self.path_index = self.path_index - 1
 *                         self.path_index = self.path_index + 1
 */
            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
 *                                                     'tree-reference'):
 *                             del self.current_dir_list[self.path_index]
 *                             self.path_index = self.path_index - 1             # <<<<<<<<<<<<<<
 *                         self.path_index = self.path_index + 1
 *                         if self.want_unversioned:
 */
            __pyx_v_self->path_index = (__pyx_v_self->path_index - 1);
            goto __pyx_L72;
          }
          __pyx_L72:;

          /* "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             # <<<<<<<<<<<<<<
 *                         if self.want_unversioned:
 *                             if current_path_info[2] == 'directory':
 */
          __pyx_v_self->path_index = (__pyx_v_self->path_index + 1);

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1691
 *                             self.path_index = self.path_index - 1
 *                         self.path_index = self.path_index + 1
 *                         if self.want_unversioned:             # <<<<<<<<<<<<<<
 *                             if current_path_info[2] == 'directory':
 *                                 if self.tree._directory_is_tree_reference(
 */
          if (__pyx_v_self->want_unversioned) {

            /* "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;
            if (__pyx_t_1) {

              /* "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);

              /* "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_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;
              if (__pyx_t_1) {

                /* "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);

                /* "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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_DECREF(__pyx_v_current_path_info);
                __pyx_v_current_path_info = __pyx_t_9;
                __pyx_t_9 = 0;
                goto __pyx_L75;
              }
              __pyx_L75:;
              goto __pyx_L74;
            }
            __pyx_L74:;

            /* "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_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_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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (__pyx_t_1) {

              /* "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_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_5); __pyx_t_5 = 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_DECREF(__pyx_v_new_executable);
            __pyx_v_new_executable = __pyx_t_5;
            __pyx_t_5 = 0;

            /* "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,             # <<<<<<<<<<<<<<
 *                                 (None, self.utf8_decode(current_path_info[0])[0]),
 *                                 True,
 */
            __Pyx_XDECREF(__pyx_r);

            /* "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_INCREF(Py_None);
            PyTuple_SET_ITEM(__pyx_t_5, 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;

            /* "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);

            /* "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_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;

            /* "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_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_9);
            __Pyx_GIVEREF(__pyx_t_9);
            __pyx_t_9 = 0;

            /* "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_INCREF(Py_None);
            PyTuple_SET_ITEM(__pyx_t_4, 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;

            /* "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_INCREF(Py_None);
            PyTuple_SET_ITEM(__pyx_t_9, 0, Py_None);
            __Pyx_GIVEREF(Py_None);
            __Pyx_INCREF(__pyx_v_new_executable);
            PyTuple_SET_ITEM(__pyx_t_9, 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_INCREF(Py_None);
            PyTuple_SET_ITEM(__pyx_t_2, 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);
            __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));
            __pyx_t_5 = 0;
            __pyx_t_3 = 0;
            __pyx_t_10 = 0;
            __pyx_t_12 = 0;
            __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
 *                                 (None, new_executable))
 *                     # This dir info has been handled, go to the next
 *                     self.path_index = 0             # <<<<<<<<<<<<<<
 *                     self.current_dir_list = None
 *                     try:
 */
        __pyx_v_self->path_index = 0;

        /* "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             # <<<<<<<<<<<<<<
 *                     try:
 *                         self.current_dir_info = self.dir_iterator.next()
 */
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_v_self->current_dir_list);
        __Pyx_DECREF(__pyx_v_self->current_dir_list);
        __pyx_v_self->current_dir_list = Py_None;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1711
 *                     self.path_index = 0
 *                     self.current_dir_list = None
 *                     try:             # <<<<<<<<<<<<<<
 *                         self.current_dir_info = self.dir_iterator.next()
 *                         self.current_dir_list = self.current_dir_info[1]
 */
        {
          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/_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_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;

            /* "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_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_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;

          /* "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, _:             # <<<<<<<<<<<<<<
 *                         self.current_dir_info = None
 *                 else: #(dircmp > 0)
 */
          __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);
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_INCREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_v__);
            __pyx_v__ = __pyx_t_2;

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1715
 *                         self.current_dir_list = self.current_dir_info[1]
 *                     except StopIteration, _:
 *                         self.current_dir_info = None             # <<<<<<<<<<<<<<
 *                 else: #(dircmp > 0)
 *                     # We have a dirblock entry for this location, but there
 */
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            __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_4); __pyx_t_4 = 0;
            goto __pyx_L77_exception_handled;
          }
          __pyx_L78_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_L77_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_L83_try_end:;
        }
        goto __pyx_L69;
      }
      /*else*/ {

        /* "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):             # <<<<<<<<<<<<<<
 *                         current_entry = self.current_block_list[self.current_block_pos]
 *                         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_11 = (__pyx_v_self->current_block_pos < __pyx_t_8);
          if (!__pyx_t_11) break;

          /* "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_DECREF(__pyx_v_current_entry);
          __pyx_v_current_entry = __pyx_t_4;
          __pyx_t_4 = 0;

          /* "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             # <<<<<<<<<<<<<<
 *                         # entry referring to file not present on disk.
 *                         # advance the entry only, after processing.
 */
          __pyx_v_self->current_block_pos = (__pyx_v_self->current_block_pos + 1);

          /* "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_DECREF(__pyx_v_result);
            __pyx_v_result = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_v_changed);
            __pyx_v_changed = __pyx_t_9;
            __pyx_t_9 = 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_DECREF(__pyx_v_result);
            __pyx_v_result = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_v_changed);
            __pyx_v_changed = __pyx_t_9;
            __pyx_t_9 = 0;
          }

          /* "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:             # <<<<<<<<<<<<<<
 *                             if changed:
 *                                 self._gather_result_for_consistency(result)
 */
          __pyx_t_11 = (__pyx_v_changed != Py_None);
          if (__pyx_t_11) {

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1731
 *                         result, changed = self._process_entry(current_entry, None)
 *                         if changed is not None:
 *                             if changed:             # <<<<<<<<<<<<<<
 *                                 self._gather_result_for_consistency(result)
 *                             if changed or self.include_unchanged:
 */
            __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
 *                         if changed is not None:
 *                             if changed:
 *                                 self._gather_result_for_consistency(result)             # <<<<<<<<<<<<<<
 *                             if changed or self.include_unchanged:
 *                                 return result
 */
              __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 = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              goto __pyx_L89;
            }
            __pyx_L89:;

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1733
 *                             if changed:
 *                                 self._gather_result_for_consistency(result)
 *                             if changed or self.include_unchanged:             # <<<<<<<<<<<<<<
 *                                 return result
 *                     self.block_index = self.block_index + 1
 */
            __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            if (!__pyx_t_11) {
              __pyx_t_1 = __pyx_v_self->include_unchanged;
            } else {
              __pyx_t_1 = __pyx_t_11;
            }
            if (__pyx_t_1) {

              /* "bzrlib/_dirstate_helpers_pyx.pyx":1734
 *                                 self._gather_result_for_consistency(result)
 *                             if changed or self.include_unchanged:
 *                                 return result             # <<<<<<<<<<<<<<
 *                     self.block_index = self.block_index + 1
 *                     self._update_current_block()
 */
              __Pyx_XDECREF(__pyx_r);
              __Pyx_INCREF(__pyx_v_result);
              __pyx_r = __pyx_v_result;
              goto __pyx_L0;
              goto __pyx_L90;
            }
            __pyx_L90:;
            goto __pyx_L88;
          }
          __pyx_L88:;
        }

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1735
 *                             if changed or self.include_unchanged:
 *                                 return result
 *                     self.block_index = self.block_index + 1             # <<<<<<<<<<<<<<
 *                     self._update_current_block()
 *                 continue # next loop-on-block/dir
 */
        __pyx_v_self->block_index = (__pyx_v_self->block_index + 1);

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1736
 *                                 return result
 *                     self.block_index = self.block_index + 1
 *                     self._update_current_block()             # <<<<<<<<<<<<<<
 *                 continue # next loop-on-block/dir
 *             result = self._loop_one_block()
 */
        __pyx_t_6 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_update_current_block(__pyx_v_self); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L69:;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1737
 *                     self.block_index = self.block_index + 1
 *                     self._update_current_block()
 *                 continue # next loop-on-block/dir             # <<<<<<<<<<<<<<
 *             result = self._loop_one_block()
 *             if result is not None:
 */
      goto __pyx_L66_continue;
      goto __pyx_L68;
    }
    __pyx_L68:;

    /* "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_DECREF(__pyx_v_result);
    __pyx_v_result = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1739
 *                 continue # next loop-on-block/dir
 *             result = self._loop_one_block()
 *             if result is not None:             # <<<<<<<<<<<<<<
 *                 return result
 *         if len(self.search_specific_files):
 */
    __pyx_t_1 = (__pyx_v_result != Py_None);
    if (__pyx_t_1) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1740
 *             result = self._loop_one_block()
 *             if result is not None:
 *                 return result             # <<<<<<<<<<<<<<
 *         if len(self.search_specific_files):
 *             # More supplied paths to process
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;
      goto __pyx_L91;
    }
    __pyx_L91:;
    __pyx_L66_continue:;
  }

  /* "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;
  if (__pyx_t_8) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1743
 *         if len(self.search_specific_files):
 *             # More supplied paths to process
 *             self.current_root = None             # <<<<<<<<<<<<<<
 *             return self._iter_next()
 *         # Start expanding more conservatively, adding paths the user may not
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->current_root);
    __Pyx_DECREF(__pyx_v_self->current_root);
    __pyx_v_self->current_root = Py_None;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1744
 *             # More supplied paths to process
 *             self.current_root = None
 *             return self._iter_next()             # <<<<<<<<<<<<<<
 *         # Start expanding more conservatively, adding paths the user may not
 *         # 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;
    goto __pyx_L0;
    goto __pyx_L92;
  }
  __pyx_L92:;

  /* "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             # <<<<<<<<<<<<<<
 *         if not self._pending_consistent_entries:
 *             self._pending_consistent_entries = self._next_consistent_entries()
 */
  __pyx_v_self->doing_consistency_expansion = 1;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1748
 *         # have intended but required for consistent deltas.
 *         self.doing_consistency_expansion = 1
 *         if not self._pending_consistent_entries:             # <<<<<<<<<<<<<<
 *             self._pending_consistent_entries = self._next_consistent_entries()
 *         while self._pending_consistent_entries:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_pending_consistent_entries); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_11 = (!__pyx_t_1);
  if (__pyx_t_11) {

    /* "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_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;
    goto __pyx_L93;
  }
  __pyx_L93:;

  /* "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:             # <<<<<<<<<<<<<<
 *             result, changed = self._pending_consistent_entries.pop()
 *             if changed is not None:
 */
  while (1) {
    __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
 *             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_DECREF(__pyx_v_result);
      __pyx_v_result = __pyx_t_9;
      __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_v_changed);
      __pyx_v_changed = __pyx_t_2;
      __pyx_t_2 = 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_DECREF(__pyx_v_result);
      __pyx_v_result = __pyx_t_9;
      __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_v_changed);
      __pyx_v_changed = __pyx_t_2;
      __pyx_t_2 = 0;
    }

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1752
 *         while self._pending_consistent_entries:
 *             result, changed = self._pending_consistent_entries.pop()
 *             if changed is not None:             # <<<<<<<<<<<<<<
 *                 return result
 *         raise StopIteration()
 */
    __pyx_t_11 = (__pyx_v_changed != Py_None);
    if (__pyx_t_11) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1753
 *             result, changed = self._pending_consistent_entries.pop()
 *             if changed is not None:
 *                 return result             # <<<<<<<<<<<<<<
 *         raise StopIteration()
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;
      goto __pyx_L96;
    }
    __pyx_L96:;
  }

  /* "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_filename = __pyx_f[0]; __pyx_lineno = 1754; __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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._iter_next");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_current_dirname);
  __Pyx_DECREF(__pyx_v_current_blockname);
  __Pyx_DECREF(__pyx_v_searched_specific_files);
  __Pyx_DECREF(__pyx_v_entry);
  __Pyx_DECREF(__pyx_v_result);
  __Pyx_DECREF(__pyx_v_changed);
  __Pyx_DECREF(__pyx_v__);
  __Pyx_DECREF(__pyx_v_root_stat);
  __Pyx_DECREF(__pyx_v_e);
  __Pyx_DECREF(__pyx_v_new_executable);
  __Pyx_DECREF(__pyx_v_e_winerror);
  __Pyx_DECREF(__pyx_v_win_errors);
  __Pyx_DECREF(__pyx_v_bzr_index);
  __Pyx_DECREF(__pyx_v_initial_key);
  __Pyx_DECREF(__pyx_v_current_path_info);
  __Pyx_DECREF(__pyx_v_current_entry);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":1756
 *         raise StopIteration()
 * 
 *     cdef object _maybe_tree_ref(self, current_path_info):             # <<<<<<<<<<<<<<
 *         if self.tree._directory_is_tree_reference(
 *             self.utf8_decode(current_path_info[0])[0]):
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__maybe_tree_ref(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_v_self, PyObject *__pyx_v_current_path_info) {
  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("_maybe_tree_ref");

  /* "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_GOTREF(__pyx_t_1);

  /* "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]):             # <<<<<<<<<<<<<<
 *             return current_path_info[:2] + \
 *                 ('tree-reference',) + current_path_info[3:]
 */
  __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));
  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_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__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));
  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_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__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
 *         if self.tree._directory_is_tree_reference(
 *             self.utf8_decode(current_path_info[0])[0]):
 *             return current_path_info[:2] + \             # <<<<<<<<<<<<<<
 *                 ('tree-reference',) + current_path_info[3:]
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);

    /* "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_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_GOTREF(__pyx_t_2);
    __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_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_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1762
 *                 ('tree-reference',) + current_path_info[3:]
 *         else:
 *             return current_path_info             # <<<<<<<<<<<<<<
 * 
 *     cdef object _loop_one_block(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_current_path_info);
    __pyx_r = __pyx_v_current_path_info;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __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._dirstate_helpers_pyx.ProcessEntryC._maybe_tree_ref");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":1764
 *             return current_path_info
 * 
 *     cdef object _loop_one_block(self):             # <<<<<<<<<<<<<<
 *             # current_dir_info and current_block refer to the same directory -
 *             # this is the common case code.
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__loop_one_block(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_v_self) {
  PyObject *__pyx_v_current_entry;
  PyObject *__pyx_v_current_path_info;
  int __pyx_v_path_handled;
  char __pyx_v_minikind;
  int __pyx_v_cmp_result;
  PyObject *__pyx_v_disk_kind;
  long __pyx_v_advance_entry;
  long __pyx_v_advance_path;
  PyObject *__pyx_v_result;
  PyObject *__pyx_v_changed;
  PyObject *__pyx_v_new_executable;
  PyObject *__pyx_v_relpath_unicode;
  PyObject *__pyx_v__;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  __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);
  __pyx_v_disk_kind = 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_new_executable = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_relpath_unicode = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v__ = Py_None; __Pyx_INCREF(Py_None);

  /* "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             # <<<<<<<<<<<<<<
 *                 self.current_block_pos < PyList_GET_SIZE(self.current_block_list)):
 *                 current_entry = PyList_GET_ITEM(self.current_block_list,
 */
  __pyx_t_1 = (__pyx_v_self->current_block != Py_None);
  if (__pyx_t_1) {

    /* "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;
  } else {
    __pyx_t_4 = __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);

    /* "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_DECREF(__pyx_v_current_entry);
    __pyx_v_current_entry = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1782
 *                     self.current_block_pos)
 *                 # accomodate pyrex
 *                 Py_INCREF(current_entry)             # <<<<<<<<<<<<<<
 *             else:
 *                 current_entry = None
 */
    Py_INCREF(__pyx_v_current_entry);
    goto __pyx_L3;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1784
 *                 Py_INCREF(current_entry)
 *             else:
 *                 current_entry = None             # <<<<<<<<<<<<<<
 *             if (self.current_dir_info is not None and
 *                 self.path_index < PyList_GET_SIZE(self.current_dir_list)):
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF(__pyx_v_current_entry);
    __pyx_v_current_entry = Py_None;
  }
  __pyx_L3:;

  /* "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) {

    /* "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;
  } else {
    __pyx_t_3 = __pyx_t_4;
  }
  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);

    /* "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_DECREF(__pyx_v_current_path_info);
    __pyx_v_current_path_info = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1790
 *                     self.path_index)
 *                 # accomodate pyrex
 *                 Py_INCREF(current_path_info)             # <<<<<<<<<<<<<<
 *                 disk_kind = PyTuple_GET_ITEM(current_path_info, 2)
 *                 # accomodate pyrex
 */
    Py_INCREF(__pyx_v_current_path_info);

    /* "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_DECREF(__pyx_v_disk_kind);
    __pyx_v_disk_kind = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1793
 *                 disk_kind = PyTuple_GET_ITEM(current_path_info, 2)
 *                 # accomodate pyrex
 *                 Py_INCREF(disk_kind)             # <<<<<<<<<<<<<<
 *                 if disk_kind == "directory":
 *                     current_path_info = self._maybe_tree_ref(current_path_info)
 */
    Py_INCREF(__pyx_v_disk_kind);

    /* "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) {

      /* "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_DECREF(__pyx_v_current_path_info);
      __pyx_v_current_path_info = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1797
 *                     current_path_info = self._maybe_tree_ref(current_path_info)
 *             else:
 *                 current_path_info = None             # <<<<<<<<<<<<<<
 *             while (current_entry is not None or current_path_info is not None):
 *                 advance_entry = -1
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF(__pyx_v_current_path_info);
    __pyx_v_current_path_info = Py_None;
  }
  __pyx_L4:;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1798
 *             else:
 *                 current_path_info = None
 *             while (current_entry is not None or current_path_info is not None):             # <<<<<<<<<<<<<<
 *                 advance_entry = -1
 *                 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_1 = __pyx_t_3;
    }
    if (!__pyx_t_1) break;

    /* "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             # <<<<<<<<<<<<<<
 *                 advance_path = -1
 *                 result = None
 */
    __pyx_v_advance_entry = -1;

    /* "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             # <<<<<<<<<<<<<<
 *                 result = None
 *                 changed = None
 */
    __pyx_v_advance_path = -1;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1801
 *                 advance_entry = -1
 *                 advance_path = -1
 *                 result = None             # <<<<<<<<<<<<<<
 *                 changed = None
 *                 path_handled = 0
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF(__pyx_v_result);
    __pyx_v_result = Py_None;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1802
 *                 advance_path = -1
 *                 result = None
 *                 changed = None             # <<<<<<<<<<<<<<
 *                 path_handled = 0
 *                 if current_entry is None:
 */
    __Pyx_INCREF(Py_None);
    __Pyx_DECREF(__pyx_v_changed);
    __pyx_v_changed = Py_None;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1803
 *                 result = None
 *                 changed = None
 *                 path_handled = 0             # <<<<<<<<<<<<<<
 *                 if current_entry is None:
 *                     # unversioned -  the check for path_handled when the path
 */
    __pyx_v_path_handled = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1804
 *                 changed = None
 *                 path_handled = 0
 *                 if current_entry is None:             # <<<<<<<<<<<<<<
 *                     # unversioned -  the check for path_handled when the path
 *                     # is advanced will yield this path if needed.
 */
    __pyx_t_1 = (__pyx_v_current_entry == Py_None);
    if (__pyx_t_1) {
      goto __pyx_L8;
    }

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1808
 *                     # is advanced will yield this path if needed.
 *                     pass
 *                 elif current_path_info is None:             # <<<<<<<<<<<<<<
 *                     # no path is fine: the per entry code will handle it.
 *                     result, changed = self._process_entry(current_entry,
 */
    __pyx_t_1 = (__pyx_v_current_path_info == Py_None);
    if (__pyx_t_1) {

      /* "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_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
 *                 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_v_result);
        __pyx_v_result = __pyx_t_5;
        __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_v_changed);
        __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_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;}
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_EndUnpack(__pyx_t_7, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1810; __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_5;
        __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_v_changed);
        __pyx_v_changed = __pyx_t_6;
        __pyx_t_6 = 0;
      }
      goto __pyx_L8;
    }
    /*else*/ {

      /* "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_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_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_v_minikind = __pyx_t_8;

      /* "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_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);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_2 = 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_GOTREF(__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__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
 *                         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
 *                         # record. Either the dirblock record is marked as
 */
      if (!__pyx_v_cmp_result) {
        switch (__pyx_v_minikind) {
          case 'a':
          case 'r':
          __pyx_t_1 = 1;
          break;
          default:
          __pyx_t_1 = 0;
          break;
        }
        __pyx_t_3 = __pyx_t_1;
      } else {
        __pyx_t_3 = __pyx_v_cmp_result;
      }
      if (__pyx_t_3) {

        /* "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) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1828
 *                             # extra file on disk: pass for now, but only
 *                             # increment the path, not the entry
 *                             advance_entry = 0             # <<<<<<<<<<<<<<
 *                         else:
 *                             # entry referring to file not present on disk.
 */
          __pyx_v_advance_entry = 0;
          goto __pyx_L10;
        }
        /*else*/ {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1833
 *                             # advance the entry only, after processing.
 *                             result, changed = self._process_entry(current_entry,
 *                                 None)             # <<<<<<<<<<<<<<
 *                             advance_path = 0
 *                     else:
 */
          __pyx_t_5 = ((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_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __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_6 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_6);
            __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2);

            /* "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,             # <<<<<<<<<<<<<<
 *                                 None)
 *                             advance_path = 0
 */
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;
          } 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);
            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;
          }

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1834
 *                             result, changed = self._process_entry(current_entry,
 *                                 None)
 *                             advance_path = 0             # <<<<<<<<<<<<<<
 *                     else:
 *                         # paths are the same,and the dirstate entry is not
 */
          __pyx_v_advance_path = 0;
        }
        __pyx_L10:;
        goto __pyx_L9;
      }
      /*else*/ {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1839
 *                         # absent or renamed.
 *                         result, changed = self._process_entry(current_entry,
 *                             current_path_info)             # <<<<<<<<<<<<<<
 *                         if changed is not None:
 *                             path_handled = -1
 */
        __pyx_t_5 = ((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_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __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_6 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_6);

          /* "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,             # <<<<<<<<<<<<<<
 *                             current_path_info)
 *                         if changed is not None:
 */
          __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_DECREF(__pyx_v_changed);
          __pyx_v_changed = __pyx_t_6;
          __pyx_t_6 = 0;
        } else {
          __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_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_DECREF(__pyx_v_changed);
          __pyx_v_changed = __pyx_t_6;
          __pyx_t_6 = 0;
        }

        /* "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) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1841
 *                             current_path_info)
 *                         if changed is not None:
 *                             path_handled = -1             # <<<<<<<<<<<<<<
 *                             if not changed and not self.include_unchanged:
 *                                 changed = None
 */
          __pyx_v_path_handled = -1;

          /* "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);
          if (__pyx_t_1) {
            __pyx_t_3 = (!__pyx_v_self->include_unchanged);
            __pyx_t_4 = __pyx_t_3;
          } else {
            __pyx_t_4 = __pyx_t_1;
          }
          if (__pyx_t_4) {

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1843
 *                             path_handled = -1
 *                             if not changed and not self.include_unchanged:
 *                                 changed = None             # <<<<<<<<<<<<<<
 *                 # >- loop control starts here:
 *                 # >- entry
 */
            __Pyx_INCREF(Py_None);
            __Pyx_DECREF(__pyx_v_changed);
            __pyx_v_changed = Py_None;
            goto __pyx_L12;
          }
          __pyx_L12:;
          goto __pyx_L11;
        }
        __pyx_L11:;
      }
      __pyx_L9:;
    }
    __pyx_L8:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1846
 *                 # >- loop control starts here:
 *                 # >- entry
 *                 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):
 */
    if (__pyx_v_advance_entry) {
      __pyx_t_4 = (__pyx_v_current_entry != Py_None);
      __pyx_t_1 = __pyx_t_4;
    } else {
      __pyx_t_1 = __pyx_v_advance_entry;
    }
    if (__pyx_t_1) {

      /* "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             # <<<<<<<<<<<<<<
 *                     if self.current_block_pos < PyList_GET_SIZE(self.current_block_list):
 *                         current_entry = self.current_block_list[self.current_block_pos]
 */
      __pyx_v_self->current_block_pos = (__pyx_v_self->current_block_pos + 1);

      /* "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;
      if (__pyx_t_1) {

        /* "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]             # <<<<<<<<<<<<<<
 *                     else:
 *                         current_entry = None
 */
        __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_self->current_block_list, __pyx_v_self->current_block_pos, sizeof(int), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_v_current_entry);
        __pyx_v_current_entry = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L14;
      }
      /*else*/ {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1851
 *                         current_entry = self.current_block_list[self.current_block_pos]
 *                     else:
 *                         current_entry = None             # <<<<<<<<<<<<<<
 *                 # >- path
 *                 if advance_path and current_path_info is not None:
 */
        __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_v_current_entry);
        __pyx_v_current_entry = Py_None;
      }
      __pyx_L14:;
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1853
 *                         current_entry = None
 *                 # >- path
 *                 if advance_path and current_path_info is not None:             # <<<<<<<<<<<<<<
 *                     if not path_handled:
 *                         # unversioned in all regards
 */
    if (__pyx_v_advance_path) {
      __pyx_t_1 = (__pyx_v_current_path_info != Py_None);
      __pyx_t_4 = __pyx_t_1;
    } else {
      __pyx_t_4 = __pyx_v_advance_path;
    }
    if (__pyx_t_4) {

      /* "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) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1856
 *                     if not path_handled:
 *                         # unversioned in all regards
 *                         if self.want_unversioned:             # <<<<<<<<<<<<<<
 *                             new_executable = bool(
 *                                 stat.S_ISREG(current_path_info[3].st_mode)
 */
        if (__pyx_v_self->want_unversioned) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1858
 *                         if self.want_unversioned:
 *                             new_executable = bool(
 *                                 stat.S_ISREG(current_path_info[3].st_mode)             # <<<<<<<<<<<<<<
 *                                 and stat.S_IEXEC & current_path_info[3].st_mode)
 *                             try:
 */
          __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__stat); if (unlikely(!__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_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__S_ISREG); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __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_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_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) {

            /* "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_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_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_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;
          } else {
            __pyx_t_3 = __pyx_t_4;
          }
          __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_DECREF(__pyx_v_new_executable);
          __pyx_v_new_executable = __pyx_t_2;
          __pyx_t_2 = 0;

          /* "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:             # <<<<<<<<<<<<<<
 *                                 relpath_unicode = self.utf8_decode(current_path_info[0])[0]
 *                             except UnicodeDecodeError, _:
 */
          {
            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/_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_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;
              __Pyx_DECREF(__pyx_v_relpath_unicode);
              __pyx_v_relpath_unicode = __pyx_t_6;
              __pyx_t_6 = 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_L25_try_end;
            __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_6); __pyx_t_6 = 0;

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1862
 *                             try:
 *                                 relpath_unicode = self.utf8_decode(current_path_info[0])[0]
 *                             except UnicodeDecodeError, _:             # <<<<<<<<<<<<<<
 *                                 raise errors.BadFilenameEncoding(
 *                                     current_path_info[0], osutils._fs_enc)
 */
            __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;}
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_GOTREF(__pyx_t_5);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_v__);
              __pyx_v__ = __pyx_t_2;

              /* "bzrlib/_dirstate_helpers_pyx.pyx":1863
 *                                 relpath_unicode = self.utf8_decode(current_path_info[0])[0]
 *                             except UnicodeDecodeError, _:
 *                                 raise errors.BadFilenameEncoding(             # <<<<<<<<<<<<<<
 *                                     current_path_info[0], osutils._fs_enc)
 *                             if changed is not None:
 */
              __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__errors); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_10 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__BadFilenameEncoding); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

              /* "bzrlib/_dirstate_helpers_pyx.pyx":1864
 *                             except UnicodeDecodeError, _:
 *                                 raise errors.BadFilenameEncoding(
 *                                     current_path_info[0], osutils._fs_enc)             # <<<<<<<<<<<<<<
 *                             if changed is not None:
 *                                 raise AssertionError(
 */
              __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_current_path_info, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_12 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s___fs_enc); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L20_except_error;}
              __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));
              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_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(((PyObject *)__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_5); __pyx_t_5 = 0;
              goto __pyx_L19_exception_handled;
            }
            __pyx_L20_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_L19_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_L25_try_end:;
          }

          /* "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) {

            /* "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_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_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_GOTREF(__pyx_t_5);
            __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 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;}
            goto __pyx_L28;
          }
          __pyx_L28:;

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1869
 *                                     "result is not None: %r" % result)
 *                             result = (None,
 *                                 (None, relpath_unicode),             # <<<<<<<<<<<<<<
 *                                 True,
 *                                 (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_INCREF(Py_None);
          PyTuple_SET_ITEM(__pyx_t_5, 0, Py_None);
          __Pyx_GIVEREF(Py_None);
          __Pyx_INCREF(__pyx_v_relpath_unicode);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_relpath_unicode);
          __Pyx_GIVEREF(__pyx_v_relpath_unicode);

          /* "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);

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1871
 *                                 (None, relpath_unicode),
 *                                 True,
 *                                 (False, False),             # <<<<<<<<<<<<<<
 *                                 (None, None),
 *                                 (None, self.utf8_decode(current_path_info[1])[0]),
 */
          __pyx_t_6 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          __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));
          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);
          __pyx_t_6 = 0;
          __pyx_t_12 = 0;

          /* "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_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_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_GIVEREF(__pyx_t_6);
          __pyx_t_6 = 0;

          /* "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_INCREF(Py_None);
          PyTuple_SET_ITEM(__pyx_t_10, 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;

          /* "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_INCREF(Py_None);
          PyTuple_SET_ITEM(__pyx_t_6, 0, Py_None);
          __Pyx_GIVEREF(Py_None);
          __Pyx_INCREF(__pyx_v_new_executable);
          PyTuple_SET_ITEM(__pyx_t_6, 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_INCREF(Py_None);
          PyTuple_SET_ITEM(__pyx_t_7, 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));
          __pyx_t_5 = 0;
          __pyx_t_2 = 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;

          /* "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_DECREF(__pyx_v_changed);
          __pyx_v_changed = __pyx_t_7;
          __pyx_t_7 = 0;
          goto __pyx_L17;
        }
        __pyx_L17:;

        /* "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) {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1880
 *                         # a dir
 *                         if current_path_info[2] in ('directory'):
 *                             del self.current_dir_list[self.path_index]             # <<<<<<<<<<<<<<
 *                             self.path_index = self.path_index - 1
 *                     # dont descend the disk iterator into any tree
 */
          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
 *                         if current_path_info[2] in ('directory'):
 *                             del self.current_dir_list[self.path_index]
 *                             self.path_index = self.path_index - 1             # <<<<<<<<<<<<<<
 *                     # dont descend the disk iterator into any tree
 *                     # paths.
 */
          __pyx_v_self->path_index = (__pyx_v_self->path_index - 1);
          goto __pyx_L29;
        }
        __pyx_L29:;
        goto __pyx_L16;
      }
      __pyx_L16:;

      /* "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) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1885
 *                     # paths.
 *                     if current_path_info[2] == 'tree-reference':
 *                         del self.current_dir_list[self.path_index]             # <<<<<<<<<<<<<<
 *                         self.path_index = self.path_index - 1
 *                     self.path_index = self.path_index + 1
 */
        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
 *                     if current_path_info[2] == 'tree-reference':
 *                         del self.current_dir_list[self.path_index]
 *                         self.path_index = self.path_index - 1             # <<<<<<<<<<<<<<
 *                     self.path_index = self.path_index + 1
 *                     if self.path_index < len(self.current_dir_list):
 */
        __pyx_v_self->path_index = (__pyx_v_self->path_index - 1);
        goto __pyx_L30;
      }
      __pyx_L30:;

      /* "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             # <<<<<<<<<<<<<<
 *                     if self.path_index < len(self.current_dir_list):
 *                         current_path_info = self.current_dir_list[self.path_index]
 */
      __pyx_v_self->path_index = (__pyx_v_self->path_index + 1);

      /* "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) {

        /* "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_DECREF(__pyx_v_current_path_info);
        __pyx_v_current_path_info = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "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)             # <<<<<<<<<<<<<<
 *                     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_DECREF(__pyx_v_current_path_info);
          __pyx_v_current_path_info = __pyx_t_7;
          __pyx_t_7 = 0;
          goto __pyx_L32;
        }
        __pyx_L32:;
        goto __pyx_L31;
      }
      /*else*/ {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1894
 *                                 current_path_info)
 *                     else:
 *                         current_path_info = None             # <<<<<<<<<<<<<<
 *                 if changed is not None:
 *                     # Found a result on this pass, yield it
 */
        __Pyx_INCREF(Py_None);
        __Pyx_DECREF(__pyx_v_current_path_info);
        __pyx_v_current_path_info = Py_None;
      }
      __pyx_L31:;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "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) {

      /* "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) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1898
 *                     # Found a result on this pass, yield it
 *                     if changed:
 *                         self._gather_result_for_consistency(result)             # <<<<<<<<<<<<<<
 *                     if changed or self.include_unchanged:
 *                         return result
 */
        __pyx_t_9 = ((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_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L34;
      }
      __pyx_L34:;

      /* "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;
      } else {
        __pyx_t_4 = __pyx_t_3;
      }
      if (__pyx_t_4) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1900
 *                         self._gather_result_for_consistency(result)
 *                     if changed or self.include_unchanged:
 *                         return result             # <<<<<<<<<<<<<<
 *             if self.current_block is not None:
 *                 self.block_index = self.block_index + 1
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_result);
        __pyx_r = __pyx_v_result;
        goto __pyx_L0;
        goto __pyx_L35;
      }
      __pyx_L35:;
      goto __pyx_L33;
    }
    __pyx_L33:;
  }

  /* "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) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1902
 *                         return result
 *             if self.current_block is not None:
 *                 self.block_index = self.block_index + 1             # <<<<<<<<<<<<<<
 *                 self._update_current_block()
 *             if self.current_dir_info is not None:
 */
    __pyx_v_self->block_index = (__pyx_v_self->block_index + 1);

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1903
 *             if self.current_block is not None:
 *                 self.block_index = self.block_index + 1
 *                 self._update_current_block()             # <<<<<<<<<<<<<<
 *             if self.current_dir_info is not None:
 *                 self.path_index = 0
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)__pyx_v_self->__pyx_vtab)->_update_current_block(__pyx_v_self); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L36;
  }
  __pyx_L36:;

  /* "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) {

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1905
 *                 self._update_current_block()
 *             if self.current_dir_info is not None:
 *                 self.path_index = 0             # <<<<<<<<<<<<<<
 *                 self.current_dir_list = None
 *                 try:
 */
    __pyx_v_self->path_index = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1906
 *             if self.current_dir_info is not None:
 *                 self.path_index = 0
 *                 self.current_dir_list = None             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.current_dir_info = self.dir_iterator.next()
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->current_dir_list);
    __Pyx_DECREF(__pyx_v_self->current_dir_list);
    __pyx_v_self->current_dir_list = Py_None;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1907
 *                 self.path_index = 0
 *                 self.current_dir_list = None
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.current_dir_info = self.dir_iterator.next()
 *                     self.current_dir_list = self.current_dir_info[1]
 */
    {
      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/_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_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;

        /* "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_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_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_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_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;

      /* "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, _:             # <<<<<<<<<<<<<<
 *                     self.current_dir_info = None
 * 
 */
      __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);
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_v__);
        __pyx_v__ = __pyx_t_7;

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1911
 *                     self.current_dir_list = self.current_dir_info[1]
 *                 except StopIteration, _:
 *                     self.current_dir_info = None             # <<<<<<<<<<<<<<
 * 
 *     cdef object _next_consistent_entries(self):
 */
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __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;
        goto __pyx_L39_exception_handled;
      }
      __pyx_L40_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_L39_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_L45_try_end:;
    }
    goto __pyx_L37;
  }
  __pyx_L37:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._loop_one_block");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_current_entry);
  __Pyx_DECREF(__pyx_v_current_path_info);
  __Pyx_DECREF(__pyx_v_disk_kind);
  __Pyx_DECREF(__pyx_v_result);
  __Pyx_DECREF(__pyx_v_changed);
  __Pyx_DECREF(__pyx_v_new_executable);
  __Pyx_DECREF(__pyx_v_relpath_unicode);
  __Pyx_DECREF(__pyx_v__);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":1913
 *                     self.current_dir_info = None
 * 
 *     cdef object _next_consistent_entries(self):             # <<<<<<<<<<<<<<
 *         """Grabs the next specific file parent case to consider.
 * 
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__next_consistent_entries(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_v_self) {
  PyObject *__pyx_v_results;
  PyObject *__pyx_v_path_utf8;
  PyObject *__pyx_v_path_entries;
  PyObject *__pyx_v_selected_entries;
  int __pyx_v_found_item;
  PyObject *__pyx_v_candidate_entry;
  PyObject *__pyx_v_path_info;
  PyObject *__pyx_v_entry;
  PyObject *__pyx_v_result;
  PyObject *__pyx_v_changed;
  PyObject *__pyx_v_entry_path_utf8;
  PyObject *__pyx_v_initial_key;
  PyObject *__pyx_v_block_index;
  PyObject *__pyx_v__;
  PyObject *__pyx_v_current_block;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __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;
  Py_ssize_t __pyx_t_11;
  __Pyx_RefNannySetupContext("_next_consistent_entries");
  __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_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_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
 *         :return: A list of the results, each of which is as for _process_entry.
 *         """
 *         results = []             # <<<<<<<<<<<<<<
 *         while self.search_specific_file_parents:
 *             # Process the parent directories for the paths we were iterating.
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(((PyObject *)__pyx_v_results));
  __pyx_v_results = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":1919
 *         """
 *         results = []
 *         while self.search_specific_file_parents:             # <<<<<<<<<<<<<<
 *             # Process the parent directories for the paths we were iterating.
 *             # Even in extremely large trees this should be modest, so currently
 */
  while (1) {
    __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
 *             # 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()             # <<<<<<<<<<<<<<
 *             if path_utf8 in self.searched_exact_paths:
 *                 # We've examined this path.
 */
    __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_self->search_specific_file_parents); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_path_utf8);
    __pyx_v_path_utf8 = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "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:             # <<<<<<<<<<<<<<
 *                 # We've examined this path.
 *                 continue
 */
    __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
 *             if path_utf8 in self.searched_exact_paths:
 *                 # We've examined this path.
 *                 continue             # <<<<<<<<<<<<<<
 *             if osutils.is_inside_any(self.searched_specific_files, path_utf8):
 *                 # We've examined this path.
 */
      goto __pyx_L3_continue;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1927
 *                 # We've examined this path.
 *                 continue
 *             if osutils.is_inside_any(self.searched_specific_files, path_utf8):             # <<<<<<<<<<<<<<
 *                 # We've examined this path.
 *                 continue
 */
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__osutils); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__is_inside_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1927; __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(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_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_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__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
 *             if osutils.is_inside_any(self.searched_specific_files, path_utf8):
 *                 # We've examined this path.
 *                 continue             # <<<<<<<<<<<<<<
 *             path_entries = self.state._entries_for_path(path_utf8)
 *             # We need either one or two entries. If the path in
 */
      goto __pyx_L3_continue;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1930
 *                 # We've examined this path.
 *                 continue
 *             path_entries = self.state._entries_for_path(path_utf8)             # <<<<<<<<<<<<<<
 *             # We need either one or two entries. If the path in
 *             # self.target_index has moved (so the entry in source_index is in
 */
    __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_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_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_v_path_entries);
    __pyx_v_path_entries = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "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 = []             # <<<<<<<<<<<<<<
 *             found_item = False
 *             for candidate_entry in path_entries:
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(((PyObject *)__pyx_v_selected_entries));
    __pyx_v_selected_entries = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1936
 *             # self.source_index, to output the appropriate delete-or-rename.
 *             selected_entries = []
 *             found_item = False             # <<<<<<<<<<<<<<
 *             for candidate_entry in path_entries:
 *                 # Find entries present in target at this path:
 */
    __pyx_v_found_item = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1937
 *             selected_entries = []
 *             found_item = False
 *             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':
 */
    if (PyList_CheckExact(__pyx_v_path_entries) || PyTuple_CheckExact(__pyx_v_path_entries)) {
      __pyx_t_5 = 0; __pyx_t_3 = __pyx_v_path_entries; __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_path_entries); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++;
      } else {
        __pyx_t_1 = PyIter_Next(__pyx_t_3);
        if (!__pyx_t_1) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_v_candidate_entry);
      __pyx_v_candidate_entry = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "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':             # <<<<<<<<<<<<<<
 *                     found_item = True
 *                     selected_entries.append(candidate_entry)
 */
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_candidate_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->target_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_2 = (__Pyx_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_n_s__ar), __pyx_t_1))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __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":1940
 *                 # Find entries present in target at this path:
 *                 if candidate_entry[1][self.target_index][0] not in 'ar':
 *                     found_item = True             # <<<<<<<<<<<<<<
 *                     selected_entries.append(candidate_entry)
 *                 # Find entries present in source at this path:
 */
        __pyx_v_found_item = 1;

        /* "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)             # <<<<<<<<<<<<<<
 *                 # Find entries present in source at this path:
 *                 elif (self.source_index is not None and
 */
        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;}
        goto __pyx_L9;
      }

      /* "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             # <<<<<<<<<<<<<<
 *                     candidate_entry[1][self.source_index][0] not in 'ar'):
 *                     found_item = True
 */
      __pyx_t_1 = PyInt_FromLong(__pyx_v_self->source_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = (__pyx_t_1 != Py_None);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (__pyx_t_2) {

        /* "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'):             # <<<<<<<<<<<<<<
 *                     found_item = True
 *                     if candidate_entry[1][self.target_index][0] == 'a':
 */
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_candidate_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __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 = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __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_NegateNonNeg(PySequence_Contains(((PyObject *)__pyx_n_s__ar), __pyx_t_1))); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_8 = __pyx_t_7;
      } else {
        __pyx_t_8 = __pyx_t_2;
      }
      if (__pyx_t_8) {

        /* "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             # <<<<<<<<<<<<<<
 *                     if candidate_entry[1][self.target_index][0] == 'a':
 *                         # Deleted, emit it here.
 */
        __pyx_v_found_item = 1;

        /* "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':             # <<<<<<<<<<<<<<
 *                         # Deleted, emit it here.
 *                         selected_entries.append(candidate_entry)
 */
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_candidate_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->target_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __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_1, ((PyObject *)__pyx_n_s__a), Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __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 = 1946; __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":1948
 *                     if candidate_entry[1][self.target_index][0] == 'a':
 *                         # Deleted, emit it here.
 *                         selected_entries.append(candidate_entry)             # <<<<<<<<<<<<<<
 *                     else:
 *                         # renamed, emit it when we process the directory it
 */
          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;}
          goto __pyx_L10;
        }
        /*else*/ {

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1952
 *                         # renamed, emit it when we process the directory it
 *                         # ended up at.
 *                         self.search_specific_file_parents.add(             # <<<<<<<<<<<<<<
 *                             candidate_entry[1][self.target_index][1])
 *             if not found_item:
 */
          __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
 *                         # ended up at.
 *                         self.search_specific_file_parents.add(
 *                             candidate_entry[1][self.target_index][1])             # <<<<<<<<<<<<<<
 *             if not found_item:
 *                 raise AssertionError(
 */
          __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_candidate_entry, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, __pyx_v_self->target_index, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __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_9, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1953; __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(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));
          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_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_1); __pyx_t_1 = 0;
        }
        __pyx_L10:;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":1954
 *                         self.search_specific_file_parents.add(
 *                             candidate_entry[1][self.target_index][1])
 *             if not found_item:             # <<<<<<<<<<<<<<
 *                 raise AssertionError(
 *                     "Missing entry for specific path parent %r, %r" % (
 */
    __pyx_t_8 = (!__pyx_v_found_item);
    if (__pyx_t_8) {

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1957
 *                 raise AssertionError(
 *                     "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:
 */
      __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_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_GOTREF(((PyObject *)__pyx_t_1));
      __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 = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__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_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__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;}
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "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_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_GOTREF(__pyx_t_3);
    __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_DECREF(__pyx_v_path_info);
    __pyx_v_path_info = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "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;} 
    }
    __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++;
      __Pyx_DECREF(__pyx_v_entry);
      __pyx_v_entry = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "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_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_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (__pyx_t_8) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":1961
 *             for entry in selected_entries:
 *                 if entry[0][2] in self.seen_ids:
 *                     continue             # <<<<<<<<<<<<<<
 *                 result, changed = self._process_entry(entry, path_info)
 *                 if changed is None:
 */
        goto __pyx_L12_continue;
        goto __pyx_L14;
      }
      __pyx_L14:;

      /* "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_4 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_v_result);
        __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_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_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_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_DECREF(__pyx_v_changed);
        __pyx_v_changed = __pyx_t_4;
        __pyx_t_4 = 0;
      }

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1963
 *                     continue
 *                 result, changed = self._process_entry(entry, path_info)
 *                 if changed is None:             # <<<<<<<<<<<<<<
 *                     raise AssertionError(
 *                         "Got entry<->path mismatch for specific path "
 */
      __pyx_t_8 = (__pyx_v_changed == Py_None);
      if (__pyx_t_8) {

        /* "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_INCREF(__pyx_v_path_utf8);
        PyTuple_SET_ITEM(__pyx_t_9, 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);
        __Pyx_GIVEREF(__pyx_v_entry);
        __Pyx_INCREF(__pyx_v_path_info);
        PyTuple_SET_ITEM(__pyx_t_9, 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_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_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_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 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;}
        goto __pyx_L15;
      }
      __pyx_L15:;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":1970
 *                 # Only include changes - we're outside the users requested
 *                 # expansion.
 *                 if changed:             # <<<<<<<<<<<<<<
 *                     self._gather_result_for_consistency(result)
 *                     if (result[6][0] == 'directory' and
 */
      __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
 *                 # expansion.
 *                 if changed:
 *                     self._gather_result_for_consistency(result)             # <<<<<<<<<<<<<<
 *                     if (result[6][0] == 'directory' and
 *                         result[6][1] != 'directory'):
 */
        __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
 *                 if changed:
 *                     self._gather_result_for_consistency(result)
 *                     if (result[6][0] == 'directory' and             # <<<<<<<<<<<<<<
 *                         result[6][1] != 'directory'):
 *                         # This stopped being a directory, the old children have
 */
        __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_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_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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
 *                     self._gather_result_for_consistency(result)
 *                     if (result[6][0] == 'directory' and
 *                         result[6][1] != 'directory'):             # <<<<<<<<<<<<<<
 *                         # This stopped being a directory, the old children have
 *                         # to be included.
 */
          __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_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_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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;
        } else {
          __pyx_t_7 = __pyx_t_8;
        }
        if (__pyx_t_7) {

          /* "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':             # <<<<<<<<<<<<<<
 *                             # renamed, take the source path
 *                             entry_path_utf8 = entry[1][self.source_index][1]
 */
          __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_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_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_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;
          if (__pyx_t_7) {

            /* "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_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_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_v_entry_path_utf8);
            __pyx_v_entry_path_utf8 = __pyx_t_9;
            __pyx_t_9 = 0;
            goto __pyx_L18;
          }
          /*else*/ {

            /* "bzrlib/_dirstate_helpers_pyx.pyx":1980
 *                             entry_path_utf8 = entry[1][self.source_index][1]
 *                         else:
 *                             entry_path_utf8 = path_utf8             # <<<<<<<<<<<<<<
 *                         initial_key = (entry_path_utf8, '', '')
 *                         block_index, _ = self.state._find_block_index_from_key(
 */
            __Pyx_INCREF(__pyx_v_path_utf8);
            __Pyx_DECREF(__pyx_v_entry_path_utf8);
            __pyx_v_entry_path_utf8 = __pyx_v_path_utf8;
          }
          __pyx_L18:;

          /* "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_INCREF(__pyx_v_entry_path_utf8);
          PyTuple_SET_ITEM(__pyx_t_9, 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));
          __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));
          __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
          __Pyx_DECREF(((PyObject *)__pyx_v_initial_key));
          __pyx_v_initial_key = __pyx_t_9;
          __pyx_t_9 = 0;

          /* "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);

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1983
 *                         initial_key = (entry_path_utf8, '', '')
 *                         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.
 */
          __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_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_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4);
            __pyx_t_9 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_9);

            /* "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_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;
          } 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_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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);
            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;
          }

          /* "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;
          if (__pyx_t_7) {

            /* "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_DECREF(__pyx_v_block_index);
            __pyx_v_block_index = __pyx_t_3;
            __pyx_t_3 = 0;
            goto __pyx_L19;
          }
          __pyx_L19:;

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1987
 *                             # 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):
 *                             current_block = self.state._dirblocks[block_index]
 */
          __Pyx_INCREF(Py_None);
          __Pyx_DECREF(__pyx_v_current_block);
          __pyx_v_current_block = Py_None;

          /* "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_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_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_7) {

            /* "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_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_v_current_block);
            __pyx_v_current_block = __pyx_t_3;
            __pyx_t_3 = 0;

            /* "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_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "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_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_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);
            __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
 *                                 entry_path_utf8, current_block[0]):
 *                                 # No entries for this directory at all.
 *                                 current_block = None             # <<<<<<<<<<<<<<
 *                         if current_block is not None:
 *                             for entry in current_block[1]:
 */
              __Pyx_INCREF(Py_None);
              __Pyx_DECREF(__pyx_v_current_block);
              __pyx_v_current_block = Py_None;
              goto __pyx_L21;
            }
            __pyx_L21:;
            goto __pyx_L20;
          }
          __pyx_L20:;

          /* "bzrlib/_dirstate_helpers_pyx.pyx":1994
 *                                 # No entries for this directory at all.
 *                                 current_block = None
 *                         if current_block is not None:             # <<<<<<<<<<<<<<
 *                             for entry in current_block[1]:
 *                                 if entry[1][self.source_index][0] in 'ar':
 */
          __pyx_t_8 = (__pyx_v_current_block != Py_None);
          if (__pyx_t_8) {

            /* "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);
            } 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_GOTREF(__pyx_t_4);
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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++;
              } 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++;
              } else {
                __pyx_t_3 = PyIter_Next(__pyx_t_4);
                if (!__pyx_t_3) {
                  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_DECREF(__pyx_v_entry);
              __pyx_v_entry = __pyx_t_3;
              __pyx_t_3 = 0;

              /* "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_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_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
 *                                     # Not in the source tree, so doesn't have to be
 *                                     # included.
 *                                     continue             # <<<<<<<<<<<<<<
 *                                 # Path of the entry itself.
 *                                 self.search_specific_file_parents.add(
 */
                goto __pyx_L23_continue;
                goto __pyx_L25;
              }
              __pyx_L25:;

              /* "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);

              /* "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_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_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_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_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_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_10); __pyx_t_10 = 0;
              __pyx_L23_continue:;
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L22;
          }
          __pyx_L22:;
          goto __pyx_L17;
        }
        __pyx_L17:;
        goto __pyx_L16;
      }
      __pyx_L16:;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":2003
 *                                 self.search_specific_file_parents.add(
 *                                     self.pathjoin(*entry[0][:2]))
 *                 if changed or self.include_unchanged:             # <<<<<<<<<<<<<<
 *                     results.append((result, changed))
 *             self.searched_exact_paths.add(path_utf8)
 */
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_changed); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      if (!__pyx_t_8) {
        __pyx_t_7 = __pyx_v_self->include_unchanged;
      } else {
        __pyx_t_7 = __pyx_t_8;
      }
      if (__pyx_t_7) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":2004
 *                                     self.pathjoin(*entry[0][:2]))
 *                 if changed or self.include_unchanged:
 *                     results.append((result, changed))             # <<<<<<<<<<<<<<
 *             self.searched_exact_paths.add(path_utf8)
 *         return results
 */
        if (unlikely(__pyx_v_results == Py_None)) {
          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_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;
        goto __pyx_L26;
      }
      __pyx_L26:;
      __pyx_L12_continue:;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "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_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_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_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_10); __pyx_t_10 = 0;
    __pyx_L3_continue:;
  }

  /* "bzrlib/_dirstate_helpers_pyx.pyx":2006
 *                     results.append((result, changed))
 *             self.searched_exact_paths.add(path_utf8)
 *         return results             # <<<<<<<<<<<<<<
 * 
 *     cdef object _path_info(self, utf8_path, unicode_path):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_results));
  __pyx_r = ((PyObject *)__pyx_v_results);
  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);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._next_consistent_entries");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_results);
  __Pyx_DECREF(__pyx_v_path_utf8);
  __Pyx_DECREF(__pyx_v_path_entries);
  __Pyx_DECREF(__pyx_v_selected_entries);
  __Pyx_DECREF(__pyx_v_candidate_entry);
  __Pyx_DECREF(__pyx_v_path_info);
  __Pyx_DECREF(__pyx_v_entry);
  __Pyx_DECREF(__pyx_v_result);
  __Pyx_DECREF(__pyx_v_changed);
  __Pyx_DECREF(__pyx_v_entry_path_utf8);
  __Pyx_DECREF(__pyx_v_initial_key);
  __Pyx_DECREF(__pyx_v_block_index);
  __Pyx_DECREF(__pyx_v__);
  __Pyx_DECREF(__pyx_v_current_block);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "bzrlib/_dirstate_helpers_pyx.pyx":2008
 *         return results
 * 
 *     cdef object _path_info(self, utf8_path, unicode_path):             # <<<<<<<<<<<<<<
 *         """Generate path_info for unicode_path.
 * 
 */

static  PyObject *__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__path_info(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *__pyx_v_self, PyObject *__pyx_v_utf8_path, PyObject *__pyx_v_unicode_path) {
  PyObject *__pyx_v_abspath;
  PyObject *__pyx_v_stat;
  PyObject *__pyx_v_e;
  PyObject *__pyx_v_utf8_basename;
  PyObject *__pyx_v_dir_info;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("_path_info");
  __pyx_v_abspath = Py_None; __Pyx_INCREF(Py_None);
  __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);

  /* "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)             # <<<<<<<<<<<<<<
 *         try:
 *             stat = os.lstat(abspath)
 */
  __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_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_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_v_abspath);
  __pyx_v_abspath = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":2014
 *         """
 *         abspath = self.tree.abspath(unicode_path)
 *         try:             # <<<<<<<<<<<<<<
 *             stat = os.lstat(abspath)
 *         except OSError, e:
 */
  {
    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/_dirstate_helpers_pyx.pyx":2015
 *         abspath = self.tree.abspath(unicode_path)
 *         try:
 *             stat = os.lstat(abspath)             # <<<<<<<<<<<<<<
 *         except OSError, e:
 *             if e.errno == errno.ENOENT:
 */
      __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__os); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L3_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 = 2015; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __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_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_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_stat);
      __pyx_v_stat = __pyx_t_1;
      __pyx_t_1 = 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_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "bzrlib/_dirstate_helpers_pyx.pyx":2016
 *         try:
 *             stat = os.lstat(abspath)
 *         except OSError, e:             # <<<<<<<<<<<<<<
 *             if e.errno == errno.ENOENT:
 *                 # the path does not exist.
 */
    __pyx_t_4 = PyErr_ExceptionMatches(__pyx_builtin_OSError);
    if (__pyx_t_4) {
      __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._path_info");
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_v_e);
      __pyx_v_e = __pyx_t_3;

      /* "bzrlib/_dirstate_helpers_pyx.pyx":2017
 *             stat = os.lstat(abspath)
 *         except OSError, e:
 *             if e.errno == errno.ENOENT:             # <<<<<<<<<<<<<<
 *                 # the path does not exist.
 *                 return None
 */
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__errno); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__errno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ENOENT); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_8) {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":2019
 *             if e.errno == errno.ENOENT:
 *                 # the path does not exist.
 *                 return None             # <<<<<<<<<<<<<<
 *             else:
 *                 raise
 */
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(Py_None);
        __pyx_r = Py_None;
        __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;
        goto __pyx_L6_except_return;
        goto __pyx_L13;
      }
      /*else*/ {

        /* "bzrlib/_dirstate_helpers_pyx.pyx":2021
 *                 return None
 *             else:
 *                 raise             # <<<<<<<<<<<<<<
 *         utf8_basename = utf8_path.rsplit('/', 1)[-1]
 *         dir_info = (utf8_path, utf8_basename,
 */
        __Pyx_GIVEREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_ErrRestore(__pyx_t_1, __pyx_t_3, __pyx_t_2);
        __pyx_t_1 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      }
      __pyx_L13:;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_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_L6_except_return:;
    __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_L0;
    __pyx_L4_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_L10_try_end:;
  }

  /* "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_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_GOTREF(__pyx_t_3);
  __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_DECREF(__pyx_v_utf8_basename);
  __pyx_v_utf8_basename = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "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_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;}
  __Pyx_GOTREF(__pyx_t_3);
  __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
 *         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_INCREF(__pyx_v_utf8_path);
  PyTuple_SET_ITEM(__pyx_t_1, 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);
  __Pyx_GIVEREF(__pyx_v_utf8_basename);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_stat);
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_stat);
  __Pyx_GIVEREF(__pyx_v_stat);
  __Pyx_INCREF(__pyx_v_abspath);
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_abspath);
  __Pyx_GIVEREF(__pyx_v_abspath);
  __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_v_dir_info));
  __pyx_v_dir_info = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "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_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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_8) {

    /* "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);

    /* "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_INCREF(__pyx_v_unicode_path);
    PyTuple_SET_ITEM(__pyx_t_1, 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_8) {

      /* "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);

      /* "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_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "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_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;
      goto __pyx_L15;
    }
    __pyx_L15:;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "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             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_dir_info));
  __pyx_r = ((PyObject *)__pyx_v_dir_info);
  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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("bzrlib._dirstate_helpers_pyx.ProcessEntryC._path_info");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_abspath);
  __Pyx_DECREF(__pyx_v_stat);
  __Pyx_DECREF(__pyx_v_e);
  __Pyx_DECREF(__pyx_v_utf8_basename);
  __Pyx_DECREF(__pyx_v_dir_info);
  __Pyx_XGIVEREF(__pyx_r);
  __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) {
  struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)o);
  p->__pyx_vtab = __pyx_vtabptr_6bzrlib_21_dirstate_helpers_pyx_Reader;
  p->state = Py_None; Py_INCREF(Py_None);
  p->text = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6bzrlib_21_dirstate_helpers_pyx_Reader(PyObject *o) {
  struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *p = (struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)o;
  Py_XDECREF(p->state);
  Py_XDECREF(p->text);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6bzrlib_21_dirstate_helpers_pyx_Reader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *p = (struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)o;
  if (p->state) {
    e = (*v)(p->state, a); if (e) return e;
  }
  if (p->text) {
    e = (*v)(p->text, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6bzrlib_21_dirstate_helpers_pyx_Reader(PyObject *o) {
  struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *p = (struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_Reader *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->state);
  p->state = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->text);
  p->text = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Reader = {
  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*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  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*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Reader = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Reader = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Reader = {
  #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_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*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6bzrlib_21_dirstate_helpers_pyx_Reader, /*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_Reader, /*tp_as_number*/
  &__pyx_tp_as_sequence_Reader, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Reader, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  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*/
  __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*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6bzrlib_21_dirstate_helpers_pyx_Reader, /*tp_methods*/
  0, /*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_21_dirstate_helpers_pyx_6Reader___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6bzrlib_21_dirstate_helpers_pyx_Reader, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  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_21_dirstate_helpers_pyx_ProcessEntryC __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC;

static PyObject *__pyx_tp_new_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)o);
  p->__pyx_vtab = __pyx_vtabptr_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC;
  p->old_dirname_to_file_id = Py_None; Py_INCREF(Py_None);
  p->new_dirname_to_file_id = Py_None; Py_INCREF(Py_None);
  p->last_source_parent = Py_None; Py_INCREF(Py_None);
  p->last_target_parent = Py_None; Py_INCREF(Py_None);
  p->use_filesystem_for_exec = Py_None; Py_INCREF(Py_None);
  p->utf8_decode = Py_None; Py_INCREF(Py_None);
  p->searched_specific_files = Py_None; Py_INCREF(Py_None);
  p->searched_exact_paths = Py_None; Py_INCREF(Py_None);
  p->search_specific_files = Py_None; Py_INCREF(Py_None);
  p->search_specific_file_parents = Py_None; Py_INCREF(Py_None);
  p->state = Py_None; Py_INCREF(Py_None);
  p->current_root = Py_None; Py_INCREF(Py_None);
  p->current_root_unicode = Py_None; Py_INCREF(Py_None);
  p->root_entries = Py_None; Py_INCREF(Py_None);
  p->root_abspath = Py_None; Py_INCREF(Py_None);
  p->tree = Py_None; Py_INCREF(Py_None);
  p->dir_iterator = Py_None; Py_INCREF(Py_None);
  p->current_block = Py_None; Py_INCREF(Py_None);
  p->current_block_list = Py_None; Py_INCREF(Py_None);
  p->current_dir_info = Py_None; Py_INCREF(Py_None);
  p->current_dir_list = Py_None; Py_INCREF(Py_None);
  p->_pending_consistent_entries = Py_None; Py_INCREF(Py_None);
  p->root_dir_info = Py_None; Py_INCREF(Py_None);
  p->bisect_left = Py_None; Py_INCREF(Py_None);
  p->pathjoin = Py_None; Py_INCREF(Py_None);
  p->fstat = Py_None; Py_INCREF(Py_None);
  p->seen_ids = Py_None; Py_INCREF(Py_None);
  p->sha_file = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC(PyObject *o) {
  struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *p = (struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)o;
  Py_XDECREF(p->old_dirname_to_file_id);
  Py_XDECREF(p->new_dirname_to_file_id);
  Py_XDECREF(p->last_source_parent);
  Py_XDECREF(p->last_target_parent);
  Py_XDECREF(p->use_filesystem_for_exec);
  Py_XDECREF(p->utf8_decode);
  Py_XDECREF(p->searched_specific_files);
  Py_XDECREF(p->searched_exact_paths);
  Py_XDECREF(p->search_specific_files);
  Py_XDECREF(p->search_specific_file_parents);
  Py_XDECREF(p->state);
  Py_XDECREF(p->current_root);
  Py_XDECREF(p->current_root_unicode);
  Py_XDECREF(p->root_entries);
  Py_XDECREF(p->root_abspath);
  Py_XDECREF(p->tree);
  Py_XDECREF(p->dir_iterator);
  Py_XDECREF(p->current_block);
  Py_XDECREF(p->current_block_list);
  Py_XDECREF(p->current_dir_info);
  Py_XDECREF(p->current_dir_list);
  Py_XDECREF(p->_pending_consistent_entries);
  Py_XDECREF(p->root_dir_info);
  Py_XDECREF(p->bisect_left);
  Py_XDECREF(p->pathjoin);
  Py_XDECREF(p->fstat);
  Py_XDECREF(p->seen_ids);
  Py_XDECREF(p->sha_file);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *p = (struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)o;
  if (p->old_dirname_to_file_id) {
    e = (*v)(p->old_dirname_to_file_id, a); if (e) return e;
  }
  if (p->new_dirname_to_file_id) {
    e = (*v)(p->new_dirname_to_file_id, a); if (e) return e;
  }
  if (p->last_source_parent) {
    e = (*v)(p->last_source_parent, a); if (e) return e;
  }
  if (p->last_target_parent) {
    e = (*v)(p->last_target_parent, a); if (e) return e;
  }
  if (p->use_filesystem_for_exec) {
    e = (*v)(p->use_filesystem_for_exec, a); if (e) return e;
  }
  if (p->utf8_decode) {
    e = (*v)(p->utf8_decode, a); if (e) return e;
  }
  if (p->searched_specific_files) {
    e = (*v)(p->searched_specific_files, a); if (e) return e;
  }
  if (p->searched_exact_paths) {
    e = (*v)(p->searched_exact_paths, a); if (e) return e;
  }
  if (p->search_specific_files) {
    e = (*v)(p->search_specific_files, a); if (e) return e;
  }
  if (p->search_specific_file_parents) {
    e = (*v)(p->search_specific_file_parents, a); if (e) return e;
  }
  if (p->state) {
    e = (*v)(p->state, a); if (e) return e;
  }
  if (p->current_root) {
    e = (*v)(p->current_root, a); if (e) return e;
  }
  if (p->current_root_unicode) {
    e = (*v)(p->current_root_unicode, a); if (e) return e;
  }
  if (p->root_entries) {
    e = (*v)(p->root_entries, a); if (e) return e;
  }
  if (p->root_abspath) {
    e = (*v)(p->root_abspath, a); if (e) return e;
  }
  if (p->tree) {
    e = (*v)(p->tree, a); if (e) return e;
  }
  if (p->dir_iterator) {
    e = (*v)(p->dir_iterator, a); if (e) return e;
  }
  if (p->current_block) {
    e = (*v)(p->current_block, a); if (e) return e;
  }
  if (p->current_block_list) {
    e = (*v)(p->current_block_list, a); if (e) return e;
  }
  if (p->current_dir_info) {
    e = (*v)(p->current_dir_info, a); if (e) return e;
  }
  if (p->current_dir_list) {
    e = (*v)(p->current_dir_list, a); if (e) return e;
  }
  if (p->_pending_consistent_entries) {
    e = (*v)(p->_pending_consistent_entries, a); if (e) return e;
  }
  if (p->root_dir_info) {
    e = (*v)(p->root_dir_info, a); if (e) return e;
  }
  if (p->bisect_left) {
    e = (*v)(p->bisect_left, a); if (e) return e;
  }
  if (p->pathjoin) {
    e = (*v)(p->pathjoin, a); if (e) return e;
  }
  if (p->fstat) {
    e = (*v)(p->fstat, a); if (e) return e;
  }
  if (p->seen_ids) {
    e = (*v)(p->seen_ids, a); if (e) return e;
  }
  if (p->sha_file) {
    e = (*v)(p->sha_file, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC(PyObject *o) {
  struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *p = (struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->old_dirname_to_file_id);
  p->old_dirname_to_file_id = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->new_dirname_to_file_id);
  p->new_dirname_to_file_id = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->last_source_parent);
  p->last_source_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->last_target_parent);
  p->last_target_parent = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->use_filesystem_for_exec);
  p->use_filesystem_for_exec = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->utf8_decode);
  p->utf8_decode = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->searched_specific_files);
  p->searched_specific_files = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->searched_exact_paths);
  p->searched_exact_paths = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->search_specific_files);
  p->search_specific_files = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->search_specific_file_parents);
  p->search_specific_file_parents = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->state);
  p->state = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->current_root);
  p->current_root = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->current_root_unicode);
  p->current_root_unicode = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->root_entries);
  p->root_entries = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->root_abspath);
  p->root_abspath = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->tree);
  p->tree = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->dir_iterator);
  p->dir_iterator = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->current_block);
  p->current_block = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->current_block_list);
  p->current_block_list = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->current_dir_info);
  p->current_dir_info = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->current_dir_list);
  p->current_dir_list = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pending_consistent_entries);
  p->_pending_consistent_entries = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->root_dir_info);
  p->root_dir_info = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->bisect_left);
  p->bisect_left = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pathjoin);
  p->pathjoin = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->fstat);
  p->fstat = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->seen_ids);
  p->seen_ids = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->sha_file);
  p->sha_file = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_searched_specific_files(PyObject *o, void *x) {
  return __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_23searched_specific_files___get__(o);
}

static PyObject *__pyx_getprop_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_searched_exact_paths(PyObject *o, void *x) {
  return __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_20searched_exact_paths___get__(o);
}

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)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC[] = {
  {(char *)"searched_specific_files", __pyx_getprop_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_searched_specific_files, 0, 0, 0},
  {(char *)"searched_exact_paths", __pyx_getprop_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC_searched_exact_paths, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ProcessEntryC = {
  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*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  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*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_ProcessEntryC = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ProcessEntryC = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ProcessEntryC = {
  #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_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*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC, /*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_ProcessEntryC, /*tp_as_number*/
  &__pyx_tp_as_sequence_ProcessEntryC, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_ProcessEntryC, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  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*/
  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_methods_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  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("_dirstate_helpers_pyx"),
    __Pyx_DOCSTR(__pyx_k_68), /* 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_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_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_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},
  {&__pyx_n_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 1},
  {&__pyx_n_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 1},
  {&__pyx_n_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 1},
  {&__pyx_n_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 1},
  {&__pyx_n_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 1},
  {&__pyx_n_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 1},
  {&__pyx_n_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 1},
  {&__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_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_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_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_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_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_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_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},
  {&__pyx_n_s__AttributeError, __pyx_k__AttributeError, sizeof(__pyx_k__AttributeError), 0, 0, 1, 1},
  {&__pyx_n_s__BadFileKindError, __pyx_k__BadFileKindError, sizeof(__pyx_k__BadFileKindError), 0, 0, 1, 1},
  {&__pyx_n_s__BadFilenameEncoding, __pyx_k__BadFilenameEncoding, sizeof(__pyx_k__BadFilenameEncoding), 0, 0, 1, 1},
  {&__pyx_n_s__BzrError, __pyx_k__BzrError, sizeof(__pyx_k__BzrError), 0, 0, 1, 1},
  {&__pyx_n_s__CorruptDirstate, __pyx_k__CorruptDirstate, sizeof(__pyx_k__CorruptDirstate), 0, 0, 1, 1},
  {&__pyx_n_s__DirState, __pyx_k__DirState, sizeof(__pyx_k__DirState), 0, 0, 1, 1},
  {&__pyx_n_s__DirstateCorrupt, __pyx_k__DirstateCorrupt, sizeof(__pyx_k__DirstateCorrupt), 0, 0, 1, 1},
  {&__pyx_n_s__EINVAL, __pyx_k__EINVAL, sizeof(__pyx_k__EINVAL), 0, 0, 1, 1},
  {&__pyx_n_s__ENOENT, __pyx_k__ENOENT, sizeof(__pyx_k__ENOENT), 0, 0, 1, 1},
  {&__pyx_n_s__ENOTDIR, __pyx_k__ENOTDIR, sizeof(__pyx_k__ENOTDIR), 0, 0, 1, 1},
  {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
  {&__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__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},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s__UnicodeDecodeError, __pyx_k__UnicodeDecodeError, sizeof(__pyx_k__UnicodeDecodeError), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____ne__, __pyx_k____ne__, sizeof(__pyx_k____ne__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___bisect_path_left, __pyx_k___bisect_path_left, sizeof(__pyx_k___bisect_path_left), 0, 0, 1, 1},
  {&__pyx_n_s___bisect_path_right, __pyx_k___bisect_path_right, sizeof(__pyx_k___bisect_path_right), 0, 0, 1, 1},
  {&__pyx_n_s___cutoff_time, __pyx_k___cutoff_time, sizeof(__pyx_k___cutoff_time), 0, 0, 1, 1},
  {&__pyx_n_s___dirblock_state, __pyx_k___dirblock_state, sizeof(__pyx_k___dirblock_state), 0, 0, 1, 1},
  {&__pyx_n_s___dirblocks, __pyx_k___dirblocks, sizeof(__pyx_k___dirblocks), 0, 0, 1, 1},
  {&__pyx_n_s___encode, __pyx_k___encode, sizeof(__pyx_k___encode), 0, 0, 1, 1},
  {&__pyx_n_s___end_of_header, __pyx_k___end_of_header, sizeof(__pyx_k___end_of_header), 0, 0, 1, 1},
  {&__pyx_n_s___ensure_block, __pyx_k___ensure_block, sizeof(__pyx_k___ensure_block), 0, 0, 1, 1},
  {&__pyx_n_s___entries_for_path, __pyx_k___entries_for_path, sizeof(__pyx_k___entries_for_path), 0, 0, 1, 1},
  {&__pyx_n_s___filename, __pyx_k___filename, sizeof(__pyx_k___filename), 0, 0, 1, 1},
  {&__pyx_n_s___fs_enc, __pyx_k___fs_enc, sizeof(__pyx_k___fs_enc), 0, 0, 1, 1},
  {&__pyx_n_s___get_entry, __pyx_k___get_entry, sizeof(__pyx_k___get_entry), 0, 0, 1, 1},
  {&__pyx_n_s___init, __pyx_k___init, sizeof(__pyx_k___init), 0, 0, 1, 1},
  {&__pyx_n_s___is_executable, __pyx_k___is_executable, sizeof(__pyx_k___is_executable), 0, 0, 1, 1},
  {&__pyx_n_s___iter_next, __pyx_k___iter_next, sizeof(__pyx_k___iter_next), 0, 0, 1, 1},
  {&__pyx_n_s___loop_one_block, __pyx_k___loop_one_block, sizeof(__pyx_k___loop_one_block), 0, 0, 1, 1},
  {&__pyx_n_s___mark_modified, __pyx_k___mark_modified, sizeof(__pyx_k___mark_modified), 0, 0, 1, 1},
  {&__pyx_n_s___maybe_tree_ref, __pyx_k___maybe_tree_ref, sizeof(__pyx_k___maybe_tree_ref), 0, 0, 1, 1},
  {&__pyx_n_s___num_entries, __pyx_k___num_entries, sizeof(__pyx_k___num_entries), 0, 0, 1, 1},
  {&__pyx_n_s___observed_sha1, __pyx_k___observed_sha1, sizeof(__pyx_k___observed_sha1), 0, 0, 1, 1},
  {&__pyx_n_s___parse_dirblocks, __pyx_k___parse_dirblocks, sizeof(__pyx_k___parse_dirblocks), 0, 0, 1, 1},
  {&__pyx_n_s___path_info, __pyx_k___path_info, sizeof(__pyx_k___path_info), 0, 0, 1, 1},
  {&__pyx_n_s___process_entry, __pyx_k___process_entry, sizeof(__pyx_k___process_entry), 0, 0, 1, 1},
  {&__pyx_n_s___py_memrchr, __pyx_k___py_memrchr, sizeof(__pyx_k___py_memrchr), 0, 0, 1, 1},
  {&__pyx_n_s___read_dirblocks, __pyx_k___read_dirblocks, sizeof(__pyx_k___read_dirblocks), 0, 0, 1, 1},
  {&__pyx_n_s___read_link, __pyx_k___read_link, sizeof(__pyx_k___read_link), 0, 0, 1, 1},
  {&__pyx_n_s___sha1_file, __pyx_k___sha1_file, sizeof(__pyx_k___sha1_file), 0, 0, 1, 1},
  {&__pyx_n_s___sha1_provider, __pyx_k___sha1_provider, sizeof(__pyx_k___sha1_provider), 0, 0, 1, 1},
  {&__pyx_n_s___sha_cutoff_time, __pyx_k___sha_cutoff_time, sizeof(__pyx_k___sha_cutoff_time), 0, 0, 1, 1},
  {&__pyx_n_s___state_file, __pyx_k___state_file, sizeof(__pyx_k___state_file), 0, 0, 1, 1},
  {&__pyx_n_s___utf8_decode, __pyx_k___utf8_decode, sizeof(__pyx_k___utf8_decode), 0, 0, 1, 1},
  {&__pyx_n_s___walkdirs_utf8, __pyx_k___walkdirs_utf8, sizeof(__pyx_k___walkdirs_utf8), 0, 0, 1, 1},
  {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1},
  {&__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},
  {&__pyx_n_s__bisect, __pyx_k__bisect, sizeof(__pyx_k__bisect), 0, 0, 1, 1},
  {&__pyx_n_s__bisect_dirblock, __pyx_k__bisect_dirblock, sizeof(__pyx_k__bisect_dirblock), 0, 0, 1, 1},
  {&__pyx_n_s__bisect_left, __pyx_k__bisect_left, sizeof(__pyx_k__bisect_left), 0, 0, 1, 1},
  {&__pyx_n_s__block_index, __pyx_k__block_index, sizeof(__pyx_k__block_index), 0, 0, 1, 1},
  {&__pyx_n_s__bzrlib, __pyx_k__bzrlib, sizeof(__pyx_k__bzrlib), 0, 0, 1, 1},
  {&__pyx_n_s__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 0, 1, 1},
  {&__pyx_n_s__cache, __pyx_k__cache, sizeof(__pyx_k__cache), 0, 0, 1, 1},
  {&__pyx_n_s__cache_utf8, __pyx_k__cache_utf8, sizeof(__pyx_k__cache_utf8), 0, 0, 1, 1},
  {&__pyx_n_s__cmp, __pyx_k__cmp, sizeof(__pyx_k__cmp), 0, 0, 1, 1},
  {&__pyx_n_s__cmp_by_dirs, __pyx_k__cmp_by_dirs, sizeof(__pyx_k__cmp_by_dirs), 0, 0, 1, 1},
  {&__pyx_n_s__cur_cstr, __pyx_k__cur_cstr, sizeof(__pyx_k__cur_cstr), 0, 0, 1, 1},
  {&__pyx_n_s__current_block, __pyx_k__current_block, sizeof(__pyx_k__current_block), 0, 0, 1, 1},
  {&__pyx_n_s__current_block_list, __pyx_k__current_block_list, sizeof(__pyx_k__current_block_list), 0, 0, 1, 1},
  {&__pyx_n_s__current_block_pos, __pyx_k__current_block_pos, sizeof(__pyx_k__current_block_pos), 0, 0, 1, 1},
  {&__pyx_n_s__current_dir_info, __pyx_k__current_dir_info, sizeof(__pyx_k__current_dir_info), 0, 0, 1, 1},
  {&__pyx_n_s__current_dir_list, __pyx_k__current_dir_list, sizeof(__pyx_k__current_dir_list), 0, 0, 1, 1},
  {&__pyx_n_s__current_root, __pyx_k__current_root, sizeof(__pyx_k__current_root), 0, 0, 1, 1},
  {&__pyx_n_s__d, __pyx_k__d, sizeof(__pyx_k__d), 0, 0, 1, 1},
  {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1},
  {&__pyx_n_s__dir_iterator, __pyx_k__dir_iterator, sizeof(__pyx_k__dir_iterator), 0, 0, 1, 1},
  {&__pyx_n_s__dirblocks, __pyx_k__dirblocks, sizeof(__pyx_k__dirblocks), 0, 0, 1, 1},
  {&__pyx_n_s__directory, __pyx_k__directory, sizeof(__pyx_k__directory), 0, 0, 1, 1},
  {&__pyx_n_s__dirname, __pyx_k__dirname, sizeof(__pyx_k__dirname), 0, 0, 1, 1},
  {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
  {&__pyx_n_s__end_cstr, __pyx_k__end_cstr, sizeof(__pyx_k__end_cstr), 0, 0, 1, 1},
  {&__pyx_n_s__entry, __pyx_k__entry, sizeof(__pyx_k__entry), 0, 0, 1, 1},
  {&__pyx_n_s__errno, __pyx_k__errno, sizeof(__pyx_k__errno), 0, 0, 1, 1},
  {&__pyx_n_s__errors, __pyx_k__errors, sizeof(__pyx_k__errors), 0, 0, 1, 1},
  {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
  {&__pyx_n_s__file, __pyx_k__file, sizeof(__pyx_k__file), 0, 0, 1, 1},
  {&__pyx_n_s__fstat, __pyx_k__fstat, sizeof(__pyx_k__fstat), 0, 0, 1, 1},
  {&__pyx_n_s__get_next, __pyx_k__get_next, sizeof(__pyx_k__get_next), 0, 0, 1, 1},
  {&__pyx_n_s__get_next_str, __pyx_k__get_next_str, sizeof(__pyx_k__get_next_str), 0, 0, 1, 1},
  {&__pyx_n_s__hi, __pyx_k__hi, sizeof(__pyx_k__hi), 0, 0, 1, 1},
  {&__pyx_n_s__include_unchanged, __pyx_k__include_unchanged, sizeof(__pyx_k__include_unchanged), 0, 0, 1, 1},
  {&__pyx_n_s__is_inside, __pyx_k__is_inside, sizeof(__pyx_k__is_inside), 0, 0, 1, 1},
  {&__pyx_n_s__is_inside_any, __pyx_k__is_inside_any, sizeof(__pyx_k__is_inside_any), 0, 0, 1, 1},
  {&__pyx_n_s__l, __pyx_k__l, sizeof(__pyx_k__l), 0, 0, 1, 1},
  {&__pyx_n_s__last_source_parent, __pyx_k__last_source_parent, sizeof(__pyx_k__last_source_parent), 0, 0, 1, 1},
  {&__pyx_n_s__last_target_parent, __pyx_k__last_target_parent, sizeof(__pyx_k__last_target_parent), 0, 0, 1, 1},
  {&__pyx_n_s__lo, __pyx_k__lo, sizeof(__pyx_k__lo), 0, 0, 1, 1},
  {&__pyx_n_s__lstat, __pyx_k__lstat, sizeof(__pyx_k__lstat), 0, 0, 1, 1},
  {&__pyx_n_s__next, __pyx_k__next, sizeof(__pyx_k__next), 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__pack_stat, __pyx_k__pack_stat, sizeof(__pyx_k__pack_stat), 0, 0, 1, 1},
  {&__pyx_n_s__parent_directories, __pyx_k__parent_directories, sizeof(__pyx_k__parent_directories), 0, 0, 1, 1},
  {&__pyx_n_s__partial, __pyx_k__partial, sizeof(__pyx_k__partial), 0, 0, 1, 1},
  {&__pyx_n_s__path, __pyx_k__path, sizeof(__pyx_k__path), 0, 0, 1, 1},
  {&__pyx_n_s__path1, __pyx_k__path1, sizeof(__pyx_k__path1), 0, 0, 1, 1},
  {&__pyx_n_s__path2, __pyx_k__path2, sizeof(__pyx_k__path2), 0, 0, 1, 1},
  {&__pyx_n_s__path_index, __pyx_k__path_index, sizeof(__pyx_k__path_index), 0, 0, 1, 1},
  {&__pyx_n_s__path_utf8, __pyx_k__path_utf8, sizeof(__pyx_k__path_utf8), 0, 0, 1, 1},
  {&__pyx_n_s__pathjoin, __pyx_k__pathjoin, sizeof(__pyx_k__pathjoin), 0, 0, 1, 1},
  {&__pyx_n_s__paths, __pyx_k__paths, sizeof(__pyx_k__paths), 0, 0, 1, 1},
  {&__pyx_n_s__platform, __pyx_k__platform, sizeof(__pyx_k__platform), 0, 0, 1, 1},
  {&__pyx_n_s__prefix, __pyx_k__prefix, sizeof(__pyx_k__prefix), 0, 0, 1, 1},
  {&__pyx_n_s__r, __pyx_k__r, sizeof(__pyx_k__r), 0, 0, 1, 1},
  {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1},
  {&__pyx_n_s__relocated, __pyx_k__relocated, sizeof(__pyx_k__relocated), 0, 0, 1, 1},
  {&__pyx_n_s__root_abspath, __pyx_k__root_abspath, sizeof(__pyx_k__root_abspath), 0, 0, 1, 1},
  {&__pyx_n_s__root_dir_info, __pyx_k__root_dir_info, sizeof(__pyx_k__root_dir_info), 0, 0, 1, 1},
  {&__pyx_n_s__root_entries, __pyx_k__root_entries, sizeof(__pyx_k__root_entries), 0, 0, 1, 1},
  {&__pyx_n_s__root_entries_len, __pyx_k__root_entries_len, sizeof(__pyx_k__root_entries_len), 0, 0, 1, 1},
  {&__pyx_n_s__root_entries_pos, __pyx_k__root_entries_pos, sizeof(__pyx_k__root_entries_pos), 0, 0, 1, 1},
  {&__pyx_n_s__rsplit, __pyx_k__rsplit, sizeof(__pyx_k__rsplit), 0, 0, 1, 1},
  {&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1},
  {&__pyx_n_s__seek, __pyx_k__seek, sizeof(__pyx_k__seek), 0, 0, 1, 1},
  {&__pyx_n_s__seen_ids, __pyx_k__seen_ids, sizeof(__pyx_k__seen_ids), 0, 0, 1, 1},
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
  {&__pyx_n_s__sha_file, __pyx_k__sha_file, sizeof(__pyx_k__sha_file), 0, 0, 1, 1},
  {&__pyx_n_s__source_index, __pyx_k__source_index, sizeof(__pyx_k__source_index), 0, 0, 1, 1},
  {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
  {&__pyx_n_s__splitpath, __pyx_k__splitpath, sizeof(__pyx_k__splitpath), 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__stat, __pyx_k__stat, sizeof(__pyx_k__stat), 0, 0, 1, 1},
  {&__pyx_n_s__stat_and_sha1, __pyx_k__stat_and_sha1, sizeof(__pyx_k__stat_and_sha1), 0, 0, 1, 1},
  {&__pyx_n_s__stat_value, __pyx_k__stat_value, sizeof(__pyx_k__stat_value), 0, 0, 1, 1},
  {&__pyx_n_s__state, __pyx_k__state, sizeof(__pyx_k__state), 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__target_index, __pyx_k__target_index, sizeof(__pyx_k__target_index), 0, 0, 1, 1},
  {&__pyx_n_s__text, __pyx_k__text, sizeof(__pyx_k__text), 0, 0, 1, 1},
  {&__pyx_n_s__text_cstr, __pyx_k__text_cstr, sizeof(__pyx_k__text_cstr), 0, 0, 1, 1},
  {&__pyx_n_s__text_size, __pyx_k__text_size, sizeof(__pyx_k__text_size), 0, 0, 1, 1},
  {&__pyx_n_s__tree, __pyx_k__tree, sizeof(__pyx_k__tree), 0, 0, 1, 1},
  {&__pyx_n_s__update, __pyx_k__update, sizeof(__pyx_k__update), 0, 0, 1, 1},
  {&__pyx_n_s__update_entry, __pyx_k__update_entry, sizeof(__pyx_k__update_entry), 0, 0, 1, 1},
  {&__pyx_n_s__utf8, __pyx_k__utf8, sizeof(__pyx_k__utf8), 0, 0, 1, 1},
  {&__pyx_n_s__utf8_decode, __pyx_k__utf8_decode, sizeof(__pyx_k__utf8_decode), 0, 0, 1, 1},
  {&__pyx_n_s__want_unversioned, __pyx_k__want_unversioned, sizeof(__pyx_k__want_unversioned), 0, 0, 1, 1},
  {&__pyx_n_s__win32, __pyx_k__win32, sizeof(__pyx_k__win32), 0, 0, 1, 1},
  {&__pyx_n_s__winerror, __pyx_k__winerror, sizeof(__pyx_k__winerror), 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 = 168; __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 = 264; __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 = 1009; __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 = 1537; __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 = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_cmp = __Pyx_GetName(__pyx_b, __pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_UnicodeDecodeError = __Pyx_GetName(__pyx_b, __pyx_n_s__UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  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;}
  #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_dirstate_helpers_pyx(void); /*proto*/
PyMODINIT_FUNC init_dirstate_helpers_pyx(void)
#else
PyMODINIT_FUNC PyInit__dirstate_helpers_pyx(void); /*proto*/
PyMODINIT_FUNC PyInit__dirstate_helpers_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__dirstate_helpers_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("_dirstate_helpers_pyx"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_68), 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
  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___dirstate_helpers_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_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);
  __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_directory = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_symlink = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_relocated = Py_None; Py_INCREF(Py_None);
  __pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_tree_reference = Py_None; Py_INCREF(Py_None);
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_6bzrlib_21_dirstate_helpers_pyx_Reader = &__pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_Reader;
  __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;
  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;
  __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;
  __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._iter_next = (PyObject *(*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__iter_next;
  __pyx_vtable_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC._maybe_tree_ref = (PyObject *(*)(struct __pyx_obj_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC *, PyObject *))__pyx_f_6bzrlib_21_dirstate_helpers_pyx_13ProcessEntryC__maybe_tree_ref;
  __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;
  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;}
  __pyx_ptype_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC = &__pyx_type_6bzrlib_21_dirstate_helpers_pyx_ProcessEntryC;
  /*--- 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/_dirstate_helpers_pyx.pyx":22
 * """
 * 
 * import binascii             # <<<<<<<<<<<<<<
 * import bisect
 * import errno
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__binascii), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  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
 * 
 * import binascii
 * import bisect             # <<<<<<<<<<<<<<
 * import errno
 * import os
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__bisect), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  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
 * import binascii
 * import bisect
 * import errno             # <<<<<<<<<<<<<<
 * import os
 * import stat
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__errno), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  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
 * import bisect
 * import errno
 * import os             # <<<<<<<<<<<<<<
 * import stat
 * 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 = 25; __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 = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":26
 * import errno
 * import os
 * import stat             # <<<<<<<<<<<<<<
 * import sys
 * 
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__stat), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  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
 * import os
 * import stat
 * import sys             # <<<<<<<<<<<<<<
 * 
 * from bzrlib import cache_utf8, errors, osutils
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __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 = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":29
 * import sys
 * 
 * from bzrlib import cache_utf8, errors, osutils             # <<<<<<<<<<<<<<
 * from bzrlib.dirstate import DirState
 * from bzrlib.osutils import parent_directories, pathjoin, splitpath
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__cache_utf8));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__cache_utf8));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__cache_utf8));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__errors));
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__errors));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__errors));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__osutils));
  PyList_SET_ITEM(__pyx_t_1, 2, ((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 = 29; __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__cache_utf8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__cache_utf8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__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 = 29; __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 = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__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 = 29; __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 = 29; __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/_dirstate_helpers_pyx.pyx":30
 * 
 * from bzrlib import cache_utf8, errors, osutils
 * from bzrlib.dirstate import DirState             # <<<<<<<<<<<<<<
 * from bzrlib.osutils import parent_directories, pathjoin, splitpath
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __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_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;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DirState, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __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/_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             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__parent_directories));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__parent_directories));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__parent_directories));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__pathjoin));
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__pathjoin));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__pathjoin));
  __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_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;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__parent_directories, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__pathjoin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__pathjoin, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__splitpath); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__splitpath, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __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/_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             # <<<<<<<<<<<<<<
 * cdef int ERROR_DIRECTORY
 * ERROR_DIRECTORY = 267
 */
  __pyx_v_6bzrlib_21_dirstate_helpers_pyx_ERROR_PATH_NOT_FOUND = 3;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":41
 * ERROR_PATH_NOT_FOUND = 3
 * cdef int ERROR_DIRECTORY
 * ERROR_DIRECTORY = 267             # <<<<<<<<<<<<<<
 * 
 * #python2.4 support, and other platform-dependent includes
 */
  __pyx_v_6bzrlib_21_dirstate_helpers_pyx_ERROR_DIRECTORY = 267;

  /* "bzrlib/_dirstate_helpers_pyx.pyx":126
 *     StaticTuple_New, StaticTuple_SET_ITEM
 * 
 * import_static_tuple_c()             # <<<<<<<<<<<<<<
 * 
 * cdef void* _my_memrchr(void *s, int c, size_t n): # cannot_raise
 */
  __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
 * 
 * 
 * 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
 * 
 * 
 * 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_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_DECREF(__pyx_t_2); __pyx_t_2 = 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
 * cdef object _kind_relocated
 * cdef object _kind_tree_reference
 * _kind_absent = "absent"             # <<<<<<<<<<<<<<
 * _kind_file = "file"
 * _kind_directory = "directory"
 */
  __Pyx_INCREF(((PyObject *)__pyx_n_s__absent));
  __Pyx_GOTREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_absent);
  __Pyx_DECREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_absent);
  __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
 * cdef object _kind_tree_reference
 * _kind_absent = "absent"
 * _kind_file = "file"             # <<<<<<<<<<<<<<
 * _kind_directory = "directory"
 * _kind_symlink = "symlink"
 */
  __Pyx_INCREF(((PyObject *)__pyx_n_s__file));
  __Pyx_GOTREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_file);
  __Pyx_DECREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_file);
  __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
 * _kind_absent = "absent"
 * _kind_file = "file"
 * _kind_directory = "directory"             # <<<<<<<<<<<<<<
 * _kind_symlink = "symlink"
 * _kind_relocated = "relocated"
 */
  __Pyx_INCREF(((PyObject *)__pyx_n_s__directory));
  __Pyx_GOTREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_directory);
  __Pyx_DECREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_directory);
  __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
 * _kind_file = "file"
 * _kind_directory = "directory"
 * _kind_symlink = "symlink"             # <<<<<<<<<<<<<<
 * _kind_relocated = "relocated"
 * _kind_tree_reference = "tree-reference"
 */
  __Pyx_INCREF(((PyObject *)__pyx_n_s__symlink));
  __Pyx_GOTREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_symlink);
  __Pyx_DECREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_symlink);
  __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
 * _kind_directory = "directory"
 * _kind_symlink = "symlink"
 * _kind_relocated = "relocated"             # <<<<<<<<<<<<<<
 * _kind_tree_reference = "tree-reference"
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_n_s__relocated));
  __Pyx_GOTREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_relocated);
  __Pyx_DECREF(__pyx_v_6bzrlib_21_dirstate_helpers_pyx__kind_relocated);
  __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
 * _kind_symlink = "symlink"
 * _kind_relocated = "relocated"
 * _kind_tree_reference = "tree-reference"             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_37));
  __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);

  /* "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));
  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._dirstate_helpers_pyx");
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init bzrlib._dirstate_helpers_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_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 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 <class>, <instance> */
        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;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}



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 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) {
    PyObject *item;
    if (!(item = PyIter_Next(iter))) {
        if (!PyErr_Occurred()) {
            __Pyx_RaiseNeedMoreValuesError(index);
        }
    }
    return item;
}

static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) {
    PyObject *item;
    if ((item = PyIter_Next(iter))) {
        Py_DECREF(item);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    }
    else if (!PyErr_Occurred())
        return 0;
    else
        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))
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 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;
}



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);
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *py_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)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_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;
}

#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)
{
    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;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        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",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const 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;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 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
    }
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) 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,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    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 */
