Simpler channel iterator

pmeunier
Dec 5, 2021, 8:49 PM
LLBKJA6YL3R5GWU5E2WRKACD3CVME2LCTVWBOAZF6IFEBZJHQFCQC

Dependencies

  • [2] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [3] FXEDPLRI Resurrecting tests, and type cleanup (no need for Arc<RwLock<…>> anymore)
  • [4] L5JW24DB Channel drops were not checking whether forks done in the same transaction before dropping unused patches
  • [5] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [6] A3RM526Y Integrating identity malleability
  • [7] VQPAUKBQ channel switch as an alias to reset
  • [8] RRCSHAYZ Formatting
  • [9] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [10] 5OGOE4VW Store the current channel in the pristine
  • [11] YN63NUZO Sanakirja 1.0
  • [12] NGCTMCDP cleaning up the deps and revdeps of unused changes after a channel drop
  • [13] G6YXRFH2 Channel drop with tags
  • [14] I24UEJQL Various post-fire fixes
  • [15] QL6K2ZM3 Tags

Change contents

  • replacement in libpijul/src/pristine/sanakirja.rs at line 1316
    [5.25125][5.47694:47722](),[5.27704][5.47694:47722](),[5.79139][5.47694:47722](),[5.551813][5.47694:47722]()
    fn iter_channels<'txn>(
    [5.27704]
    [5.47722]
    fn channels<'txn>(
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1319
    [5.47763][5.47763:47836]()
    ) -> Result<ChannelIterator<'txn, Self>, TxnErr<Self::GraphError>> {
    [5.47763]
    [5.551898]
    ) -> Result<Vec<ChannelRef<Self>>, TxnErr<Self::GraphError>> {
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1323
    [5.79266][5.79266:79316]()
    Ok(ChannelIterator { cursor, txn: self })
    [5.79266]
    [5.552158]
    while let Ok(Some((name, _))) = self.cursor_channels_next(&mut cursor) {
    self.load_channel(name.as_str())?;
    }
    Ok(self
    .open_channels
    .lock()
    .iter()
    .map(|(_, x)| x.clone())
    .collect())
  • replacement in libpijul/src/pristine/sanakirja.rs at line 1967
    [4.151][4.151:664]()
    let mut it0 = self.iter_channels("").map_err(|e| e.0)?;
    let it1 = self.open_channels.lock();
    let mut it1 = it1.iter();
    loop {
    let (name, chan) = if let Some(chan) = it0.next() {
    chan.map_err(|e| e.0)?
    } else if let Some((name, chan)) = it1.next() {
    (name.as_ref(), chan.clone())
    } else {
    break
    };
    [4.151]
    [4.664]
    for chan in self.channels("").map_err(|e| e.0)? {
  • edit in libpijul/src/pristine/sanakirja.rs at line 1969
    [4.739][5.136:190](),[5.285][5.136:190]()
    assert_ne!(name.as_str(), name0);
  • edit in libpijul/src/pristine/sanakirja.rs at line 1970
    [3.99702]
    [5.2052]
    assert_ne!(chan.name.as_str(), name0);
  • replacement in libpijul/src/pristine/mod.rs at line 648
    [5.592225][5.58709:58737]()
    fn iter_channels<'txn>(
    [5.592225]
    [5.58737]
    fn channels<'txn>(
  • replacement in libpijul/src/pristine/mod.rs at line 651
    [5.58778][5.58778:58850]()
    ) -> Result<ChannelIterator<'txn, Self>, TxnErr<Self::GraphError>>;
    [5.58778]
    [5.600373]
    ) -> Result<Vec<ChannelRef<Self>>, TxnErr<Self::GraphError>>;
  • replacement in libpijul/src/unrecord/mod.rs at line 123
    [3.933][5.23537:23576](),[5.29942][5.23537:23576](),[5.233731][5.23537:23576](),[5.23576][5.29943:30022]()
    for br in txn.iter_channels("")? {
    let (name, br) = br?;
    if name.as_str() == txn.name(&channel) {
    [3.933]
    [5.30022]
    for br in txn.channels("")? {
    let br = br.read();
    if txn.name(&br) == txn.name(&channel) {
  • edit in libpijul/src/unrecord/mod.rs at line 128
    [5.30054][3.934:962]()
    let br = br.read();
  • replacement in pijul/src/commands/channel.rs at line 45
    [5.3916][5.18688:18744](),[5.187789][5.18688:18744](),[5.18744][5.23141:23190]()
    for channel in txn.iter_channels("")? {
    let (_, channel) = channel?;
    [5.3916]
    [2.17354]
    for channel in txn.channels("")? {