##// END OF EJS Templates
dirstate-entry: add a `mode` property...
marmoute -
r48325:8e4b9fe3 default
parent child Browse files
Show More
@@ -169,6 +169,11 b' static PyMethodDef dirstatetuple_methods'
169 {NULL} /* Sentinel */
169 {NULL} /* Sentinel */
170 };
170 };
171
171
172 static PyObject *dirstatetuple_get_mode(dirstateTupleObject *self)
173 {
174 return PyInt_FromLong(self->mode);
175 };
176
172 static PyObject *dirstatetuple_get_state(dirstateTupleObject *self)
177 static PyObject *dirstatetuple_get_state(dirstateTupleObject *self)
173 {
178 {
174 return PyBytes_FromStringAndSize(&self->state, 1);
179 return PyBytes_FromStringAndSize(&self->state, 1);
@@ -238,6 +243,7 b' static PyObject *dirstatetuple_get_remov'
238 };
243 };
239
244
240 static PyGetSetDef dirstatetuple_getset[] = {
245 static PyGetSetDef dirstatetuple_getset[] = {
246 {"mode", (getter)dirstatetuple_get_mode, NULL, "mode", NULL},
241 {"state", (getter)dirstatetuple_get_state, NULL, "state", NULL},
247 {"state", (getter)dirstatetuple_get_state, NULL, "state", NULL},
242 {"tracked", (getter)dirstatetuple_get_tracked, NULL, "tracked", NULL},
248 {"tracked", (getter)dirstatetuple_get_tracked, NULL, "tracked", NULL},
243 {"added", (getter)dirstatetuple_get_added, NULL, "added", NULL},
249 {"added", (getter)dirstatetuple_get_added, NULL, "added", NULL},
@@ -1307,7 +1307,7 b' class dirstate(object):'
1307 # general. That is much slower than simply accessing and storing the
1307 # general. That is much slower than simply accessing and storing the
1308 # tuple members one by one.
1308 # tuple members one by one.
1309 t = dget(fn)
1309 t = dget(fn)
1310 mode = t[1]
1310 mode = t.mode
1311 size = t[2]
1311 size = t[2]
1312 time = t[3]
1312 time = t[3]
1313
1313
@@ -72,6 +72,10 b' class dirstatetuple(object):'
72 raise IndexError(idx)
72 raise IndexError(idx)
73
73
74 @property
74 @property
75 def mode(self):
76 return self._mode
77
78 @property
75 def state(self):
79 def state(self):
76 """
80 """
77 States are:
81 States are:
General Comments 0
You need to be logged in to leave comments. Login now