Mercurial > hg
comparison rust/hg-core/src/revlog/index.rs @ 49092:d200ecb76c72
rust-revlog: change default version from 2 to 1 in test builder
Version 1 is the only version we support, so it seems like the natural
choice for making it easy to create valid revlogs.
Differential Revision: https://phab.mercurial-scm.org/D12563
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 15 Apr 2022 17:06:10 -0700 |
parents | e91aa800ae5b |
children | 2a9a55ffe24f |
comparison
equal
deleted
inserted
replaced
49091:9b5334c1e499 | 49092:d200ecb76c72 |
---|---|
321 pub fn new() -> Self { | 321 pub fn new() -> Self { |
322 Self { | 322 Self { |
323 is_first: false, | 323 is_first: false, |
324 is_inline: false, | 324 is_inline: false, |
325 is_general_delta: true, | 325 is_general_delta: true, |
326 version: 2, | 326 version: 1, |
327 offset: 0, | 327 offset: 0, |
328 compressed_len: 0, | 328 compressed_len: 0, |
329 uncompressed_len: 0, | 329 uncompressed_len: 0, |
330 base_revision_or_base_of_delta_chain: 0, | 330 base_revision_or_base_of_delta_chain: 0, |
331 } | 331 } |
515 | 515 |
516 #[test] | 516 #[test] |
517 fn version_test() { | 517 fn version_test() { |
518 let bytes = IndexEntryBuilder::new() | 518 let bytes = IndexEntryBuilder::new() |
519 .is_first(true) | 519 .is_first(true) |
520 .with_version(1) | 520 .with_version(2) |
521 .build(); | 521 .build(); |
522 | 522 |
523 assert_eq!(get_version(&bytes), 1) | 523 assert_eq!(get_version(&bytes), 2) |
524 } | 524 } |
525 } | 525 } |
526 | 526 |
527 #[cfg(test)] | 527 #[cfg(test)] |
528 pub use tests::IndexEntryBuilder; | 528 pub use tests::IndexEntryBuilder; |