Add progress-interval flag
Dependencies
- [2]
QWLMNP5Fnew ChangeStore implementation - [3]
XJLSNX3LRun cargo update - [4]
FIIUZR4LInclude file content - [5]
GKLDTVAKRIIR: add libpijul - [6]
TQBJZLD7RIIR: hello, world - [7]
YNZMKRJDinclude more information in log - [8]
OZUZ5H6DUse marks for commits - [9]
W7HZ5VFMRIIR: list changes - [10]
UFSP7C7BExport metadata - [11]
R3XMFPCYimport and export marks - [12]
IKID4WPYInclude "state" for each change. - [13]
KPGRBRHSexport only the files touched by each change - [14]
ATRA7XTTRIIR: factor out Repository struct
Change contents
- replacement in src/main.rs at line 1
use std::env;use clap::Parser; - edit in src/main.rs at line 3
use getopts::Options; - edit in src/main.rs at line 11
#[derive(Parser)]struct Cli {#[arg(long, default_value = ".", help = "repository path")]repo: String,#[arg(long, default_value = "main", help = "channel to export")]channel: String,#[arg(long, help = "branch name in git")]branch: Option<String>,#[arg(long, help = "file to import and export marks")]marks: Option<String>,#[arg(long = "progress-interval",help = "report progress every N commits",value_name = "N")]progress_interval: Option<i32>,} - replacement in src/main.rs at line 34[4.80]→[4.148:291](∅→∅),[4.291]→[4.1540:1602](∅→∅),[4.1602]→[4.54:116](∅→∅),[4.116]→[4.0:119](∅→∅),[4.116]→[4.291:342](∅→∅),[4.119]→[4.291:342](∅→∅),[4.1602]→[4.291:342](∅→∅),[4.291]→[4.291:342](∅→∅),[4.342]→[4.1505:1574](∅→∅),[4.1574]→[4.1603:1673](∅→∅)
let args: Vec<String> = env::args().collect();let mut opts = Options::new();opts.optopt("r", "repo", "repository path", "PATH");opts.optopt("c", "channel", "channel to export", "NAME");opts.optopt("b", "branch", "branch name in git", "NAME");opts.optopt("m","marks","file to import and export marks","MARKS-FILE",);let matches = opts.parse(&args[1..]).unwrap();let repo_path = matches.opt_str("r").unwrap_or(".".to_string());let channel = matches.opt_str("c").unwrap_or("main".to_string());let cli = Cli::parse(); - replacement in src/main.rs at line 36
let mut repo = Repository::load(&repo_path).unwrap();let mut stream = FastExportStream::new(matches.opt_str("b").unwrap_or(channel.to_string()));let mut repo = Repository::load(&cli.repo).unwrap();let mut stream = FastExportStream::new(cli.branch.unwrap_or(cli.channel.to_string())); - replacement in src/main.rs at line 39
match matches.opt_str("m") {Some(filename) => stream.load_marks(&filename).unwrap(),match cli.marks {Some(ref filename) => stream.load_marks(filename).unwrap(), - replacement in src/main.rs at line 44
let changes = repo.log(&channel).unwrap();let changes = repo.log(&cli.channel).unwrap(); - edit in src/main.rs at line 46
let mut count = 0; - edit in src/main.rs at line 58
}count += 1;if let Some(p) = cli.progress_interval {if count % p == 0 {println!("progress Exported {} changes; current change is {:?}",count, changes[i].hash);} - replacement in src/main.rs at line 70
match matches.opt_str("m") {Some(filename) => stream.save_marks(&filename).unwrap(),match cli.marks {Some(ref filename) => stream.save_marks(filename).unwrap(), - edit in Cargo.toml at line 11
getopts = "0.2" - edit in Cargo.toml at line 20[2.6846]
clap = { version = "4.2.3", features = ["derive"] } - edit in Cargo.lock at line 40
][[package]]name = "anstream"version = "0.3.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9e579a7752471abc2a8268df8b20005e3eadd975f585398f17efcfd8d4927371"dependencies = ["anstyle","anstyle-parse","anstyle-query","anstyle-wincon","colorchoice","is-terminal","utf8parse", - edit in Cargo.lock at line 58
name = "anstyle"version = "1.0.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d"[[package]]name = "anstyle-parse"version = "0.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee"dependencies = ["utf8parse",][[package]]name = "anstyle-query"version = "1.0.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b"dependencies = ["windows-sys 0.48.0",][[package]]name = "anstyle-wincon"version = "1.0.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "4bcd8291a340dd8ac70e18878bc4501dd7b4ff970cfa21c207d36ece51ea88fd"dependencies = ["anstyle","windows-sys 0.48.0",][[package]] - edit in Cargo.lock at line 231
][[package]]name = "clap"version = "4.2.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "49f9152d70e42172fdb87de2efd7327160beee37886027cf86f30a233d5b30b4"dependencies = ["clap_builder","clap_derive","once_cell",][[package]]name = "clap_builder"version = "4.2.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e067b220911598876eb55d52725ddcc201ffe3f0904018195973bc5b012ea2ca"dependencies = ["anstream","anstyle","bitflags","clap_lex","strsim",][[package]]name = "clap_derive"version = "4.2.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4"dependencies = ["heck","proc-macro2","quote","syn 2.0.15", - edit in Cargo.lock at line 270
name = "clap_lex"version = "0.4.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1"[[package]] - edit in Cargo.lock at line 286
name = "colorchoice"version = "1.0.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"[[package]] - edit in Cargo.lock at line 564
name = "getopts"version = "0.2.21"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"dependencies = ["unicode-width",][[package]] - edit in Cargo.lock at line 599
name = "heck"version = "0.4.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"[[package]] - edit in Cargo.lock at line 693
"windows-sys 0.48.0",][[package]]name = "is-terminal"version = "0.4.7"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f"dependencies = ["hermit-abi 0.3.1","io-lifetimes","rustix", - replacement in Cargo.lock at line 963
"getopts","clap", - edit in Cargo.lock at line 1282
name = "strsim"version = "0.10.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"[[package]] - edit in Cargo.lock at line 1436
[[package]]name = "utf8parse"version = "0.2.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"