##// END OF EJS Templates
head-revs: move hg-cpython's inner_headrevsfiltered closer to inner_headrevs...
marmoute -
r52863:e5dcaf6d default
parent child Browse files
Show More
@@ -839,6 +839,30 impl Index {
839 .into_object())
839 .into_object())
840 }
840 }
841
841
842 fn inner_headrevsfiltered(
843 &self,
844 py: Python,
845 filtered_revs: &PyObject,
846 ) -> PyResult<PyObject> {
847 let index = &*self.index(py).borrow();
848 let filtered_revs = rev_pyiter_collect(py, filtered_revs, index)?;
849
850 if let Some(new_heads) = index
851 .head_revs_filtered(&filtered_revs, true)
852 .map_err(|e| graph_error(py, e))?
853 {
854 self.cache_new_heads_py_list(&new_heads, py);
855 }
856
857 Ok(self
858 .head_revs_py_list(py)
859 .borrow()
860 .as_ref()
861 .expect("head revs should be cached")
862 .clone_ref(py)
863 .into_object())
864 }
865
842 fn check_revision(
866 fn check_revision(
843 index: &hg::index::Index,
867 index: &hg::index::Index,
844 rev: UncheckedRevision,
868 rev: UncheckedRevision,
@@ -871,30 +895,6 impl Index {
871 Ok(res)
895 Ok(res)
872 }
896 }
873
897
874 fn inner_headrevsfiltered(
875 &self,
876 py: Python,
877 filtered_revs: &PyObject,
878 ) -> PyResult<PyObject> {
879 let index = &*self.index(py).borrow();
880 let filtered_revs = rev_pyiter_collect(py, filtered_revs, index)?;
881
882 if let Some(new_heads) = index
883 .head_revs_filtered(&filtered_revs, true)
884 .map_err(|e| graph_error(py, e))?
885 {
886 self.cache_new_heads_py_list(&new_heads, py);
887 }
888
889 Ok(self
890 .head_revs_py_list(py)
891 .borrow()
892 .as_ref()
893 .expect("head revs should be cached")
894 .clone_ref(py)
895 .into_object())
896 }
897
898 fn cache_new_heads_node_ids_py_list(
898 fn cache_new_heads_node_ids_py_list(
899 &self,
899 &self,
900 new_heads: &[Revision],
900 new_heads: &[Revision],
General Comments 0
You need to be logged in to leave comments. Login now