Rev 2340: Change the path_info_c stat encoding to use snprintf, saving 2usec from a 7usec call. in file:///home/robertc/source/baz/pathinfo/
Robert Collins
robertc at robertcollins.net
Wed Mar 14 01:06:43 GMT 2007
At file:///home/robertc/source/baz/pathinfo/
------------------------------------------------------------
revno: 2340
revision-id: robertc at robertcollins.net-20070314010639-evk1bw9gapb98efq
parent: robertc at robertcollins.net-20070313073226-hkqg6tof89stgulw
committer: Robert Collins <robertc at robertcollins.net>
branch nick: pathinfo
timestamp: Wed 2007-03-14 12:06:39 +1100
message:
Change the path_info_c stat encoding to use snprintf, saving 2usec from a 7usec call.
modified:
bzrlib/path_info_c.c path_info_c.c-20070309072643-pox974xfyuw278hs-1
bzrlib/path_info_c.pyx path_info_c.pyx-20070309072643-pox974xfyuw278hs-2
=== modified file 'bzrlib/path_info_c.c'
--- a/bzrlib/path_info_c.c 2007-03-13 07:32:26 +0000
+++ b/bzrlib/path_info_c.c 2007-03-14 01:06:39 +0000
@@ -1,4 +1,4 @@
-/* Generated by Pyrex 0.9.4.1 on Tue Mar 13 15:34:36 2007 */
+/* Generated by Pyrex 0.9.4.1 on Wed Mar 14 11:51:38 2007 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -21,6 +21,7 @@
__PYX_EXTERN_C double pow(double, double);
#include "errno.h"
#include "sys/types.h"
+#include "stdio.h"
#include "sys/stat.h"
#include "dirent.h"
@@ -58,6 +59,8 @@
/* Declarations from path_info_c */
+static void (*__pyx_v_11path_info_c__directory_kind);
+static void (*__pyx_v_11path_info_c_kind_file);
static PyObject *__pyx_k21;
static PyObject *__pyx_k22;
static PyObject *__pyx_k26;
@@ -76,8 +79,6 @@
static PyObject *__pyx_n___all__;
static PyObject *__pyx_n_os;
static PyObject *__pyx_n_sys;
-static PyObject *__pyx_n__directory_kind;
-static PyObject *__pyx_n_kind_file;
static PyObject *__pyx_n_kind_missing;
static PyObject *__pyx_n__directory;
static PyObject *__pyx_n__chardev;
@@ -101,6 +102,8 @@
static PyObject *__pyx_n_fast_pack;
static PyObject *__pyx_n_path_info;
static PyObject *__pyx_n_modules;
+static PyObject *__pyx_n__directory_kind;
+static PyObject *__pyx_n_kind_file;
static PyObject *__pyx_n_directory;
static PyObject *__pyx_n_chardev;
static PyObject *__pyx_n_block;
@@ -134,8 +137,6 @@
DIR (*__pyx_v_the_dir);
struct dirent (*__pyx_v_entry);
char (*__pyx_v_name);
- struct stat __pyx_v_a_stat;
- int __pyx_v_stat_result;
PyObject *__pyx_v_p_name;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
@@ -652,6 +653,7 @@
static PyObject *__pyx_k31p;
static char (__pyx_k31[]) = "";
+static char (__pyx_k32[]) = "%lX.%lX.%lX.%lX.%lX.%lX";
static PyObject *__pyx_f_11path_info_c_path_info(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_11path_info_c_path_info[] = "Get the kind, size, executability and statcache key for abspath.";
@@ -662,6 +664,8 @@
int __pyx_v_recenttime;
int __pyx_v_new_executable;
int __pyx_v_mode_value;
+ char (__pyx_v_encoded[97]);
+ int __pyx_v_snprintf_result;
PyObject *__pyx_v_statcachekey;
PyObject *__pyx_v_kind;
PyObject *__pyx_r;
@@ -672,7 +676,6 @@
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
- int __pyx_8;
static char *__pyx_argnames[] = {"abspath",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_abspath)) return 0;
Py_INCREF(__pyx_v_abspath);
@@ -691,43 +694,46 @@
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
}
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":182 */
- __pyx_4 = PyString_AsString(__pyx_v_abspath); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":186 */
+ (__pyx_v_encoded[97]) = 0;
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":187 */
+ __pyx_4 = PyString_AsString(__pyx_v_abspath); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
__pyx_v_stat_result = lstat(__pyx_4,(&__pyx_v_st));
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":183 */
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":188 */
__pyx_3 = (__pyx_v_stat_result != 0);
if (__pyx_3) {
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":184 */
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":189 */
__pyx_3 = (errno != ENOENT);
if (__pyx_3) {
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":185 */
- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
- __pyx_2 = PyInt_FromLong(errno); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
- __pyx_5 = PyString_FromString(strerror(errno)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
- __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":190 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(errno); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
+ __pyx_5 = PyString_FromString(strerror(errno)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
+ __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
PyTuple_SET_ITEM(__pyx_6, 1, __pyx_5);
__pyx_2 = 0;
__pyx_5 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
+ __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
+ {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; goto __pyx_L1;}
goto __pyx_L3;
}
/*else*/ {
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":189 */
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_kind_missing); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;}
- __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;}
- __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;}
- __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;}
- __pyx_7 = PyTuple_New(5); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;}
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":194 */
+ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_kind_missing); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
+ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
+ __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
+ __pyx_7 = PyTuple_New(5); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_5);
PyTuple_SET_ITEM(__pyx_7, 1, __pyx_1);
PyTuple_SET_ITEM(__pyx_7, 2, __pyx_6);
@@ -748,208 +754,150 @@
__pyx_L2:;
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":195 */
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_fast_pack); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;}
- __pyx_3 = PyObject_IsTrue(__pyx_5); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- if (__pyx_3) {
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":196 */
- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- __pyx_6 = PyInt_FromLong(__pyx_v_st.st_mtime); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
- __pyx_6 = 0;
- __pyx_7 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_3 = PyInt_AsLong(__pyx_7); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- __pyx_6 = PyInt_FromLong(__pyx_v_st.st_ctime); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6);
- __pyx_6 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_8 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_7 = __pyx_f_11path_info_c__fast__pack(__pyx_v_st.st_size,__pyx_3,__pyx_8,__pyx_v_st.st_dev,__pyx_v_st.st_ino,__pyx_v_st.st_mode); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
- Py_DECREF(__pyx_v_statcachekey);
- __pyx_v_statcachekey = __pyx_7;
- __pyx_7 = 0;
- goto __pyx_L4;
- }
- /*else*/ {
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":199 */
- __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- __pyx_5 = PyInt_FromLong(__pyx_v_st.st_mtime); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_7 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- __pyx_5 = PyInt_FromLong(__pyx_v_st.st_ctime); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_1 = PyObject_CallObject(__pyx_7, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- __pyx_8 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_2 = __pyx_f_11path_info_c__slow__pack(__pyx_v_st.st_size,__pyx_3,__pyx_8,__pyx_v_st.st_dev,__pyx_v_st.st_ino,__pyx_v_st.st_mode); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
- Py_DECREF(__pyx_v_statcachekey);
- __pyx_v_statcachekey = __pyx_2;
- __pyx_2 = 0;
- }
- __pyx_L4:;
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":201 */
+ __pyx_v_snprintf_result = snprintf(__pyx_v_encoded,96,__pyx_k32,__pyx_v_st.st_size,__pyx_v_st.st_mtime,__pyx_v_st.st_ctime,__pyx_v_st.st_dev,__pyx_v_st.st_ino,__pyx_v_st.st_mode);
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":197 */
+ __pyx_5 = PyString_FromString(__pyx_v_encoded); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
+ Py_DECREF(__pyx_v_statcachekey);
+ __pyx_v_statcachekey = __pyx_5;
+ __pyx_5 = 0;
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":210 */
__pyx_3 = (__pyx_v_st.st_ctime < __pyx_v_st.st_mtime);
if (__pyx_3) {
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":202 */
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":211 */
__pyx_v_recenttime = __pyx_v_st.st_mtime;
- goto __pyx_L5;
+ goto __pyx_L4;
}
/*else*/ {
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":204 */
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":213 */
__pyx_v_recenttime = __pyx_v_st.st_ctime;
}
- __pyx_L5:;
+ __pyx_L4:;
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":207 */
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":216 */
__pyx_v_mode_value = (__pyx_v_st.st_mode & S_IFMT);
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":208 */
- __pyx_8 = (__pyx_v_mode_value == S_IFREG);
- if (__pyx_8) {
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":209 */
- __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_kind_file); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;}
- Py_DECREF(__pyx_v_kind);
- __pyx_v_kind = __pyx_5;
- __pyx_5 = 0;
- goto __pyx_L6;
- }
- __pyx_3 = (__pyx_v_mode_value == S_IFDIR);
- if (__pyx_3) {
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":211 */
- __pyx_7 = __Pyx_GetName(__pyx_m, __pyx_n__directory_kind); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;}
- Py_DECREF(__pyx_v_kind);
- __pyx_v_kind = __pyx_7;
- __pyx_7 = 0;
- goto __pyx_L6;
- }
- __pyx_8 = (__pyx_v_mode_value == S_IFLNK);
- if (__pyx_8) {
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":213 */
- Py_INCREF(__pyx_n_symlink);
- Py_DECREF(__pyx_v_kind);
- __pyx_v_kind = __pyx_n_symlink;
- goto __pyx_L6;
- }
- __pyx_3 = (__pyx_v_mode_value == S_IFCHR);
- if (__pyx_3) {
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":215 */
- Py_INCREF(__pyx_n_chardev);
- Py_DECREF(__pyx_v_kind);
- __pyx_v_kind = __pyx_n_chardev;
- goto __pyx_L6;
- }
- __pyx_8 = (__pyx_v_mode_value == S_IFBLK);
- if (__pyx_8) {
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":217 */
- Py_INCREF(__pyx_n_block);
- Py_DECREF(__pyx_v_kind);
- __pyx_v_kind = __pyx_n_block;
- goto __pyx_L6;
- }
- __pyx_3 = (__pyx_v_mode_value == S_IFIFO);
- if (__pyx_3) {
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":217 */
+ __pyx_3 = (__pyx_v_mode_value == S_IFREG);
+ if (__pyx_3) {
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":218 */
+ __pyx_1 = (PyObject *)__pyx_v_11path_info_c_kind_file;
+ Py_INCREF(__pyx_1);
+ Py_DECREF(__pyx_v_kind);
+ __pyx_v_kind = __pyx_1;
+ __pyx_1 = 0;
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":219 */
- Py_INCREF(__pyx_n_fifo);
- Py_DECREF(__pyx_v_kind);
- __pyx_v_kind = __pyx_n_fifo;
- goto __pyx_L6;
+ __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;}
+ __pyx_2 = PyInt_FromLong((S_IXUSR & __pyx_v_st.st_mode)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;}
+ __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;}
+ PyTuple_SET_ITEM(__pyx_7, 0, __pyx_2);
+ __pyx_2 = 0;
+ __pyx_5 = PyObject_CallObject(__pyx_6, __pyx_7); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;}
+ Py_DECREF(__pyx_6); __pyx_6 = 0;
+ Py_DECREF(__pyx_7); __pyx_7 = 0;
+ __pyx_3 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; goto __pyx_L1;}
+ Py_DECREF(__pyx_5); __pyx_5 = 0;
+ __pyx_v_new_executable = __pyx_3;
+ goto __pyx_L5;
}
- __pyx_8 = (__pyx_v_mode_value == S_IFSOCK);
- if (__pyx_8) {
+ /*else*/ {
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":221 */
- Py_INCREF(__pyx_n_socket);
- Py_DECREF(__pyx_v_kind);
- __pyx_v_kind = __pyx_n_socket;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":223 */
- Py_INCREF(__pyx_n_unknown);
- Py_DECREF(__pyx_v_kind);
- __pyx_v_kind = __pyx_n_unknown;
- }
- __pyx_L6:;
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":225 */
- __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_kind_file); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;}
- __pyx_3 = __pyx_v_kind == __pyx_6;
- Py_DECREF(__pyx_6); __pyx_6 = 0;
- if (__pyx_3) {
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":226 */
- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
- __pyx_2 = PyInt_FromLong((S_IXUSR & __pyx_v_st.st_mode)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
- __pyx_2 = 0;
- __pyx_7 = PyObject_CallObject(__pyx_1, __pyx_5); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;}
+ __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_8 = PyInt_AsLong(__pyx_7); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;}
- Py_DECREF(__pyx_7); __pyx_7 = 0;
- __pyx_v_new_executable = __pyx_8;
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":228 */
- __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
- __pyx_3 = PyInt_AsLong(__pyx_6); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;}
- Py_DECREF(__pyx_6); __pyx_6 = 0;
__pyx_v_new_executable = __pyx_3;
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":222 */
+ __pyx_3 = (__pyx_v_mode_value == S_IFDIR);
+ if (__pyx_3) {
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":223 */
+ __pyx_2 = (PyObject *)__pyx_v_11path_info_c__directory_kind;
+ Py_INCREF(__pyx_2);
+ Py_DECREF(__pyx_v_kind);
+ __pyx_v_kind = __pyx_2;
+ __pyx_2 = 0;
+ goto __pyx_L6;
+ }
+ __pyx_3 = (__pyx_v_mode_value == S_IFLNK);
+ if (__pyx_3) {
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":225 */
+ Py_INCREF(__pyx_n_symlink);
+ Py_DECREF(__pyx_v_kind);
+ __pyx_v_kind = __pyx_n_symlink;
+ goto __pyx_L6;
+ }
+ __pyx_3 = (__pyx_v_mode_value == S_IFCHR);
+ if (__pyx_3) {
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":227 */
+ Py_INCREF(__pyx_n_chardev);
+ Py_DECREF(__pyx_v_kind);
+ __pyx_v_kind = __pyx_n_chardev;
+ goto __pyx_L6;
+ }
+ __pyx_3 = (__pyx_v_mode_value == S_IFBLK);
+ if (__pyx_3) {
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":229 */
+ Py_INCREF(__pyx_n_block);
+ Py_DECREF(__pyx_v_kind);
+ __pyx_v_kind = __pyx_n_block;
+ goto __pyx_L6;
+ }
+ __pyx_3 = (__pyx_v_mode_value == S_IFIFO);
+ if (__pyx_3) {
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":231 */
+ Py_INCREF(__pyx_n_fifo);
+ Py_DECREF(__pyx_v_kind);
+ __pyx_v_kind = __pyx_n_fifo;
+ goto __pyx_L6;
+ }
+ __pyx_3 = (__pyx_v_mode_value == S_IFSOCK);
+ if (__pyx_3) {
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":233 */
+ Py_INCREF(__pyx_n_socket);
+ Py_DECREF(__pyx_v_kind);
+ __pyx_v_kind = __pyx_n_socket;
+ goto __pyx_L6;
+ }
+ /*else*/ {
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":235 */
+ Py_INCREF(__pyx_n_unknown);
+ Py_DECREF(__pyx_v_kind);
+ __pyx_v_kind = __pyx_n_unknown;
+ }
+ __pyx_L6:;
}
- __pyx_L7:;
+ __pyx_L5:;
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":229 */
- __pyx_2 = PyInt_FromLong(__pyx_v_st.st_size); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
- __pyx_1 = PyInt_FromLong(__pyx_v_new_executable); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
- __pyx_5 = PyInt_FromLong(__pyx_v_recenttime); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
- __pyx_7 = PyTuple_New(5); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;}
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":237 */
+ __pyx_6 = PyInt_FromLong(__pyx_v_st.st_size); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
+ __pyx_7 = PyInt_FromLong(__pyx_v_new_executable); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
+ __pyx_5 = PyInt_FromLong(__pyx_v_recenttime); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
+ __pyx_1 = PyTuple_New(5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;}
Py_INCREF(__pyx_v_kind);
- PyTuple_SET_ITEM(__pyx_7, 0, __pyx_v_kind);
- PyTuple_SET_ITEM(__pyx_7, 1, __pyx_2);
- PyTuple_SET_ITEM(__pyx_7, 2, __pyx_1);
- PyTuple_SET_ITEM(__pyx_7, 3, __pyx_5);
+ PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_kind);
+ PyTuple_SET_ITEM(__pyx_1, 1, __pyx_6);
+ PyTuple_SET_ITEM(__pyx_1, 2, __pyx_7);
+ PyTuple_SET_ITEM(__pyx_1, 3, __pyx_5);
Py_INCREF(__pyx_v_statcachekey);
- PyTuple_SET_ITEM(__pyx_7, 4, __pyx_v_statcachekey);
- __pyx_2 = 0;
+ PyTuple_SET_ITEM(__pyx_1, 4, __pyx_v_statcachekey);
+ __pyx_6 = 0;
+ __pyx_7 = 0;
+ __pyx_5 = 0;
+ __pyx_r = __pyx_1;
__pyx_1 = 0;
- __pyx_5 = 0;
- __pyx_r = __pyx_7;
- __pyx_7 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
@@ -1090,72 +1038,72 @@
if (PyObject_SetAttr(__pyx_m, __pyx_n_sys, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":33 */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_modules); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_k5p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n__directory_kind); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n__directory_kind, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":34 */
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_modules); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_k6p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_kind_file); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_kind_file, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
-
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":35 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_modules); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_k7p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_kind_missing); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_kind_missing, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":92 */
- if (PyObject_SetAttr(__pyx_m, __pyx_n__directory, __pyx_n_directory) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
-
- /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":93 */
- if (PyObject_SetAttr(__pyx_m, __pyx_n__chardev, __pyx_n_chardev) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
+ __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_k5p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n__directory_kind); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_v_11path_info_c__directory_kind = ((void (*))__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":36 */
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_modules); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_k6p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_kind_file); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_v_11path_info_c_kind_file = ((void (*))__pyx_2);
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":37 */
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_modules); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_k7p); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_kind_missing); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
+ Py_DECREF(__pyx_1); __pyx_1 = 0;
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_kind_missing, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; goto __pyx_L1;}
+ Py_DECREF(__pyx_2); __pyx_2 = 0;
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":94 */
- if (PyObject_SetAttr(__pyx_m, __pyx_n__block, __pyx_n_block) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__directory, __pyx_n_directory) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; goto __pyx_L1;}
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":95 */
- if (PyObject_SetAttr(__pyx_m, __pyx_n__file, __pyx_n_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__chardev, __pyx_n_chardev) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":96 */
- if (PyObject_SetAttr(__pyx_m, __pyx_n__fifo, __pyx_n_fifo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__block, __pyx_n_block) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":97 */
- if (PyObject_SetAttr(__pyx_m, __pyx_n__symlink, __pyx_n_symlink) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__file, __pyx_n_file) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":98 */
- if (PyObject_SetAttr(__pyx_m, __pyx_n__socket, __pyx_n_socket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__fifo, __pyx_n_fifo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":99 */
- if (PyObject_SetAttr(__pyx_m, __pyx_n__unknown, __pyx_n_unknown) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__symlink, __pyx_n_symlink) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;}
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":100 */
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__socket, __pyx_n_socket) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;}
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":101 */
- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ord); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n__unknown, __pyx_n_unknown) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
+
+ /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":103 */
+ __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ord); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;}
Py_INCREF(__pyx_k16p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k16p);
- __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
+ __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_dot, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_dot, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":137 */
@@ -1265,7 +1213,7 @@
__pyx_7 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_fast_pack, __pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
Py_DECREF(__pyx_7); __pyx_7 = 0;
- goto __pyx_L8;
+ goto __pyx_L7;
}
/*else*/ {
@@ -1279,7 +1227,7 @@
if (PyObject_SetAttr(__pyx_m, __pyx_n_fast_pack, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
}
- __pyx_L8:;
+ __pyx_L7:;
/* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":174 */
return;
=== modified file 'bzrlib/path_info_c.pyx'
--- a/bzrlib/path_info_c.pyx 2007-03-13 07:32:26 +0000
+++ b/bzrlib/path_info_c.pyx 2007-03-14 01:06:39 +0000
@@ -30,8 +30,10 @@
# import from the imported path_info module, which has not yet been assigned
# into bzrlib.
-_directory_kind = sys.modules['bzrlib.path_info']._directory_kind
-kind_file = sys.modules['bzrlib.path_info'].kind_file
+cdef void * _directory_kind
+cdef void * kind_file
+_directory_kind = <void *>sys.modules['bzrlib.path_info']._directory_kind
+kind_file = <void*>sys.modules['bzrlib.path_info'].kind_file
kind_missing = sys.modules['bzrlib.path_info'].kind_missing
# the opaque C library DIR type.
@@ -44,8 +46,8 @@
ctypedef long ssize_t
ctypedef unsigned long size_t
-#cdef extern from 'stdio.h':
-# int snprintf(char *str, size_t size, const char *format, ...)
+cdef extern from 'stdio.h':
+ int snprintf(char *str, size_t size, char *format, ...)
cdef extern from 'sys/stat.h':
@@ -112,8 +114,6 @@
# 'struct dirent'
cdef dirent * entry
cdef char *name
- cdef stat a_stat
- cdef int stat_result
p_name = None
the_dir = opendir(path)
result = []
@@ -179,6 +179,11 @@
cdef int recenttime
cdef int new_executable
cdef int mode_value
+ # we need: size, mtime, ctime, dev, ino, mode, allowing them to be 64 bit each:
+ # 4bits/char: 6*64/4 = 96bytes
+ cdef char encoded[97]
+ cdef int snprintf_result
+ encoded[97] = 0
stat_result = lstat(abspath, &st)
if stat_result != 0:
if errno != ENOENT:
@@ -187,17 +192,21 @@
# TODO: could make this a constant to return, if we expect it to be
# common.
return (kind_missing, 0, False, 0, '')
+ snprintf_result = snprintf(encoded, 96, "%lX.%lX.%lX.%lX.%lX.%lX",
+ st.st_size, st.st_mtime, st.st_ctime, st.st_dev, st.st_ino, st.st_mode)
+ statcachekey = encoded
# result.append((fullname, a_stat.st_mode, a_stat.st_size, entry.d_ino))
# base64.encode always adds a final newline, so strip it off
#statcachekey = _encode(_pack('>llllll'
# , st.st_size, int(st.st_mtime), int(st.st_ctime)
# , st.st_dev, st.st_ino, st.st_mode))[:-1]
- if fast_pack:
- statcachekey = _fast__pack(st.st_size, int(st.st_mtime), int(st.st_ctime),
- st.st_dev, st.st_ino, st.st_mode)
- else:
- statcachekey = _slow__pack(st.st_size, int(st.st_mtime), int(st.st_ctime),
- st.st_dev, st.st_ino, st.st_mode)
+
+## if fast_pack:
+## statcachekey = _fast__pack(st.st_size, int(st.st_mtime), int(st.st_ctime),
+## st.st_dev, st.st_ino, st.st_mode)
+## else:
+## statcachekey = _slow__pack(st.st_size, int(st.st_mtime), int(st.st_ctime),
+## st.st_dev, st.st_ino, st.st_mode)
if st.st_ctime < st.st_mtime:
recenttime = st.st_mtime
else:
@@ -206,25 +215,24 @@
# %0x
mode_value = st.st_mode & S_IFMT
if mode_value == S_IFREG:
- kind = kind_file
- elif mode_value == S_IFDIR:
- kind = _directory_kind
- elif mode_value == S_IFLNK:
- kind = 'symlink'
- elif mode_value == S_IFCHR:
- kind ='chardev'
- elif mode_value == S_IFBLK:
- kind = 'block'
- elif mode_value == S_IFIFO:
- kind = 'fifo'
- elif mode_value == S_IFSOCK:
- kind ='socket'
- else:
- kind = 'unknown'
-
- if kind is kind_file:
+ kind = <object>kind_file
new_executable = bool(S_IXUSR & st.st_mode)
else:
new_executable = False
+ if mode_value == S_IFDIR:
+ kind = <object>_directory_kind
+ elif mode_value == S_IFLNK:
+ kind = 'symlink'
+ elif mode_value == S_IFCHR:
+ kind ='chardev'
+ elif mode_value == S_IFBLK:
+ kind = 'block'
+ elif mode_value == S_IFIFO:
+ kind = 'fifo'
+ elif mode_value == S_IFSOCK:
+ kind ='socket'
+ else:
+ kind = 'unknown'
+
return (kind, st.st_size, new_executable, recenttime,
statcachekey)
More information about the bazaar-commits
mailing list