[Request] [+ ] D11580: dirstatemap: fix copymap.pop in Rust to return the value it pops

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Sat Oct 2 15:06:14 UTC 2021


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

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),
         }
     }



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20211002/fea5eb3d/attachment-0001.html>


More information about the Mercurial-patches mailing list