##// END OF EJS Templates
rhg: correctly handle the case where diffs are encoded relative to nullrev...
Arseniy Alekseyev -
r50105:cc92ad0e stable
parent child Browse files
Show More
@@ -32,6 +32,8 b' const REVIDX_KNOWN_FLAGS: u16 = REVISION'
32 32 | REVISION_FLAG_EXTSTORED
33 33 | REVISION_FLAG_HASCOPIESINFO;
34 34
35 const NULL_REVLOG_ENTRY_FLAGS: u16 = 0;
36
35 37 #[derive(derive_more::From)]
36 38 pub enum RevlogError {
37 39 InvalidRevision,
@@ -262,11 +264,29 b' impl Revlog {'
262 264 }
263 265 }
264 266
267 pub fn make_null_entry(&self) -> RevlogEntry {
268 RevlogEntry {
269 revlog: self,
270 rev: NULL_REVISION,
271 bytes: b"",
272 compressed_len: 0,
273 uncompressed_len: 0,
274 base_rev_or_base_of_delta_chain: None,
275 p1: NULL_REVISION,
276 p2: NULL_REVISION,
277 flags: NULL_REVLOG_ENTRY_FLAGS,
278 hash: NULL_NODE,
279 }
280 }
281
265 282 /// Get an entry of the revlog.
266 283 pub fn get_entry(
267 284 &self,
268 285 rev: Revision,
269 286 ) -> Result<RevlogEntry, RevlogError> {
287 if rev == NULL_REVISION {
288 return Ok(self.make_null_entry());
289 }
270 290 let index_entry = self
271 291 .index
272 292 .get_entry(rev)
@@ -78,12 +78,6 b' This is what we did to produce the repo '
78 78 $ hg debugdeltachain a
79 79 rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
80 80 0 1 2 -1 p1 15 3 15 5.00000 15 0 0.00000 15 15 1.00000 1
81 #if rhg
82 $ hg cat --config rhg.cat=true -r 0 a
83 abort: corrupted revlog
84 [255]
85 #else
86 81 $ hg cat --config rhg.cat=true -r 0 a
87 82 hi
88 #endif
89 83 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now