comparison rust/hg-core/src/repo.rs @ 52031:babfa9ddca0e

rust-repo: add a method to get a `Node` from a `Revision` to the `Repo` This is going to be more and more useful as we start writing higher-level code
author Rapha?l Gom?s <rgomes@octobus.net>
date Mon, 30 Sep 2024 17:46:24 +0200
parents 88aa21d654e5
children d7bc6e482033
comparison
equal deleted inserted replaced
52030:b55f653a0b34 52031:babfa9ddca0e
795 self.config(), 795 self.config(),
796 requirements, 796 requirements,
797 )?, 797 )?,
798 }) 798 })
799 } 799 }
800
801 pub fn node(&self, rev: UncheckedRevision) -> Option<crate::Node> {
802 self.changelog()
803 .ok()
804 .and_then(|c| c.node_from_rev(rev).copied())
805 }
800 } 806 }
801 807
802 /// Lazily-initialized component of `Repo` with interior mutability 808 /// Lazily-initialized component of `Repo` with interior mutability
803 /// 809 ///
804 /// This differs from `OnceCell` in that the value can still be "deinitialized" 810 /// This differs from `OnceCell` in that the value can still be "deinitialized"