Show More
@@ -92,18 +92,22 b" impl<'a> DebugData<'a> {" | |||||
92 | } |
|
92 | } | |
93 |
|
93 | |||
94 | pub fn run(&mut self) -> Result<Vec<u8>, DebugDataError> { |
|
94 | pub fn run(&mut self) -> Result<Vec<u8>, DebugDataError> { | |
95 | let rev = self |
|
|||
96 | .rev |
|
|||
97 | .parse::<Revision>() |
|
|||
98 | .or(Err(DebugDataErrorKind::InvalidRevision))?; |
|
|||
99 |
|
||||
100 | let root = find_root::FindRoot::new().run()?; |
|
95 | let root = find_root::FindRoot::new().run()?; | |
101 | let index_file = match self.kind { |
|
96 | let index_file = match self.kind { | |
102 | DebugDataKind::Changelog => root.join(".hg/store/00changelog.i"), |
|
97 | DebugDataKind::Changelog => root.join(".hg/store/00changelog.i"), | |
103 | DebugDataKind::Manifest => root.join(".hg/store/00manifest.i"), |
|
98 | DebugDataKind::Manifest => root.join(".hg/store/00manifest.i"), | |
104 | }; |
|
99 | }; | |
105 | let revlog = Revlog::open(&index_file, None)?; |
|
100 | let revlog = Revlog::open(&index_file, None)?; | |
106 | let data = revlog.get_rev_data(rev)?; |
|
101 | ||
|
102 | let data = match self.rev.parse::<Revision>() { | |||
|
103 | Ok(rev) => revlog.get_rev_data(rev)?, | |||
|
104 | _ => { | |||
|
105 | let node = hex::decode(&self.rev) | |||
|
106 | .map_err(|_| DebugDataErrorKind::InvalidRevision)?; | |||
|
107 | let rev = revlog.get_node_rev(&node)?; | |||
|
108 | revlog.get_rev_data(rev)? | |||
|
109 | } | |||
|
110 | }; | |||
107 |
|
111 | |||
108 | Ok(data) |
|
112 | Ok(data) | |
109 | } |
|
113 | } |
@@ -91,6 +91,15 b' Debuging data in inline index' | |||||
91 | file2\x005d9299349fc01ddd25d0070d149b124d8f10411e (esc) |
|
91 | file2\x005d9299349fc01ddd25d0070d149b124d8f10411e (esc) | |
92 | file3\x002661d26c649684b482d10f91960cc3db683c38b4 (esc) |
|
92 | file3\x002661d26c649684b482d10f91960cc3db683c38b4 (esc) | |
93 |
|
93 | |||
|
94 | Debuging with full node id | |||
|
95 | $ rhg debugdata -c `hg log -r 0 -T '{node}'` | |||
|
96 | c8e64718e1ca0312eeee0f59d37f8dc612793856 | |||
|
97 | test | |||
|
98 | 0 0 | |||
|
99 | file1 | |||
|
100 | ||||
|
101 | commit 1 (no-eol) | |||
|
102 | ||||
94 | Cat files |
|
103 | Cat files | |
95 | $ cd $TESTTMP |
|
104 | $ cd $TESTTMP | |
96 | $ rm -rf repository |
|
105 | $ rm -rf repository |
General Comments 0
You need to be logged in to leave comments.
Login now