Show More
@@ -448,6 +448,7 b' class dirstate(object):' | |||
|
448 | 448 | size=None, |
|
449 | 449 | mtime=None, |
|
450 | 450 | added=False, |
|
451 | merged=False, | |
|
451 | 452 | from_p2=False, |
|
452 | 453 | possibly_dirty=False, |
|
453 | 454 | ): |
@@ -476,6 +477,7 b' class dirstate(object):' | |||
|
476 | 477 | size=size, |
|
477 | 478 | mtime=mtime, |
|
478 | 479 | added=added, |
|
480 | merged=merged, | |
|
479 | 481 | from_p2=from_p2, |
|
480 | 482 | possibly_dirty=possibly_dirty, |
|
481 | 483 | ) |
@@ -538,7 +540,7 b' class dirstate(object):' | |||
|
538 | 540 | raise error.Abort(msg) |
|
539 | 541 | if f in self and self[f] == b'n': |
|
540 | 542 | # merge-like |
|
541 |
self._addpath(f, |
|
|
543 | self._addpath(f, merged=True) | |
|
542 | 544 | else: |
|
543 | 545 | # add-like |
|
544 | 546 | self._addpath(f, b'n', 0, from_p2=True) |
@@ -152,16 +152,24 b' class dirstatemap(object):' | |||
|
152 | 152 | size=None, |
|
153 | 153 | mtime=None, |
|
154 | 154 | added=False, |
|
155 | merged=False, | |
|
155 | 156 | from_p2=False, |
|
156 | 157 | possibly_dirty=False, |
|
157 | 158 | ): |
|
158 | 159 | """Add a tracked file to the dirstate.""" |
|
159 | 160 | if added: |
|
161 | assert not merged | |
|
160 | 162 | assert not possibly_dirty |
|
161 | 163 | assert not from_p2 |
|
162 | 164 | state = b'a' |
|
163 | 165 | size = NONNORMAL |
|
164 | 166 | mtime = AMBIGUOUS_TIME |
|
167 | elif merged: | |
|
168 | assert not possibly_dirty | |
|
169 | assert not from_p2 | |
|
170 | state = b'm' | |
|
171 | size = FROM_P2 | |
|
172 | mtime = AMBIGUOUS_TIME | |
|
165 | 173 | elif from_p2: |
|
166 | 174 | assert not possibly_dirty |
|
167 | 175 | size = FROM_P2 |
@@ -470,6 +478,7 b' if rustmod is not None:' | |||
|
470 | 478 | size=None, |
|
471 | 479 | mtime=None, |
|
472 | 480 | added=False, |
|
481 | merged=False, | |
|
473 | 482 | from_p2=False, |
|
474 | 483 | possibly_dirty=False, |
|
475 | 484 | ): |
@@ -480,6 +489,7 b' if rustmod is not None:' | |||
|
480 | 489 | size, |
|
481 | 490 | mtime, |
|
482 | 491 | added, |
|
492 | merged, | |
|
483 | 493 | from_p2, |
|
484 | 494 | possibly_dirty, |
|
485 | 495 | ) |
@@ -71,16 +71,24 b' impl DirstateMap {' | |||
|
71 | 71 | entry: DirstateEntry, |
|
72 | 72 | // XXX once the dust settle this should probably become an enum |
|
73 | 73 | added: bool, |
|
74 | merged: bool, | |
|
74 | 75 | from_p2: bool, |
|
75 | 76 | possibly_dirty: bool, |
|
76 | 77 | ) -> Result<(), DirstateError> { |
|
77 | 78 | let mut entry = entry; |
|
78 | 79 | if added { |
|
80 | assert!(!merged); | |
|
79 | 81 | assert!(!possibly_dirty); |
|
80 | 82 | assert!(!from_p2); |
|
81 | 83 | entry.state = EntryState::Added; |
|
82 | 84 | entry.size = SIZE_NON_NORMAL; |
|
83 | 85 | entry.mtime = MTIME_UNSET; |
|
86 | } else if merged { | |
|
87 | assert!(!possibly_dirty); | |
|
88 | assert!(!from_p2); | |
|
89 | entry.state = EntryState::Merged; | |
|
90 | entry.size = SIZE_FROM_OTHER_PARENT; | |
|
91 | entry.mtime = MTIME_UNSET; | |
|
84 | 92 | } else if from_p2 { |
|
85 | 93 | assert!(!possibly_dirty); |
|
86 | 94 | entry.size = SIZE_FROM_OTHER_PARENT; |
@@ -410,6 +418,7 b' mod tests {' | |||
|
410 | 418 | false, |
|
411 | 419 | false, |
|
412 | 420 | false, |
|
421 | false, | |
|
413 | 422 | ) |
|
414 | 423 | .unwrap(); |
|
415 | 424 |
@@ -723,6 +723,7 b" impl<'on_disk> super::dispatch::Dirstate" | |||
|
723 | 723 | filename: &HgPath, |
|
724 | 724 | entry: DirstateEntry, |
|
725 | 725 | added: bool, |
|
726 | merged: bool, | |
|
726 | 727 | from_p2: bool, |
|
727 | 728 | possibly_dirty: bool, |
|
728 | 729 | ) -> Result<(), DirstateError> { |
@@ -733,6 +734,12 b" impl<'on_disk> super::dispatch::Dirstate" | |||
|
733 | 734 | entry.state = EntryState::Added; |
|
734 | 735 | entry.size = SIZE_NON_NORMAL; |
|
735 | 736 | entry.mtime = MTIME_UNSET; |
|
737 | } else if merged { | |
|
738 | assert!(!possibly_dirty); | |
|
739 | assert!(!from_p2); | |
|
740 | entry.state = EntryState::Merged; | |
|
741 | entry.size = SIZE_FROM_OTHER_PARENT; | |
|
742 | entry.mtime = MTIME_UNSET; | |
|
736 | 743 | } else if from_p2 { |
|
737 | 744 | assert!(!possibly_dirty); |
|
738 | 745 | entry.size = SIZE_FROM_OTHER_PARENT; |
@@ -49,6 +49,7 b' pub trait DirstateMapMethods {' | |||
|
49 | 49 | filename: &HgPath, |
|
50 | 50 | entry: DirstateEntry, |
|
51 | 51 | added: bool, |
|
52 | merged: bool, | |
|
52 | 53 | from_p2: bool, |
|
53 | 54 | possibly_dirty: bool, |
|
54 | 55 | ) -> Result<(), DirstateError>; |
@@ -289,10 +290,11 b' impl DirstateMapMethods for DirstateMap ' | |||
|
289 | 290 | filename: &HgPath, |
|
290 | 291 | entry: DirstateEntry, |
|
291 | 292 | added: bool, |
|
293 | merged: bool, | |
|
292 | 294 | from_p2: bool, |
|
293 | 295 | possibly_dirty: bool, |
|
294 | 296 | ) -> Result<(), DirstateError> { |
|
295 | self.add_file(filename, entry, added, from_p2, possibly_dirty) | |
|
297 | self.add_file(filename, entry, added, merged, from_p2, possibly_dirty) | |
|
296 | 298 | } |
|
297 | 299 | |
|
298 | 300 | fn remove_file( |
@@ -113,6 +113,7 b' py_class!(pub class DirstateMap |py| {' | |||
|
113 | 113 | size: PyObject, |
|
114 | 114 | mtime: PyObject, |
|
115 | 115 | added: PyObject, |
|
116 | merged: PyObject, | |
|
116 | 117 | from_p2: PyObject, |
|
117 | 118 | possibly_dirty: PyObject, |
|
118 | 119 | ) -> PyResult<PyObject> { |
@@ -153,12 +154,14 b' py_class!(pub class DirstateMap |py| {' | |||
|
153 | 154 | mtime: mtime, |
|
154 | 155 | }; |
|
155 | 156 | let added = added.extract::<PyBool>(py)?.is_true(); |
|
157 | let merged = merged.extract::<PyBool>(py)?.is_true(); | |
|
156 | 158 | let from_p2 = from_p2.extract::<PyBool>(py)?.is_true(); |
|
157 | 159 | let possibly_dirty = possibly_dirty.extract::<PyBool>(py)?.is_true(); |
|
158 | 160 | self.inner(py).borrow_mut().add_file( |
|
159 | 161 | filename, |
|
160 | 162 | entry, |
|
161 | 163 | added, |
|
164 | merged, | |
|
162 | 165 | from_p2, |
|
163 | 166 | possibly_dirty |
|
164 | 167 | ).and(Ok(py.None())).or_else(|e: DirstateError| { |
@@ -26,6 +26,7 b' impl DirstateMapMethods for OwningDirsta' | |||
|
26 | 26 | filename: &HgPath, |
|
27 | 27 | entry: DirstateEntry, |
|
28 | 28 | added: bool, |
|
29 | merged: bool, | |
|
29 | 30 | from_p2: bool, |
|
30 | 31 | possibly_dirty: bool, |
|
31 | 32 | ) -> Result<(), DirstateError> { |
@@ -33,6 +34,7 b' impl DirstateMapMethods for OwningDirsta' | |||
|
33 | 34 | filename, |
|
34 | 35 | entry, |
|
35 | 36 | added, |
|
37 | merged, | |
|
36 | 38 | from_p2, |
|
37 | 39 | possibly_dirty, |
|
38 | 40 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now