Show More
@@ -336,6 +336,11 b' message",' | |||||
336 | changelog.data_for_rev(NULL_REVISION)?, |
|
336 | changelog.data_for_rev(NULL_REVISION)?, | |
337 | ChangelogRevisionData::null() |
|
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 | Ok(()) |
|
344 | Ok(()) | |
340 | } |
|
345 | } | |
341 | } |
|
346 | } |
@@ -562,6 +562,9 b" impl<'revlog> RevlogEntry<'revlog> {" | |||||
562 |
|
562 | |||
563 | pub fn data(&self) -> Result<Cow<'revlog, [u8]>, HgError> { |
|
563 | pub fn data(&self) -> Result<Cow<'revlog, [u8]>, HgError> { | |
564 | let data = self.rawdata()?; |
|
564 | let data = self.rawdata()?; | |
|
565 | if self.rev == NULL_REVISION { | |||
|
566 | return Ok(data); | |||
|
567 | } | |||
565 | if self.is_censored() { |
|
568 | if self.is_censored() { | |
566 | return Err(HgError::CensoredNodeError); |
|
569 | return Err(HgError::CensoredNodeError); | |
567 | } |
|
570 | } | |
@@ -688,6 +691,9 b' mod tests {' | |||||
688 | revlog.rev_from_node(NULL_NODE.into()).unwrap(), |
|
691 | revlog.rev_from_node(NULL_NODE.into()).unwrap(), | |
689 | NULL_REVISION |
|
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 | #[test] |
|
699 | #[test] |
General Comments 0
You need to be logged in to leave comments.
Login now