From patchwork Sat Oct 2 15:06:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11580: dirstatemap: fix copymap.pop in Rust to return the value it pops From: phabricator X-Patchwork-Id: 49904 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sat, 2 Oct 2021 15:06:14 +0000 marmoute created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY I guess this was overlooked in the initial implementation? Without this, the next patch would, loose copy information in setparent. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11580 AFFECTED FILES rust/hg-cpython/src/dirstate/dirstate_map.rs CHANGE DETAILS To: marmoute, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/rust/hg-cpython/src/dirstate/dirstate_map.rs b/rust/hg-cpython/src/dirstate/dirstate_map.rs --- a/rust/hg-cpython/src/dirstate/dirstate_map.rs +++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs @@ -401,7 +401,9 @@ .copy_map_remove(HgPath::new(key.data(py))) .map_err(|e| v2_error(py, e))? { - Some(_) => Ok(None), + Some(copy) => Ok(Some( + PyBytes::new(py, copy.as_bytes()).into_object(), + )), None => Ok(default), } }