Tags: dropping useless Hashes in favour of Merkles

pmeunier
Dec 17, 2021, 5:14 PM
C267PHOH3QJBSBEWQB3J7PPOOXIUKM3DIIZIPLHPU4D5OXRCGLZAC

Dependencies

  • [2] AETYXHGO Using an LruCache instead of a HashMap for loaded pages in a tag
  • [3] FDEVV5NG Tag check
  • [4] DX2FO4HZ Tag CLI cleanup
  • [5] TSQI6N2I Pop the filename in pijul::commands::tags after printing the first one
  • [6] TYAKEAJL A better estimate of the maximum number of open patches we can keep (Unix-only at the moment)
  • [7] GHO6DWPI Refactoring iterators
  • [8] TZ42DX3B Properly dropping a channel
  • [9] QL6K2ZM3 Tags
  • [10] N3X5YP7P Adding tag/txn.rs, now that the parser allows it
  • [11] YN63NUZO Sanakirja 1.0
  • [12] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [13] IIV3EL2X Cleanup, formatting, and fixing the Git feature
  • [14] AAXP2534 Tags: completing the subcommand
  • [15] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [16] L3RCAPPK Add --repository to tag commands
  • [17] G6UIBL6U Cleaner error handling for tag deserialization
  • [18] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [19] 5BRU2RRW Cleanup (debugging a crash related to trees/inodes)
  • [20] RRCSHAYZ Formatting
  • [21] FZ7MXL3B Allow to use short tag hashes
  • [22] FXEDPLRI Resurrecting tests, and type cleanup (no need for Arc<RwLock<…>> anymore)
  • [23] A3RM526Y Integrating identity malleability
  • [24] 7ZFRYVVQ Cargo.nix and formatting
  • [25] I24UEJQL Various post-fire fixes
  • [26] E7UUQQCC Apply changes with prefixes in .pijul/changes
  • [27] ZDK3GNDB Tag transactions (including a massive refactoring of errors)
  • [28] 5OGOE4VW Store the current channel in the pristine

Change contents

  • replacement in pijul/src/commands/tag.rs at line 97
    [4.2499][4.2762:2924]()
    if txn
    .read()
    .get_tags(&channel.read().tags, &last_t)?
    .is_some()
    {
    [4.2499]
    [4.2576]
    if txn.read().is_tagged(&channel.read().tags, last_t)? {
  • replacement in pijul/src/commands/tag.rs at line 108
    [4.3053][4.2925:3025](),[4.3025][4.3145:3230](),[4.3145][4.3145:3230](),[4.3230][3.102:149]()
    let h = libpijul::tag::from_channel(&*txn.read(), &channel_name, &header, &mut w)?;
    libpijul::changestore::filesystem::push_filename(&mut tag_path, &h);
    tag_path.set_extension("tag");
    [4.3053]
    [4.3230]
    let h: libpijul::Merkle =
    libpijul::tag::from_channel(&*txn.read(), &channel_name, &header, &mut w)?;
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &h);
  • replacement in pijul/src/commands/tag.rs at line 114
    [4.3358][4.3026:3128]()
    txn.write()
    .put_tags(&mut *channel.write(), last_t.into(), &h)?;
    [4.3358]
    [4.3432]
    txn.write().put_tags(&mut *channel.write(), last_t.into())?;
  • replacement in pijul/src/commands/tag.rs at line 125
    [4.157][4.3591:3678](),[3.211][4.3591:3678](),[4.222][4.3591:3678](),[4.3591][4.3591:3678](),[4.3678][4.223:312](),[4.312][3.212:263]()
    let h = if let Some(h) = libpijul::Hash::from_base32(tag.as_bytes()) {
    libpijul::changestore::filesystem::push_filename(&mut tag_path, &h);
    tag_path.set_extension("tag");
    [3.211]
    [4.3678]
    let h = if let Some(h) = libpijul::Merkle::from_base32(tag.as_bytes()) {
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &h);
  • replacement in pijul/src/commands/tag.rs at line 142
    [4.4198][3.264:368]()
    let mut f = libpijul::tag::OpenTagFile::open(&tag_path)?;
    f.check(&h)?;
    [4.4198]
    [4.4457]
    let f = libpijul::tag::OpenTagFile::open(&tag_path, &h)?;
  • replacement in pijul/src/commands/tag.rs at line 150
    [3.430][4.5830:6006](),[4.5830][4.5830:6006](),[4.6006][3.431:482]()
    let h = if let Some(h) = libpijul::Hash::from_base32(tag.as_bytes()) {
    libpijul::changestore::filesystem::push_filename(&mut tag_path, &h);
    tag_path.set_extension("tag");
    [3.430]
    [4.6006]
    let h = if let Some(h) = libpijul::Merkle::from_base32(tag.as_bytes()) {
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &h);
  • replacement in pijul/src/commands/tag.rs at line 196
    [4.3209][4.930:1110](),[4.930][4.930:1110](),[4.1110][3.621:672](),[3.672][4.1110:1188](),[4.1110][4.1110:1188]()
    let (_, h) = t?;
    let h: libpijul::Hash = h.into();
    libpijul::changestore::filesystem::push_filename(&mut tag_path, &h);
    tag_path.set_extension("tag");
    let mut f = libpijul::tag::OpenTagFile::open(&tag_path)?;
    [4.3209]
    [4.1188]
    let t = (*t?).into();
    let (_, m) = txn.get_changes(&channel, t)?.unwrap();
    libpijul::changestore::filesystem::push_tag_filename(&mut tag_path, &m);
    let mut f = libpijul::tag::OpenTagFile::open(&tag_path, &m)?;
  • replacement in pijul/src/commands/tag.rs at line 201
    [4.1234][4.1234:1298]()
    writeln!(stdout, "Tag {}", h.to_base32())?;
    [4.1234]
    [4.1298]
    writeln!(stdout, "State {}", m.to_base32())?;
  • edit in pijul/src/commands/tag.rs at line 204
    [4.1438][4.1438:1513]()
    writeln!(stdout, "State: {}", f.state().to_base32())?;
  • replacement in pijul/src/commands/mod.rs at line 267
    [4.69][4.69:194]()
    fn find_hash(path: &mut std::path::PathBuf, hash: &str) -> Result<libpijul::Hash, anyhow::Error> {
    use libpijul::Base32;
    [4.69]
    [4.194]
    fn find_hash<B: libpijul::Base32>(
    path: &mut std::path::PathBuf,
    hash: &str,
    ) -> Result<B, anyhow::Error> {
  • replacement in pijul/src/commands/mod.rs at line 298
    [4.912][4.912:981]()
    if let Some(h) = libpijul::Hash::from_base32(f.as_bytes()) {
    [4.912]
    [4.981]
    if let Some(h) = B::from_base32(f.as_bytes()) {
  • replacement in libpijul/src/tag.rs at line 60
    [4.7538][3.673:805]()
    #[error("Wrong hash, expected {}, got {}", expected.to_base32(), got.to_base32())]
    WrongHash { expected: Hash, got: Hash },
    [4.7538]
    [4.7538]
    #[error("Wrong state, expected {}, got {}", expected.to_base32(), got.to_base32())]
    WrongHash { expected: Merkle, got: Merkle },
  • replacement in libpijul/src/tag.rs at line 77
    [4.7694][4.7694:7760]()
    pub fn open<P: AsRef<Path>>(p: P) -> Result<Self, TagError> {
    [4.7694]
    [4.7760]
    pub fn open<P: AsRef<Path>>(p: P, expected: &Merkle) -> Result<Self, TagError> {
  • replacement in libpijul/src/tag.rs at line 81
    [4.7917][4.140:219](),[4.219][4.7967:8008](),[4.7967][4.7967:8008]()
    let header = bincode::deserialize(&off).map_err(TagError::BincodeDe)?;
    Ok(OpenTagFile { header, file })
    [4.7917]
    [4.1662]
    let header: FileHeader = bincode::deserialize(&off).map_err(TagError::BincodeDe)?;
    if &header.state == expected {
    Ok(OpenTagFile { header, file })
    } else {
    Err(TagError::WrongHash {
    expected: *expected,
    got: header.state,
    })
    }
  • edit in libpijul/src/tag.rs at line 99
    [4.1977][4.1977:1983](),[4.1983][3.806:1736]()
    }
    pub fn check(&mut self, expected: &Hash) -> Result<(), TagError> {
    let mut hasher = Hasher::default();
    self.file.seek(SeekFrom::Start(0))?;
    let mut buf = Vec::new();
    // Reading the FileHeader
    buf.resize(self.header.header as usize, 0);
    self.file.read_exact(&mut buf)?;
    hasher.update(&buf);
    // Reading the Header
    buf.resize((self.header.channel - self.header.header) as usize, 0);
    self.file.read_exact(&mut buf)?;
    hasher.update(&buf);
    // Reading the Header
    buf.resize((self.header.unhashed - self.header.channel) as usize, 0);
    self.file.read_exact(&mut buf)?;
    hasher.update(&buf);
    let got = hasher.finish();
    if &got != expected {
    Err(TagError::WrongHash {
    expected: *expected,
    got,
    })
    } else {
    Ok(())
    }
  • replacement in libpijul/src/tag.rs at line 227
    [4.12064][4.12064:12122]()
    |_, _, k: &L64, v: &SerializedHash| Ok((*k, *v)),
    [4.12064]
    [4.12122]
    |_, _, k: &L64, v: &()| Ok((*k, *v)),
  • replacement in libpijul/src/tag.rs at line 351
    [4.15209][4.15209:15239]()
    ) -> Result<Hash, TagError> {
    [4.15209]
    [4.15239]
    ) -> Result<Merkle, TagError> {
  • replacement in libpijul/src/tag.rs at line 366
    [4.15714][4.15714:15729]()
    state,
    [4.15714]
    [4.15729]
    state: state.clone(),
  • replacement in libpijul/src/tag.rs at line 372
    [4.15923][4.15923:15963]()
    let mut hasher = Hasher::default();
    [4.15923]
    [4.15963]
  • edit in libpijul/src/tag.rs at line 377
    [4.16149][4.16149:16178]()
    hasher.update(&off_buf);
  • edit in libpijul/src/tag.rs at line 379
    [4.16260][4.16260:16292]()
    hasher.update(&header_buf);
  • replacement in libpijul/src/tag.rs at line 381
    [4.16353][4.16353:16402]()
    hasher.update(&out);
    Ok(hasher.finish())
    [4.16353]
    [4.16402]
    Ok(state)
  • replacement in libpijul/src/tag/txn.rs at line 53
    [4.1336][2.142:228]()
    pub fn new<P: AsRef<std::path::Path>>(p: P, h: &Hash) -> Result<Self, TagError> {
    [4.1336]
    [4.1412]
    pub fn new<P: AsRef<std::path::Path>>(p: P, expected: &Merkle) -> Result<Self, TagError> {
  • edit in libpijul/src/tag/txn.rs at line 58
    [2.332]
    [2.332]
    if &header.state != expected {
    return Err(TagError::WrongHash {
    expected: *expected,
    got: header.state,
    })
    }
  • edit in libpijul/src/tag/txn.rs at line 68
    [2.415][2.415:437]()
    ch.check(h)?;
  • replacement in libpijul/src/tag/txn.rs at line 405
    [4.12692][4.12692:13093]()
    fn get_tags(
    &self,
    channel: &Self::Tags,
    c: &L64,
    ) -> Result<Option<&SerializedHash>, TxnErr<Self::GraphError>> {
    use crate::pristine::sanakirja::UDb;
    let db: UDb<L64, SerializedHash> = UDb::from_page(*channel);
    match ::sanakirja::btree::get(self, &db, c, None)? {
    Some((k, v)) if k == c => Ok(Some(v)),
    _ => Ok(None),
    [4.12692]
    [4.13093]
    type TagsCursor =
    ::sanakirja::btree::cursor::Cursor<L64, (), P<L64, ()>>;
    fn is_tagged(&self, tags: &Self::Tags, t: u64) -> Result<bool, TxnErr<Self::GraphError>> {
    use crate::pristine::sanakirja::Db;
    let db: Db<L64, ()> = Db::from_page(*tags);
    let t: L64 = t.into();
    match ::sanakirja::btree::get(self, &db, &t, None)? {
    Some((k, _)) => Ok(k == &t),
    _ => Ok(false)
  • edit in libpijul/src/tag/txn.rs at line 418
    [4.13110][4.13110:13222]()
    type TagsCursor =
    ::sanakirja::btree::cursor::Cursor<L64, SerializedHash, UP<L64, SerializedHash>>;
  • replacement in libpijul/src/tag/txn.rs at line 423
    [4.13339][4.13339:13429]()
    crate::pristine::Cursor<Self, &'txn Self, Self::TagsCursor, L64, SerializedHash>,
    [4.13339]
    [4.13429]
    crate::pristine::Cursor<Self, &'txn Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/tag/txn.rs at line 426
    [4.13471][4.13471:13585]()
    use crate::pristine::sanakirja::UDb;
    let db: UDb<L64, SerializedHash> = UDb::from_page(*channel);
    [4.13471]
    [4.13585]
    use crate::pristine::sanakirja::Db;
    let db: Db<L64, ()> = Db::from_page(*channel);
  • replacement in libpijul/src/tag/txn.rs at line 443
    [4.14025][4.14025:14102]()
    ) -> Result<Option<(&L64, &SerializedHash)>, TxnErr<Self::GraphError>> {
    [4.14025]
    [4.14102]
    ) -> Result<Option<&L64>, TxnErr<Self::GraphError>> {
  • replacement in libpijul/src/tag/txn.rs at line 445
    [4.14145][4.14145:14163]()
    Ok(x)
    [4.14145]
    [4.14163]
    Ok(x.map(|(a, _)| a))
  • replacement in libpijul/src/tag/txn.rs at line 454
    [4.14340][4.14340:14417]()
    ) -> Result<Option<(&L64, &SerializedHash)>, TxnErr<Self::GraphError>> {
    [4.14340]
    [4.14417]
    ) -> Result<Option<&L64>, TxnErr<Self::GraphError>> {
  • replacement in libpijul/src/tag/txn.rs at line 456
    [4.14460][4.14460:14478]()
    Ok(x)
    [4.14460]
    [4.14478]
    Ok(x.map(|(a, _)| a))
  • replacement in libpijul/src/tag/txn.rs at line 467
    [4.14675][4.14675:14760]()
    crate::pristine::Cursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    [4.14675]
    [4.14760]
    crate::pristine::Cursor<Self, &Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/tag/txn.rs at line 478
    [4.14973][4.14973:15061]()
    crate::pristine::RevCursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    [4.14973]
    [4.15061]
    crate::pristine::RevCursor<Self, &Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/tag/txn.rs at line 481
    [4.15103][4.15103:15217]()
    use crate::pristine::sanakirja::UDb;
    let db: UDb<L64, SerializedHash> = UDb::from_page(*channel);
    [4.15103]
    [4.15217]
    use crate::pristine::sanakirja::Db;
    let db: Db<L64, ()> = Db::from_page(*channel);
  • edit in libpijul/src/tag/txn.rs at line 640
    [4.19490]
    [4.19490]
    fn is_tagged(&self, tags: &Self::Tags, t: u64) -> Result<bool, TxnErr<Self::GraphError>> {
    self.tag.is_tagged(tags, t)
    }
  • edit in libpijul/src/tag/txn.rs at line 746
    [4.22648][4.22648:22841]()
    fn get_tags(
    &self,
    channel: &Self::Tags,
    c: &L64,
    ) -> Result<Option<&SerializedHash>, TxnErr<Self::GraphError>> {
    self.tag.get_tags(channel, c)
    }
  • replacement in libpijul/src/tag/txn.rs at line 752
    [4.23017][4.23017:23107]()
    crate::pristine::Cursor<Self, &'txn Self, Self::TagsCursor, L64, SerializedHash>,
    [4.23017]
    [4.23107]
    crate::pristine::Cursor<Self, &'txn Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/tag/txn.rs at line 760
    [4.23298][4.23298:23375]()
    ) -> Result<Option<(&L64, &SerializedHash)>, TxnErr<Self::GraphError>> {
    [4.23298]
    [4.23375]
    ) -> Result<Option<&L64>, TxnErr<Self::GraphError>> {
  • replacement in libpijul/src/tag/txn.rs at line 767
    [4.23503][4.23503:23580]()
    ) -> Result<Option<(&L64, &SerializedHash)>, TxnErr<Self::GraphError>> {
    [4.23503]
    [4.23580]
    ) -> Result<Option<&L64>, TxnErr<Self::GraphError>> {
  • replacement in libpijul/src/tag/txn.rs at line 776
    [4.23728][4.23728:23813]()
    crate::pristine::Cursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    [4.23728]
    [4.23813]
    crate::pristine::Cursor<Self, &Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/tag/txn.rs at line 787
    [4.24038][4.24038:24126]()
    crate::pristine::RevCursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    [4.24038]
    [4.24126]
    crate::pristine::RevCursor<Self, &Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/pristine/sanakirja.rs at line 726
    [4.70500][4.23047:23087]()
    pub tags: UDb<L64, SerializedHash>,
    [4.70500]
    [4.39127]
    pub tags: Db<L64, ()>,
  • replacement in libpijul/src/pristine/sanakirja.rs at line 926
    [4.23105][4.23105:23430]()
    type Tags = UDb<L64, SerializedHash>;
    fn get_tags(
    &self,
    channel: &Self::Tags,
    c: &L64,
    ) -> Result<Option<&SerializedHash>, TxnErr<Self::GraphError>> {
    match btree::get(&self.txn, channel, c, None)? {
    Some((k, v)) if k == c => Ok(Some(v)),
    _ => Ok(None),
    [4.23105]
    [4.23430]
    type Tags = Db<L64, ()>;
    fn is_tagged(&self, tags: &Self::Tags, t: u64) -> Result<bool, TxnErr<Self::GraphError>> {
    let t: L64 = t.into();
    match btree::get(&self.txn, tags, &t, None)? {
    Some((k, _)) => Ok(k == &t),
    _ => Ok(false)
  • replacement in libpijul/src/pristine/sanakirja.rs at line 937
    [4.23469][4.23469:23559]()
    ::sanakirja::btree::cursor::Cursor<L64, SerializedHash, UP<L64, SerializedHash>>;
    [4.23469]
    [4.23559]
    ::sanakirja::btree::cursor::Cursor<L64, (), P<L64, ()>>;
  • replacement in libpijul/src/pristine/sanakirja.rs at line 943
    [4.23676][4.23676:23766]()
    crate::pristine::Cursor<Self, &'txn Self, Self::TagsCursor, L64, SerializedHash>,
    [4.23676]
    [4.23766]
    crate::pristine::Cursor<Self, &'txn Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/pristine/sanakirja.rs at line 961
    [4.24249][4.24249:24326]()
    ) -> Result<Option<(&L64, &SerializedHash)>, TxnErr<Self::GraphError>> {
    [4.24249]
    [4.24326]
    ) -> Result<Option<&L64>, TxnErr<Self::GraphError>> {
  • replacement in libpijul/src/pristine/sanakirja.rs at line 963
    [4.24374][4.24374:24392]()
    Ok(x)
    [4.24374]
    [4.24392]
    Ok(x.map(|(a, _)| a))
  • replacement in libpijul/src/pristine/sanakirja.rs at line 972
    [4.24562][4.24562:24639]()
    ) -> Result<Option<(&L64, &SerializedHash)>, TxnErr<Self::GraphError>> {
    [4.24562]
    [4.24639]
    ) -> Result<Option<&L64>, TxnErr<Self::GraphError>> {
  • replacement in libpijul/src/pristine/sanakirja.rs at line 974
    [4.24687][4.24687:24705]()
    Ok(x)
    [4.24687]
    [4.24705]
    Ok(x.map(|(a, _)| a))
  • replacement in libpijul/src/pristine/sanakirja.rs at line 985
    [4.2184][4.2184:2259]()
    super::Cursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    [4.2184]
    [4.2259]
    super::Cursor<Self, &Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/pristine/sanakirja.rs at line 996
    [4.2472][4.2472:2550]()
    super::RevCursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    [4.2472]
    [4.2550]
    super::RevCursor<Self, &Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1174
    [4.26643][4.26643:26702]()
    tags: UDb::from_page(tup.tags.into()),
    [4.26643]
    [4.26702]
    tags: Db::from_page(tup.tags.into()),
  • edit in libpijul/src/pristine/sanakirja.rs at line 1731
    [4.25300][4.25300:25318]()
    h: &Hash,
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1732
    [4.25366][4.25366:25443]()
    btree::put(&mut self.txn, &mut channel.tags, &t.into(), &h.into())?;
    [4.25366]
    [4.25443]
    btree::put(&mut self.txn, &mut channel.tags, &t.into(), &())?;
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1838
    [4.28817][4.28817:28882]()
    tags: UDb::from_page(b.tags.into()),
    [4.28817]
    [4.28882]
    tags: Db::from_page(b.tags.into()),
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1983
    [4.30119][4.30119:30173]()
    UDb::from_page(chan.tags.into()),
    [4.30119]
    [4.1017]
    Db::from_page(chan.tags.into()),
  • replacement in libpijul/src/pristine/sanakirja.rs at line 2188
    [4.31856][4.31856:31913]()
    tags: UDb::from_page(c.tags.into()),
    [4.31856]
    [4.31913]
    tags: Db::from_page(c.tags.into()),
  • replacement in libpijul/src/pristine/mod.rs at line 451
    [4.26541][4.26541:26688]()
    fn get_tags(
    &self,
    channel: &Self::Tags,
    c: &L64,
    ) -> Result<Option<&SerializedHash>, TxnErr<Self::GraphError>>;
    [4.26541]
    [4.26688]
    fn is_tagged(&self, tags: &Self::Tags, t: u64) -> Result<bool, TxnErr<Self::GraphError>>;
  • replacement in libpijul/src/pristine/mod.rs at line 459
    [4.26829][4.26829:26919]()
    crate::pristine::Cursor<Self, &'txn Self, Self::TagsCursor, L64, SerializedHash>,
    [4.26829]
    [4.26919]
    crate::pristine::Cursor<Self, &'txn Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/pristine/mod.rs at line 466
    [4.27039][4.27039:27115]()
    ) -> Result<Option<(&L64, &SerializedHash)>, TxnErr<Self::GraphError>>;
    [4.27039]
    [4.27115]
    ) -> Result<Option<&L64>, TxnErr<Self::GraphError>>;
  • replacement in libpijul/src/pristine/mod.rs at line 471
    [4.27195][4.27195:27271]()
    ) -> Result<Option<(&L64, &SerializedHash)>, TxnErr<Self::GraphError>>;
    [4.27195]
    [4.3106]
    ) -> Result<Option<&L64>, TxnErr<Self::GraphError>>;
  • replacement in libpijul/src/pristine/mod.rs at line 477
    [4.3189][4.2544:2647]()
    ) -> Result<Cursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>, TxnErr<Self::GraphError>>;
    [4.3189]
    [4.3315]
    ) -> Result<Cursor<Self, &Self, Self::TagsCursor, L64, ()>, TxnErr<Self::GraphError>>;
  • replacement in libpijul/src/pristine/mod.rs at line 484
    [4.3427][4.3427:3498]()
    RevCursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    [4.3427]
    [4.3498]
    RevCursor<Self, &Self, Self::TagsCursor, L64, ()>,
  • replacement in libpijul/src/pristine/mod.rs at line 1501
    [4.22745][4.3540:3690](),[4.68729][4.3540:3690]()
    initialized_cursor!(tags, L64, SerializedHash, ChannelTxnT, GraphError);
    initialized_rev_cursor!(tags, L64, SerializedHash, ChannelTxnT, GraphError);
    [4.22745]
    [4.621548]
    impl<'a, T: ChannelTxnT> Iterator for crate::pristine::RevCursor<T, &'a T, T::TagsCursor, L64, ()>
    {
    type Item = Result<&'a L64, TxnErr<T::GraphError>>;
    fn next(&mut self) -> Option<Self::Item> {
    match self.txn.cursor_tags_prev(&mut self.cursor) {
    Ok(Some(x)) => Some(Ok(x)),
    Ok(None) => None,
    Err(e) => Some(Err(e)),
    }
    }
    }
    impl<'a, T: ChannelTxnT>
    crate::pristine::Cursor<T, &'a T, T::TagsCursor, L64, ()>
    {
    pub fn prev(&mut self) -> Option<Result<u64, TxnErr<T::GraphError>>> {
    match self.txn.cursor_tags_prev(&mut self.cursor) {
    Ok(Some(x)) => Some(Ok((*x).into())),
    Ok(None) => None,
    Err(e) => Some(Err(e)),
    }
    }
    }
    impl<'a, T: ChannelTxnT> Iterator for crate::pristine::Cursor<T, &'a T, T::TagsCursor, L64, ()>
    {
    type Item = Result<u64, TxnErr<T::GraphError>>;
    fn next(&mut self) -> Option<Self::Item> {
    match self.txn.cursor_tags_next(&mut self.cursor) {
    Ok(Some(x)) => Some(Ok((*x).into())),
    Ok(None) => None,
    Err(e) => Some(Err(e)),
    }
    }
    }
  • edit in libpijul/src/pristine/mod.rs at line 1789
    [4.27411][4.27411:27429]()
    h: &Hash,
  • replacement in libpijul/src/changestore/filesystem.rs at line 3
    [4.824124][4.824124:824179]()
    use crate::pristine::{Base32, ChangeId, Hash, Vertex};
    [4.824124]
    [4.1356]
    use crate::pristine::{Base32, ChangeId, Hash, Vertex, Merkle};
  • edit in libpijul/src/changestore/filesystem.rs at line 41
    [4.824742]
    [4.824742]
    }
    pub fn push_tag_filename(changes_dir: &mut PathBuf, hash: &Merkle) {
    let h32 = hash.to_base32();
    let (a, b) = h32.split_at(2);
    changes_dir.push(a);
    changes_dir.push(b);
    changes_dir.set_extension("tag");