merge with changes from sanakirja v1.1.2

[?]
Feb 26, 2021, 9:42 AM
Q3GU26WDEYE2HXMM4WWNEGVMSXLQAKRJBSB2EJZA6JTHPKQHXCXQC

Dependencies

  • [2] IYJZVLET Cleaning up the literate programming bits
  • [3] CCFJ7VO3 Renaming "Record" to "Hunk" in the changes
  • [4] YN63NUZO Sanakirja 1.0
  • [5] UM5DLRPB store new non-UTF-8 files raw and decode to deplay the contents
  • [6] TPEH2XNB 1.0.0-alpha.28, with Tokio 1.0
  • [7] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [8] 3AMEP2Y5 More convenient interface for channels
  • [9] ZRUPLBBT Colours in diff and change: separating concerns and dependencies
  • [10] GHO6DWPI Refactoring iterators
  • [11] WIORLB47 Version bump
  • [12] BZSC7VMY address clippy lints
  • [13] JACZWIJ6 Version bump
  • [14] EQLDTLXV Fixing a bug with empty new files, and another one with empty replacements
  • [15] VO5OQW4W Removing anyhow in libpijul
  • [16] 6YMDOZIB Refactoring apply
  • [17] 6HNRL5RT detect non-utf8 text files
  • [18] VMOYG7MK text file decoding for new files
  • [19] 246V5TYI decode existing files
  • [20] NYOF5766 track file encoding in the record, including change text for file adds
  • [21] LYTVEPH3 Avoid cloning into an existing path
  • [22] 3M7WBE24 Re-adding anyhow in the tests of libpijul
  • [23] W4NSLQNG make text_encoding available to all of libpijul
  • [24] WZVCLZKY address clippy lints
  • [25] NA5I4WYN Fixing the inverse of conflict resolutions
  • [26] NO2QPRFL Adding rollback test
  • [27] JRENVH5D Reqwest 0.11
  • [28] CCLLB7OI Upgrading to Sanakirja 0.15 + version bump
  • [29] SAGSYAPX Various version bumps
  • [*] ZHABNS3S Canonicalize all paths

Change contents

  • resurrect zombie in "libpijul/src/working_copy/mod.rs" at line 1
    [6.15][6.0:33](),[6.198228][6.0:33](),[6.198228][6.0:33]()
    use chardetng::EncodingDetector;
  • resurrect zombie in "libpijul/src/working_copy/mod.rs" at line 2
    [6.66][6.63:64](),[6.63][6.63:64](),[6.63][6.63:64]()
  • resurrect zombie in "libpijul/src/working_copy/mod.rs" at line 3
    [6.64][6.0:63](),[6.64][6.0:63]()
    use crate::{pristine::InodeMetadata, text_encoding::Encoding};
  • file un-deletion: text.rs (-xw-x--x--)text.rs (-xwrx-rx-r)text.rs (-xw-x--x--)
    [6.248792][6.0:9](),[6.248792][6.2008:2017](),[6.9][6.10:10](),[6.2017][6.10:10](),[6.9][6.10:10](),[6.2017][6.10:10](),[5.375][6.10:10](),[6.248792][5.366:375]()
  • edit in libpijul/src/tests/text.rs at line 2
    [6.25][6.25:47]()
    use crate::change::*;
  • replacement in libpijul/src/tests/text.rs at line 21
    [6.669][6.669:751]()
    let (h, change) = record_all(&mut repo, &store, &mut txn, &mut channel, "")?;
    [6.669]
    [6.751]
    let (h, change) = record_all_change(&mut repo, &store, &mut txn, &mut channel, "")?;
  • replacement in libpijul/src/tests/text.rs at line 77
    [6.2456][6.2456:2540]()
    let (h1, change1) = record_all(&mut repo, &store, &mut txn, &mut channel, "")?;
    [6.2456]
    [6.2540]
    let (h1, change1) = record_all_change(&mut repo, &store, &mut txn, &mut channel, "")?;
  • edit in libpijul/src/tests/text.rs at line 105
    [6.3149][6.3149:4356]()
    fn record_all<T: MutTxnT, R: WorkingCopy, P: ChangeStore>(
    repo: &mut R,
    store: &P,
    txn: &mut T,
    channel: &mut ChannelRef<T>,
    prefix: &str,
    ) -> Result<(Hash, Change), anyhow::Error>
    where
    R::Error: Send + Sync + 'static,
    {
    let mut state = Builder::new();
    state.record(txn, Algorithm::default(), channel, repo, store, prefix)?;
    let rec = state.finish();
    let changes = rec
    .actions
    .into_iter()
    .map(|rec| rec.globalize(txn))
    .collect();
    let change0 = crate::change::Change::make_change(
    txn,
    &channel,
    changes,
    rec.contents,
    crate::change::ChangeHeader {
    message: "test".to_string(),
    authors: vec![],
    description: None,
    // Beware of changing the following line: two changes
    // doing the same thing will be equal. Sometimes we don't
    // want that, as in tests::unrecord::unrecord_double.
    timestamp: chrono::Utc::now(),
    },
    Vec::new(),
    );
    let hash = store.save_change(&change0)?;
    apply::apply_local_change(txn, channel, &change0, hash, &rec.updatables)?;
    Ok((hash, change0))
    }
  • edit in libpijul/src/tests/mod.rs at line 1
    [6.289338]
    [6.289394]
    use crate::change::{Local, LocalChange};
  • resolve order conflict in libpijul/src/tests/mod.rs at line 20
    [6.14]
    [6.4357]
  • replacement in libpijul/src/tests/mod.rs at line 23
    [6.289730][6.1788:1847]()
    fn record_all<T: MutTxnT, R: WorkingCopy, P: ChangeStore>(
    [6.289730]
    [6.289795]
    fn record_all_change<T: MutTxnT, R: WorkingCopy, P: ChangeStore>(
  • replacement in libpijul/src/tests/mod.rs at line 29
    [6.289896][6.1628:1661]()
    ) -> Result<Hash, anyhow::Error>
    [6.289896]
    [6.1661]
    ) -> Result<(Hash, LocalChange<Local>), anyhow::Error>
  • edit in libpijul/src/tests/mod.rs at line 79
    [4.25832]
    [6.291146]
    Ok((hash, change0))
    }
    fn record_all<T: MutTxnT, R: WorkingCopy, P: ChangeStore>(
    repo: &mut R,
    store: &P,
    txn: &mut T,
    channel: &mut ChannelRef<T>,
    prefix: &str,
    ) -> Result<Hash, anyhow::Error>
    where
    R::Error: Send + Sync + 'static,
    {
    let Ok((hash, _)) = record_all_change(repo, store, txn, channel, prefix);
  • edit in libpijul/src/record.rs at line 2
    [6.488937][6.571:613](),[6.488937][6.571:613](),[6.677][6.677:678](),[6.677][6.677:678]()
    use std::collections::{HashMap, HashSet};
  • edit in libpijul/src/record.rs at line 11
    [6.489199]
    [6.11033]
    use std::collections::{HashMap, HashSet};
  • resurrect zombie in "libpijul/src/record.rs" at line 273
    [6.496480][4.49402:49474](),[6.496480][4.49402:49474](),[6.496480][4.49402:49474]()
    let start = ChangePosition(self.rec.contents.len().into());
  • edit in libpijul/src/record.rs at line 273
    [6.496437]
    [4.49402]
    let (contents, encoding) = if meta.is_file() {
    let encoding = working_copy.decode_file(&item.full_path, &mut self.rec.contents)?;
  • resurrect zombie in "libpijul/src/record.rs" at line 276
    [6.496630][4.49475:49643](),[6.496630][4.49475:49643](),[6.496630][4.49475:49643]()
    let end = ChangePosition(self.rec.contents.len().into());
    self.rec.largest_file = self.rec.largest_file.max(end.0.as_u64() - start.0.as_u64());
  • edit in libpijul/src/record.rs at line 276
    [4.49474]
    [4.49475]
    self.rec.has_binary_files |= encoding.is_none();
  • edit in libpijul/src/record.rs at line 279
    [6.496823][4.49644:49750](),[6.496823][4.49644:49750](),[6.496823][4.49644:49750]()
    let s = start.0.into();
    let e = end.0.as_usize().min(s + CHECK_UTF8 + 4);
  • resurrect zombie in "libpijul/src/record.rs" at line 280
    [6.497247][6.0:29](),[6.497247][6.0:29]()
    if end > start {
  • edit in libpijul/src/record.rs at line 281
    [6.497606][6.6231:6275](),[6.497606][6.6231:6275]()
    flag: EdgeFlags::BLOCK,
  • resurrect zombie in "libpijul/src/record.rs" at line 281
    [6.497313][6.2232:2575](),[6.497313][6.2232:2575]()
    (
    Some(Atom::NewVertex(NewVertex {
    up_context: vec![Position {
    change: None,
    pos: inode_pos,
    }],
    down_context: vec![],
    start,
    end,
  • replacement in libpijul/src/record.rs at line 290
    [6.2575][6.2575:2625](),[6.2575][6.2575:2625]()
    flag: EdgeFlags::empty(),
    [6.2575]
    [6.2625]
    flag: EdgeFlags::BLOCK,
  • edit in libpijul/src/record.rs at line 1142
    [6.496437][6.2018:2073](),[6.496437][6.2018:2073](),[6.496780][6.2170:2231](),[6.496780][6.2170:2231](),[6.496552][6.2074:2169](),[6.496552][6.2074:2169]()
    let (contents, encoding) = if meta.is_file() {
    self.rec.has_binary_files |= encoding.is_none();
    let encoding = working_copy.decode_file(&item.full_path, &mut self.rec.contents)?;
  • file un-deletion: mod.rs (-xwrx-rx-r)mod.rs (-xw-x--x--)mod.rs (-xw-x--x--)
    [6.768883][6.2937:2945](),[6.768883][6.793238:793246](),[6.2945][6.793247:793247](),[6.793246][6.793247:793247](),[6.793246][6.793247:793247](),[5.384][6.793247:793247](),[6.768883][5.376:384](),[6.2945][6.793247:793247]()
  • edit in libpijul/src/diff/mod.rs at line 64
    [6.5921][6.6675:6760](),[6.5921][6.6675:6760]()
    self.diff_binary(changes, txn, txn.graph(channel), path, inode, a, &b)?;
  • resurrect zombie in "libpijul/src/diff/mod.rs" at line 64
    [6.794648][6.4948:5212](),[6.794648][6.4948:5212]()
    let mime_a = tree_magic_mini::from_u8(&d.contents_a);
    let mime_b = tree_magic_mini::from_u8(&b);
    debug!("mimes = {:?}, {:?}", mime_a, mime_b);
    if (!mime_a.starts_with("text/") || !mime_b.starts_with("text/")) && d.contents_a != b {
  • edit in libpijul/src/diff/mod.rs at line 64
    [6.794648]
    [6.4948]
    // TODO pass through the encodings and use that to decide
  • edit in libpijul/src/diff/mod.rs at line 69
    [6.5212]
    [6.5994]
    self.diff_binary(changes, txn, txn.graph(channel), path, inode, a, &b)?;
  • edit in libpijul/src/change.rs at line 1118
    [6.865376]
    [3.7972]
    encoding,
  • edit in libpijul/src/change.rs at line 1120
    [6.865376][6.3085:3111](),[6.865376][6.3085:3111]()
    encoding,
  • replacement in libpijul/src/change/text_changes.rs at line 434
    [4.140860][6.2882:2930](),[6.53215][6.2882:2930](),[6.53215][5.385:448](),[6.53215][5.385:448]()
    print_contents(w, "+", c)?;
    print_contents(&mut w, "+", c, encoding)?;
    [4.140860]
    [6.53268]
    print_contents(w, "+", c, encoding)?;
  • edit in libpijul/src/change/text_changes.rs at line 1226
    [6.84951][6.3870:3912](),[6.84951][6.3870:3912](),[6.84951][6.3870:3912]()
    w.write_change_line(pref, a)?
  • replacement in libpijul/src/change/text_changes.rs at line 1228
    [6.85037][6.3913:3962](),[6.85037][6.3913:3962](),[5.591][6.5804:5848](),[6.1861][6.5804:5848](),[6.5804][6.5804:5848]()
    w.write_change_line(pref, contents)?
    writeln!(w, "{} {}", pref, a)?;
    [5.591]
    [6.85088]
    w.write_change_line(pref, a)?
  • resurrect zombie in "libpijul/src/change/text_changes.rs" at line 1244
    [6.85462][4.143164:143228](),[6.85462][4.143164:143228]()
    let c = &change_contents[n.start.us()..n.end.us()];
  • resurrect zombie in "libpijul/src/change/text_changes.rs" at line 1245
    [6.85538][5.592:639](),[6.85538][5.592:639]()
    print_contents(w, "+", c, &None)?;
  • resurrect zombie in "libpijul/Cargo.toml" at line 116
    [6.1023338][6.5871:5941](),[6.1023338][6.5871:5941]()
    tree_magic_mini = "1.0.0"
    chardetng = "0.1.10"
    encoding_rs = "0.8.26"
  • resolve order conflict in Cargo.lock at line 986
    [31.3328]
    [6.6687]
  • edit in Cargo.lock at line 1183
    [6.961][6.2863:3071](),[6.2863][6.2863:3071](),[6.3071][6.1451:1462]()
    ]
    [[package]]
    name = "ntapi"
    version = "0.3.6"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
    dependencies = [
    "winapi",
  • resurrect zombie in "Cargo.lock" at line 1183
    [6.1060297][6.6740:6992](),[6.1060297][6.6740:6992]()
    ]
    [[package]]
    name = "nom"
    version = "5.1.2"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af"
    dependencies = [
    "lexical-core",
    "memchr",
    "version_check",
  • edit in Cargo.lock at line 1194
    [6.6992]
    [6.1060297]
    ]
    [[package]]
    name = "ntapi"
    version = "0.3.6"
    source = "registry+https://github.com/rust-lang/crates.io-index"
    checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
    dependencies = [
    "winapi",