Allowing vertex buffer to use references to the transaction, by changing `output::output` to take an ArcTxn<T> instead of a simple T

pmeunier
Apr 29, 2022, 9:06 AM
YXAVFTPP2PQAYMKGQH7QNKFVGKDI2UHVWB7SIDA4QEYSBP75ZGUQC

Dependencies

  • [2] VPENMXMZ Using prefixes of the base32 of external hashes instead of full internal hashes
  • [3] PXR7LQ26 Resurrecting known deleted files instead of re-adding them (this is needed after `tag reset`)
  • [4] 3X5ZCEPZ Fixing a panic when `pijul archive` does not find the channel
  • [5] YHG37GA4 Removing one buffer copy in VertexBuffer
  • [6] G55Y75FU Avoiding deadlocks when using output.rs with a non-filesystem output
  • [7] OWCCRVO5 Fixing a broken pipe in credit
  • [8] 5OGOE4VW Store the current channel in the pristine
  • [9] Z6FWHKCA Improving the UI around zombie conflicts
  • [10] JL4WKA5P Implement the Sanakirja concurrency model in a cross-process way
  • [11] L4JXJHWX pijul/*: reorganize imports and remove extern crate
  • [12] FBZ6LBF3 Permissions in archives (since we do not store full permissions anymore)
  • [13] VO5OQW4W Removing anyhow in libpijul
  • [14] NLGQAH4H Credit and reset relative to current directory instead of the root
  • [15] Y6EVFMTA Don't output files if they aren't in the current channel
  • [16] 2K7JLB4Z No pager on Windows
  • [17] 2UTQVDLP Do not create an archive if the prefix is absolute
  • [18] YRBOKAWJ Formatting (why wasn't this recorded before? I'm not sure)
  • [19] ZBNKSYA6 Fixing a bus error when starting a transaction on a full disk
  • [20] WW2EOFBB Umask in archives
  • [21] 27PYHR6L Making the get_latest_touch function (useful to make archives) public in libpijul
  • [22] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [23] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [24] VYHHOEYH Versions and formatting
  • [25] EUZFFJSO Updating Pijul with the latest changes in Libpijul
  • [26] SECWDBUH Adding empty directories to archives
  • [27] I24UEJQL Various post-fire fixes
  • [28] FXEDPLRI Resurrecting tests, and type cleanup (no need for Arc<RwLock<…>> anymore)
  • [29] PIQCNEEB Upgrading to Clap 3.0.0-alpha.5
  • [30] RMDMAYRX Adding a root inode (aka supporting submodules)
  • [31] GA3P7FOM Nicer conflict markers
  • [32] ZDK3GNDB Tag transactions (including a massive refactoring of errors)
  • [33] I3OVP3NH Archive: set the accurate and deterministic mtime
  • [34] GLMOA3PF More edges in "credit"
  • [35] GHO6DWPI Refactoring iterators
  • [36] 3AMEP2Y5 More convenient interface for channels
  • [37] IIV3EL2X Cleanup, formatting, and fixing the Git feature
  • [38] A3RM526Y Integrating identity malleability
  • [39] OY3CGEHQ Early stop in the diff algorithms for diff --short
  • [40] ZSF3YFZT encoded file deletion
  • [41] YN63NUZO Sanakirja 1.0
  • [42] I52XSRUH Massive cleanup, and simplification
  • [43] I7VL7VPZ Minor cleanup
  • [44] 2RXOCWUW Making libpijul deterministic (and getting rid of `rand`)
  • [45] 5SLOJYHG Fixing the Git feature
  • [46] C4MJ7D7Q Verbose printing of conflicts to stderr
  • [47] BZSC7VMY address clippy lints
  • [48] YCEZL7VF Moving to temporary paths when outputting
  • [*] XR7MNOMU file encoding in updates

Change contents

  • replacement in pijul/src/remote/mod.rs at line 936
    [7.61269][7.0:63](),[7.63][7.8957:9035](),[7.61331][7.8957:9035](),[7.9035][7.0:100]()
    let mut txn = l.pristine.mut_txn_begin()?;
    let mut channel = txn.load_channel(&l.channel)?.unwrap();
    txn.archive_with_state(&changes, &mut channel, &state, extra, &mut tarball, 0)?
    [7.61269]
    [7.61504]
    let txn = l.pristine.arc_txn_begin()?;
    let channel = {
    let txn = txn.read();
    txn.load_channel(&l.channel)?.unwrap()
    };
    txn.archive_with_state(&changes, &channel, &state, extra, &mut tarball, 0)?
  • replacement in pijul/src/remote/mod.rs at line 943
    [7.61529][7.61529:61584](),[7.61584][7.9036:9110]()
    let txn = l.pristine.txn_begin()?;
    let channel = txn.load_channel(&l.channel)?.unwrap();
    [7.61529]
    [7.61657]
    let txn = l.pristine.arc_txn_begin()?;
    let channel = {
    let txn = txn.read();
    txn.load_channel(&l.channel)?.unwrap()
    };
  • replacement in pijul/src/commands/reset.rs at line 86
    [7.99469][7.3852:3915]()
    &*txn.read(),
    &channel.read(),
    [7.99469]
    [7.99495]
    &txn,
    &channel,
  • replacement in pijul/src/commands/protocol.rs at line 297
    [7.12446][7.12446:12529]()
    txn.read().archive(&repo.changes, &channel, &mut tarball)?
    [7.12446]
    [7.131952]
    txn.archive(&repo.changes, &channel, &mut tarball)?
  • replacement in pijul/src/commands/protocol.rs at line 305
    [7.132242][7.12530:12581](),[7.12581][7.132242:132314](),[7.132242][7.132242:132314]()
    let mut txn = txn.write();
    let mut fork = txn.fork(&channel, &fork_name)?;
    [7.132242]
    [7.132314]
    let mut fork = {
    let mut txn = txn.write();
    txn.fork(&channel, &fork_name)?
    };
  • replacement in pijul/src/commands/protocol.rs at line 317
    [7.132601][7.132601:132656]()
    txn.drop_channel(&fork_name)?;
    [7.132601]
    [7.132656]
    txn.write().drop_channel(&fork_name)?;
  • replacement in pijul/src/commands/protocol.rs at line 321
    [7.132737][7.12582:12662]()
    txn.write().archive(&repo.changes, &channel, &mut tarball)?
    [7.132737]
    [7.132809]
    txn.archive(&repo.changes, &channel, &mut tarball)?
  • replacement in pijul/src/commands/credit.rs at line 29
    [7.3572][7.179302:179348](),[7.13643][7.179302:179348](),[7.15812][7.179302:179348](),[7.24306][7.179302:179348](),[7.179302][7.179302:179348]()
    let txn = repo.pristine.txn_begin()?;
    [7.24306]
    [7.3573]
    let txn_ = repo.pristine.arc_txn_begin()?;
    let txn = txn_.read();
  • replacement in pijul/src/commands/credit.rs at line 54
    [7.237][7.16703:16741]()
    let channel = channel.read();
    [7.237]
    [7.0]
    std::mem::drop(txn);
  • replacement in pijul/src/commands/credit.rs at line 57
    [7.180336][7.22252:22270]()
    &txn,
    [7.180336]
    [7.180336]
    &txn_,
  • replacement in pijul/src/commands/credit.rs at line 60
    [7.180375][7.22271:22338]()
    &mut Creditor::new(std::io::stdout(), &txn, &channel),
    [7.180375]
    [7.46]
    &mut Creditor::new(std::io::stdout(), txn_.clone(), channel.clone()),
  • replacement in pijul/src/commands/credit.rs at line 75
    [7.180479][7.18260:18321]()
    pub struct Creditor<'a, W: std::io::Write, T: ChannelTxnT> {
    [7.180479]
    [7.180533]
    pub struct Creditor<W: std::io::Write, T: ChannelTxnT> {
  • replacement in pijul/src/commands/credit.rs at line 80
    [2.28][7.180613:180629](),[7.180613][7.180613:180629](),[7.180629][7.844:873]()
    txn: &'a T,
    channel: &'a T::Channel,
    [2.28]
    [7.180658]
    txn: ArcTxn<T>,
    channel: ChannelRef<T>,
  • replacement in pijul/src/commands/credit.rs at line 84
    [7.180661][7.18322:18387](),[7.18387][7.874:942]()
    impl<'a, W: std::io::Write, T: ChannelTxnT> Creditor<'a, W, T> {
    pub fn new(w: W, txn: &'a T, channel: &'a T::Channel) -> Self {
    [7.180661]
    [7.180787]
    impl<W: std::io::Write, T: ChannelTxnT> Creditor<W, T> {
    pub fn new(w: W, txn: ArcTxn<T>, channel: ChannelRef<T>) -> Self {
  • replacement in pijul/src/commands/credit.rs at line 97
    [7.180972][7.6081:6159]()
    impl<'a, W: std::io::Write, T: TxnTExt> VertexBuffer for Creditor<'a, W, T> {
    [7.180972]
    [5.0]
    impl<W: std::io::Write, T: TxnTExt> VertexBuffer for Creditor<W, T> {
  • replacement in pijul/src/commands/credit.rs at line 112
    [7.181426][7.181426:181558]()
    for e in self
    .txn
    .iter_adjacent(self.channel, v, EdgeFlags::PARENT, EdgeFlags::all())
    [7.181426]
    [7.18388]
    let txn = self.txn.read();
    let channel = self.channel.read();
    for e in txn
    .iter_adjacent(&channel, v, EdgeFlags::PARENT, EdgeFlags::all())
  • replacement in pijul/src/commands/credit.rs at line 122
    [7.18546][2.29:114]()
    if let Ok(Some(intro)) = self.txn.get_external(&e.introduced_by()) {
    [7.18546]
    [2.114]
    if let Ok(Some(intro)) = txn.get_external(&e.introduced_by()) {
  • replacement in pijul/src/commands/archive.rs at line 5
    [7.1637][7.6427:6484](),[7.3169][7.6427:6484]()
    use libpijul::{Hash, Merkle, MutTxnTExt, TxnT, TxnTExt};
    [7.1637]
    [7.3252]
    use libpijul::{Hash, Merkle, TxnT};
  • replacement in pijul/src/commands/archive.rs at line 114
    [7.193436][7.1023:1085](),[7.1085][7.4392:4586]()
    let mut txn = repo.pristine.mut_txn_begin()?;
    let channel_name = if let Some(ref c) = self.channel {
    c
    } else {
    txn.current_channel().unwrap_or(crate::DEFAULT_CHANNEL)
    [7.193436]
    [7.4586]
    let txn = repo.pristine.arc_txn_begin()?;
    let channel = {
    let txn = txn.read();
    let channel_name = if let Some(ref c) = self.channel {
    c
    } else {
    txn.current_channel().unwrap_or(crate::DEFAULT_CHANNEL)
    };
    txn.load_channel(&channel_name)?.unwrap()
  • edit in pijul/src/commands/archive.rs at line 124
    [7.1085][7.19221:19298](),[7.4605][7.19221:19298](),[7.193497][7.19221:19298]()
    let mut channel = txn.load_channel(&channel_name)?.unwrap();
  • replacement in pijul/src/commands/archive.rs at line 126
    [7.193648][7.193648:193682]()
    &mut channel,
    [7.193648]
    [7.14173]
    &channel,
  • replacement in pijul/src/commands/archive.rs at line 133
    [7.193815][7.193815:193869](),[7.193869][7.4606:4800]()
    let txn = repo.pristine.txn_begin()?;
    let channel_name = if let Some(ref c) = self.channel {
    c
    } else {
    txn.current_channel().unwrap_or(crate::DEFAULT_CHANNEL)
    [7.193815]
    [7.4800]
    let txn = repo.pristine.arc_txn_begin()?;
    let channel = {
    let txn = txn.read();
    let channel_name = if let Some(ref c) = self.channel {
    c
    } else {
    txn.current_channel().unwrap_or(crate::DEFAULT_CHANNEL)
    };
    if let Some(channel) = txn.load_channel(&channel_name)? {
    channel
    } else {
    bail!("No such channel: {:?}", channel_name);
    }
  • replacement in pijul/src/commands/archive.rs at line 147
    [7.4819][4.0:255]()
    if let Some(channel) = txn.load_channel(&channel_name)? {
    txn.archive(&repo.changes, &channel, &mut tarball)?
    } else {
    bail!("No such channel: {:?}", channel_name);
    }
    [7.4819]
    [7.194009]
    txn.archive(&repo.changes, &channel, &mut tarball)?
  • replacement in libpijul/src/record.rs at line 907
    [7.500045][7.98128:98198](),[7.98198][3.40:93](),[3.93][7.6768:6853](),[7.6768][7.6768:6853]()
    let txn_ = txn.read();
    let channel_ = channel.read();
    let (former_parents, is_deleted, encoding) =
    collect_former_parents::<C, W, T>(changes, &*txn_, &*channel_, vertex)?;
    [7.499882]
    [7.501222]
    let (former_parents, is_deleted, encoding) = {
    let txn_ = txn.read();
    let channel_ = channel.read();
    collect_former_parents::<C, W, T>(changes, &*txn_, &*channel_, vertex)?
    };
  • replacement in libpijul/src/record.rs at line 918
    [7.6890][7.6890:6914]()
    &*txn_,
    [7.6890]
    [7.6914]
    txn,
  • replacement in libpijul/src/record.rs at line 922
    [7.6972][7.6972:7000]()
    &*channel_,
    [7.6972]
    [7.7000]
    channel,
  • edit in libpijul/src/record.rs at line 935
    [7.503210]
    [7.28919]
    let txn_ = txn.read();
    let channel_ = channel.read();
  • replacement in libpijul/src/record.rs at line 951
    [7.7491][7.7491:7508]()
    txn: &T,
    [7.7491]
    [7.7508]
    txn: &ArcTxn<T>,
  • replacement in libpijul/src/record.rs at line 955
    [7.7589][7.7589:7619]()
    channel: &T::Channel,
    [7.7589]
    [7.7619]
    channel: &ChannelRef<T>,
  • edit in libpijul/src/record.rs at line 979
    [3.681]
    [3.681]
    let txn = txn.read();
    let channel = channel.read();
  • replacement in libpijul/src/record.rs at line 983
    [3.753][3.753:799]()
    txn,
    channel,
    [3.753]
    [3.799]
    &*txn,
    &*channel,
  • edit in libpijul/src/record.rs at line 997
    [7.8323]
    [7.8323]
    let txn = txn.read();
    let channel = channel.read();
  • replacement in libpijul/src/record.rs at line 1001
    [7.2335][7.8371:8417]()
    txn,
    channel,
    [7.2335]
    [7.8417]
    &*txn,
    &*channel,
  • replacement in libpijul/src/record.rs at line 1011
    [7.8626][7.8626:8720]()
    || modified_since_last_commit(txn, channel, &working_copy, &item.full_path)?)
    [7.8626]
    [7.8720]
    || modified_since_last_commit(
    &*txn.read(),
    &*channel.read(),
    &working_copy,
    &item.full_path,
    )?)
  • replacement in libpijul/src/record.rs at line 1018
    [7.8730][7.8730:8800]()
    let mut ret = retrieve(txn, txn.graph(channel), vertex)?;
    [7.8730]
    [7.8800]
    let mut ret = {
    let txn = txn.read();
    let channel = channel.read();
    retrieve(&*txn, txn.graph(&*channel), vertex)?
    };
  • replacement in libpijul/src/output/output.rs at line 649
    [7.26402][6.158:368]()
    {
    let txn = txn.read();
    let channel = channel.read();
    alive::output_graph(changes, &*txn, &*channel, &mut f, &mut l, forward)
    .map_err(PristineOutputError::from)?;
    }
    [7.26402]
    [7.26524]
    alive::output_graph(changes, &txn, &channel, &mut f, &mut l, forward)
    .map_err(PristineOutputError::from)?;
  • replacement in libpijul/src/output/mod.rs at line 316
    [7.82736][7.82736:82775]()
    txn: &T,
    channel: &T::Channel,
    [7.82736]
    [7.82775]
    txn: &ArcTxn<T>,
    channel: &ChannelRef<T>,
  • replacement in libpijul/src/output/mod.rs at line 322
    [7.82908][7.82908:83077]()
    let mut graph = crate::alive::retrieve(&*txn, txn.graph(&*channel), v0)?;
    crate::alive::output_graph(changes, &*txn, &*channel, out, &mut graph, &mut forward)?;
    [7.82908]
    [7.83077]
    let mut graph = {
    let txn = txn.read();
    let channel = channel.read();
    crate::alive::retrieve(&*txn, txn.graph(&*channel), v0)?
    };
    crate::alive::output_graph(changes, txn, channel, out, &mut graph, &mut forward)?;
  • replacement in libpijul/src/output/archive.rs at line 150
    [7.692279][7.692279:692292]()
    txn: &T,
    [7.692279]
    [7.692292]
    txn: &ArcTxn<T>,
  • edit in libpijul/src/output/archive.rs at line 155
    [7.32374][7.103479:103513](),[7.88013][7.103479:103513]()
    let channel = channel.read();
  • replacement in libpijul/src/output/archive.rs at line 159
    [7.692602][7.692602:692654](),[7.692654][7.5033:5062](),[7.5062][7.692672:692729](),[7.58587][7.692672:692729](),[7.88038][7.692672:692729](),[7.692672][7.692672:692729](),[7.692729][7.1472:1486](),[7.1486][7.692729:692788](),[7.692729][7.692729:692788]()
    collect_children(
    txn,
    changes,
    txn.graph(&channel),
    Position::ROOT,
    Inode::ROOT,
    "",
    None,
    next_prefix_basename,
    &mut files,
    )?;
    [7.692602]
    [7.4963]
    {
    let txn_ = txn.read();
    let channel_ = channel.read();
    collect_children(
    &*txn_,
    changes,
    txn_.graph(&channel_),
    Position::ROOT,
    Inode::ROOT,
    "",
    None,
    next_prefix_basename,
    &mut files,
    )?;
    }
  • replacement in libpijul/src/output/archive.rs at line 183
    [7.693101][7.693101:693132](),[7.693132][7.122535:122605](),[7.5132][7.693202:693232](),[7.58656][7.693202:693232](),[7.122605][7.693202:693232](),[7.693202][7.693202:693232](),[7.693232][7.907:933](),[7.933][7.122606:122685](),[7.122685][7.1011:1072](),[7.1011][7.1011:1072](),[7.1072][7.693398:693414](),[7.5222][7.693398:693414](),[7.58745][7.693398:693414](),[7.693398][7.693398:693414]()
    b.sort_by(|u, v| {
    txn.get_changeset(txn.changes(&channel), &u.0.change)
    .unwrap()
    .cmp(
    &txn.get_changeset(txn.changes(&channel), &v.0.change)
    .unwrap(),
    )
    });
    [7.693101]
    [7.693414]
    {
    let txn_ = txn.read();
    let channel_ = channel.read();
    b.sort_by(|u, v| {
    txn_.get_changeset(txn_.changes(&channel_), &u.0.change)
    .unwrap()
    .cmp(
    &txn_
    .get_changeset(txn_.changes(&channel_), &v.0.change)
    .unwrap(),
    )
    });
    }
  • edit in libpijul/src/output/archive.rs at line 198
    [7.693507]
    [7.5043]
    let txn_ = txn.read();
    let channel_ = channel.read();
  • replacement in libpijul/src/output/archive.rs at line 233
    [7.40][7.122686:122769]()
    crate::fs::get_latest_touch(txn, &channel, &output_item.pos)?;
    [7.40]
    [7.122]
    crate::fs::get_latest_touch(&*txn_, &channel_, &output_item.pos)?;
  • replacement in libpijul/src/output/archive.rs at line 235
    [7.159][7.122770:122843]()
    let ext = txn.get_external(&latest_touch)?.unwrap();
    [7.159]
    [7.122843]
    let ext = txn_.get_external(&latest_touch)?.unwrap();
  • replacement in libpijul/src/output/archive.rs at line 242
    [7.694976][7.694976:695005]()
    txn,
    [7.694976]
    [7.695005]
    &*txn_,
  • replacement in libpijul/src/output/archive.rs at line 244
    [7.695038][7.5223:5268]()
    txn.graph(&channel),
    [7.695038]
    [7.695072]
    txn_.graph(&channel_),
  • replacement in libpijul/src/output/archive.rs at line 258
    [7.1275][7.5269:5369]()
    let mut l = crate::alive::retrieve(txn, txn.graph(&channel), output_item.pos)?;
    [7.1275]
    [7.0]
    let mut l =
    crate::alive::retrieve(&*txn_, txn_.graph(&channel_), output_item.pos)?;
  • edit in libpijul/src/output/archive.rs at line 272
    [7.695759]
    [7.695759]
    std::mem::drop(channel_);
    std::mem::drop(txn_);
  • replacement in libpijul/src/output/archive.rs at line 277
    [7.695881][7.695881:695919]()
    &channel,
    [7.695881]
    [7.695919]
    channel,
  • edit in libpijul/src/lib.rs at line 261
    [7.727750][7.727750:727756](),[7.727756][7.84622:84623](),[7.84623][7.2901:2969](),[7.126273][7.2901:2969](),[7.727757][7.2901:2969](),[7.2969][7.727829:727919](),[7.727829][7.727829:727919](),[7.727919][7.126274:126308](),[7.126308][7.727952:728008](),[7.727952][7.727952:728008](),[7.728008][7.4880:4899](),[7.4899][7.33677:33766](),[7.29838][7.728064:728239](),[7.33766][7.728064:728239](),[7.95462][7.728064:728239](),[7.728064][7.728064:728239](),[7.728239][7.4900:4918](),[7.4918][7.728239:728644](),[7.728239][7.728239:728644](),[7.728644][7.126309:126343](),[7.126343][7.728677:728757](),[7.728677][7.728677:728757](),[7.728757][7.4919:4938](),[7.4938][7.33767:33856](),[7.29935][7.728813:728883](),[7.33856][7.728813:728883](),[7.95568][7.728813:728883](),[7.728813][7.728813:728883](),[7.728883][7.103863:103939](),[7.84709][7.126344:126445](),[7.103939][7.126344:126445](),[7.95647][7.126344:126445](),[7.126445][7.728987:729061](),[7.728987][7.728987:729061](),[7.729061][7.126446:126488](),[7.126488][7.729094:729182](),[7.729094][7.729094:729182](),[7.729182][7.126489:126591](),[7.126591][7.4939:4999](),[7.4999][7.729333:729347](),[7.729333][7.729333:729347](),[7.729347][7.5958:5972](),[7.5972][7.103940:103992](),[7.103992][7.6033:6165](),[7.6033][7.6033:6165](),[7.6165][7.729448:729545](),[7.126654][7.729448:729545](),[7.729448][7.729448:729545](),[7.729545][7.126655:126726](),[7.29999][7.729602:729612](),[7.126726][7.729602:729612](),[7.729602][7.729602:729612]()
    }
    fn archive_with_state<P: changestore::ChangeStore, A: Archive>(
    &mut self,
    changes: &P,
    channel: &mut pristine::ChannelRef<Self>,
    state: &pristine::Merkle,
    extra: &[pristine::Hash],
    arch: &mut A,
    salt: u64,
    ) -> Result<Vec<output::Conflict>, output::ArchiveError<P::Error, Self, A::Error>> {
    self.archive_prefix_with_state(
    changes,
    channel,
    state,
    extra,
    &mut std::iter::empty(),
    arch,
    salt,
    )
    }
    /// Warning: this method unrecords changes until finding the
    /// state. If this is not wanted, please fork the channel before
    /// calling.
    fn archive_prefix_with_state<
    'a,
    P: changestore::ChangeStore,
    A: Archive,
    I: Iterator<Item = &'a str>,
    >(
    &mut self,
    changes: &P,
    channel: &mut pristine::ChannelRef<Self>,
    state: &pristine::Merkle,
    extra: &[pristine::Hash],
    prefix: &mut I,
    arch: &mut A,
    salt: u64,
    ) -> Result<Vec<output::Conflict>, output::ArchiveError<P::Error, Self, A::Error>> {
    let mut unrecord = Vec::new();
    let mut found = false;
    for x in pristine::changeid_rev_log(self, &channel.read(), None)? {
    let (_, p) = x?;
    let m: Merkle = (&p.b).into();
    if &m == state {
    found = true;
    break;
    } else {
    unrecord.push(p.a.into())
    }
    }
    debug!("unrecord = {:?}", unrecord);
    if found {
    for h in unrecord.iter() {
    let h = self.get_external(h)?.unwrap().into();
    self.unrecord(changes, channel, &h, salt)?;
    }
    {
    let mut channel_ = channel.write();
    for app in extra.iter() {
    self.apply_change_rec(changes, &mut channel_, app)?
    }
    }
    output::archive(changes, self, channel, prefix, arch)
    } else {
    Err(output::ArchiveError::StateNotFound { state: *state })
    }
  • replacement in libpijul/src/lib.rs at line 456
    [7.733559][7.3109:3166]()
    fn archive<C: changestore::ChangeStore, A: Archive>(
    [7.733559]
    [7.733620]
    fn iter_adjacent<'txn>(
    &'txn self,
    graph: &'txn Self::Channel,
    key: Vertex<pristine::ChangeId>,
    min_flag: pristine::EdgeFlags,
    max_flag: pristine::EdgeFlags,
    ) -> Result<pristine::AdjacentIterator<'txn, Self>, pristine::TxnErr<Self::GraphError>> {
    pristine::iter_adjacent(self, self.graph(graph), key, min_flag, max_flag)
    }
    }
    impl<T: ChannelTxnT + TreeTxnT + DepsTxnT<DepsError = <T as GraphTxnT>::GraphError>> ArcTxn<T> {
    pub fn archive<C: changestore::ChangeStore, A: Archive>(
  • replacement in libpijul/src/lib.rs at line 471
    [7.733656][7.733656:733702]()
    channel: &pristine::ChannelRef<Self>,
    [7.733656]
    [7.733702]
    channel: &pristine::ChannelRef<T>,
  • replacement in libpijul/src/lib.rs at line 473
    [7.733724][7.34110:34199]()
    ) -> Result<Vec<output::Conflict>, output::ArchiveError<C::Error, Self, A::Error>> {
    [7.733724]
    [7.733780]
    ) -> Result<Vec<output::Conflict>, output::ArchiveError<C::Error, T, A::Error>> {
  • replacement in libpijul/src/lib.rs at line 477
    [7.733866][7.733866:733963]()
    fn archive_prefix<'a, C: changestore::ChangeStore, I: Iterator<Item = &'a str>, A: Archive>(
    [7.733866]
    [7.733963]
    pub fn archive_prefix<
    'a,
    C: changestore::ChangeStore,
    I: Iterator<Item = &'a str>,
    A: Archive,
    >(
  • replacement in libpijul/src/lib.rs at line 485
    [7.733999][7.733999:734045]()
    channel: &pristine::ChannelRef<Self>,
    [7.733999]
    [7.734045]
    channel: &pristine::ChannelRef<T>,
  • replacement in libpijul/src/lib.rs at line 488
    [7.734091][7.34200:34289]()
    ) -> Result<Vec<output::Conflict>, output::ArchiveError<C::Error, Self, A::Error>> {
    [7.734091]
    [7.734147]
    ) -> Result<Vec<output::Conflict>, output::ArchiveError<C::Error, T, A::Error>> {
  • edit in libpijul/src/lib.rs at line 490
    [7.734209]
    [7.734209]
    }
    }
    impl<T: MutTxnT> ArcTxn<T> {
    pub fn archive_with_state<P: changestore::ChangeStore, A: Archive>(
    &self,
    changes: &P,
    channel: &pristine::ChannelRef<T>,
    state: &pristine::Merkle,
    extra: &[pristine::Hash],
    arch: &mut A,
    salt: u64,
    ) -> Result<Vec<output::Conflict>, output::ArchiveError<P::Error, T, A::Error>> {
    self.archive_prefix_with_state(
    changes,
    channel,
    state,
    extra,
    &mut std::iter::empty(),
    arch,
    salt,
    )
  • replacement in libpijul/src/lib.rs at line 514
    [7.62357][7.60581:60609](),[7.60609][7.62395:62415](),[7.62395][7.62395:62415](),[7.62415][7.60610:60646](),[7.60646][7.62462:62581](),[7.99401][7.62462:62581](),[7.62462][7.62462:62581](),[7.62581][7.99402:99496](),[7.99496][7.5729:5811]()
    fn iter_adjacent<'txn>(
    &'txn self,
    graph: &'txn Self::Channel,
    key: Vertex<pristine::ChangeId>,
    min_flag: pristine::EdgeFlags,
    max_flag: pristine::EdgeFlags,
    ) -> Result<pristine::AdjacentIterator<'txn, Self>, pristine::TxnErr<Self::GraphError>> {
    pristine::iter_adjacent(self, self.graph(graph), key, min_flag, max_flag)
    [7.62357]
    [7.62703]
    /// Warning: this method unrecords changes until finding the
    /// state. If this is not wanted, please fork the channel before
    /// calling.
    pub fn archive_prefix_with_state<
    'a,
    P: changestore::ChangeStore,
    A: Archive,
    I: Iterator<Item = &'a str>,
    >(
    &self,
    changes: &P,
    channel: &pristine::ChannelRef<T>,
    state: &pristine::Merkle,
    extra: &[pristine::Hash],
    prefix: &mut I,
    arch: &mut A,
    salt: u64,
    ) -> Result<Vec<output::Conflict>, output::ArchiveError<P::Error, T, A::Error>> {
    let mut unrecord = Vec::new();
    let mut found = false;
    let mut txn = self.write();
    for x in pristine::changeid_rev_log(&*txn, &channel.read(), None)? {
    let (_, p) = x?;
    let m: Merkle = (&p.b).into();
    if &m == state {
    found = true;
    break;
    } else {
    unrecord.push(p.a.into())
    }
    }
    debug!("unrecord = {:?}", unrecord);
    if found {
    for h in unrecord.iter() {
    let h = txn.get_external(h)?.unwrap().into();
    unrecord::unrecord(&mut *txn, channel, changes, &h, salt)?;
    }
    {
    let mut channel_ = channel.write();
    for app in extra.iter() {
    crate::apply::apply_change_rec(changes, &mut *txn, &mut channel_, app, false)?
    }
    }
    std::mem::drop(txn);
    output::archive(changes, self, channel, prefix, arch)
    } else {
    Err(output::ArchiveError::StateNotFound { state: *state })
    }
  • replacement in libpijul/src/diff/mod.rs at line 132
    [7.794205][7.794205:794222](),[7.794222][7.63534:63564]()
    txn: &T,
    channel: &T::Channel,
    [7.794205]
    [7.794252]
    txn: &ArcTxn<T>,
    channel: &ChannelRef<T>,
  • edit in libpijul/src/diff/mod.rs at line 147
    [7.794648]
    [50.716]
    let txn = txn.read();
    let channel = channel.read();
  • replacement in libpijul/src/diff/mod.rs at line 176
    [7.796878][7.796878:796903](),[7.796903][7.6761:6801]()
    txn,
    txn.graph(channel),
    [7.796878]
    [7.796932]
    &*txn,
    txn.graph(&*channel),
  • replacement in libpijul/src/alive/output.rs at line 19
    [7.988922][7.988922:988935](),[7.988935][7.67155:67181]()
    txn: &T,
    channel: &T::Channel,
    [7.988922]
    [7.988961]
    txn: &ArcTxn<T>,
    channel: &ChannelRef<T>,
  • edit in libpijul/src/alive/output.rs at line 37
    [7.989411]
    [7.989518]
    let txn = txn.read();
    let channel = channel.read();
  • replacement in libpijul/src/alive/output.rs at line 43
    [7.989641][7.135742:135833]()
    .map(|a| a.oldest_vertex(changes, txn, channel, graph, sccs).unwrap())
    [7.989641]
    [7.989723]
    .map(|a| {
    a.oldest_vertex(changes, &*txn, &*channel, graph, sccs)
    .unwrap()
    })
  • replacement in libpijul/src/alive/output.rs at line 52
    [7.989862][7.135834:135925]()
    .map(|b| b.oldest_vertex(changes, txn, channel, graph, sccs).unwrap())
    [7.989862]
    [7.989944]
    .map(|b| {
    b.oldest_vertex(changes, &*txn, &*channel, graph, sccs)
    .unwrap()
    })
  • edit in libpijul/src/alive/output.rs at line 81
    [7.6440]
    [7.6440]
    let txn = txn.read();
  • replacement in libpijul/src/alive/output.rs at line 196
    [7.993009][7.993009:993022]()
    txn: &T,
    [7.993009]
    [7.993022]
    txn: &ArcTxn<T>,
  • edit in libpijul/src/alive/output.rs at line 213
    [7.7638]
    [7.7638]
    let txn = txn.read();
  • replacement in libpijul/src/alive/output.rs at line 229
    [7.22286][7.22286:22359]()
    |p| txn.get_external(&p).unwrap().map(|x| x.into()),
    [7.22286]
    [7.22359]
    |p| txn.read().get_external(&p).unwrap().map(|x| x.into()),
  • replacement in libpijul/src/alive/output.rs at line 254
    [7.994361][7.994361:994374](),[7.994374][7.67393:67419]()
    txn: &T,
    channel: &T::Channel,
    [7.994361]
    [7.994400]
    txn: &ArcTxn<T>,
    channel: &ChannelRef<T>,
  • replacement in libpijul/src/alive/output.rs at line 266
    [7.994757][7.8316:8404](),[7.8404][7.994833:994834](),[7.67507][7.994833:994834](),[7.137675][7.994833:994834](),[7.994833][7.994833:994834]()
    graph.collect_forward_edges(txn, txn.graph(channel), &scc, &forward_scc, forward)?;
    [7.994757]
    [7.994834]
    {
    let txn = txn.read();
    let channel = channel.read();
    graph.collect_forward_edges(&*txn, txn.graph(&*channel), &scc, &forward_scc, forward)?;
    }