##// END OF EJS Templates
dirstate-item: introduce a `dm_otherparent` property...
marmoute -
r48486:e43128ee default
parent child Browse files
Show More
@@ -150,6 +150,14 b' static PyObject *dm_nonnormal(dirstateIt'
150 Py_RETURN_FALSE;
150 Py_RETURN_FALSE;
151 }
151 }
152 };
152 };
153 static PyObject *dm_otherparent(dirstateItemObject *self)
154 {
155 if (self->size == dirstate_v1_from_p2) {
156 Py_RETURN_TRUE;
157 } else {
158 Py_RETURN_FALSE;
159 }
160 };
153
161
154 static PyObject *dirstate_item_need_delay(dirstateItemObject *self,
162 static PyObject *dirstate_item_need_delay(dirstateItemObject *self,
155 PyObject *value)
163 PyObject *value)
@@ -232,6 +240,8 b' static PyMethodDef dirstate_item_methods'
232 METH_NOARGS, "mark a file as \"possibly dirty\""},
240 METH_NOARGS, "mark a file as \"possibly dirty\""},
233 {"dm_nonnormal", (PyCFunction)dm_nonnormal, METH_NOARGS,
241 {"dm_nonnormal", (PyCFunction)dm_nonnormal, METH_NOARGS,
234 "True is the entry is non-normal in the dirstatemap sense"},
242 "True is the entry is non-normal in the dirstatemap sense"},
243 {"dm_otherparent", (PyCFunction)dm_otherparent, METH_NOARGS,
244 "True is the entry is `otherparent` in the dirstatemap sense"},
235 {NULL} /* Sentinel */
245 {NULL} /* Sentinel */
236 };
246 };
237
247
@@ -199,7 +199,7 b' class dirstatemap(object):'
199 e = self._map[f] = DirstateItem(state, mode, size, mtime)
199 e = self._map[f] = DirstateItem(state, mode, size, mtime)
200 if e.dm_nonnormal:
200 if e.dm_nonnormal:
201 self.nonnormalset.add(f)
201 self.nonnormalset.add(f)
202 if size == FROM_P2:
202 if e.dm_otherparent:
203 self.otherparentset.add(f)
203 self.otherparentset.add(f)
204
204
205 def removefile(self, f, in_merge=False):
205 def removefile(self, f, in_merge=False):
@@ -195,6 +195,14 b' class DirstateItem(object):'
195 """
195 """
196 return self.state != b'n' or self.mtime == AMBIGUOUS_TIME
196 return self.state != b'n' or self.mtime == AMBIGUOUS_TIME
197
197
198 @property
199 def dm_otherparent(self):
200 """True is the entry is `otherparent` in the dirstatemap sense
201
202 There is no reason for any code, but the dirstatemap one to use this.
203 """
204 return self._size == FROM_P2
205
198 def v1_state(self):
206 def v1_state(self):
199 """return a "state" suitable for v1 serialization"""
207 """return a "state" suitable for v1 serialization"""
200 return self._state
208 return self._state
General Comments 0
You need to be logged in to leave comments. Login now