cli/id: Print Parent of Revision
When delegates collaborate on the repository identity, their voting narrows the tree of active proposals to the chain of accepted proposals. Thus, they crucially must understand which proposals are siblings, i.e., which proposals share the same parent, because no two sibling proposals should ever be accepted at the same time, as this would mean a fork. To ease collaboration of delegates and improve their overview, also print the parent revision, if present. Note that the initial revision is the only revision that has no parent.
This commit is contained in:
parent
5bd3569e12
commit
998ff91e2c
|
|
@ -51,6 +51,7 @@ $ rad id update --title "Add canonical reference rules" --payload xyz.radicle.cr
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add canonical reference rules │
|
||||
│ Revision c3349f07bfe6a82bbeb2989d2de4a918408f9831 │
|
||||
│ Parent 0656c217f917c3e06234771e9ecae53aba5e173e │
|
||||
│ Blob 85fa09e2de93b825d5231778dbb34143004a4bca │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State accepted │
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ $ rad id update --title "Add canonical branch for releases" --payload xyz.radicl
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add canonical branch for releases │
|
||||
│ Revision 37a1aad231100cd206c49aed79e405ea2da9204b │
|
||||
│ Parent dace164ba43fa51802697ec28d0b1965a9d7808b │
|
||||
│ Blob bbefd77cfeb456e500ad868c3b4effe1f7f818e2 │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State active │
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ $ rad id update --title "Add canonical reference rules" --payload xyz.radicle.cr
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add canonical reference rules │
|
||||
│ Revision c3349f07bfe6a82bbeb2989d2de4a918408f9831 │
|
||||
│ Parent 0656c217f917c3e06234771e9ecae53aba5e173e │
|
||||
│ Blob 85fa09e2de93b825d5231778dbb34143004a4bca │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State accepted │
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ $ rad id update --title "Add canonical symbolic ref" --payload xyz.radicle.crefs
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add canonical symbolic ref │
|
||||
│ Revision 62e2cb60c6df9ad9908b6697b5d126760a855484 │
|
||||
│ Parent 37a1aad231100cd206c49aed79e405ea2da9204b │
|
||||
│ Blob b20de7b184673eb0d9227be17640c923d8ef3f3e │
|
||||
│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │
|
||||
│ State active │
|
||||
|
|
|
|||
|
|
@ -33,14 +33,14 @@ Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from the network, found 1 potential s
|
|||
✓ Target met: 1 seed(s)
|
||||
🌱 Fetched from z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
|
||||
$ rad id list
|
||||
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ ● ID Title Author Status Created │
|
||||
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ ● 89b2623 Edit project name bob z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk active now │
|
||||
│ ● 12d7300 Edit project name alice (you) active now │
|
||||
│ ● 0ca42d3 Add Bob alice (you) accepted now │
|
||||
│ ● 0656c21 Initial revision alice (you) accepted now │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ ● ID Title Author Status Created Parent │
|
||||
├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ ● 89b2623 Edit project name bob z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk active now 0ca42d3 │
|
||||
│ ● 12d7300 Edit project name alice (you) active now 0ca42d3 │
|
||||
│ ● 0ca42d3 Add Bob alice (you) accepted now 0656c21 │
|
||||
│ ● 0656c21 Initial revision alice (you) accepted now none │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
```
|
||||
|
||||
This isn't a problem as long as we don't try to accept both. So let's accept
|
||||
|
|
@ -49,14 +49,14 @@ Bob's:
|
|||
``` ~alice
|
||||
$ rad id accept 89b2623 -q
|
||||
$ rad id list
|
||||
╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ ● ID Title Author Status Created │
|
||||
├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ ● 89b2623 Edit project name bob z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk accepted now │
|
||||
│ ● 12d7300 Edit project name alice (you) stale now │
|
||||
│ ● 0ca42d3 Add Bob alice (you) accepted now │
|
||||
│ ● 0656c21 Initial revision alice (you) accepted now │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ ● ID Title Author Status Created Parent │
|
||||
├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ ● 89b2623 Edit project name bob z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk accepted now 0ca42d3 │
|
||||
│ ● 12d7300 Edit project name alice (you) stale now 0ca42d3 │
|
||||
│ ● 0ca42d3 Add Bob alice (you) accepted now 0656c21 │
|
||||
│ ● 0656c21 Initial revision alice (you) accepted now none │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
```
|
||||
|
||||
Doing so voided the other conflicting revision, and it can no longer be
|
||||
|
|
@ -79,6 +79,7 @@ $ rad id show 12d7300
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Edit project name │
|
||||
│ Revision 12d7300d1bbba84e4e5760c8c61999bf5fefb81a │
|
||||
│ Parent 0ca42d376bd566631083c8913cf86bec722da392 │
|
||||
│ Blob e93aa3e3c5c448bacd3537a81daf1437eccd046a │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State stale │
|
||||
|
|
|
|||
|
|
@ -14,12 +14,12 @@ Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from the network, found 1 potential s
|
|||
✓ Target met: 1 seed(s)
|
||||
🌱 Fetched from z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
|
||||
$ rad id --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji
|
||||
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ ● ID Title Author Status Created │
|
||||
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ ● 069e7d5 Add Bob alice z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi accepted now │
|
||||
│ ● 0656c21 Initial revision alice z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi accepted now │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ ● ID Title Author Status Created Parent │
|
||||
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ ● 069e7d5 Add Bob alice z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi accepted now 0656c21 │
|
||||
│ ● 0656c21 Initial revision alice z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi accepted now none │
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
$ rad inspect rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --sigrefs
|
||||
z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi [..] parent
|
||||
z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk [..] root
|
||||
|
|
@ -32,6 +32,7 @@ $ rad id update --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --title "Add Eve" --des
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add Eve │
|
||||
│ Revision 3cd3c7f9900de0fcb19705856a7cc339a38fb0b3 │
|
||||
│ Parent 069e7d58faa9a7473d27f5510d676af33282796f │
|
||||
│ Blob 74581605d1f75396c331487a10ca61c4815ed685 │
|
||||
│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │
|
||||
│ State active │
|
||||
|
|
@ -74,6 +75,7 @@ $ rad id accept 3cd3c7f9900de0fcb19705856a7cc339a38fb0b3 --repo rad:z42hL2jL4XNk
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add Eve │
|
||||
│ Revision 3cd3c7f9900de0fcb19705856a7cc339a38fb0b3 │
|
||||
│ Parent 069e7d58faa9a7473d27f5510d676af33282796f │
|
||||
│ Blob 74581605d1f75396c331487a10ca61c4815ed685 │
|
||||
│ Author did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk │
|
||||
│ State accepted │
|
||||
|
|
@ -97,14 +99,14 @@ We can list all revisions:
|
|||
|
||||
``` ~alice
|
||||
$ rad id list
|
||||
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ ● ID Title Author Status Created │
|
||||
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ ● e6bf105 Make private alice (you) active now │
|
||||
│ ● 3cd3c7f Add Eve bob z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk accepted now │
|
||||
│ ● 069e7d5 Add Bob alice (you) accepted now │
|
||||
│ ● 0656c21 Initial revision alice (you) accepted now │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ ● ID Title Author Status Created Parent │
|
||||
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
|
||||
│ ● e6bf105 Make private alice (you) active now 3cd3c7f │
|
||||
│ ● 3cd3c7f Add Eve bob z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk accepted now 069e7d5 │
|
||||
│ ● 069e7d5 Add Bob alice (you) accepted now 0656c21 │
|
||||
│ ● 0656c21 Initial revision alice (you) accepted now none │
|
||||
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
```
|
||||
|
||||
Despite being a delegate, Bob can't edit or redact Alice's revision:
|
||||
|
|
@ -127,6 +129,7 @@ $ rad id show e6bf10593b78384eb2b281cbb18a605668a6d1f7
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Make private │
|
||||
│ Revision e6bf10593b78384eb2b281cbb18a605668a6d1f7 │
|
||||
│ Parent 3cd3c7f9900de0fcb19705856a7cc339a38fb0b3 │
|
||||
│ Blob c533865b2846ca6c5b4436ec6872257293380c3b │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State active │
|
||||
|
|
@ -179,6 +182,7 @@ $ rad id update --repo rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji --title "Remove Bob" --
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Remove Bob │
|
||||
│ Revision 8ba242a80bc1181f41f9ea7a19286038c7948994 │
|
||||
│ Parent 3cd3c7f9900de0fcb19705856a7cc339a38fb0b3 │
|
||||
│ Blob 254d62de237117e7d7b9ceff85c47f5e3b610c1e │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State active │
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ $ rad id update --title "Add Bob" --description "Add Bob as a delegate" --delega
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add Bob │
|
||||
│ Revision 7be665f9fccba97abb21b2fa85a6fd3181c72858 │
|
||||
│ Parent 0656c217f917c3e06234771e9ecae53aba5e173e │
|
||||
│ Blob 93d3009787e5d8a481dffc4dd248ea46af592466 │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State accepted │
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ $ rad id update --title "Add emoji alias" --description "Adding alias field" --p
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add emoji alias │
|
||||
│ Revision 05100d3f0a73b9373681677158615a53ba51940e │
|
||||
│ Parent 0656c217f917c3e06234771e9ecae53aba5e173e │
|
||||
│ Blob a0f421c928dcfc6eca129fc2ea1f50877de7dc20 │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State accepted │
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ $ rad id update --title "Add field" --description "Add a new 'web' field" --payl
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add field │
|
||||
│ Revision a8a9fee6c4f83578ab132d375f1da0c81282bef3 │
|
||||
│ Parent 0656c217f917c3e06234771e9ecae53aba5e173e │
|
||||
│ Blob fbe268d13e60f1f3a1972e0ccd592f3cdecf08b5 │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State accepted │
|
||||
|
|
@ -42,6 +43,7 @@ $ rad id update --title "Delete field" --description "Delete 'web'" --payload xy
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Delete field │
|
||||
│ Revision d373c35876833105f8aafed8b610660b5737cd67 │
|
||||
│ Parent a8a9fee6c4f83578ab132d375f1da0c81282bef3 │
|
||||
│ Blob d96f425412c9f8ad5d9a9a05c9831d0728e2338d │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State accepted │
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ $ rad id update --title "Add Bob" --description "Add Bob as a delegate" --delega
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add Bob │
|
||||
│ Revision 0ca42d376bd566631083c8913cf86bec722da392 │
|
||||
│ Parent 0656c217f917c3e06234771e9ecae53aba5e173e │
|
||||
│ Blob 053541ba7b90534b35dd8718e0ceaa408979b02b │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State accepted │
|
||||
|
|
@ -129,6 +130,7 @@ $ rad id show 0ca42d376bd566631083c8913cf86bec722da392
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Add Bob │
|
||||
│ Revision 0ca42d376bd566631083c8913cf86bec722da392 │
|
||||
│ Parent 0656c217f917c3e06234771e9ecae53aba5e173e │
|
||||
│ Blob 053541ba7b90534b35dd8718e0ceaa408979b02b │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State accepted │
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ $ rad id update --visibility private --title "Privatise" --description "Revertin
|
|||
╭────────────────────────────────────────────────────────────────────────╮
|
||||
│ Title Privatise │
|
||||
│ Revision 774cc1e72641d97d7dc9377745b7f454a9171747 │
|
||||
│ Parent cecb16c9bebf35cfc4130f17efe6424f8ac71d66 │
|
||||
│ Blob 88f759a4d46e9535766fccec0cbfe1fed6160b1a │
|
||||
│ Author did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi │
|
||||
│ State accepted │
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
|
|||
}
|
||||
Command::List => {
|
||||
let mut revisions =
|
||||
term::Table::<7, term::Label>::new(term::table::TableOptions::bordered());
|
||||
term::Table::<8, term::Label>::new(term::table::TableOptions::bordered());
|
||||
|
||||
revisions.header([
|
||||
term::format::dim(String::from("●")).into(),
|
||||
|
|
@ -214,6 +214,7 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
|
|||
term::Label::blank(),
|
||||
term::format::bold(String::from("Status")).into(),
|
||||
term::format::bold(String::from("Created")).into(),
|
||||
term::format::bold(String::from("Parent")).into(),
|
||||
]);
|
||||
revisions.divider();
|
||||
|
||||
|
|
@ -231,8 +232,21 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
|
|||
let (alias, author) =
|
||||
term::format::Author::new(r.author.public_key(), &profile, true).labels();
|
||||
let timestamp = term::format::timestamp(r.timestamp).into();
|
||||
let parent = r
|
||||
.parent
|
||||
.map(term::format::oid)
|
||||
.unwrap_or_else(|| term::Paint::new("none".to_string()));
|
||||
|
||||
revisions.push([icon, id, title, alias, author, state, timestamp]);
|
||||
revisions.push([
|
||||
icon,
|
||||
id,
|
||||
title,
|
||||
alias,
|
||||
author,
|
||||
state,
|
||||
timestamp,
|
||||
parent.into(),
|
||||
]);
|
||||
}
|
||||
revisions.print();
|
||||
}
|
||||
|
|
@ -290,6 +304,12 @@ fn print_meta(revision: &Revision, previous: &Doc, profile: &Profile) -> anyhow:
|
|||
term::format::bold("Revision").into(),
|
||||
term::label(revision.id.to_string()),
|
||||
]);
|
||||
if let Some(parent) = revision.parent {
|
||||
attrs.push([
|
||||
term::format::bold("Parent").into(),
|
||||
term::label(parent.to_string()),
|
||||
]);
|
||||
}
|
||||
attrs.push([
|
||||
term::format::bold("Blob").into(),
|
||||
term::label(revision.blob.to_string()),
|
||||
|
|
|
|||
Loading…
Reference in New Issue