RIIR: list changes

andybalholm
Mar 15, 2023, 9:36 PM
W7HZ5VFMEFVJIPYZJXOSMWTQ7DOZOOHT4QZTMDCT63AKIWB3TCZQC

Dependencies

Change contents

  • edit in rust/src/main.rs at line 1
    [3.67]
    [3.68]
    use std::env;
    use std::path::Path;
    use getopts::Options;
    use libpijul::pristine::sanakirja::Pristine;
    use libpijul::TxnT;
    use libpijul::TxnTExt;
  • replacement in rust/src/main.rs at line 10
    [3.80][3.80:111]()
    println!("Hello, world!");
    [3.80]
    [3.111]
    let args: Vec<String> = env::args().collect();
    let mut opts = Options::new();
    opts.optopt("r", "repo", "repository path", "PATH");
    let matches = opts.parse(&args[1..]).unwrap();
    let repo = matches.opt_str("r").unwrap_or(".".to_string());
    let repo_path = Path::new(&repo);
    let pristine_path = repo_path.join(".pijul/pristine/db");
    let pristine = Pristine::new(pristine_path).unwrap();
    let txn = pristine.txn_begin().unwrap();
    let channel_name = txn.current_channel().unwrap();
    println!("On channel {}", channel_name);
    let channel = txn.load_channel(channel_name).unwrap().unwrap();
    let rev_log = txn.reverse_log(&*channel.read(), None).unwrap();
    for pr in rev_log {
    let (_, (h, _)) = pr.unwrap();
    println!("{:?}", h);
    }
  • edit in rust/Cargo.toml at line 9
    [3.331]
    [2.0]
    getopts = "0.2"
  • edit in rust/Cargo.lock at line 464
    [2.11736]
    [2.11736]
    ]
    [[package]]
    name = "getopts"
    version = "0.2.21"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5"
    dependencies = [
    "unicode-width",
  • edit in rust/Cargo.lock at line 842
    [2.20468]
    [2.20468]
    "getopts",