Tags: completing the subcommand
[?]
May 5, 2021, 8:37 PM
AAXP2534BWX2ZUDZZHUMLYDBMGFGUH32CNRA3KOLER3JKOIJUZLACDependencies
- [2]
QL6K2ZM3Tags - [3]
VU4KVXHWGit import was importing parents and hidden files (including .git), in some cases - [4]
CCLLB7OIUpgrading to Sanakirja 0.15 + version bump - [5]
5BRU2RRWCleanup (debugging a crash related to trees/inodes) - [6]
SXEYMYF7Fixing the bad changes in history (unfortunately, by rebooting). - [7]
YN63NUZOSanakirja 1.0 - [8]
I24UEJQLVarious post-fire fixes - [*]
GHO6DWPIRefactoring iterators - [*]
3AMEP2Y5More convenient interface for channels - [*]
HSVGP2G4Version bump + formatting
Change contents
- replacement in pijul/src/commands/tag.rs at line 19
subcmd: SubCommand,subcmd: Option<SubCommand>, - replacement in pijul/src/commands/tag.rs at line 54
SubCommand::Create {Some(SubCommand::Create { - replacement in pijul/src/commands/tag.rs at line 59
} => {}) => { - replacement in pijul/src/commands/tag.rs at line 95
SubCommand::Checkout { tag, to_channel } => {Some(SubCommand::Checkout { tag, to_channel }) => { - edit in pijul/src/commands/tag.rs at line 116
writeln!(stdout, "Tag {} restored as channel {}", tag, channel_name)?; - edit in pijul/src/commands/tag.rs at line 118
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
debug!("t = {:?}", t.name()); - edit in libpijul/src/tag.rs at line 69
}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
pub fn state(&self) -> Merkle {self.header.state.clone()} - edit in libpijul/src/pristine/sanakirja.rs at line 687
fn tags<'a>(&self, channel: &'a Self::Channel) -> &'a Self::Tags {&channel.tags} - edit in libpijul/src/pristine/sanakirja.rs at line 909
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
- edit in libpijul/src/pristine/mod.rs at line 370
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
// #[cfg(debug_assertions)] - edit in libpijul/src/pristine/mod.rs at line 1291
initialized_cursor!(tags, L64, SerializedHash, ChannelTxnT, GraphError);initialized_rev_cursor!(tags, L64, SerializedHash, ChannelTxnT, GraphError);