Tags: completing the subcommand

[?]
May 5, 2021, 8:37 PM
AAXP2534BWX2ZUDZZHUMLYDBMGFGUH32CNRA3KOLER3JKOIJUZLAC

Dependencies

  • [2] QL6K2ZM3 Tags
  • [3] VU4KVXHW Git import was importing parents and hidden files (including .git), in some cases
  • [4] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [5] YN63NUZO Sanakirja 1.0
  • [6] 5BRU2RRW Cleanup (debugging a crash related to trees/inodes)
  • [7] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [8] I24UEJQL Various post-fire fixes
  • [*] GHO6DWPI Refactoring iterators
  • [*] 3AMEP2Y5 More convenient interface for channels
  • [*] HSVGP2G4 Version bump + formatting

Change contents

  • replacement in pijul/src/commands/tag.rs at line 19
    [2.628][2.628:652]()
    subcmd: SubCommand,
    [2.628]
    [2.652]
    subcmd: Option<SubCommand>,
  • replacement in pijul/src/commands/tag.rs at line 54
    [2.1679][2.1679:1712]()
    SubCommand::Create {
    [2.1679]
    [2.1712]
    Some(SubCommand::Create {
  • replacement in pijul/src/commands/tag.rs at line 59
    [2.1813][2.1813:1832]()
    } => {
    [2.1813]
    [2.1832]
    }) => {
  • replacement in pijul/src/commands/tag.rs at line 95
    [2.3533][2.3533:3591]()
    SubCommand::Checkout { tag, to_channel } => {
    [2.3533]
    [2.3591]
    Some(SubCommand::Checkout { tag, to_channel }) => {
  • edit in pijul/src/commands/tag.rs at line 116
    [2.4565]
    [2.4565]
    writeln!(stdout, "Tag {} restored as channel {}", tag, channel_name)?;
  • edit in pijul/src/commands/tag.rs at line 118
    [2.4579]
    [2.4579]
    None => {
    let channel_name = repo
    .config
    .get_current_channel(None)
    .0
    .to_string();
    let txn = repo.pristine.txn_begin()?;
    let channel = if let Some(c) = txn.load_channel(&channel_name)? {
    c
    } else {
    bail!("Channel {:?} not found", channel_name)
    };
    let mut tag_path = repo.path.join(libpijul::DOT_DIR);
    tag_path.push("tags");
    super::pager();
    for t in txn.rev_iter_tags(txn.tags(&*channel.read()?), None)? {
    let (_, h) = t?;
    let h: libpijul::Hash = h.into();
    libpijul::changestore::filesystem::push_filename(&mut tag_path, &h);
    let mut f = libpijul::tag::OpenTagFile::open(&tag_path)?;
    let header = f.header()?;
    writeln!(stdout, "Tag {}", h.to_base32())?;
    writeln!(stdout, "Author: {:?}", header.authors)?;
    writeln!(stdout, "Date: {}", header.timestamp)?;
    writeln!(stdout, "State: {}", f.state().to_base32())?;
    writeln!(stdout, "\n {}\n", header.message)?;
    }
    }
  • edit in pijul/src/commands/git.rs at line 620
    [3.178]
    [3.178]
    debug!("t = {:?}", t.name());
  • edit in libpijul/src/tag.rs at line 69
    [2.8008]
    [2.8008]
    }
    pub fn header(&mut self) -> Result<crate::change::ChangeHeader, TagError> {
    use std::io::{Seek, SeekFrom};
    self.file.seek(SeekFrom::Start(self.header.header))?;
    Ok(bincode::deserialize_from(&mut self.file)?)
  • edit in libpijul/src/tag.rs at line 76
    [2.8014]
    [2.8014]
    pub fn state(&self) -> Merkle {
    self.header.state.clone()
    }
  • edit in libpijul/src/pristine/sanakirja.rs at line 687
    [10.39779]
    [10.39779]
    fn tags<'a>(&self, channel: &'a Self::Channel) -> &'a Self::Tags {
    &channel.tags
    }
  • edit in libpijul/src/pristine/sanakirja.rs at line 909
    [10.43991]
    [4.41048]
    fn iter_tags(
    &self,
    channel: &Self::Tags,
    from: u64,
    ) -> Result<
    super::Cursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    TxnErr<Self::GraphError>,
    > {
    self.cursor_tags(channel, Some(from.into()))
    }
    fn rev_iter_tags(
    &self,
    channel: &Self::Tags,
    from: Option<u64>,
    ) -> Result<
    super::RevCursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    TxnErr<Self::GraphError>,
    > {
    let mut cursor = btree::cursor::Cursor::new(&self.txn, channel)?;
    if let Some(from) = from {
    cursor.set(&self.txn, &from.into(), None)?;
    } else {
    cursor.set_last(&self.txn)?;
    };
    Ok(RevCursor {
    cursor,
    txn: self,
    k: std::marker::PhantomData,
    v: std::marker::PhantomData,
    t: std::marker::PhantomData,
    })
    }
  • edit in libpijul/src/pristine/mod.rs at line 269
    [11.2877]
    [12.893]
    fn tags<'a>(&self, channel: &'a Self::Channel) -> &'a Self::Tags;
  • edit in libpijul/src/pristine/mod.rs at line 360
    [2.26960]
    [2.26960]
  • edit in libpijul/src/pristine/mod.rs at line 370
    [2.27271]
    [10.51831]
    fn iter_tags(
    &self,
    channel: &Self::Tags,
    from: u64,
    ) -> Result<
    Cursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    TxnErr<Self::GraphError>,
    >;
    fn rev_iter_tags(
    &self,
    channel: &Self::Tags,
    from: Option<u64>,
    ) -> Result<
    RevCursor<Self, &Self, Self::TagsCursor, L64, SerializedHash>,
    TxnErr<Self::GraphError>,
    >;
  • edit in libpijul/src/pristine/mod.rs at line 1290
    [4.68648][4.70131:70159]()
    // #[cfg(debug_assertions)]
  • edit in libpijul/src/pristine/mod.rs at line 1291
    [4.68729]
    [4.621548]
    initialized_cursor!(tags, L64, SerializedHash, ChannelTxnT, GraphError);
    initialized_rev_cursor!(tags, L64, SerializedHash, ChannelTxnT, GraphError);