equal
deleted
inserted
replaced
94 self.get_rev(py, node)?.ok_or_else(|| revlog_error(py)) |
94 self.get_rev(py, node)?.ok_or_else(|| revlog_error(py)) |
95 } |
95 } |
96 |
96 |
97 /// return True if the node exist in the index |
97 /// return True if the node exist in the index |
98 def has_node(&self, node: PyBytes) -> PyResult<bool> { |
98 def has_node(&self, node: PyBytes) -> PyResult<bool> { |
|
99 // TODO OPTIM we could avoid a needless conversion here, |
|
100 // to do when scaffolding for pure Rust switch is removed, |
|
101 // as `get_rev()` currently does the necessary assertions |
99 self.get_rev(py, node).map(|opt| opt.is_some()) |
102 self.get_rev(py, node).map(|opt| opt.is_some()) |
100 } |
103 } |
101 |
104 |
102 /// find length of shortest hex nodeid of a binary ID |
105 /// find length of shortest hex nodeid of a binary ID |
103 def shortest(&self, node: PyBytes) -> PyResult<usize> { |
106 def shortest(&self, node: PyBytes) -> PyResult<usize> { |