include more information in log
Dependencies
- [2]
RVRUZGHUFactor out load_channel function - [3]
W7HZ5VFMRIIR: list changes - [4]
ATRA7XTTRIIR: factor out Repository struct - [*]
TQBJZLD7RIIR: hello, world - [*]
GKLDTVAKRIIR: add libpijul
Change contents
- edit in rust/src/repo.rs at line 4
use chrono::DateTime;use chrono::Utc; - edit in rust/src/repo.rs at line 8
use libpijul::change::Author;use libpijul::changestore::ChangeStore; - edit in rust/src/repo.rs at line 13
use libpijul::Base32; - edit in rust/src/repo.rs at line 19
change_store: libpijul::changestore::filesystem::FileSystem, - edit in rust/src/repo.rs at line 24
pub message: String,pub description: Option<String>,pub timestamp: DateTime<Utc>,pub authors: Vec<String>, - edit in rust/src/repo.rs at line 48
let change_store =libpijul::changestore::filesystem::FileSystem::from_root(&repo_path, 256); - replacement in rust/src/repo.rs at line 51
return Ok(Repository { pristine });return Ok(Repository {change_store,pristine,}); - edit in rust/src/repo.rs at line 73
fn author_string(&self, a: &Author) -> String {if let Some(name) = a.0.get("name") {if let Some(email) = a.0.get("email") {return format!("{} <{}>", name, email);}return format!("{} <>", name);}if let Some(email) = a.0.get("email") {return format!("<{}>", email);}if let Some(key) = a.0.get("key") {return format!("{} <>", key);}return "<>".to_string();} - edit in rust/src/repo.rs at line 100
let hash: libpijul::Hash = h.into();let header = self.change_store.get_header(&h.into())?;let authors: Vec<String> = header.authors.iter().map(|a| self.author_string(&a)).collect(); - replacement in rust/src/repo.rs at line 109
hash: format!("{:?}", h),hash: hash.to_base32(),message: header.message,description: header.description,timestamp: header.timestamp,authors, - edit in rust/src/main.rs at line 12
opts.optopt("c", "channel", "channel to export", "NAME"); - edit in rust/src/main.rs at line 15
let channel = matches.opt_str("c").unwrap_or("main".to_string()); - replacement in rust/src/main.rs at line 18
let changes = repo.log("main").unwrap();let changes = repo.log(&channel).unwrap(); - edit in rust/src/main.rs at line 21
println!("{}", c.timestamp);println!("{:?}", c.authors);println!("{}", c.message);println!(""); - edit in rust/Cargo.toml at line 9
chrono = "0.4.24" - edit in rust/Cargo.lock at line 842[7.20468][3.1193]
"chrono",