##// END OF EJS Templates
rust-revlog: fix RevlogEntry.data() for NULL_REVISION...
Georges Racinet -
r51639:124c44b5 stable
parent child Browse files
Show More
@@ -336,6 +336,11 b' message",'
336 336 changelog.data_for_rev(NULL_REVISION)?,
337 337 ChangelogRevisionData::null()
338 338 );
339 // same with the intermediate entry object
340 assert_eq!(
341 changelog.entry_for_rev(NULL_REVISION)?.data()?,
342 ChangelogRevisionData::null()
343 );
339 344 Ok(())
340 345 }
341 346 }
@@ -562,6 +562,9 b" impl<'revlog> RevlogEntry<'revlog> {"
562 562
563 563 pub fn data(&self) -> Result<Cow<'revlog, [u8]>, HgError> {
564 564 let data = self.rawdata()?;
565 if self.rev == NULL_REVISION {
566 return Ok(data);
567 }
565 568 if self.is_censored() {
566 569 return Err(HgError::CensoredNodeError);
567 570 }
@@ -688,6 +691,9 b' mod tests {'
688 691 revlog.rev_from_node(NULL_NODE.into()).unwrap(),
689 692 NULL_REVISION
690 693 );
694 let null_entry = revlog.get_entry(NULL_REVISION).ok().unwrap();
695 assert_eq!(null_entry.revision(), NULL_REVISION);
696 assert!(null_entry.data().unwrap().is_empty());
691 697 }
692 698
693 699 #[test]
General Comments 0
You need to be logged in to leave comments. Login now