| 290 | } |
| 291 | |
| 292 | pub fn get_uncommitted(&mut self, last_seconds: u64) -> Result<Vec<CommitListItem>, io::Error> { |
| 293 | let start = SystemTime::now() |
| 294 | .duration_since(UNIX_EPOCH) |
| 295 | .unwrap() |
| 296 | .as_secs() |
| 297 | - last_seconds; |
| 298 | |
| 299 | let end = SystemTime::now() |
| 300 | .duration_since(UNIX_EPOCH) |
| 301 | .unwrap() |
| 302 | .as_secs() |
| 303 | + 1; |
| 304 | |
| 305 | let all_hashes = self.timestamps.get_range(start, end)?; |
| 306 | |
| 307 | let mut commits = Vec::new(); |
| 308 | |
| 309 | for (_, hashes) in all_hashes { |
| 310 | for hash in hashes { |
| 311 | match self.commit_finish.has_key(hash) { |
| 312 | Ok(has_key) => { |
| 313 | if !has_key { |
| 314 | match self.commit_list.search(hash) { |
| 315 | Ok(commit) => match commit { |
| 316 | Some(c) => { |
| 317 | commits.push(c); |
| 318 | } |
| 319 | None => {} |
| 320 | }, |
| 321 | Err(_) => {} |
| 322 | } |
| 323 | } |
| 324 | } |
| 325 | Err(_) => {} |
| 326 | } |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | // commits.dedup_by_key(|c| c.hash); |
| 331 | |
| 332 | Ok(commits) |
| 333 | } |
| 334 | |
| 335 | pub fn compute_hash( |
| 336 | &self, |