cli: Stabilize sort order of inbox repos
Sort repositories before displaying them.
This commit is contained in:
parent
9576a6496b
commit
b477864b83
|
|
@ -28,17 +28,17 @@ $ rad inbox --sort-by id
|
||||||
|
|
||||||
``` ~alice
|
``` ~alice
|
||||||
$ rad inbox --all --sort-by id
|
$ rad inbox --all --sort-by id
|
||||||
|
╭──────────────────────────────────────────────────────────╮
|
||||||
|
│ radicle-git │
|
||||||
|
├──────────────────────────────────────────────────────────┤
|
||||||
|
│ 3 ● patch Copyright fixes [ ... ] opened now │
|
||||||
|
╰──────────────────────────────────────────────────────────╯
|
||||||
╭──────────────────────────────────────────────────────────────╮
|
╭──────────────────────────────────────────────────────────────╮
|
||||||
│ heartwood │
|
│ heartwood │
|
||||||
├──────────────────────────────────────────────────────────────┤
|
├──────────────────────────────────────────────────────────────┤
|
||||||
│ 1 ● issue No license file [ .. ] opened now │
|
│ 1 ● issue No license file [ .. ] opened now │
|
||||||
│ 2 ● branch Change copyright bob/copy created now │
|
│ 2 ● branch Change copyright bob/copy created now │
|
||||||
╰──────────────────────────────────────────────────────────────╯
|
╰──────────────────────────────────────────────────────────────╯
|
||||||
╭──────────────────────────────────────────────────────────╮
|
|
||||||
│ radicle-git │
|
|
||||||
├──────────────────────────────────────────────────────────┤
|
|
||||||
│ 3 ● patch Copyright fixes [ ... ] opened now │
|
|
||||||
╰──────────────────────────────────────────────────────────╯
|
|
||||||
```
|
```
|
||||||
|
|
||||||
``` ~alice
|
``` ~alice
|
||||||
|
|
|
||||||
|
|
@ -201,12 +201,15 @@ fn list_all<'a>(
|
||||||
notifs: ¬ifications::StoreReader,
|
notifs: ¬ifications::StoreReader,
|
||||||
storage: &Storage,
|
storage: &Storage,
|
||||||
) -> anyhow::Result<Vec<term::VStack<'a>>> {
|
) -> anyhow::Result<Vec<term::VStack<'a>>> {
|
||||||
let mut repos = Vec::new();
|
let mut repos = storage.repositories()?;
|
||||||
for repo in storage.repositories()? {
|
repos.sort_by_key(|r| r.rid);
|
||||||
let repo = list_repo(repo.rid, sort_by, notifs, storage)?;
|
|
||||||
repos.extend(repo.into_iter());
|
let mut vstacks = Vec::new();
|
||||||
|
for repo in repos {
|
||||||
|
let vstack = list_repo(repo.rid, sort_by, notifs, storage)?;
|
||||||
|
vstacks.extend(vstack.into_iter());
|
||||||
}
|
}
|
||||||
Ok(repos)
|
Ok(vstacks)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn list_repo<'a, R: ReadStorage>(
|
fn list_repo<'a, R: ReadStorage>(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue