Rev 2330: Merge update to path_info API to support recent time feedback for cache lookup checking. in file:///home/robertc/source/baz/pathinfo/

Robert Collins robertc at robertcollins.net
Fri Mar 9 14:56:56 GMT 2007


At file:///home/robertc/source/baz/pathinfo/

------------------------------------------------------------
revno: 2330
revision-id: robertc at robertcollins.net-20070309145635-ebwqt24zw8vj2ggd
parent: robertc at robertcollins.net-20070309072649-yo0m5xrntkah3e7e
parent: robertc at robertcollins.net-20070309143019-8y1a649z5hzryiuh
committer: Robert Collins <robertc at robertcollins.net>
branch nick: pathinfo
timestamp: Sat 2007-03-10 01:56:35 +1100
message:
  Merge update to path_info API to support recent time feedback for cache lookup checking.
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
  bzrlib/path_info_python.py     path_info_python.py-20070309041626-f8val8ukxzzzyudi-2
  bzrlib/tests/path_info_implementations/test_path_info.py test_path_info.py-20070309041626-f8val8ukxzzzyudi-5
    ------------------------------------------------------------
    revno: 2326.1.1
    merged: robertc at robertcollins.net-20070309143019-8y1a649z5hzryiuh
    parent: robertc at robertcollins.net-20070309061608-pau0d6iy2rss65lg
    committer: Robert Collins <robertc at robertcollins.net>
    branch nick: dirstate2
    timestamp: Sat 2007-03-10 01:30:19 +1100
    message:
      Add the most recent time stamp into path_info output, for cache usability checking.
=== modified file 'bzrlib/path_info_c.c'
--- a/bzrlib/path_info_c.c	2007-03-09 07:26:49 +0000
+++ b/bzrlib/path_info_c.c	2007-03-09 14:56:35 +0000
@@ -1,4 +1,4 @@
-/* Generated by Pyrex 0.9.4.1 on Fri Mar  9 18:18:49 2007 */
+/* Generated by Pyrex 0.9.4.1 on Sat Mar 10 01:52:35 2007 */
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
@@ -451,6 +451,7 @@
   PyObject *__pyx_v__pack = 0;
   int __pyx_v_stat_result;
   struct stat __pyx_v_st;
+  int __pyx_v_recenttime;
   PyObject *__pyx_v_statcachekey;
   PyObject *__pyx_r;
   PyObject *__pyx_1 = 0;
@@ -491,51 +492,54 @@
     {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;}
   }
 
-  /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":175 */
-  __pyx_4 = PyString_AsString(__pyx_v_abspath); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;}
+  /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":176 */
+  __pyx_4 = PyString_AsString(__pyx_v_abspath); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;}
   __pyx_v_stat_result = lstat(__pyx_4,(&__pyx_v_st));
 
-  /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":176 */
+  /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":177 */
   __pyx_3 = (__pyx_v_stat_result != 0);
   if (__pyx_3) {
 
-    /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":177 */
+    /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":178 */
     __pyx_3 = (errno != ENOENT);
     if (__pyx_3) {
 
-      /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":178 */
-      __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}
-      __pyx_2 = PyInt_FromLong(errno); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}
-      __pyx_5 = PyString_FromString(strerror(errno)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}
-      __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;}
+      /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":179 */
+      __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_OSError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
+      __pyx_2 = PyInt_FromLong(errno); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
+      __pyx_5 = PyString_FromString(strerror(errno)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
+      __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; 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 = 178; goto __pyx_L1;}
+      __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; 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 = 178; goto __pyx_L1;}
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;}
       goto __pyx_L3;
     }
     /*else*/ {
 
-      /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":182 */
-      __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
-      __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
-      __pyx_6 = PyTuple_New(4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; goto __pyx_L1;}
+      /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":183 */
+      __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
+      __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
+      __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
+      __pyx_2 = PyTuple_New(5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}
       Py_INCREF(__pyx_v__kind_missing);
-      PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v__kind_missing);
-      PyTuple_SET_ITEM(__pyx_6, 1, __pyx_5);
-      PyTuple_SET_ITEM(__pyx_6, 2, __pyx_1);
+      PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v__kind_missing);
+      PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5);
+      PyTuple_SET_ITEM(__pyx_2, 2, __pyx_1);
+      PyTuple_SET_ITEM(__pyx_2, 3, __pyx_6);
       Py_INCREF(__pyx_k31p);
-      PyTuple_SET_ITEM(__pyx_6, 3, __pyx_k31p);
+      PyTuple_SET_ITEM(__pyx_2, 4, __pyx_k31p);
       __pyx_5 = 0;
       __pyx_1 = 0;
-      __pyx_r = __pyx_6;
       __pyx_6 = 0;
+      __pyx_r = __pyx_2;
+      __pyx_2 = 0;
       goto __pyx_L0;
     }
     __pyx_L3:;
@@ -543,84 +547,102 @@
   }
   __pyx_L2:;
 
-  /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":187 */
-  __pyx_2 = PyInt_FromLong(__pyx_v_st.st_size); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
-  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
-  __pyx_1 = PyInt_FromLong(__pyx_v_st.st_mtime); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
-  __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
-  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1);
-  __pyx_1 = 0;
-  __pyx_1 = PyObject_CallObject(__pyx_5, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
-  Py_DECREF(__pyx_5); __pyx_5 = 0;
-  Py_DECREF(__pyx_6); __pyx_6 = 0;
-  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
-  __pyx_6 = PyInt_FromLong(__pyx_v_st.st_ctime); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
-  __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
-  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_6);
+  /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":188 */
+  __pyx_5 = PyInt_FromLong(__pyx_v_st.st_size); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
+  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
+  __pyx_6 = PyInt_FromLong(__pyx_v_st.st_mtime); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6);
   __pyx_6 = 0;
-  __pyx_6 = PyObject_CallObject(__pyx_5, __pyx_7); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
-  Py_DECREF(__pyx_5); __pyx_5 = 0;
+  __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
+  __pyx_2 = PyInt_FromLong(__pyx_v_st.st_ctime); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
+  __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_7); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
   Py_DECREF(__pyx_7); __pyx_7 = 0;
-  __pyx_5 = PyInt_FromLong(__pyx_v_st.st_dev); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
-  __pyx_7 = PyInt_FromLong(__pyx_v_st.st_ino); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
-  __pyx_8 = PyInt_FromLong(__pyx_v_st.st_mode); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
-  __pyx_9 = PyTuple_New(7); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
+  __pyx_1 = PyInt_FromLong(__pyx_v_st.st_dev); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
+  __pyx_7 = PyInt_FromLong(__pyx_v_st.st_ino); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
+  __pyx_8 = PyInt_FromLong(__pyx_v_st.st_mode); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
+  __pyx_9 = PyTuple_New(7); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
   Py_INCREF(__pyx_k32p);
   PyTuple_SET_ITEM(__pyx_9, 0, __pyx_k32p);
-  PyTuple_SET_ITEM(__pyx_9, 1, __pyx_2);
-  PyTuple_SET_ITEM(__pyx_9, 2, __pyx_1);
-  PyTuple_SET_ITEM(__pyx_9, 3, __pyx_6);
-  PyTuple_SET_ITEM(__pyx_9, 4, __pyx_5);
+  PyTuple_SET_ITEM(__pyx_9, 1, __pyx_5);
+  PyTuple_SET_ITEM(__pyx_9, 2, __pyx_6);
+  PyTuple_SET_ITEM(__pyx_9, 3, __pyx_2);
+  PyTuple_SET_ITEM(__pyx_9, 4, __pyx_1);
   PyTuple_SET_ITEM(__pyx_9, 5, __pyx_7);
   PyTuple_SET_ITEM(__pyx_9, 6, __pyx_8);
+  __pyx_5 = 0;
+  __pyx_6 = 0;
   __pyx_2 = 0;
   __pyx_1 = 0;
-  __pyx_6 = 0;
-  __pyx_5 = 0;
   __pyx_7 = 0;
   __pyx_8 = 0;
-  __pyx_2 = PyObject_CallObject(__pyx_v__pack, __pyx_9); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
+  __pyx_5 = PyObject_CallObject(__pyx_v__pack, __pyx_9); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
   Py_DECREF(__pyx_9); __pyx_9 = 0;
-  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
-  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
-  __pyx_2 = 0;
-  __pyx_6 = PyObject_CallObject(__pyx_v__encode, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; goto __pyx_L1;}
-  Py_DECREF(__pyx_1); __pyx_1 = 0;
-  __pyx_5 = PySequence_GetSlice(__pyx_6, 0, (-1)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}
+  __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
+  __pyx_5 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_v__encode, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;}
   Py_DECREF(__pyx_6); __pyx_6 = 0;
+  __pyx_1 = PySequence_GetSlice(__pyx_2, 0, (-1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
   Py_DECREF(__pyx_v_statcachekey);
-  __pyx_v_statcachekey = __pyx_5;
-  __pyx_5 = 0;
-
-  /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":188 */
-  __pyx_7 = PyInt_FromLong(__pyx_v_st.st_mode); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
-  __pyx_8 = PyTuple_New(1); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
+  __pyx_v_statcachekey = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":189 */
+  __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":190 */
+    __pyx_v_recenttime = __pyx_v_st.st_mtime;
+    goto __pyx_L4;
+  }
+  /*else*/ {
+
+    /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":192 */
+    __pyx_v_recenttime = __pyx_v_st.st_ctime;
+  }
+  __pyx_L4:;
+
+  /* "/home/robertc/source/baz/pathinfo/bzrlib/path_info_c.pyx":193 */
+  __pyx_7 = PyInt_FromLong(__pyx_v_st.st_mode); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
+  __pyx_8 = PyTuple_New(1); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
   PyTuple_SET_ITEM(__pyx_8, 0, __pyx_7);
   __pyx_7 = 0;
-  __pyx_9 = PyObject_CallObject(__pyx_v__mapper, __pyx_8); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
+  __pyx_9 = PyObject_CallObject(__pyx_v__mapper, __pyx_8); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
   Py_DECREF(__pyx_8); __pyx_8 = 0;
-  __pyx_2 = PyInt_FromLong(__pyx_v_st.st_size); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
-  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
-  __pyx_6 = PyInt_FromLong(__pyx_v_st.st_mode); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
-  __pyx_5 = PyNumber_And(__pyx_v__S_IEXEC, __pyx_6); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
+  __pyx_5 = PyInt_FromLong(__pyx_v_st.st_size); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
+  __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
+  __pyx_2 = PyInt_FromLong(__pyx_v_st.st_mode); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
+  __pyx_1 = PyNumber_And(__pyx_v__S_IEXEC, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1);
+  __pyx_1 = 0;
+  __pyx_8 = PyObject_CallObject(__pyx_6, __pyx_7); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
   Py_DECREF(__pyx_6); __pyx_6 = 0;
-  __pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
-  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_5);
-  __pyx_5 = 0;
-  __pyx_8 = PyObject_CallObject(__pyx_1, __pyx_7); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
-  Py_DECREF(__pyx_1); __pyx_1 = 0;
   Py_DECREF(__pyx_7); __pyx_7 = 0;
-  __pyx_6 = PyTuple_New(4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;}
-  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_9);
-  PyTuple_SET_ITEM(__pyx_6, 1, __pyx_2);
-  PyTuple_SET_ITEM(__pyx_6, 2, __pyx_8);
+  __pyx_2 = PyInt_FromLong(__pyx_v_recenttime); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
+  __pyx_1 = PyTuple_New(5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_9);
+  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_5);
+  PyTuple_SET_ITEM(__pyx_1, 2, __pyx_8);
+  PyTuple_SET_ITEM(__pyx_1, 3, __pyx_2);
   Py_INCREF(__pyx_v_statcachekey);
-  PyTuple_SET_ITEM(__pyx_6, 3, __pyx_v_statcachekey);
+  PyTuple_SET_ITEM(__pyx_1, 4, __pyx_v_statcachekey);
   __pyx_9 = 0;
+  __pyx_5 = 0;
+  __pyx_8 = 0;
   __pyx_2 = 0;
-  __pyx_8 = 0;
-  __pyx_r = __pyx_6;
-  __pyx_6 = 0;
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
   goto __pyx_L0;
 
   __pyx_r = Py_None; Py_INCREF(Py_None);

=== modified file 'bzrlib/path_info_c.pyx'
--- a/bzrlib/path_info_c.pyx	2007-03-09 07:26:49 +0000
+++ b/bzrlib/path_info_c.pyx	2007-03-09 14:56:35 +0000
@@ -16,7 +16,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
-# :vim: et sw=4 sts=4
+# vim: et sw=4 sts=4
 
 """Functions for accessing data about paths.
 
@@ -172,6 +172,7 @@
     assert abspath.__class__ == str
     cdef int stat_result
     cdef stat st
+    cdef int recenttime
     stat_result = lstat(abspath, &st)
     if stat_result != 0:
         if errno != ENOENT:
@@ -179,11 +180,15 @@
         else:
             # TODO: could make this a constant to return, if we expect it to be
             # common.
-            return (_kind_missing, 0, False, '')
+            return (_kind_missing, 0, False, 0, '')
     # 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 st.st_ctime < st.st_mtime:
+      recenttime = st.st_mtime
+    else:
+      recenttime = st.st_ctime
     return (_mapper(st.st_mode), st.st_size, bool(_S_IEXEC & st.st_mode),
-        statcachekey)
+        recenttime, statcachekey)

=== modified file 'bzrlib/path_info_python.py'
--- a/bzrlib/path_info_python.py	2007-03-09 06:16:08 +0000
+++ b/bzrlib/path_info_python.py	2007-03-09 14:30:19 +0000
@@ -32,6 +32,7 @@
 # into bzrlib.
 file_kind_from_stat_mode = sys.modules['bzrlib.path_info'].file_kind_from_stat_mode
 kind_missing = sys.modules['bzrlib.path_info'].kind_missing
+kind_file = sys.modules['bzrlib.path_info'].kind_file
 
 
 def pack_stat(st, _encode=base64.encodestring, _pack=struct.pack):
@@ -49,9 +50,10 @@
 
 
 def path_info(abspath, _lstat=os.lstat, _mapper=file_kind_from_stat_mode,
-    _S_IEXEC=stat.S_IEXEC, _ENOENT=errno.ENOENT, _kind_missing=kind_missing):
+    _S_IEXEC=stat.S_IEXEC, _ENOENT=errno.ENOENT, _kind_missing=kind_missing,
+    _kind_file=kind_file):
     """Get the kind, size, executability and statcache key for abspath."""
-    assert abspath.__class__ == str
+    assert abspath.__class__ == str, '%r is not a basic string' % (abspath, )
     try:
         st = _lstat(abspath)
     except OSError, e:
@@ -60,6 +62,16 @@
         else:
             # TODO: could make this a constant to return, if we expect it to be
             # common.
-            return (_kind_missing, 0, False, '')
-    return (_mapper(st.st_mode), st.st_size, bool(_S_IEXEC & st.st_mode),
-        pack_stat(st))
+            return (_kind_missing, 0, False, 0, '')
+    kind = _mapper(st.st_mode)
+    if kind is _kind_file:
+        size = st.st_size
+        executable = bool(_S_IEXEC & st.st_mode)
+    else:
+        size = 0
+        executable = False
+    if st.st_mtime < st.st_ctime:
+        recenttime = st.st_ctime
+    else:
+        recenttime = st.st_mtime
+    return (_mapper(st.st_mode), size, executable, recenttime, pack_stat(st))

=== modified file 'bzrlib/tests/path_info_implementations/test_path_info.py'
--- a/bzrlib/tests/path_info_implementations/test_path_info.py	2007-03-09 06:16:08 +0000
+++ b/bzrlib/tests/path_info_implementations/test_path_info.py	2007-03-09 14:30:19 +0000
@@ -33,7 +33,11 @@
         self.build_tree(['file'])
         result = self.path_info.path_info(os.path.abspath('file'))
         stat = os.lstat('file')
-        expected = ('file', stat.st_size, False, pack_stat(stat))
+        if stat.st_mtime < stat.st_ctime:
+            recenttime = stat.st_ctime
+        else:
+            recenttime = stat.st_mtime
+        expected = ('file', stat.st_size, False, recenttime, pack_stat(stat))
         self.assertEqual(expected, result)
         self.assertIs(kind_file, result[0])
 
@@ -47,8 +51,12 @@
         # make the file executable for this user
         os.chmod('file', st.st_mode | stat.S_IXUSR)
         st = os.lstat('file')
+        if st.st_mtime < st.st_ctime:
+            recenttime = st.st_ctime
+        else:
+            recenttime = st.st_mtime
         result = self.path_info.path_info(os.path.abspath('file'))
-        expected = ('file', st.st_size, True, pack_stat(st))
+        expected = ('file', st.st_size, True, recenttime, pack_stat(st))
         self.assertEqual(expected, result)
         self.assertIs(kind_file, result[0])
 
@@ -68,8 +76,12 @@
         encoding = sys.getfilesystemencoding()
         encoded_name = u'\xe8file'.encode(encoding)
         result = self.path_info.path_info(os.path.abspath(encoded_name))
-        stat = os.lstat(encoded_name)
-        expected = ('file', stat.st_size, False, pack_stat(stat))
+        st = os.lstat(encoded_name)
+        if st.st_mtime < st.st_ctime:
+            recenttime = st.st_ctime
+        else:
+            recenttime = st.st_mtime
+        expected = ('file', st.st_size, False, recenttime, pack_stat(st))
         self.assertEqual(expected, result)
         self.assertIs(kind_file, result[0])
 
@@ -77,6 +89,6 @@
         # path_info should return a canned 'missing' kind for paths that are not
         # present on disk.
         result = self.path_info.path_info(os.path.abspath('missing-file'))
-        expected = ('missing', 0, False, '')
+        expected = ('missing', 0, False, 0, '')
         self.assertEqual(expected, result)
         self.assertIs(kind_missing, result[0])



More information about the bazaar-commits mailing list