D8161: rust-nodemap: also clear Rust data in `clearcaches`
Closed by commit rHGcadcc8c20860: rust-nodemap: also clear Rust data in `clearcaches` (authored by gracinet). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D8161?vs=20660=20699 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D8161/new/ REVISION DETAIL https://phab.mercurial-scm.org/D8161 AFFECTED FILES rust/hg-cpython/src/revlog.rs CHANGE DETAILS diff --git a/rust/hg-cpython/src/revlog.rs b/rust/hg-cpython/src/revlog.rs --- a/rust/hg-cpython/src/revlog.rs +++ b/rust/hg-cpython/src/revlog.rs @@ -161,8 +161,12 @@ self.call_cindex(py, "commonancestorsheads", args, kw) } -/// clear the index caches +/// Clear the index caches and inner py_class data. +/// It is Python's responsibility to call `update_nodemap_data` again. def clearcaches(, *args, **kw) -> PyResult { +self.nt(py).borrow_mut().take(); +self.docket(py).borrow_mut().take(); +self.mmap(py).borrow_mut().take(); self.call_cindex(py, "clearcaches", args, kw) } @@ -231,7 +235,7 @@ // `index_getitem` does not handle conversion from PyLong, // which expressions such as [e for e in index] internally use. // Note that we don't seem to have a direct way to call -// PySequence_GetItem (does the job), which would be better for +// PySequence_GetItem (does the job), which would possibly be better // for performance let key = match key.extract::(py) { Ok(rev) => rev.to_py_object(py).into_object(), To: Alphare, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D8161: rust-nodemap: also clear Rust data in `clearcaches`
Alphare updated this revision to Diff 20660. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D8161?vs=20380=20660 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D8161/new/ REVISION DETAIL https://phab.mercurial-scm.org/D8161 AFFECTED FILES rust/hg-cpython/src/revlog.rs CHANGE DETAILS diff --git a/rust/hg-cpython/src/revlog.rs b/rust/hg-cpython/src/revlog.rs --- a/rust/hg-cpython/src/revlog.rs +++ b/rust/hg-cpython/src/revlog.rs @@ -161,8 +161,12 @@ self.call_cindex(py, "commonancestorsheads", args, kw) } -/// clear the index caches +/// Clear the index caches and inner py_class data. +/// It is Python's responsibility to call `update_nodemap_data` again. def clearcaches(, *args, **kw) -> PyResult { +self.nt(py).borrow_mut().take(); +self.docket(py).borrow_mut().take(); +self.mmap(py).borrow_mut().take(); self.call_cindex(py, "clearcaches", args, kw) } @@ -231,7 +235,7 @@ // `index_getitem` does not handle conversion from PyLong, // which expressions such as [e for e in index] internally use. // Note that we don't seem to have a direct way to call -// PySequence_GetItem (does the job), which would be better for +// PySequence_GetItem (does the job), which would possibly be better // for performance let key = match key.extract::(py) { Ok(rev) => rev.to_py_object(py).into_object(), To: Alphare, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D8161: rust-nodemap: also clear Rust data in `clearcaches`
marmoute updated this revision to Diff 20380. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D8161?vs=20336=20380 BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D8161/new/ REVISION DETAIL https://phab.mercurial-scm.org/D8161 AFFECTED FILES rust/hg-cpython/src/revlog.rs CHANGE DETAILS diff --git a/rust/hg-cpython/src/revlog.rs b/rust/hg-cpython/src/revlog.rs --- a/rust/hg-cpython/src/revlog.rs +++ b/rust/hg-cpython/src/revlog.rs @@ -161,8 +161,12 @@ self.call_cindex(py, "commonancestorsheads", args, kw) } -/// clear the index caches +/// Clear the index caches and inner py_class data. +/// It is Python's responsibility to call `update_nodemap_data` again. def clearcaches(, *args, **kw) -> PyResult { +self.nt(py).borrow_mut().take(); +self.docket(py).borrow_mut().take(); +self.mmap(py).borrow_mut().take(); self.call_cindex(py, "clearcaches", args, kw) } @@ -231,7 +235,7 @@ // `index_getitem` does not handle conversion from PyLong, // which expressions such as [e for e in index] internally use. // Note that we don't seem to have a direct way to call -// PySequence_GetItem (does the job), which would be better for +// PySequence_GetItem (does the job), which would possibly be better // for performance let key = match key.extract::(py) { Ok(rev) => rev.to_py_object(py).into_object(), To: Alphare, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D8161: rust-nodemap: also clear Rust data in `clearcaches`
Alphare created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D8161 AFFECTED FILES rust/hg-cpython/src/revlog.rs CHANGE DETAILS diff --git a/rust/hg-cpython/src/revlog.rs b/rust/hg-cpython/src/revlog.rs --- a/rust/hg-cpython/src/revlog.rs +++ b/rust/hg-cpython/src/revlog.rs @@ -152,8 +152,12 @@ self.call_cindex(py, "commonancestorsheads", args, kw) } -/// clear the index caches +/// Clear the index caches and inner py_class data. +/// It is Python's responsibility to call `update_nodemap_data` again. def clearcaches(, *args, **kw) -> PyResult { +self.nt(py).borrow_mut().take(); +self.docket(py).borrow_mut().take(); +self.mmap(py).borrow_mut().take(); self.call_cindex(py, "clearcaches", args, kw) } @@ -222,7 +226,7 @@ // `index_getitem` does not handle conversion from PyLong, // which expressions such as [e for e in index] internally use. // Note that we don't seem to have a direct way to call -// PySequence_GetItem (does the job), which would be better for +// PySequence_GetItem (does the job), which would possibly be better // for performance let key = match key.extract::(py) { Ok(rev) => rev.to_py_object(py).into_object(), To: Alphare, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel