Show More
@@ -76,7 +76,6 b' pub trait Graph {' | |||||
76 | #[derive(Clone, Debug, PartialEq)] |
|
76 | #[derive(Clone, Debug, PartialEq)] | |
77 | pub enum GraphError { |
|
77 | pub enum GraphError { | |
78 | ParentOutOfRange(Revision), |
|
78 | ParentOutOfRange(Revision), | |
79 | WorkingDirectoryUnsupported, |
|
|||
80 | } |
|
79 | } | |
81 |
|
80 | |||
82 | /// The Mercurial Revlog Index |
|
81 | /// The Mercurial Revlog Index |
@@ -15,7 +15,7 b' use cpython::{' | |||||
15 | PyObject, PyResult, PyTuple, Python, PythonObject, |
|
15 | PyObject, PyResult, PyTuple, Python, PythonObject, | |
16 | }; |
|
16 | }; | |
17 | use hg::revlog::{Node, RevlogIndex}; |
|
17 | use hg::revlog::{Node, RevlogIndex}; | |
18 |
use hg::{Graph, GraphError, Revision |
|
18 | use hg::{Graph, GraphError, Revision}; | |
19 | use libc::{c_int, ssize_t}; |
|
19 | use libc::{c_int, ssize_t}; | |
20 |
|
20 | |||
21 | const REVLOG_CABI_VERSION: c_int = 3; |
|
21 | const REVLOG_CABI_VERSION: c_int = 3; | |
@@ -141,9 +141,6 b' impl PyClone for Index {' | |||||
141 | impl Graph for Index { |
|
141 | impl Graph for Index { | |
142 | /// wrap a call to the C extern parents function |
|
142 | /// wrap a call to the C extern parents function | |
143 | fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> { |
|
143 | fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> { | |
144 | if rev == WORKING_DIRECTORY_REVISION { |
|
|||
145 | return Err(GraphError::WorkingDirectoryUnsupported); |
|
|||
146 | } |
|
|||
147 | let mut res: [c_int; 2] = [0; 2]; |
|
144 | let mut res: [c_int; 2] = [0; 2]; | |
148 | let code = unsafe { |
|
145 | let code = unsafe { | |
149 | (self.capi.index_parents)( |
|
146 | (self.capi.index_parents)( | |
@@ -170,9 +167,6 b' impl vcsgraph::graph::Graph for Index {' | |||||
170 | Err(GraphError::ParentOutOfRange(rev)) => { |
|
167 | Err(GraphError::ParentOutOfRange(rev)) => { | |
171 | Err(vcsgraph::graph::GraphReadError::KeyedInvalidKey(rev)) |
|
168 | Err(vcsgraph::graph::GraphReadError::KeyedInvalidKey(rev)) | |
172 | } |
|
169 | } | |
173 | Err(GraphError::WorkingDirectoryUnsupported) => Err( |
|
|||
174 | vcsgraph::graph::GraphReadError::WorkingDirectoryUnsupported, |
|
|||
175 | ), |
|
|||
176 | } |
|
170 | } | |
177 | } |
|
171 | } | |
178 | } |
|
172 | } |
@@ -26,15 +26,6 b' impl GraphError {' | |||||
26 | hg::GraphError::ParentOutOfRange(r) => { |
|
26 | hg::GraphError::ParentOutOfRange(r) => { | |
27 | GraphError::new(py, ("ParentOutOfRange", r)) |
|
27 | GraphError::new(py, ("ParentOutOfRange", r)) | |
28 | } |
|
28 | } | |
29 | hg::GraphError::WorkingDirectoryUnsupported => { |
|
|||
30 | match py |
|
|||
31 | .import("mercurial.error") |
|
|||
32 | .and_then(|m| m.get(py, "WdirUnsupported")) |
|
|||
33 | { |
|
|||
34 | Err(e) => e, |
|
|||
35 | Ok(cls) => PyErr::from_instance(py, cls), |
|
|||
36 | } |
|
|||
37 | } |
|
|||
38 | } |
|
29 | } | |
39 | } |
|
30 | } | |
40 |
|
31 |
General Comments 0
You need to be logged in to leave comments.
Login now