##// END OF EJS Templates
dirstate-entry: restrict `from_p2` property to tracked file...
marmoute -
r48306:28632eb3 default
parent child Browse files
Show More
@@ -178,7 +178,7 b' static PyObject *dirstatetuple_get_merge'
178
178
179 static PyObject *dirstatetuple_get_from_p2(dirstateTupleObject *self)
179 static PyObject *dirstatetuple_get_from_p2(dirstateTupleObject *self)
180 {
180 {
181 if (self->size == dirstate_v1_from_p2) {
181 if (self->state == 'n' && self->size == dirstate_v1_from_p2) {
182 Py_RETURN_TRUE;
182 Py_RETURN_TRUE;
183 } else {
183 } else {
184 Py_RETURN_FALSE;
184 Py_RETURN_FALSE;
@@ -393,7 +393,7 b' class dirstate(object):'
393 copies[f] = source
393 copies[f] = source
394 self.normallookup(f)
394 self.normallookup(f)
395 # Also fix up otherparent markers
395 # Also fix up otherparent markers
396 elif s.state == b'n' and s.from_p2:
396 elif s.from_p2:
397 source = self._map.copymap.get(f)
397 source = self._map.copymap.get(f)
398 if source:
398 if source:
399 copies[f] = source
399 copies[f] = source
@@ -542,7 +542,7 b' class dirstate(object):'
542 if source is not None:
542 if source is not None:
543 self.copy(source, f)
543 self.copy(source, f)
544 return
544 return
545 elif entry.merged or entry.state == b'n' and entry.from_p2:
545 elif entry.merged or entry.from_p2:
546 return
546 return
547 self._addpath(f, b'n', 0, possibly_dirty=True)
547 self._addpath(f, b'n', 0, possibly_dirty=True)
548 self._map.copymap.pop(f, None)
548 self._map.copymap.pop(f, None)
@@ -98,9 +98,11 b' class dirstatetuple(object):'
98 def from_p2(self):
98 def from_p2(self):
99 """True if the file have been fetched from p2 during the current merge
99 """True if the file have been fetched from p2 during the current merge
100
100
101 This is only True is the file is currently tracked.
102
101 Should only be set if a merge is in progress in the dirstate
103 Should only be set if a merge is in progress in the dirstate
102 """
104 """
103 return self._size == FROM_P2
105 return self._state == b'n' and self._size == FROM_P2
104
106
105 @property
107 @property
106 def from_p2_removed(self):
108 def from_p2_removed(self):
General Comments 0
You need to be logged in to leave comments. Login now