Export metadata
Dependencies
- [2]
IKID4WPYInclude "state" for each change. - [3]
ATRA7XTTRIIR: factor out Repository struct - [4]
YNZMKRJDinclude more information in log - [5]
W7HZ5VFMRIIR: list changes - [*]
TQBJZLD7RIIR: hello, world
Change contents
- edit in rust/src/main.rs at line 4
use libpijul::Base32; - edit in rust/src/main.rs at line 8[3.147][7.68]
mod fast_export;use fast_export::FastExportStream; - edit in rust/src/main.rs at line 16
opts.optopt("b", "branch", "branch name in git", "NAME"); - edit in rust/src/main.rs at line 22
let mut stream = FastExportStream {branch_name: matches.opt_str("b").unwrap_or(channel.to_string()),}; - replacement in rust/src/main.rs at line 28
println!("{}", c.hash.to_base32());println!("{}", c.state.to_base32());println!("{}", c.timestamp);println!("{:?}", c.authors);println!("{}", c.message);println!("");stream.write_commit(&c); - file addition: fast_export.rs[7.33]
use crate::repo::Change;pub struct FastExportStream {pub branch_name: String,}impl FastExportStream {pub fn write_commit(&mut self, c: &Change) {println!("commit refs/heads/{}", self.branch_name);// TODO: marklet committer = if c.authors.len() > 0 {&c.authors[0]} else {"<>"};println!("committer {} {} +0000", committer, c.timestamp.timestamp());let message = match &c.description {Some(description) => format!("{}\n\n{}", c.message, description),None => c.message.to_string(),};println!("data {}", message.len());println!("{}", message);// TODO: from// TODO: deleteall// TODO: filesprintln!("");}}