equal
deleted
inserted
replaced
1 // Copyright 2018 Georges Racinet <gracinet@anybox.fr> |
1 // Copyright 2018 Georges Racinet <gracinet@anybox.fr> |
2 // |
2 // |
3 // This software may be used and distributed according to the terms of the |
3 // This software may be used and distributed according to the terms of the |
4 // GNU General Public License version 2 or any later version. |
4 // GNU General Public License version 2 or any later version. |
|
5 extern crate byteorder; |
|
6 extern crate memchr; |
|
7 |
5 mod ancestors; |
8 mod ancestors; |
6 pub mod dagops; |
9 pub mod dagops; |
7 pub use ancestors::{AncestorsIterator, LazyAncestors, MissingAncestors}; |
10 pub use ancestors::{AncestorsIterator, LazyAncestors, MissingAncestors}; |
8 pub mod testing; // unconditionally built, for use from integration tests |
11 pub mod testing; // unconditionally built, for use from integration tests |
9 pub mod discovery; |
12 pub mod discovery; |
38 #[derive(Clone, Debug, PartialEq)] |
41 #[derive(Clone, Debug, PartialEq)] |
39 pub enum GraphError { |
42 pub enum GraphError { |
40 ParentOutOfRange(Revision), |
43 ParentOutOfRange(Revision), |
41 WorkingDirectoryUnsupported, |
44 WorkingDirectoryUnsupported, |
42 } |
45 } |
|
46 |
|
47 #[derive(Clone, Debug, PartialEq)] |
|
48 pub enum DirstateParseError { |
|
49 TooLittleData, |
|
50 Overflow, |
|
51 CorruptedEntry(String), |
|
52 } |
|
53 |
|
54 #[derive(Debug, PartialEq)] |
|
55 pub enum DirstatePackError { |
|
56 CorruptedEntry(String), |
|
57 CorruptedParent, |
|
58 BadSize(usize, usize), |
|
59 } |
|
60 |
|
61 impl From<std::io::Error> for DirstatePackError { |
|
62 fn from(e: std::io::Error) -> Self { |
|
63 DirstatePackError::CorruptedEntry(e.to_string()) |
|
64 } |
|
65 } |
|
66 |
|
67 impl From<std::io::Error> for DirstateParseError { |
|
68 fn from(e: std::io::Error) -> Self { |
|
69 DirstateParseError::CorruptedEntry(e.to_string()) |
|
70 } |
|
71 } |