equal
deleted
inserted
replaced
135 } |
135 } |
136 |
136 |
137 def removefile( |
137 def removefile( |
138 &self, |
138 &self, |
139 f: PyObject, |
139 f: PyObject, |
140 oldstate: PyObject, |
140 in_merge: PyObject |
141 size: PyObject |
|
142 ) -> PyResult<PyObject> { |
141 ) -> PyResult<PyObject> { |
143 self.inner(py).borrow_mut() |
142 self.inner(py).borrow_mut() |
144 .remove_file( |
143 .remove_file( |
145 HgPath::new(f.extract::<PyBytes>(py)?.data(py)), |
144 HgPath::new(f.extract::<PyBytes>(py)?.data(py)), |
146 oldstate.extract::<PyBytes>(py)?.data(py)[0] |
145 in_merge.extract::<PyBool>(py)?.is_true(), |
147 .try_into() |
|
148 .map_err(|e: HgError| { |
|
149 PyErr::new::<exc::ValueError, _>(py, e.to_string()) |
|
150 })?, |
|
151 size.extract(py)?, |
|
152 ) |
146 ) |
153 .or_else(|_| { |
147 .or_else(|_| { |
154 Err(PyErr::new::<exc::OSError, _>( |
148 Err(PyErr::new::<exc::OSError, _>( |
155 py, |
149 py, |
156 "Dirstate error".to_string(), |
150 "Dirstate error".to_string(), |