FXEDPLRI7PXLDXV634ZA6D5Q3ZWG3ESTKJTMRPJ4MAHI7PKU3M6AC
S7MAMMFWLEBKCZZ2ZUU743Z2X7XRB2IBB7LPXZVYN37RNPGN4ATAC
WUBONLD6E3OB5L7SKLIJZKVUUKXEVK7ZZLOHH347H3HV45XH3EUAC
3EMLWXLHXMGW2HO4WQLN67S6RN47OJXD5ZXETFLVM22IRX4TXRHQC
KL5737GRIOFVXKSINVO5DLLWWV4EMHF7ECXMX6ZZLAZZPWDJPB2QC
I24UEJQLCH2SOXA4UHIYWTRDCHSOPU7AFTRUOTX7HZIAV4AZKYEQC
SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC
7FFFKQZU3TFXWL45TILYNX5A7AC7HBK526SD5DZGYCELN76YE7TAC
MOPABMFWZOEMCIQMLEFH74NGTFV6K26FGUFETV3FG5VHCBGLXDIQC
VO5OQW4W2656DIYYRNZ3PO7TQ4JOKQ3GVWE5ALUTYVMX3WMXJOYQC
RRCSHAYZ6RLWVPNYHF2F5FSRL2KKJNPQUQRIJYLJGB23BZQQ7JLQC
ZHABNS3S6FSINO74FOI5KHYXYDTBPO4FQTTYTUS7NNKEVVNLYC4AC
4OCC6D42GZYRDLH3NSKXMJTRKXP7UZ6Z3YNGCNUT7NT6WBDBCBIAC
OJZWJUF2TCGZ7RFVY6FPKBS5P3C4BGHZDPVH775OHVNVFMJICKNQC
CCLLB7OIFNFYJZTG3UCI7536TOCWSCSXR67VELSB466R24WLJSDAC
XSEODPNEN2Y2THBRO7L5QFPAEQVSQTLAFZFWCRMBGZ3YSRZB2UJAC
TVVW53HZGYPODAXEQ4BFZNSPBOFG6JEDVOKIYIDZMWFAMOBKOR2QC
6HNRL5RT76NH5YNSUN7B4FHNRZXKNLX4DROFGMO4R5P2U7JWOL2QC
LCXEUK7KIZTFHTMBBDCURKU3CU62YG4NWKEU65UM5HGXMWIBHAHAC
TIPZ7UXNIZ3UMIXDUP2M33FUP7LY3XM2NX424ZE4EO5V7CZTOGXQC
YN63NUZO4LVJ7XPMURDULTXBVJKW5MVCTZ24R7Z52QMHO3HPDUVQC
IIV3EL2XYI2X7HZWKXEXQFAE3R3KC2Q7SGOT3Q332HSENMYVF32QC
GHO6DWPILBBTL6CVZKERJBTFL3EY6ZT4YM4E5R4S6YPGVFKFHCVAC
I52XSRUH5RVHQBFWVMAQPTUSPAJ4KNVID2RMI3UGCVKFLYUO6WZAC
3M7WBE24JTPTHWQOU5PO2ZJYKPKEH2F6R4M6RWIRFG334PQEA55QC
7UPL3Y2A5QOBU6VIUHNWEFGSGQ5CMWGDGOVLRZ53UARXG3TDGLMAC
SHSJ3Y5332WHVUDDQZ2P7GH6VMC7XIX5L7BDJUUMF3QCDRZP7NLQC
NO2QPRFLGCYUDXYJTOY3S3NZJCCLAFOQUHITKDZ7LSZLRLOV5W3QC
X7OHUPL5VYT6ECER2KNGRNFLRX7SBZOM5QWSQ4PBO2UPIE7XM6MAC
Q3GU26WDEYE2HXMM4WWNEGVMSXLQAKRJBSB2EJZA6JTHPKQHXCXQC
NA5I4WYNE2O3LPSHXGWXW7XL4YNYFDREEGDOP6LJ5HJXTQDXM7BAC
GDDYJH7AJYJ2DWTYVP6WS3FPPRTDRQAXZ2BH2CKIFGMIASTSLD4QC
6YMDOZIB5LVYLFIDGN2WNT5JTHEAMS4TFPVDEZ3OWXWOKJOC5QDAC
BZSC7VMYSFRXDHDDAMCDR6X67FN5VWIBOSE76BQLX7OCVOJFUA3AC
Q45QHPO4HDTEZF2W4UDZSYYQ46BPEIWSW4GJILZR5HTJNLKXJABQC
QL6K2ZM35B3NIXEMMCJWUSFXOBQHAGXRDMO7ID5DCKTJH4QJVY7QC
AJEH3FSPKLBYSRQQQ4UL4QA3SPT4MHIC4VEM3XDVATMFFU3R7JKAC
ZAEUSICJC3YOWGF6NZEQCQ34PHPRSBCJEP7FIWE6VIWJGVU734HQC
G6S6PWZEFJK7ARWBIFKDU6VYC5DCJ2YFJMWZOLLWWKU52R2QPXZAC
ADPAFSMYUBTKSK63EPCY5WQGROJQWFCWO4UFPWY3ZXD5ZNH26P2QC
3S6LU2U5TIU43WRE5RQS3IOLVJLVNCDL4W44FVK2HR3NAXZ7IDUAC
A3RM526Y7LUXNYW4TL56YKQ5GVOK2R5D7JJVTSQ6TT5MEXIR6YAAC
TZ42DX3BML5C3O5Z6OBVNBCHSIIHT6AOJPD6ICOLOP4LPYFXQN2QC
TKEVOH7HXON7SOBGXTUDHAHO2U2GPTQRNESP6ERKUQAS526OZIRAC
G6YXRFH24OGXYVO4535WCNQMMWOLDH6JYXFDBCL2HQZSOFD25Z5AC
NGCTMCDPB45UDEXX3RMMQ4JXPILETG7EEFNKMLGP4SJJK52XPLOAC
6DOXSHWGKJIMIPFCNLASGKBAJCJMJULW5HFRZAZ67EYSMXXGJ3KAC
YCEZL7VFBZNOZTSSI24D36ACJVZKXCCEOIFWIHQWK22QPB4PDTRAC
5SLOJYHGPMZVCOE3IS7ICNMJJYX3RBT6CDG5MAV6T4CJIOW7YZ6QC
EEBKW7VTILH6AGGV57ZIJ3DJGYHDSYBWGU3C7Q4WWAKSVNUGIYMQC
SGXOEWHUET7RVS5HANSYE7QRQAG56NIKTC56MLPZ5XBCXODEWUXQC
4DNDMC7IUZNYLDEQQYYF5K3G2QWWXGQENTEWPNTM6XKQEFPW7L3QC
CIEUBH465IFZXO3YDG7XYHP54NJ4TGVQD47SKNW6P5XM4X7IVNBAC
ZSF3YFZTDOXMCOC3HOT5C6MQLYLWOR7QJAOUDS2M2Z4SC2YW3GRAC
B3QWIGDERNMB3M6P5WTWP5CN2DB3KCS7MVTEPC2XVJ237ZXVQGMAC
let channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
let _h0 = record_all(repo.clone(), &changes, txn.clone(), channel.clone(), "")?;
let channel = txn.write().open_or_create_channel("main")?;
let _h0 = record_all(&repo, &changes, &txn, &channel, "")?;
let channel2 = (&mut *txn.write().unwrap()).fork(&channel, "main2")?;
crate::unrecord::unrecord(&mut *txn.write().unwrap(), &channel, &changes, &h1)?;
let _channel2 = txn.write().fork(&channel, "main2")?;
crate::unrecord::unrecord(&mut *txn.write(), &channel, &changes, &h1, 0)?;
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
let channel = txn.write().unwrap().open_or_create_channel("main")?;
let _h0 = record_all(repo.clone(), &changes, txn.clone(), channel.clone(), "")?;
let channel = txn.write().open_or_create_channel("main")?;
let _h0 = record_all(&repo, &changes, &txn, &channel, "")?;
let channel2 = txn.write().unwrap().fork(&channel, "main2")?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug_un0")?;
crate::unrecord::unrecord(&mut *txn.write().unwrap(), &channel, &changes, &h1)?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug_un1")?;
let _channel2 = txn.write().fork(&channel, "main2")?;
crate::unrecord::unrecord(&mut *txn.write(), &channel, &changes, &h1, 0)?;
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
let channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
let _h0 = record_all(repo.clone(), &changes, txn.clone(), channel.clone(), "")?;
let channel = txn.write().open_or_create_channel("main")?;
let _h0 = record_all(&repo, &changes, &txn, &channel, "")?;
output::output_repository_no_pending(
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
)?;
output::output_repository_no_pending(&repo, &changes, &txn, &channel, "", true, None, 1, 0)?;
let repo = Arc::new(working_copy::memory::Memory::new());
let repo2 = Arc::new(working_copy::memory::Memory::new());
let repo3 = Arc::new(working_copy::memory::Memory::new());
let repo = working_copy::memory::Memory::new();
let repo2 = working_copy::memory::Memory::new();
let repo3 = working_copy::memory::Memory::new();
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
let txn2 = Arc::new(RwLock::new(env2.mut_txn_begin().unwrap()));
let txn3 = Arc::new(RwLock::new(env3.mut_txn_begin().unwrap()));
txn.write().unwrap().add_file("file")?;
let txn = env.arc_txn_begin().unwrap();
let txn2 = env2.arc_txn_begin().unwrap();
let txn3 = env3.arc_txn_begin().unwrap();
txn.write().add_file("file", 0)?;
let channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
let h0 = record_all(repo.clone(), &changes, txn.clone(), channel.clone(), "")?;
let channel = txn.write().open_or_create_channel("main")?;
let h0 = record_all(&repo, &changes, &txn, &channel, "")?;
let channel2 = (&mut *txn2.write().unwrap()).open_or_create_channel("main")?;
let channel3 = (&mut *txn3.write().unwrap()).open_or_create_channel("main")?;
let channel2 = txn2.write().open_or_create_channel("main")?;
let channel3 = txn3.write().open_or_create_channel("main")?;
apply::apply_change(
&changes,
&mut *txn2.write().unwrap(),
&mut *channel2.write().unwrap(),
&h0,
)?;
output::output_repository_no_pending(
repo2.clone(),
&changes,
txn2.clone(),
channel2.clone(),
"",
true,
None,
1,
)?;
apply::apply_change(
&changes,
&mut *txn3.write().unwrap(),
&mut *channel3.write().unwrap(),
&h0,
)?;
output::output_repository_no_pending(
repo3.clone(),
&changes,
txn3.clone(),
channel3.clone(),
"",
true,
None,
1,
)?;
apply::apply_change_arc(&changes, &txn2, &channel2, &h0)?;
output::output_repository_no_pending(&repo2, &changes, &txn2, &channel2, "", true, None, 1, 0)?;
apply::apply_change_arc(&changes, &txn3, &channel3, &h0)?;
output::output_repository_no_pending(&repo3, &changes, &txn3, &channel3, "", true, None, 1, 0)?;
apply::apply_change(
&changes,
&mut *txn.write().unwrap(),
&mut *channel.write().unwrap(),
&h2,
)?;
apply::apply_change(
&changes,
&mut *txn.write().unwrap(),
&mut *channel.write().unwrap(),
&h3,
)?;
output::output_repository_no_pending(
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
)?;
apply::apply_change_arc(&changes, &txn, &channel, &h2)?;
apply::apply_change_arc(&changes, &txn, &channel, &h3)?;
output::output_repository_no_pending(&repo, &changes, &txn, &channel, "", true, None, 1, 0)?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug_un")?;
crate::unrecord::unrecord(&mut *txn.write().unwrap(), &channel, &changes, &h2)?;
crate::unrecord::unrecord(&mut *txn.write(), &channel, &changes, &h2, 0)?;
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
let txn2 = Arc::new(RwLock::new(env2.mut_txn_begin().unwrap()));
txn.write().unwrap().add_file("file")?;
let txn = env.arc_txn_begin().unwrap();
let txn2 = env2.arc_txn_begin().unwrap();
txn.write().add_file("file", 0)?;
let channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
let h0 = record_all(repo.clone(), &changes, txn.clone(), channel.clone(), "")?;
let channel2 = (&mut *txn2.write().unwrap()).open_or_create_channel("main")?;
let channel = txn.write().open_or_create_channel("main")?;
let h0 = record_all(&repo, &changes, &txn, &channel, "")?;
let channel2 = txn2.write().open_or_create_channel("main")?;
apply::apply_change(
&changes,
&mut *txn2.write().unwrap(),
&mut *channel2.write().unwrap(),
&h0,
)?;
output::output_repository_no_pending(
repo2.clone(),
&changes,
txn2.clone(),
channel2.clone(),
"",
true,
None,
1,
)?;
apply::apply_change_arc(&changes, &txn2, &channel2, &h0)?;
output::output_repository_no_pending(&repo2, &changes, &txn2, &channel2, "", true, None, 1, 0)?;
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
repo.clone(),
&changes,
txn2.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn2, &channel, "", true, None, 1, 0,
let channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
record_all(repo.clone(), &changes, txn.clone(), channel.clone(), "")?;
let channel = txn.write().open_or_create_channel("main")?;
record_all(&repo, &changes, &txn, &channel, "")?;
let _h2 = record_all_output(
repo.clone(),
changes.clone(),
txn.clone(),
channel.clone(),
"",
)?;
output::output_repository_no_pending(
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
)?;
let _h2 = record_all_output(&repo, changes.clone(), &txn, &channel, "")?;
output::output_repository_no_pending(&repo, &changes, &txn, &channel, "", true, None, 1, 0)?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug_un")?;
crate::unrecord::unrecord(&mut *txn.write().unwrap(), &channel, &changes, &h1)?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug_un2")?;
crate::unrecord::unrecord(&mut *txn.write(), &channel, &changes, &h1, 0)?;
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
txn.write().unwrap().add_file("dir/file")?;
debug_inodes(&*txn.read().unwrap());
let txn = env.arc_txn_begin().unwrap();
txn.write().add_file("dir/file", 0)?;
debug_inodes(&*txn.read());
let channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
let h0 = record_all(repo.clone(), &changes, txn.clone(), channel.clone(), "")?;
let channel = txn.write().open_or_create_channel("main")?;
let h0 = record_all(&repo, &changes, &txn, &channel, "")?;
debug_inodes(&*txn.read().unwrap());
let channel2 = (&mut *txn.write().unwrap()).open_or_create_channel("main2")?;
match crate::unrecord::unrecord(&mut *txn.write().unwrap(), &channel2, &changes, &h0) {
debug_inodes(&*txn.read());
let channel2 = txn.write().open_or_create_channel("main2")?;
match crate::unrecord::unrecord(&mut *txn.write(), &channel2, &changes, &h0, 0) {
debug_inodes(&*txn.read().unwrap());
debug_to_file(&*txn.read().unwrap(), &channel, "debug")?;
crate::unrecord::unrecord(&mut *txn.write().unwrap(), &channel, &changes, &h1)?;
debug_inodes(&*txn.read());
crate::unrecord::unrecord(&mut *txn.write(), &channel, &changes, &h1, 0)?;
debug_inodes(&*txn.read().unwrap());
debug_to_file(&*txn.read().unwrap(), &channel, "debug2")?;
crate::unrecord::unrecord(&mut *txn.write().unwrap(), &channel, &changes, &h0)?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug3")?;
debug_inodes(&*txn.read());
crate::unrecord::unrecord(&mut *txn.write(), &channel, &changes, &h0, 0)?;
output::output_repository_no_pending(
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
)?;
output::output_repository_no_pending(&repo, &changes, &txn, &channel, "", true, None, 1, 0)?;
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
let channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
let channel2 = (&mut *txn.write().unwrap()).open_or_create_channel("main2")?;
let txn = env.arc_txn_begin().unwrap();
let channel = txn.write().open_or_create_channel("main")?;
let channel2 = txn.write().open_or_create_channel("main2")?;
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
let mut channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
let mut channel2 = (&mut *txn.write().unwrap()).open_or_create_channel("main2")?;
let txn = env.arc_txn_begin().unwrap();
let mut channel = txn.write().open_or_create_channel("main")?;
let mut channel2 = txn.write().open_or_create_channel("main2")?;
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
apply::apply_change(
&changes,
&mut *txn.write().unwrap(),
&mut *channel2.write().unwrap(),
&r,
)
.unwrap();
debug_to_file(&*txn.read().unwrap(), &channel2, format!("debug_{}", i))?;
apply::apply_change_arc(&changes, &txn, &channel2, &r).unwrap();
repo.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
&repo, &changes, &txn, &channel, "", true, None, 1, 0,
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
let channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
let channel2 = (&mut *txn.write().unwrap()).open_or_create_channel("main2")?;
let txn = env.arc_txn_begin().unwrap();
let channel = txn.write().open_or_create_channel("main")?;
let channel2 = txn.write().open_or_create_channel("main2")?;
crate::unrecord::unrecord(&mut *txn.write().unwrap(), &channel, &changes, &h1)?;
crate::unrecord::unrecord(&mut *txn.write().unwrap(), &channel, &changes, &h2)?;
crate::unrecord::unrecord(&mut *txn.write(), &channel, &changes, &h1, 0)?;
crate::unrecord::unrecord(&mut *txn.write(), &channel, &changes, &h2, 0)?;
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
let channel = txn.write().unwrap().open_or_create_channel("main")?;
txn.write().unwrap().add_file("file", 0)?;
let txn = env.arc_txn_begin().unwrap();
let channel = txn.write().open_or_create_channel("main")?;
txn.write().add_file("file", 0)?;
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
let channel = txn.write().unwrap().open_or_create_channel("main")?;
txn.write().unwrap().add_file("file", 0)?;
let txn = env.arc_txn_begin().unwrap();
let channel = txn.write().open_or_create_channel("main")?;
txn.write().add_file("file", 0)?;
txn.add_file("file").unwrap();
record_all(&mut repo, &changes, &mut txn, &mut channela, "").unwrap();
let mut channelb = txn.fork(&channela, "other").unwrap();
txn.write().add_file("file", 0).unwrap();
record_all(&repo, &changes, &txn, &channela, "").unwrap();
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(b"a\nx\nb\n").unwrap();
Ok(())
})
.unwrap();
let ha = record_all(&mut repo, &changes, &mut txn, &mut channela, "").unwrap();
let channelb = txn.write().fork(&channela, "other").unwrap();
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(b"a\ny\nb\n").unwrap();
Ok(())
})
.unwrap();
let hb = record_all(&mut repo, &changes, &mut txn, &mut channelb, "").unwrap();
repo.write_file("file")
.unwrap()
.write_all(b"a\nx\nb\n")
.unwrap();
let ha = record_all(&repo, &changes, &txn, &channela, "").unwrap();
apply::apply_change(&changes, &mut txn, &mut channelb, &ha).unwrap();
apply::apply_change(&changes, &mut txn, &mut channela, &hb).unwrap();
repo.write_file("file")
.unwrap()
.write_all(b"a\ny\nb\n")
.unwrap();
let hb = record_all(&repo, &changes, &txn, &channelb, "").unwrap();
debug_to_file(&txn, &channela.borrow(), "debuga").unwrap();
debug_to_file(&txn, &channelb.borrow(), "debugb").unwrap();
apply::apply_change_arc(&changes, &txn, &channelb, &ha).unwrap();
apply::apply_change_arc(&changes, &txn, &channela, &hb).unwrap();
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(b"a\nx\nb\n")?;
Ok(())
})?;
let ha = record_all(&mut repo, &changes, &mut txn, &mut channela, "")?;
repo.write_file("file")
.unwrap()
.write_all(b"a\nx\nb\n")
.unwrap();
let ha = record_all(&repo, &changes, &txn, &channela, "")?;
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(b"a\ny\nb\n")?;
Ok(())
})?;
let hb = record_all(&mut repo, &changes, &mut txn, &mut channelb, "")?;
repo.write_file("file").unwrap().write_all(b"a\ny\nb\n")?;
let hb = record_all(&repo, &changes, &txn, &channelb, "")?;
apply::apply_change(&changes, &mut txn, &mut channelb, &ha)?;
apply::apply_change(&changes, &mut txn, &mut channela, &hb)?;
debug_to_file(&txn, &channela.borrow(), "debuga")?;
debug_to_file(&txn, &channelb.borrow(), "debugb")?;
apply::apply_change_arc(&changes, &txn, &channelb, &ha)?;
apply::apply_change_arc(&changes, &txn, &channela, &hb)?;
let mut txn_bob = env_bob.mut_txn_begin().unwrap();
let mut channel_alice = txn_alice.open_or_create_channel("alice").unwrap();
let txn_bob = env_bob.arc_txn_begin().unwrap();
let channel_alice = txn_alice.write().open_or_create_channel("alice").unwrap();
txn_alice.add_file("a/b/c/d").unwrap();
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice0")?;
txn_alice.write().add_file("a/b/c/d", 0).unwrap();
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h).unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h).unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h)?;
let mut txn = env.mut_txn_begin().unwrap();
let mut channel = txn.open_or_create_channel("main").unwrap();
let txn = env.arc_txn_begin().unwrap();
let channel = txn.write().open_or_create_channel("main").unwrap();
txn.add_file("file")?;
record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap();
debug_to_file(&txn, &channel.borrow(), "debug").unwrap();
txn.write().add_file("file", 0)?;
record_all(&mut repo, &changes, &txn, &channel, "").unwrap();
repo.write_file::<_, std::io::Error, _>("file", |w| {
for j in 0..i {
writeln!(w, "{}", j)?;
}
w.write_all(&contents[..])?;
for j in (0..i).rev() {
writeln!(w, "{}", j)?;
}
Ok(())
})
.unwrap();
record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap();
debug_to_file(&txn, &channel.borrow(), &format!("debug{}", i)).unwrap();
let mut w = repo.write_file("file").unwrap();
for j in 0..i {
writeln!(w, "{}", j)?;
}
w.write_all(&contents[..])?;
for j in (0..i).rev() {
writeln!(w, "{}", j)?;
}
record_all(&repo, &changes, &txn, &channel, "").unwrap();
Ok(())
})
.unwrap();
record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap();
debug_to_file(&txn, &channel.borrow(), "debug_final").unwrap();
}
record_all(&repo, &changes, &txn, &channel, "").unwrap();
let mut it = txn.iter_graph(&channel.graph, None).unwrap();
while let Some(Ok(_)) = txn.next_graph(&channel.graph, &mut it) {
let mut it = txn.read().iter_graph(&channel.graph, None).unwrap();
while let Some(Ok(_)) = txn.read().next_graph(&channel.graph, &mut it) {
let mut txn = env.mut_txn_begin().unwrap();
let mut channel = txn.open_or_create_channel("main").unwrap();
let mut txn = env.arc_txn_begin().unwrap();
let channel = txn.write().open_or_create_channel("main").unwrap();
txn.add_file("file").unwrap();
record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap();
debug_to_file(&txn, &channel.borrow(), "debug").unwrap();
txn.write().add_file("file", 0).unwrap();
record_all(&mut repo, &changes, &txn, &channel, "").unwrap();
repo.write_file::<_, std::io::Error, _>("file", |w| {
for j in 0..i {
writeln!(w, "{}", j).unwrap();
}
w.write_all(&contents[..]).unwrap();
for j in (0..i).rev() {
writeln!(w, "{}", j).unwrap();
}
Ok(())
})
.unwrap();
record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap();
debug_to_file(&txn, &channel.borrow(), &format!("debug{}", i)).unwrap();
let mut w = repo.write_file("file").unwrap();
for j in 0..i {
writeln!(w, "{}", j).unwrap();
}
w.write_all(&contents[..]).unwrap();
for j in (0..i).rev() {
writeln!(w, "{}", j).unwrap();
}
record_all(&repo, &changes, &txn, &channel, "").unwrap();
let mut channel2 = txn.fork(&channel, "fork").unwrap();
repo.write_file::<_, std::io::Error, _>("file", |w| {
let mut channel2 = txn.write().fork(&channel, "fork").unwrap();
{
let mut w = repo.write_file("file").unwrap();
txn.apply_change(&changes, &mut channel, &p1).unwrap();
debug_to_file(&txn, &channel.borrow(), "debug_alice").unwrap();
txn.write()
.apply_change(&changes, &mut *channel.write(), &p1)
.unwrap();
txn.apply_change(&changes, &mut channel2, &p2).unwrap();
debug_to_file(&txn, &channel2.borrow(), "debug_bob").unwrap();
txn.write()
.apply_change(&changes, &mut *channel2.write(), &p2)
.unwrap();
let mut it = txn.iter_graph(&channel.graph, None).unwrap();
while let Some(Ok(_)) = txn.next_graph(&channel.graph, &mut it) {
let mut it = txn.read().iter_graph(&channel.graph, None).unwrap();
while let Some(Ok(_)) = txn.read().next_graph(&channel.graph, &mut it) {
let mut it = txn.iter_graph(&channel.graph, None).unwrap();
while let Some(Ok(_)) = txn.next_graph(&channel.graph, &mut it) {
let mut it = txn.read().iter_graph(&channel.graph, None).unwrap();
while let Some(Ok(_)) = txn.read().next_graph(&channel.graph, &mut it) {
let mut channel = txn.open_or_create_channel("main").unwrap();
txn.add_file("a/b/c")?;
record_all(&mut repo, &changes, &mut txn, &mut channel, "")?;
txn.add_file("d/e/f")?;
let hd = record_all(&mut repo, &changes, &mut txn, &mut channel, "")?;
txn.add_file("g/h/i")?;
let hg = record_all(&mut repo, &changes, &mut txn, &mut channel, "")?;
let channel = txn.write().open_or_create_channel("main").unwrap();
txn.write().add_file("a/b/c", 0)?;
record_all(&mut repo, &changes, &txn, &channel, "")?;
txn.write().add_file("d/e/f", 0)?;
let hd = record_all(&repo, &changes, &txn, &channel, "")?;
txn.write().add_file("g/h/i", 0)?;
let hg = record_all(&repo, &changes, &txn, &channel, "")?;
debug_to_file(&txn, &channel.borrow(), "debug").unwrap();
let inode = crate::fs::find_inode(&txn, "d")?;
let key = txn.get_inodes(&inode, None).unwrap().unwrap();
let inode = crate::fs::find_inode(&*txn.read(), "d")?;
let key = *txn.read().get_inodes(&inode, None).unwrap().unwrap();
let mut channel = txn.open_or_create_channel("main").unwrap();
txn.add_file("a/b/c/d")?;
txn.add_file("e/f/g/h")?;
txn.add_file("i/j/k/l")?;
let mut channel = txn.write().open_or_create_channel("main").unwrap();
txn.write().add_file("a/b/c/d", 0)?;
txn.write().add_file("e/f/g/h", 0)?;
txn.write().add_file("i/j/k/l", 0)?;
let mut channel = txn.open_or_create_channel("main").unwrap();
repo.write_file::<_, std::io::Error, _>("a/b/c/d", |w| {
w.write_all(b"edits\n")?;
Ok(())
})?;
repo.write_file::<_, std::io::Error, _>("e/f/g/h", |w| {
w.write_all(b"edits\n")?;
Ok(())
})?;
record_all(&mut repo, &changes, &mut txn, &mut channel, "a/b/c/d")?
let channel = txn.write().open_or_create_channel("main").unwrap();
repo.write_file("a/b/c/d").unwrap().write_all(b"edits\n")?;
repo.write_file("e/f/g/h").unwrap().write_all(b"edits\n")?;
record_all(&repo, &changes, &txn, &channel, "a/b/c/d")?
let mut channel = txn2.open_or_create_channel("main2").unwrap();
apply::apply_change(&changes, &mut txn2, &mut channel, &h).unwrap();
let channel = txn2.write().open_or_create_channel("main2").unwrap();
apply::apply_change_arc(&changes, &txn2, &channel, &h).unwrap();
let hash = record_all(repo.clone(), &changes, txn.clone(), channel.clone(), prefix)?;
output::output_repository_no_pending(
repo.clone(),
&changes,
txn,
channel.clone(),
"",
true,
None,
1,
0,
)
.unwrap();
let hash = record_all(repo, &changes, txn, channel, prefix)?;
output::output_repository_no_pending(repo, &changes, txn, channel, "", true, None, 1, 0)
.unwrap();
let mut txn_alice = env_alice.mut_txn_begin().unwrap();
let mut channel_alice = txn_alice.open_or_create_channel("main").unwrap();
txn_alice.add_file("file").unwrap();
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap();
let txn_alice = env_alice.arc_txn_begin().unwrap();
let channel_alice = txn_alice.write().open_or_create_channel("main").unwrap();
txn_alice.write().add_file("file", 0).unwrap();
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap();
let mut txn_bob = env_bob.mut_txn_begin().unwrap();
let mut channel_bob = txn_bob.open_or_create_channel("main").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h).unwrap();
let txn_bob = env_bob.arc_txn_begin().unwrap();
let mut channel_bob = txn_bob.write().open_or_create_channel("main").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h).unwrap();
repo_bob
.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})
.unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
let bob_h2 = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "bob0")?;
let bob_h2 = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice.as_bytes()).unwrap();
Ok(())
})?
repo_alice
.write_file("file")
.unwrap()
.write_all(alice.as_bytes())
.unwrap();
let alice_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug0")?;
let alice_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h)?;
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h2)?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h)?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h2)?;
crate::unrecord::unrecord(&mut txn_alice, &mut channel_alice, &changes, &bob_h2)?;
crate::unrecord::unrecord(&mut txn_alice, &mut channel_alice, &changes, &bob_h)?;
crate::unrecord::unrecord(
&mut *txn_alice.write(),
&channel_alice,
&changes,
&bob_h2,
0,
)?;
crate::unrecord::unrecord(&mut *txn_alice.write(), &channel_alice, &changes, &bob_h, 0)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1_unrec")?;
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h)?;
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h2)?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h)?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h2)?;
&"a\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\nx\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\ny\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\nz\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\nf\n"
&"a\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\nx\ny\nz\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\nf\n"
Ok(&">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\nx\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\ny\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\nz\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"[..])
Ok(
&">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\nx\ny\nz\n<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"[..]
)
let _fix_deletion = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice2")?;
let _fix_deletion = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob0")?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_h).unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_h).unwrap();
let mut txn_alice = env_alice.mut_txn_begin().unwrap();
let mut channel_alice = txn_alice.open_or_create_channel("main")?;
txn_alice.add_file("file")?;
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_init").unwrap();
let txn_alice = env_alice.arc_txn_begin().unwrap();
let channel_alice = txn_alice.write().open_or_create_channel("main")?;
txn_alice.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut txn_bob = env_bob.mut_txn_begin().unwrap();
let mut channel_bob = txn_bob.open_or_create_channel("main")?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h)?;
let txn_bob = env_bob.arc_txn_begin().unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("main")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h)?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "")?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let _alice_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let _alice_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut channel = txn.open_or_create_channel("main").unwrap();
let p = record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap();
let mut channel = txn.open_or_create_channel("main2").unwrap();
let channel = txn.write().open_or_create_channel("main").unwrap();
let p = record_all(&repo, &changes, &txn, &channel, "").unwrap();
let channel = txn.write().open_or_create_channel("main2").unwrap();
apply::apply_change(&changes, &mut txn, &mut channel, &p)?;
output::output_repository_no_pending(
&mut repo,
&changes,
&mut txn,
&mut channel,
"",
true,
None,
)
.unwrap();
apply::apply_change_arc(&changes, &txn, &channel, &p)?;
output::output_repository_no_pending(&repo, &changes, &txn, &channel, "", true, None, 1, 0)
.unwrap();
let mut txn = env.mut_txn_begin().unwrap();
txn.add_file("dir/file").unwrap();
txn.add_file("dir/link").unwrap();
let txn = env.arc_txn_begin().unwrap();
txn.write().add_file("dir/file", 0).unwrap();
txn.write().add_file("dir/link", 0).unwrap();
let mut channel = txn.open_or_create_channel("main").unwrap();
let p = record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap();
let channel = txn.write().open_or_create_channel("main").unwrap();
let p = record_all(&repo, &changes, &txn, &channel, "").unwrap();
let mut channel = txn.open_or_create_channel("main2").unwrap();
apply::apply_change(&changes, &mut txn, &mut channel, &p)?;
output::output_repository_no_pending(
&mut repo,
&changes,
&mut txn,
&mut channel,
"",
true,
None,
)
.unwrap();
let channel = txn.write().open_or_create_channel("main2").unwrap();
apply::apply_change_arc(&changes, &txn, &channel, &p)?;
output::output_repository_no_pending(&repo, &changes, &txn, &channel, "", true, None, 1, 0)
.unwrap();
let mut channel = txn.open_or_create_channel("main").unwrap();
let p = record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap();
let channel = txn.write().open_or_create_channel("main").unwrap();
let p = record_all(&repo, &changes, &txn, &channel, "").unwrap();
let mut channel = txn.open_or_create_channel("main2").unwrap();
apply::apply_change(&changes, &mut txn, &mut channel, &p)?;
output::output_repository_no_pending(
&mut repo,
&changes,
&mut txn,
&mut channel,
"",
true,
None,
)
.unwrap();
let channel = txn.write().open_or_create_channel("main2").unwrap();
apply::apply_change_arc(&changes, &txn, &channel, &p)?;
output::output_repository_no_pending(&repo, &changes, &txn, &channel, "", true, None, 1, 0)
.unwrap();
let mut channel = txn.open_or_create_channel("main").unwrap();
let p = record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap();
let channel = txn.write().open_or_create_channel("main").unwrap();
let p = record_all(&repo, &changes, &txn, &channel, "").unwrap();
apply::apply_change(&changes, &mut txn, &mut channel, &p)?;
output::output_repository_no_pending(
&mut repo,
&changes,
&mut txn,
&mut channel,
"",
true,
None,
)
.unwrap();
apply::apply_change_arc(&changes, &txn, &channel, &p)?;
output::output_repository_no_pending(&repo, &changes, &txn, &channel, "", true, None, 1, 0)
.unwrap();
txn_alice.add_file(file).unwrap();
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice0")?;
txn_alice.write().add_file(file, 0).unwrap();
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h).unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h).unwrap();
let alice_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
let alice_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h)?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_h)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_h)?;
debug_tree(&txn_alice, "debug_tree")?;
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice0")?;
debug_tree(&*txn_alice.read(), "debug_tree")?;
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h).unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h).unwrap();
let alice_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
let alice_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h)?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_h)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_h)?;
debug_tree(&txn_alice, "debug_tree")?;
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice0")?;
debug_tree(&*txn_alice.read(), "debug_tree")?;
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h).unwrap();
let mut channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h).unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
let alice_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
let alice_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap();
let mut txn_charlie = env_charlie.mut_txn_begin().unwrap();
let mut channel_charlie = txn_charlie.open_or_create_channel("charlie").unwrap();
apply::apply_change(&changes, &mut txn_charlie, &mut channel_charlie, &init_h).unwrap();
let txn_charlie = env_charlie.arc_txn_begin().unwrap();
let channel_charlie = txn_charlie
.write()
.open_or_create_channel("charlie")
.unwrap();
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &init_h).unwrap();
txn_charlie.move_file("file1", "file3")?;
let charlie_h = record_all(
&mut repo_charlie,
&changes,
&mut txn_charlie,
&mut channel_charlie,
"",
)
.unwrap();
debug_to_file(&txn_charlie, &channel_charlie.borrow(), "debug_charlie1")?;
txn_charlie.write().move_file("file1", "file3", 0)?;
let charlie_h =
record_all(&repo_charlie, &changes, &txn_charlie, &channel_charlie, "").unwrap();
apply::apply_change(&changes, &mut txn_charlie, &mut channel_charlie, &bob_h)?;
apply::apply_change(&changes, &mut txn_charlie, &mut channel_charlie, &alice_h)?;
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &bob_h)?;
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &alice_h)?;
txn_charlie.move_file(&files_charlie[1], "file3")?;
let _charlie_solution = record_all(
&mut repo_charlie,
&changes,
&mut txn_charlie,
&mut channel_charlie,
"",
)
.unwrap();
debug_to_file(&txn_charlie, &channel_charlie.borrow(), "debug_charlie3")?;
txn_charlie
.write()
.move_file(&files_charlie[1], "file3", 0)?;
let _charlie_solution =
record_all(&repo_charlie, &changes, &txn_charlie, &channel_charlie, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h)?;
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &charlie_h)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice2")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h)?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &charlie_h)?;
let _alice_solution = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice3")?;
let _alice_solution =
record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_h)?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &charlie_h)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob2")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_h)?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &charlie_h)?;
txn_alice.add_file("a/b/c/file").unwrap();
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice0")?;
txn_alice.write().add_file("a/b/c/file", 0).unwrap();
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h).unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h).unwrap();
let alice_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
let alice_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap();
repo_bob.write_file::<_, std::io::Error, _>("a/b/c/file", |w| {
w.write_all(contents2)?;
Ok(())
})?;
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
repo_bob
.write_file("a/b/c/file")
.unwrap()
.write_all(contents2)?;
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h)?;
let alice_solution = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice3")?;
let alice_solution = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_h)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_h)?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_solution)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob2")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_solution)?;
txn_alice.add_file("a/b/c/file").unwrap();
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice0")?;
txn_alice.write().add_file("a/b/c/file", 0).unwrap();
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h).unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h).unwrap();
repo_bob.write_file::<_, std::io::Error, _>("a/b/c/file2", |w| {
w.write_all(contents2)?;
Ok(())
})?;
txn_bob.move_file("a/b/c/file", "a/b/c/file2")?;
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
repo_bob
.write_file("a/b/c/file2")
.unwrap()
.write_all(contents2)?;
txn_bob.write().move_file("a/b/c/file", "a/b/c/file2", 0)?;
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice2")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h)?;
let alice_solution = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice4")?;
let alice_solution = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_h)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob2")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_h)?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_solution)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob3")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_solution)?;
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h).unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h).unwrap();
repo_bob.write_file::<_, std::io::Error, _>("a/b/d/file", |w| {
w.write_all(contents2)?;
Ok(())
})?;
txn_bob.move_file("a/b/c", "a/b/d")?;
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
repo_bob
.write_file("a/b/d/file")
.unwrap()
.write_all(contents2)?;
txn_bob.write().move_file("a/b/c", "a/b/d", 0)?;
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice2")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h)?;
let alice_solution = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice4")?;
let alice_solution = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_h)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob2")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_h)?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_solution)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob3")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_solution)?;
let mut repo_alice = working_copy::memory::Memory::new();
let mut repo_bob = working_copy::memory::Memory::new();
let mut repo_charlie = working_copy::memory::Memory::new();
let repo_alice = working_copy::memory::Memory::new();
let repo_bob = working_copy::memory::Memory::new();
let repo_charlie = working_copy::memory::Memory::new();
txn_alice.add_file("a/b/c/file").unwrap();
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice0")?;
txn_alice.write().add_file("a/b/c/file", 0).unwrap();
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h).unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h).unwrap();
let mut channel_charlie = txn_charlie.open_or_create_channel("charlie").unwrap();
apply::apply_change(&changes, &mut txn_charlie, &mut channel_charlie, &init_h).unwrap();
let channel_charlie = txn_charlie
.write()
.open_or_create_channel("charlie")
.unwrap();
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &init_h).unwrap();
let alice_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
let alice_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap();
repo_bob.write_file::<_, std::io::Error, _>("a/b/c/file", |w| {
w.write_all(contents2)?;
Ok(())
})?;
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
repo_bob
.write_file("a/b/c/file")
.unwrap()
.write_all(contents2)?;
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
repo_charlie.write_file::<_, std::io::Error, _>("a/b/c/file", |w| {
w.write_all(contents3)?;
Ok(())
})?;
let charlie_h = record_all(
&mut repo_charlie,
&changes,
&mut txn_charlie,
&mut channel_charlie,
"",
)
.unwrap();
debug_to_file(&txn_charlie, &channel_charlie.borrow(), "debug_charlie1")?;
repo_charlie
.write_file("a/b/c/file")
.unwrap()
.write_all(contents3)?;
let charlie_h =
record_all(&repo_charlie, &changes, &txn_charlie, &channel_charlie, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h)?;
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &charlie_h)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h)?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &charlie_h)?;
assert_eq!(conflicts.len(), 5);
match conflicts[0] {
Conflict::ZombieFile { ref path } => assert_eq!(path, "a/b"),
ref c => panic!("unexpected conflict {:#?}", c),
}
let expected = [
Conflict::ZombieFile {
path: "a/b".to_string(),
},
Conflict::ZombieFile {
path: "a/b/c".to_string(),
},
Conflict::ZombieFile {
path: "a/b/c/file".to_string(),
},
Conflict::Zombie {
path: "a/b/c/file".to_string(),
line: 1,
},
];
assert_eq!(&conflicts[..], &expected[..]);
let alice_solution = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice3")?;
let alice_solution = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_h)?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &charlie_h)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob2")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_h)?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &charlie_h)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob2")?;
assert_eq!(conflicts.len(), 5);
match conflicts[0] {
Conflict::ZombieFile { ref path } => assert_eq!(path, "a/b"),
ref c => panic!("unexpected conflict {:#?}", c),
}
assert_eq!(conflicts, expected);
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_solution)?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob3")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_solution)?;
apply::apply_change(&changes, &mut txn_charlie, &mut channel_charlie, &bob_h)?;
debug_to_file(&txn_charlie, &channel_charlie.borrow(), "debug_charlie2")?;
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &bob_h)?;
apply::apply_change(&changes, &mut txn_charlie, &mut channel_charlie, &alice_h)?;
debug_to_file(&txn_charlie, &channel_charlie.borrow(), "debug_charlie3")?;
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &alice_h)?;
apply::apply_change(
&changes,
&mut txn_charlie,
&mut channel_charlie,
&alice_solution,
)?;
debug_to_file(&txn_charlie, &channel_charlie.borrow(), "debug_charlie4")?;
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &alice_solution)?;
let mut repo_alice = working_copy::memory::Memory::new();
let mut repo_bob = working_copy::memory::Memory::new();
let mut repo_charlie = working_copy::memory::Memory::new();
let repo_alice = working_copy::memory::Memory::new();
let repo_bob = working_copy::memory::Memory::new();
let repo_charlie = working_copy::memory::Memory::new();
txn_alice.add_file("a/b/c/file").unwrap();
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice0")?;
txn_alice.write().add_file("a/b/c/file", 0).unwrap();
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
txn_alice.move_file("a/b/c/file", "a/b/c/alice")?;
let alice_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
txn_alice
.write()
.move_file("a/b/c/file", "a/b/c/alice", 0)?;
let alice_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h).unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h).unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &alice_h).unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1")?;
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &alice_h).unwrap();
let bob_resolution =
record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob2")?;
let bob_resolution = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &bob_h).unwrap();
apply::apply_change(
&changes,
&mut txn_alice,
&mut channel_alice,
&bob_resolution,
)
.unwrap();
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_h).unwrap();
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &bob_resolution).unwrap();
let mut channel_charlie = txn_charlie.open_or_create_channel("charlie").unwrap();
apply::apply_change(&changes, &mut txn_charlie, &mut channel_charlie, &init_h).unwrap();
apply::apply_change(&changes, &mut txn_charlie, &mut channel_charlie, &alice_h).unwrap();
let channel_charlie = txn_charlie
.write()
.open_or_create_channel("charlie")
.unwrap();
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &init_h).unwrap();
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &alice_h).unwrap();
let charlie_h = record_all(
&mut repo_charlie,
&changes,
&mut txn_charlie,
&mut channel_charlie,
"",
)
.unwrap();
debug_to_file(&txn_charlie, &channel_charlie.borrow(), "debug_charlie1")?;
let charlie_h =
record_all(&repo_charlie, &changes, &txn_charlie, &channel_charlie, "").unwrap();
apply::apply_change(&changes, &mut txn_charlie, &mut channel_charlie, &bob_h).unwrap();
debug_to_file(&txn_charlie, &channel_charlie.borrow(), "debug_charlie2")?;
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &bob_h).unwrap();
apply::apply_change(
&changes,
&mut txn_charlie,
&mut channel_charlie,
&bob_resolution,
)
.unwrap();
debug_to_file(&txn_charlie, &channel_charlie.borrow(), "debug_charlie3")?;
apply::apply_change_arc(&changes, &txn_charlie, &channel_charlie, &bob_resolution).unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &charlie_h).unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice3")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &charlie_h).unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &charlie_h).unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob3")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &charlie_h).unwrap();
let mut txn_alice = env_alice.mut_txn_begin().unwrap();
let mut channel_alice = txn_alice.open_or_create_channel("main")?;
let txn_alice = env_alice.arc_txn_begin().unwrap();
let channel_alice = txn_alice.write().open_or_create_channel("main")?;
let mut txn_bob = env_bob.mut_txn_begin().unwrap();
let mut channel_bob = txn_bob.open_or_create_channel("main")?;
let txn_bob = env_bob.arc_txn_begin().unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("main")?;
txn_alice.move_file("file", "alice/file").unwrap_or(());
let alice_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1").unwrap();
txn_alice
.write()
.move_file("file", "alice/file", 0)
.unwrap_or(());
let alice_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "")?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob0").unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "")?;
let resolution = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "")?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob2").unwrap();
let resolution = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "")?;
let mut txn_alice = env_alice.mut_txn_begin().unwrap();
let mut channel_alice = txn_alice.open_or_create_channel("main")?;
let txn_alice = env_alice.arc_txn_begin().unwrap();
let channel_alice = txn_alice.write().open_or_create_channel("main")?;
let mut txn_bob = env_bob.mut_txn_begin().unwrap();
let mut channel_bob = txn_bob.open_or_create_channel("main")?;
let txn_bob = env_bob.arc_txn_begin().unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("main")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(b"a\nb\nx\nc\nd\n")?;
Ok(())
})?;
record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(b"a\nb\nx\nc\nd\n")?;
record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(b"a\nd\n")?;
Ok(())
})?;
let bob_h1 = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "")?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(b"a\nd\n")?;
let bob_h1 = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "")?;
let bob_h2 = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "")?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob1").unwrap();
let bob_h2 = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "")?;
crate::unrecord::unrecord(&mut txn_alice, &mut channel_alice, &changes, &bob_h2).unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice4").unwrap();
crate::unrecord::unrecord(
&mut *txn_alice.write(),
&channel_alice,
&changes,
&bob_h2,
0,
)
.unwrap();
let mut txn_alice = env_alice.mut_txn_begin().unwrap();
let mut channel_alice = txn_alice.open_or_create_channel("main")?;
let txn_alice = env_alice.arc_txn_begin().unwrap();
let channel_alice = txn_alice.write().open_or_create_channel("main")?;
txn_alice.add_file("file")?;
txn_alice.add_dir("dir")?;
let init = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
txn_alice.write().add_file("file", 0)?;
txn_alice.write().add_dir("dir", 0)?;
let init = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut txn_bob = env_bob.mut_txn_begin().unwrap();
let mut channel_bob = txn_bob.open_or_create_channel("main")?;
let mut txn_bob = env_bob.arc_txn_begin().unwrap();
let mut channel_bob = txn_bob.write().open_or_create_channel("main")?;
txn_alice.move_file("file", "dir/file").unwrap_or(());
let alice_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1").unwrap();
txn_alice
.write()
.move_file("file", "dir/file", 0)
.unwrap_or(());
let alice_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "")?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob0").unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "")?;
let resolution = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "")?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob2").unwrap();
let resolution = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "")?;
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut repo_bob = working_copy::memory::Memory::new();
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let repo_bob = working_copy::memory::Memory::new();
let channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change(
&changes,
&mut *txn.write(),
&mut *channel_bob.write(),
&init_h,
)?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice").unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob").unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let alice_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let resolution = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice2").unwrap();
let resolution = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
crate::unrecord::unrecord(&mut txn, &mut channel_bob, &changes, &resolution).unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob3").unwrap();
crate::unrecord::unrecord(&mut *txn.write(), &channel_bob, &changes, &resolution, 0).unwrap();
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change(
&changes,
&mut *txn.write(),
&mut *channel_bob.write(),
&init_h,
)?;
let mut repo_charlie = working_copy::memory::Memory::new();
let mut channel_charlie = txn.open_or_create_channel("charlie")?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &init_h)?;
let repo_charlie = working_copy::memory::Memory::new();
let channel_charlie = txn.write().open_or_create_channel("charlie")?;
apply::apply_change(
&changes,
&mut *txn.write(),
&mut *channel_charlie.write(),
&init_h,
)?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice").unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob").unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_charlie.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(charlie).unwrap();
Ok(())
})?;
let charlie_h = record_all(
&mut repo_charlie,
&changes,
&mut txn,
&mut channel_charlie,
"",
)?;
debug_to_file(&txn, &channel_charlie.borrow(), "debug_charlie0").unwrap();
repo_charlie
.write_file("file")
.unwrap()
.write_all(charlie)
.unwrap();
let charlie_h = record_all(&repo_charlie, &changes, &txn, &channel_charlie, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let alice_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let resolution = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice2").unwrap();
let resolution = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &alice_h).unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_bob, &charlie_h).unwrap();
apply::apply_change(
&changes,
&mut *txn.write(),
&mut *channel_bob.write(),
&alice_h,
)
.unwrap();
apply::apply_change(
&changes,
&mut *txn.write(),
&mut *channel_bob.write(),
&charlie_h,
)
.unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &alice_h).unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &bob_h).unwrap();
apply::apply_change_arc(&changes, &txn, &channel_charlie, &alice_h).unwrap();
apply::apply_change_arc(&changes, &txn, &channel_charlie, &bob_h).unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &resolution).unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &resolution2).unwrap();
apply::apply_change_arc(&changes, &txn, &channel_charlie, &resolution).unwrap();
apply::apply_change_arc(&changes, &txn, &channel_charlie, &resolution2).unwrap();
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut repo_bob = working_copy::memory::Memory::new();
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let repo_bob = working_copy::memory::Memory::new();
let channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice").unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob").unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let alice_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let resolution = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice2").unwrap();
let resolution = record_all(&mut repo_alice, &changes, &txn, &channel_alice, "")?;
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&mut repo, &changes, &txn, &channel_alice, "")?;
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice").unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob").unwrap();
let bob_h = record_all(&mut repo, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo, &changes, &txn, &channel_bob, "")?;
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo.write_file("file").unwrap().write_all(alice).unwrap();
let alice_h = record_all(&repo, &changes, &txn, &channel_alice, "")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &alice_h)?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &resolution)?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &alice_h)?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &resolution)?;
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo, &changes, &txn, &channel_alice, "")?;
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice").unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob").unwrap();
let bob_h = record_all(&mut repo, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo, &changes, &txn, &channel_bob, "")?;
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo.write_file("file").unwrap().write_all(alice).unwrap();
let alice_h = record_all(&repo, &changes, &txn, &channel_alice, "")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &alice_h)?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &resolution)?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &alice_h)?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &resolution)?;
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let mut txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo, &changes, &txn, &channel_alice, "")?;
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let mut channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})
.unwrap();
record_all(&mut repo, &changes, &mut txn, &mut channel_bob, "").unwrap()
repo.write_file("file").unwrap().write_all(bob).unwrap();
record_all(&repo, &changes, &txn, &channel_bob, "").unwrap()
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})
.unwrap();
record_all(&mut repo, &changes, &mut txn, &mut channel_alice, "").unwrap()
repo.write_file("file").unwrap().write_all(alice).unwrap();
record_all(&repo, &changes, &txn, &channel_alice, "").unwrap()
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let mut txn = env.arc_txn_begin().unwrap();
let mut channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut repo_bob = working_copy::memory::Memory::new();
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let repo_bob = working_copy::memory::Memory::new();
let channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice").unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob").unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let alice_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &resolution).unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob2").unwrap();
apply::apply_change_arc(&changes, &txn, &channel_bob, &resolution).unwrap();
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let mut txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let mut channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice").unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob").unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let alice_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let resolution = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice2").unwrap();
let resolution = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &resolution).unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob2").unwrap();
apply::apply_change_arc(&changes, &txn, &channel_bob, &resolution).unwrap();
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut repo_bob = working_copy::memory::Memory::new();
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let repo_bob = working_copy::memory::Memory::new();
let channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice").unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob").unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let alice_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let resolution = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice2").unwrap();
let resolution = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut repo_bob = working_copy::memory::Memory::new();
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let repo_bob = working_copy::memory::Memory::new();
let channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice").unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob").unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let alice_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let resolution_alice = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice2").unwrap();
let resolution_alice = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
repo_alice
.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(c)?;
Ok(())
})
.unwrap();
record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap()
repo_alice.write_file("file").unwrap().write_all(c).unwrap();
record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap()
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &p_alice[0]).unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &p_alice[0]).unwrap();
let p_bob = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob0")?;
let p_bob = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, p).unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), &format!("debug_bob_{}", n))?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, p).unwrap();
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(b"x\nc\n")?;
Ok(())
})?;
let resolution =
record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob2")?;
repo_bob.write_file("file").unwrap().write_all(b"x\nc\n")?;
let resolution = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &p_bob).unwrap();
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_alice1")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &p_bob).unwrap();
repo_alice
.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(c)?;
Ok(())
})
.unwrap();
record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)
.unwrap()
repo_alice.write_file("file").unwrap().write_all(c).unwrap();
record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "").unwrap()
let mut channel_bob = txn_bob.open_or_create_channel("bob").unwrap();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &p_alice[0]).unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob").unwrap();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &p_alice[0]).unwrap();
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(b"a\nb\nx\ny\nz\nc\nd\n")?;
Ok(())
})?;
let p_bob = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob0")?;
repo_bob
.write_file("file")
.unwrap()
.write_all(b"a\nb\nx\ny\nz\nc\nd\n")
.unwrap();
let p_bob = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(b"a\nz\nd\n")?;
Ok(())
})?;
let resolution =
record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "").unwrap();
repo_bob
.write_file("file")
.unwrap()
.write_all(b"a\nz\nd\n")?;
let resolution = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "").unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &p_bob).unwrap();
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &resolution).unwrap();
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &p_bob).unwrap();
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &resolution).unwrap();
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut repo_bob = working_copy::memory::Memory::new();
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let repo_bob = working_copy::memory::Memory::new();
let channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
let mut repo_charlie = working_copy::memory::Memory::new();
let mut channel_charlie = txn.open_or_create_channel("charlie")?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &init_h)?;
let repo_charlie = working_copy::memory::Memory::new();
let channel_charlie = txn.write().open_or_create_channel("charlie")?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &init_h)?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let alice_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
let bob_h = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_charlie.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(charlie).unwrap();
Ok(())
})?;
record_all(
&mut repo_charlie,
&changes,
&mut txn,
&mut channel_charlie,
"",
)?;
debug_to_file(&txn, &channel_charlie.borrow(), "debug_charlie0").unwrap();
repo_charlie
.write_file("file")
.unwrap()
.write_all(charlie)
.unwrap();
record_all(&repo_charlie, &changes, &txn, &channel_charlie, "")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &alice_h)?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &resolution)?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob1").unwrap();
apply::apply_change_arc(&changes, &txn, &channel_bob, &alice_h)?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &resolution)?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &bob_h)?;
debug_to_file(&txn, &channel_charlie.borrow(), "debug_charlie1").unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &alice_h)?;
debug_to_file(&txn, &channel_charlie.borrow(), "debug_charlie2").unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &resolution)?;
debug_to_file(&txn, &channel_charlie.borrow(), "debug_charlie3").unwrap();
apply::apply_change_arc(&changes, &txn, &channel_charlie, &bob_h)?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &alice_h)?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &resolution)?;
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let mut txn = env.arc_txn_begin().unwrap();
let channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let mut channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
let mut repo_charlie = working_copy::memory::Memory::new();
let mut channel_charlie = txn.open_or_create_channel("charlie")?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &init_h)?;
let repo_charlie = working_copy::memory::Memory::new();
let channel_charlie = txn.write().open_or_create_channel("charlie")?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &init_h)?;
)?;
repo_charlie.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(charlie).unwrap();
Ok(())
})?;
let charlie_h = record_all(
&mut repo_charlie,
&changes,
&mut txn,
&mut channel_charlie,
"",
1,
0,
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice").unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob").unwrap();
let bob_h = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let alice_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let alices_resolution =
record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice2").unwrap();
let alices_resolution = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &charlie_h).unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob2").unwrap();
apply::apply_change_arc(&changes, &txn, &channel_bob, &charlie_h).unwrap();
let mut txn = env.mut_txn_begin().unwrap();
let mut channel_alice = txn.open_or_create_channel("alice")?;
txn.add_file("file")?;
let init_h = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_init").unwrap();
let mut txn = env.arc_txn_begin().unwrap();
let mut channel_alice = txn.write().open_or_create_channel("alice")?;
txn.write().add_file("file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
let mut repo_bob = working_copy::memory::Memory::new();
let mut channel_bob = txn.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &init_h)?;
let repo_bob = working_copy::memory::Memory::new();
let channel_bob = txn.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn, &channel_bob, &init_h)?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob).unwrap();
Ok(())
})?;
let bob_h1 = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob2).unwrap();
Ok(())
})?;
let bob_h2 = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
repo_bob.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(bob3).unwrap();
Ok(())
})?;
let bob_h3 = record_all(&mut repo_bob, &changes, &mut txn, &mut channel_bob, "")?;
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob0").unwrap();
repo_bob.write_file("file").unwrap().write_all(bob).unwrap();
let bob_h1 = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_bob
.write_file("file")
.unwrap()
.write_all(bob2)
.unwrap();
let bob_h2 = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_bob
.write_file("file")
.unwrap()
.write_all(bob3)
.unwrap();
let bob_h3 = record_all(&repo_bob, &changes, &txn, &channel_bob, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice).unwrap();
Ok(())
})?;
let alice_h1 = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice2).unwrap();
Ok(())
})?;
let alice_h2 = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
repo_alice.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(alice3).unwrap();
Ok(())
})?;
let alice_h3 = record_all(&mut repo_alice, &changes, &mut txn, &mut channel_alice, "")?;
debug_to_file(&txn, &channel_alice.borrow(), "debug_alice0").unwrap();
repo_alice
.write_file("file")
.unwrap()
.write_all(alice)
.unwrap();
let alice_h1 = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
repo_alice
.write_file("file")
.unwrap()
.write_all(alice2)
.unwrap();
let alice_h2 = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
repo_alice
.write_file("file")
.unwrap()
.write_all(alice3)
.unwrap();
let alice_h3 = record_all(&repo_alice, &changes, &txn, &channel_alice, "")?;
apply::apply_change(&changes, &mut txn, &mut channel_alice, &bob_h1)?;
apply::apply_change(&changes, &mut txn, &mut channel_alice, &bob_h2)?;
apply::apply_change(&changes, &mut txn, &mut channel_alice, &bob_h3)?;
apply::apply_change_arc(&changes, &txn, &channel_alice, &bob_h1)?;
apply::apply_change_arc(&changes, &txn, &channel_alice, &bob_h2)?;
apply::apply_change_arc(&changes, &txn, &channel_alice, &bob_h3)?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &alice_h1).unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_bob, &alice_h2).unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_bob, &alice_h3).unwrap();
apply::apply_change_arc(&changes, &txn, &channel_bob, &alice_h1).unwrap();
apply::apply_change_arc(&changes, &txn, &channel_bob, &alice_h2).unwrap();
apply::apply_change_arc(&changes, &txn, &channel_bob, &alice_h3).unwrap();
let mut repo_charlie = working_copy::memory::Memory::new();
let mut channel_charlie = txn.open_or_create_channel("charlie")?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &init_h)?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &alice_h1)?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &alice_h2)?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &alice_h3)?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &bob_h1)?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &bob_h2)?;
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &bob_h3)?;
let repo_charlie = working_copy::memory::Memory::new();
let channel_charlie = txn.write().open_or_create_channel("charlie")?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &init_h)?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &alice_h1)?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &alice_h2)?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &alice_h3)?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &bob_h1)?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &bob_h2)?;
apply::apply_change_arc(&changes, &txn, &channel_charlie, &bob_h3)?;
repo_charlie.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(charlie).unwrap();
Ok(())
})?;
let charlie_h = record_all(
&mut repo_charlie,
&changes,
&mut txn,
&mut channel_charlie,
"",
)?;
repo_charlie
.write_file("file")
.unwrap()
.write_all(charlie)
.unwrap();
let charlie_h = record_all(&repo_charlie, &changes, &txn, &channel_charlie, "")?;
apply::apply_change(&changes, &mut txn, &mut channel_bob, &alices_resolution).unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob2").unwrap();
apply::apply_change_arc(&changes, &txn, &channel_bob, &alices_resolution).unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_bob, &charlie_h).unwrap();
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob4").unwrap();
let (alive_, reachable_) = check_alive(&txn, &channel_bob.borrow().graph);
apply::apply_change_arc(&changes, &txn, &channel_bob, &charlie_h).unwrap();
let (alive_, reachable_) = check_alive(&*txn.read(), &channel_bob.read().graph);
debug_to_file(&txn, &channel_bob.borrow(), "debug_bob5").unwrap();
let (alive, reachable) = check_alive(&txn, &channel_bob.borrow().graph);
let (alive, reachable) = check_alive(&*txn.read(), &channel_bob.read().graph);
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &alices_resolution).unwrap();
apply::apply_change(&changes, &mut txn, &mut channel_charlie, &bobs_resolution).unwrap();
debug_to_file(&txn, &channel_charlie.borrow(), "debug_charlie").unwrap();
let (alive, reachable) = check_alive(&txn, &channel_charlie.borrow().graph);
apply::apply_change_arc(&changes, &txn, &channel_charlie, &alices_resolution).unwrap();
apply::apply_change_arc(&changes, &txn, &channel_charlie, &bobs_resolution).unwrap();
let (alive, reachable) = check_alive(&*txn.read(), &channel_charlie.read().graph);
let mut txn_alice = env_alice.mut_txn_begin().unwrap();
let mut txn_bob = env_bob.mut_txn_begin().unwrap();
let mut channel_alice = txn_alice.open_or_create_channel("alice")?;
txn_alice.add_file("a/file")?;
txn_alice.add_file("b/file")?;
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_init").unwrap();
let mut txn_alice = env_alice.arc_txn_begin().unwrap();
let txn_bob = env_bob.arc_txn_begin().unwrap();
let mut channel_alice = txn_alice.write().open_or_create_channel("alice")?;
txn_alice.write().add_file("a/file", 0)?;
txn_alice.write().add_file("b/file", 0)?;
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut channel_bob = txn_bob.open_or_create_channel("bob")?;
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h)?;
let channel_bob = txn_bob.write().open_or_create_channel("bob")?;
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h)?;
let _ba = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
apply::apply_change(&changes, &mut txn_alice, &mut channel_alice, &ab)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug").unwrap();
let _ba = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
apply::apply_change_arc(&changes, &txn_alice, &channel_alice, &ab)?;
let mut txn_alice = env_alice.mut_txn_begin().unwrap();
let mut channel_alice = txn_alice.open_or_create_channel("alice")?;
txn_alice.add_file("a/b/file")?;
let txn_alice = env_alice.arc_txn_begin().unwrap();
let channel_alice = txn_alice.write().open_or_create_channel("alice")?;
txn_alice.write().add_file("a/b/file", 0)?;
let mut txn_bob = env_bob.mut_txn_begin().unwrap();
let mut channel_bob = txn_bob.open_or_create_channel("bob")?;
txn_bob.add_file("a/b/file")?;
let txn_bob = env_bob.arc_txn_begin().unwrap();
let channel_bob = txn_bob.write().open_or_create_channel("bob")?;
txn_bob.write().add_file("a/b/file", 0)?;
let init_h = record_all(
&mut repo_alice,
&changes,
&mut txn_alice,
&mut channel_alice,
"",
)?;
debug_to_file(&txn_alice, &channel_alice.borrow(), "debug_init").unwrap();
let init_h = record_all(&repo_alice, &changes, &txn_alice, &channel_alice, "")?;
let mut repo_bob = working_copy::memory::Memory::new();
apply::apply_change(&changes, &mut txn_bob, &mut channel_bob, &init_h)?;
let repo_bob = working_copy::memory::Memory::new();
apply::apply_change_arc(&changes, &txn_bob, &channel_bob, &init_h)?;
txn_bob.remove_file("a")?;
let bob_h = record_all(&mut repo_bob, &changes, &mut txn_bob, &mut channel_bob, "")?;
debug_to_file(&txn_bob, &channel_bob.borrow(), "debug_bob0").unwrap();
txn_bob.write().remove_file("a")?;
let bob_h = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "")?;
txn.add_file("file")?;
recorded_changes.push(record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap());
debug_to_file(&txn, &channel.borrow(), "debug0").unwrap();
repo.write_file::<_, std::io::Error, _>("file", |w| {
w.write_all(contents2).unwrap();
Ok(())
})
.unwrap();
recorded_changes.push(record_all(&mut repo, &changes, &mut txn, &mut channel, "").unwrap());
debug_to_file(&txn, &channel.borrow(), "debug1").unwrap();
txn.write().add_file("file", 0)?;
recorded_changes.push(record_all(&repo, &changes, &txn, &channel, "").unwrap());
repo.write_file("file")
.unwrap()
.write_all(contents2)
.unwrap();
recorded_changes.push(record_all(&repo, &changes, &txn, &channel, "").unwrap());
apply::apply_change(&changes, &mut txn2, &mut channel, h).unwrap();
debug_to_file(&txn2, &channel.borrow(), "debug2").unwrap();
apply::apply_change(&changes, &mut *txn2.write(), &mut *channel.write(), h).unwrap();
&mut repo2,
&changes,
&mut txn2,
&mut channel,
"",
true,
None,
&repo2, &changes, &txn2, &channel, "", true, None, 1, 0,
let mut channel = txn.open_or_create_channel("main").unwrap();
txn.add_file("a/b/c/d")?;
txn.add_file("e/f/g/h")?;
txn.add_file("i/j/k/l")?;
record_all(&mut repo, &changes, &mut txn, &mut channel, "")?
let channel = txn.write().open_or_create_channel("main").unwrap();
txn.write().add_file("a/b/c/d", 0)?;
txn.write().add_file("e/f/g/h", 0)?;
txn.write().add_file("i/j/k/l", 0)?;
record_all(&repo, &changes, &txn, &channel, "")?
let mut channel = txn.open_or_create_channel("main").unwrap();
repo.write_file::<_, std::io::Error, _>("a/b/c/d", |w| {
w.write_all(b"edits\n")?;
Ok(())
})?;
repo.write_file::<_, std::io::Error, _>("e/f/g/h", |w| {
w.write_all(b"edits\n")?;
Ok(())
})?;
record_all(&mut repo, &changes, &mut txn, &mut channel, "a/b/c/d")?
let channel = txn.write().open_or_create_channel("main").unwrap();
repo.write_file("a/b/c/d").unwrap().write_all(b"edits\n")?;
repo.write_file("e/f/g/h").unwrap().write_all(b"edits\n")?;
record_all(&mut repo, &changes, &txn, &channel, "a/b/c/d")?
let mut channel = txn2.open_or_create_channel("main2").unwrap();
apply::apply_change(&changes, &mut txn2, &mut channel, &h).unwrap();
let channel = txn2.write().open_or_create_channel("main2").unwrap();
apply::apply_change(&changes, &mut *txn2.write(), &mut *channel.write(), &h).unwrap();
&mut repo2,
&changes,
&mut txn2,
&mut channel,
"e/f",
true,
None,
&repo2, &changes, &txn2, &channel, "e/f", true, None, 1, 0,
&mut repo2,
&changes,
&mut txn2,
&mut channel,
"",
true,
None,
&repo2, &changes, &txn2, &channel, "", true, None, 1, 0,
let mut txn = env.mut_txn_begin().unwrap();
let mut channel = txn.open_or_create_channel("main")?;
txn.add_file("file")?;
txn.add_file("file2")?;
let txn = env.arc_txn_begin().unwrap();
let mut channel = txn.write().open_or_create_channel("main")?;
txn.write().add_file("file", 0)?;
txn.write().add_file("file2", 0)?;
}
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(),
&mut channel.borrow_mut(),
repo,
store,
prefix,
)?;
let rec = state.finish();
let changes = rec
.actions
.into_iter()
.map(|rec| rec.globalize(txn).unwrap())
.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(),
)
.unwrap();
let hash = store.save_change(&change0)?;
apply::apply_local_change(txn, channel, &change0, &hash, &rec.updatables)?;
Ok((hash, change0))
let mut txn = env.mut_txn_begin().unwrap();
let mut channel = txn.open_or_create_channel("main")?;
txn.add_file("file")?;
txn.add_file("file2")?;
let (h0, change0) = record_all(&mut repo, &store, &mut txn, &mut channel, "")?;
let txn = env.arc_txn_begin().unwrap();
let channel = txn.write().open_or_create_channel("main")?;
txn.write().add_file("file", 0)?;
txn.write().add_file("file2", 0)?;
let h0 = record_all(&repo, &store, &txn, &channel, "")?;
let change0 = store.get_change(&h0).unwrap();
repo.write_file::<_, std::io::Error, _>("file", |w| {
write!(w, "a\nx\nc\ne\ny\nf\n")?;
Ok(())
})?;
let (h1, change1) = record_all(&mut repo, &store, &mut txn, &mut channel, "")?;
write!(repo.write_file("file")?, "a\nx\nc\ne\ny\nf\n")?;
let h1 = record_all(&repo, &store, &txn, &channel, "")?;
let change1 = store.get_change(&h1).unwrap();
txn.move_file("file", "file3")?;
let (h3, change3) = record_all(&mut repo, &store, &mut txn, &mut channel, "")?;
txn.write().move_file("file", "file3", 0)?;
let h3 = record_all(&repo, &store, &txn, &channel, "")?;
let change3 = store.get_change(&h3).unwrap();
let mut txn2 = env2.mut_txn_begin().unwrap();
let mut channel2 = txn2.open_or_create_channel("main")?;
let mut repo2 = working_copy::memory::Memory::new();
apply::apply_change(&store, &mut txn2, &mut channel2, &h0)?;
apply::apply_change(&store, &mut txn2, &mut channel2, &h1)?;
apply::apply_change(&store, &mut txn2, &mut channel2, &h2)?;
output::output_repository_no_pending(
&mut repo2,
&store,
&mut txn2,
&mut channel2,
"",
true,
None,
)?;
let txn2 = env2.arc_txn_begin().unwrap();
let channel2 = txn2.write().open_or_create_channel("main")?;
let repo2 = working_copy::memory::Memory::new();
apply::apply_change(&store, &mut *txn2.write(), &mut *channel2.write(), &h0)?;
apply::apply_change(&store, &mut *txn2.write(), &mut *channel2.write(), &h1)?;
apply::apply_change(&store, &mut *txn2.write(), &mut *channel2.write(), &h2)?;
output::output_repository_no_pending(&repo2, &store, &txn2, &channel2, "", true, None, 1, 0)?;
apply::apply_change(&store, &mut txn2, &mut channel2, &h3)?;
output::output_repository_no_pending(
&mut repo2,
&store,
&mut txn2,
&mut channel2,
"",
true,
None,
)?;
let (h, solution) = record_all(&mut repo2, &store, &mut txn2, &mut channel2, "")?;
apply::apply_change(&store, &mut *txn2.write(), &mut *channel2.write(), &h3)?;
output::output_repository_no_pending(&repo2, &store, &txn2, &channel2, "", true, None, 1, 0)?;
let h = record_all(&repo2, &store, &txn2, &channel2, "")?;
let solution = store.get_change(&h).unwrap();
let channel = txn.write().unwrap().open_or_create_channel("main").unwrap();
record_all(repo, &changes, txn.clone(), channel.clone(), "").unwrap();
let channel = txn.write().open_or_create_channel("main").unwrap();
record_all(&repo, &changes, &txn, &channel, "").unwrap();
assert!(txn.write().unwrap().add_file("dir/file", 0).is_err());
debug_to_file(&*txn.read().unwrap(), &channel, "debug").unwrap();
commit(txn).unwrap()
assert!(txn.write().add_file("dir/file", 0).is_err());
txn.commit().unwrap()
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
txn.write().unwrap().add_file("dir/file", 0).unwrap();
let channel = txn.write().unwrap().open_or_create_channel("main").unwrap();
let txn = env.arc_txn_begin().unwrap();
txn.write().add_file("dir/file", 0).unwrap();
let channel = txn.write().open_or_create_channel("main").unwrap();
record_all_output(
repo.clone(),
changes.clone(),
txn.clone(),
channel.clone(),
"",
)
.unwrap();
debug_to_file(&*txn.read().unwrap(), &channel, "debug0").unwrap();
let files: Vec<_> = crate::fs::iter_working_copy(&*txn.read().unwrap(), Inode::ROOT)
record_all_output(&repo, changes.clone(), &txn, &channel, "").unwrap();
let files: Vec<_> = crate::fs::iter_working_copy(&*txn.read(), Inode::ROOT)
record_all_output(repo, changes, txn.clone(), channel.clone(), "").unwrap();
debug_to_file(&*txn.read().unwrap(), &channel, "debug").unwrap();
record_all_output(&repo, changes, &txn, &channel, "").unwrap();
txn.write().unwrap().add_file("dir2/file", 0).unwrap();
txn.write().unwrap().remove_file("dir2").unwrap();
txn.write().add_file("dir2/file", 0).unwrap();
txn.write().remove_file("dir2").unwrap();
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
txn.write().unwrap().add_file("a/b/c/d/e", 0)?;
let channel = txn.write().unwrap().open_or_create_channel("main")?;
let txn = env.arc_txn_begin().unwrap();
txn.write().add_file("a/b/c/d/e", 0)?;
let channel = txn.write().open_or_create_channel("main")?;
record_all_output(
repo.clone(),
changes.clone(),
txn.clone(),
channel.clone(),
"",
)?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug0").unwrap();
let files: Vec<_> = crate::fs::iter_working_copy(&*txn.read().unwrap(), Inode::ROOT)
record_all_output(&repo, changes.clone(), &txn, &channel, "")?;
let files: Vec<_> = crate::fs::iter_working_copy(&*txn.read(), Inode::ROOT)
record_all_output(
repo.clone(),
changes.clone(),
txn.clone(),
channel.clone(),
"",
)?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug").unwrap();
record_all_output(&repo, changes.clone(), &txn, &channel, "")?;
let repo2 = Arc::new(working_copy::memory::Memory::new());
output::output_repository_no_pending(
repo2.clone(),
&changes,
txn.clone(),
channel.clone(),
"",
true,
None,
1,
0,
)?;
let repo2 = working_copy::memory::Memory::new();
output::output_repository_no_pending(&repo2, &changes, &txn, &channel, "", true, None, 1, 0)?;
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
txn.write().unwrap().add_file("dir/file", 0)?;
let channel = txn.write().unwrap().open_or_create_channel("main")?;
let txn = env.arc_txn_begin().unwrap();
txn.write().add_file("dir/file", 0)?;
let channel = txn.write().open_or_create_channel("main")?;
record_all_output(
repo.clone(),
changes.clone(),
txn.clone(),
channel.clone(),
"",
)
.unwrap();
debug_to_file(&*txn.read().unwrap(), &channel, "debug").unwrap();
record_all_output(&repo, changes.clone(), &txn, &channel, "").unwrap();
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
txn.write().unwrap().add_file("dir/file", 0)?;
let channel = txn.write().unwrap().open_or_create_channel("main")?;
let txn = env.arc_txn_begin().unwrap();
txn.write().add_file("dir/file", 0)?;
let channel = txn.write().open_or_create_channel("main")?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug0").unwrap();
record_all_output(
repo.clone(),
changes.clone(),
txn.clone(),
channel.clone(),
"",
)?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug1").unwrap();
record_all_output(&repo, changes.clone(), &txn, &channel, "")?;
let txn_alice = Arc::new(RwLock::new(env_alice.mut_txn_begin().unwrap()));
txn_alice.write().unwrap().add_file("file", 0)?;
let txn_alice = env_alice.arc_txn_begin().unwrap();
txn_alice.write().add_file("file", 0)?;
let channel = (&mut *txn_alice.write().unwrap()).open_or_create_channel("main")?;
let alice0 = record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
debug_to_file(&*txn_alice.read().unwrap(), &channel, "debug0").unwrap();
let channel = txn_alice.write().open_or_create_channel("main")?;
let alice0 = record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
let alice1 = record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
debug_to_file(&*txn_alice.read().unwrap(), &channel, "debug1").unwrap();
let alice1 = record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
let txn_bob = Arc::new(RwLock::new(env_bob.mut_txn_begin().unwrap()));
let channel = (&mut *txn_bob.write().unwrap()).open_or_create_channel("main")?;
let txn_bob = env_bob.arc_txn_begin().unwrap();
let channel = (&mut *txn_bob.write()).open_or_create_channel("main")?;
repo_bob.clone(),
&changes,
txn_bob.clone(),
channel.clone(),
"",
true,
None,
1,
0,
&repo_bob, &changes, &txn_bob, &channel, "", true, None, 1, 0,
repo_bob.clone(),
&changes,
txn_bob.clone(),
channel.clone(),
"",
true,
None,
1,
0,
&repo_bob, &changes, &txn_bob, &channel, "", true, None, 1, 0,
let txn_alice = Arc::new(RwLock::new(env_alice.mut_txn_begin().unwrap()));
txn_alice.write().unwrap().add_file("file", 0)?;
let txn_alice = env_alice.arc_txn_begin().unwrap();
txn_alice.write().add_file("file", 0)?;
let channel = (&mut *txn_alice.write().unwrap()).open_or_create_channel("main")?;
let alice0 = record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
let channel = (&mut *txn_alice.write()).open_or_create_channel("main")?;
let alice0 = record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
debug_to_file(&*txn_alice.read().unwrap(), &channel, "debug0").unwrap();
txn_alice.write().unwrap().add_dir("dir", 0)?;
txn_alice
.write()
.unwrap()
.move_file("file", "dir/file2", 0)?;
txn_alice.write().add_dir("dir", 0)?;
txn_alice.write().move_file("file", "dir/file2", 0)?;
debug_tree(&*txn_alice.read().unwrap(), "debug_tree")?;
let alice1 = record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
debug_tree(&*txn_alice.read(), "debug_tree")?;
let alice1 = record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
debug_to_file(&*txn_alice.read().unwrap(), &channel, "debug1").unwrap();
debug_tree(&*txn_alice.read().unwrap(), "debug_tree")?;
debug_inodes(&*txn_alice.read().unwrap());
debug_tree(&*txn_alice.read(), "debug_tree")?;
debug_inodes(&*txn_alice.read());
let alice2 = record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
debug_to_file(&*txn_alice.read().unwrap(), &channel, "debug2").unwrap();
commit(txn_alice).unwrap();
let alice2 = record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
txn_alice.commit().unwrap();
let txn_bob = Arc::new(RwLock::new(env_bob.mut_txn_begin().unwrap()));
let channel = (&mut *txn_bob.write().unwrap()).open_or_create_channel("main")?;
let txn_bob = env_bob.arc_txn_begin().unwrap();
let channel = (&mut *txn_bob.write()).open_or_create_channel("main")?;
repo_bob.clone(),
&changes,
txn_bob.clone(),
channel.clone(),
"",
true,
None,
1,
0,
&repo_bob, &changes, &txn_bob, &channel, "", true, None, 1, 0,
repo_bob.clone(),
&changes,
txn_bob.clone(),
channel.clone(),
"",
true,
None,
1,
0,
&repo_bob, &changes, &txn_bob, &channel, "", true, None, 1, 0,
repo_bob.clone(),
&changes,
txn_bob,
channel,
"",
true,
None,
1,
0,
&repo_bob, &changes, &txn_bob, &channel, "", true, None, 1, 0,
let txn_alice = Arc::new(RwLock::new(env_alice.mut_txn_begin().unwrap()));
txn_alice.write().unwrap().add_file("file", 0)?;
txn_alice.write().unwrap().add_file("file2", 0)?;
let txn_alice = env_alice.arc_txn_begin().unwrap();
txn_alice.write().add_file("file", 0)?;
txn_alice.write().add_file("file2", 0)?;
let channel = (&mut *txn_alice.write().unwrap()).open_or_create_channel("main")?;
record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
txn_alice.write().unwrap().move_file("file", "file2", 0)?;
let channel = (&mut *txn_alice.write()).open_or_create_channel("main")?;
record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
txn_alice.write().move_file("file", "file2", 0)?;
record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
debug_to_file(&*txn_alice.read().unwrap(), &channel, "debug1").unwrap();
record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
let channel = txn_alice.write().unwrap().open_or_create_channel("main")?;
let alice1 = record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
let channel = txn_alice.write().open_or_create_channel("main")?;
let alice1 = record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
let alice2 = record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
debug_to_file(&*txn_alice.read().unwrap(), &channel, "debug1").unwrap();
let alice2 = record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
let alice3 = record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
debug_to_file(&*txn_alice.read().unwrap(), &channel, "debug2").unwrap();
let alice3 = record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
let txn_bob = Arc::new(RwLock::new(env_bob.mut_txn_begin().unwrap()));
let channel_bob = (&mut *txn_bob.write().unwrap()).open_or_create_channel("main")?;
let txn_bob = env_bob.arc_txn_begin().unwrap();
let channel_bob = (&mut *txn_bob.write()).open_or_create_channel("main")?;
let bob1 = record_all(
repo_bob.clone(),
&changes,
txn_bob.clone(),
channel_bob.clone(),
"",
)?;
debug_to_file(&*txn_bob.read().unwrap(), &channel_bob, "debug_bob1").unwrap();
(&mut *txn_bob.write().unwrap())
.apply_change(&changes, &mut *channel_bob.write().unwrap(), &alice2)
let bob1 = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "")?;
(&mut *txn_bob.write())
.apply_change(&changes, &mut *channel_bob.write(), &alice2)
repo_bob.clone(),
&changes,
txn_bob.clone(),
channel.clone(),
"",
true,
None,
1,
0,
&repo_bob, &changes, &txn_bob, &channel, "", true, None, 1, 0,
repo_bob.clone(),
&changes,
txn_bob.clone(),
channel.clone(),
"",
true,
None,
1,
0,
&repo_bob, &changes, &txn_bob, &channel, "", true, None, 1, 0,
let bob2 = record_all(
repo_bob.clone(),
&changes,
txn_bob.clone(),
channel_bob.clone(),
"",
)?;
debug_to_file(&*txn_bob.read().unwrap(), &channel_bob, "debug_bob4").unwrap();
let bob2 = record_all(&repo_bob, &changes, &txn_bob, &channel_bob, "")?;
let txn_alice = Arc::new(RwLock::new(env_alice.mut_txn_begin().unwrap()));
txn_alice.write().unwrap().add_file("dir/file", 0)?;
txn_alice.write().unwrap().add_file("dir/file2", 0)?;
let txn_alice = env_alice.arc_txn_begin().unwrap();
txn_alice.write().add_file("dir/file", 0)?;
txn_alice.write().add_file("dir/file2", 0)?;
let channel = (&mut *txn_alice.write().unwrap()).open_or_create_channel("main")?;
let alice0 = record_all(
repo_alice.clone(),
&changes,
txn_alice.clone(),
channel.clone(),
"",
)?;
let channel = (&mut *txn_alice.write()).open_or_create_channel("main")?;
let alice0 = record_all(&repo_alice, &changes, &txn_alice, &channel, "")?;
txn_alice
.write()
.unwrap()
.move_file("dir/file", "dir2/file", 0)?;
txn_alice
.write()
.unwrap()
.move_file("dir/file2", "dir2/file2", 0)?;
txn_alice.write().move_file("dir/file", "dir2/file", 0)?;
txn_alice.write().move_file("dir/file2", "dir2/file2", 0)?;
let channel = (&mut *txn.write().unwrap())
.open_or_create_channel("main")
.unwrap();
record_all(repo.clone(), &changes, txn.clone(), channel.clone(), "").unwrap();
let channel = (&mut *txn.write()).open_or_create_channel("main").unwrap();
record_all(&repo, &changes, &txn, &channel, "").unwrap();
txn.write().unwrap().add_file("filedir/file", 0).unwrap();
record_all(repo.clone(), &changes, txn.clone(), channel.clone(), "").unwrap();
debug_to_file(&*txn.read().unwrap(), &channel, "debug").unwrap();
txn.write().add_file("filedir/file", 0).unwrap();
record_all(&repo, &changes, &txn, &channel, "").unwrap();
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
txn.write().unwrap().add_file("dir/file", 0)?;
let channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
record_all_output(repo, changes.clone(), txn.clone(), channel.clone(), "")?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug").unwrap();
let files: Vec<_> = crate::fs::iter_working_copy(&*txn.read().unwrap(), Inode::ROOT)
let txn = env.arc_txn_begin().unwrap();
txn.write().add_file("dir/file", 0)?;
let channel = (&mut *txn.write()).open_or_create_channel("main")?;
record_all_output(&repo, changes.clone(), &txn, &channel, "")?;
let files: Vec<_> = crate::fs::iter_working_copy(&*txn.read(), Inode::ROOT)
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
let channel = txn.write().unwrap().open_or_create_channel("main")?;
record_all_output(repo.clone(), changes, txn.clone(), channel.clone(), "")?;
debug_to_file(&*txn.read().unwrap(), &channel, "debug").unwrap();
let files: Vec<_> = crate::fs::iter_working_copy(&*txn.read().unwrap(), Inode::ROOT)
let txn = env.arc_txn_begin().unwrap();
let channel = txn.write().open_or_create_channel("main")?;
record_all_output(&repo, changes, &txn, &channel, "")?;
let files: Vec<_> = crate::fs::iter_working_copy(&*txn.read(), Inode::ROOT)
let txn = Arc::new(RwLock::new(env.mut_txn_begin().unwrap()));
let channel = (&mut *txn.write().unwrap()).open_or_create_channel("main")?;
assert!(record_all_output(repo, changes, txn, channel, "dir").is_err());
let txn = env.arc_txn_begin().unwrap();
let channel = (&mut *txn.write()).open_or_create_channel("main")?;
assert!(record_all_output(&repo, changes, &txn, &channel, "dir").is_err());
txn.write().unwrap().add_file("file", 0)?;
record_all_output(
repo.clone(),
changes.clone(),
txn.clone(),
channel.clone(),
"",
)?;
txn.write().add_file("file", 0)?;
record_all_output(&repo, changes.clone(), &txn, &channel, "")?;
channel.r.write().unwrap().name = name.clone();
self.open_channels
.lock()
.unwrap()
.insert(name, channel.clone());
channel.r.write().name = name.clone();
self.open_channels.lock().insert(name, channel.clone());
std::mem::drop(
self.open_channels
.lock()
.unwrap()
.remove(&channel.r.read().unwrap().name),
);
std::mem::drop(self.open_channels.lock().remove(&channel.r.read().name));
impl<T: MutTxnT> ArcTxn<T> {
pub fn commit(self) -> Result<(), T::GraphError> {
if let Ok(txn) = Arc::try_unwrap(self.0) {
txn.into_inner().commit()
} else {
unreachable!()
}
}
}
impl<T> std::ops::Deref for ArcTxn<T> {
type Target = RwLock<T>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
Base32, ChangeId, ChannelMutTxnT, ChannelRef, ChannelTxnT, DepsTxnT, EdgeFlags, GraphTxnT,
Hash, Inode, Merkle, MutTxnT, OwnedPathId, RemoteRef, TreeTxnT, TxnT, Vertex,
ArcTxn, Base32, ChangeId, ChannelMutTxnT, ChannelRef, ChannelTxnT, DepsTxnT, EdgeFlags,
GraphTxnT, Hash, Inode, Merkle, MutTxnT, OwnedPathId, RemoteRef, TreeTxnT, TxnT, Vertex,
.get_revchangeset(
self.rev_changes(&channel.read().unwrap()),
&pristine::L64(n.to_le()),
)
.get_revchangeset(self.rev_changes(&channel.read()), &pristine::L64(n.to_le()))
#[cfg(test)]
mod tests {
use super::*;
use detone::IterDecomposeVietnamese;
use encoding_rs::IBM866;
use encoding_rs::ISO_8859_2;
use encoding_rs::ISO_8859_4;
use encoding_rs::ISO_8859_5;
use encoding_rs::ISO_8859_6;
use encoding_rs::ISO_8859_7;
use encoding_rs::KOI8_U;
use encoding_rs::WINDOWS_1250;
use encoding_rs::WINDOWS_1251;
use encoding_rs::WINDOWS_1252;
use encoding_rs::WINDOWS_1253;
use encoding_rs::WINDOWS_1254;
use encoding_rs::WINDOWS_1256;
use encoding_rs::WINDOWS_1257;
use encoding_rs::WINDOWS_1258;
use encoding_rs::WINDOWS_874;
fn check_bytes(bytes: &[u8], encoding: &'static Encoding) {
let mut det = EncodingDetector::new();
det.feed(bytes, true);
let enc = det.guess(None, false);
let (decoded, _) = enc.decode_without_bom_handling(bytes);
println!("{:?}", decoded);
assert_eq!(enc, encoding);
}
fn check(input: &str, encoding: &'static Encoding) {
let orthographic;
let (bytes, _, _) = if encoding == WINDOWS_1258 {
orthographic = input
.chars()
.decompose_vietnamese_tones(true)
.collect::<String>();
encoding.encode(&orthographic)
} else {
encoding.encode(input)
};
check_bytes(&bytes, encoding);
}
#[test]
fn test_i_apostrophe() {
let mut det = EncodingDetector::new();
det.feed(b"I\x92", true);
let enc = det.guess(None, false);
assert_eq!(enc, WINDOWS_1252);
}
#[test]
fn test_streaming_numero_one_by_one() {
let mut det = EncodingDetector::new();
det.feed(b"n", false);
det.feed(b".", false);
det.feed(b"\xBA", false);
det.feed(b"1", true);
let enc = det.guess(None, false);
assert_eq!(enc, WINDOWS_1252);
}
#[test]
fn test_streaming_numero_two_together() {
let mut det = EncodingDetector::new();
det.feed(b"n.", false);
det.feed(b"\xBA", false);
det.feed(b"1", true);
let enc = det.guess(None, false);
assert_eq!(enc, WINDOWS_1252);
}
#[test]
fn test_streaming_numero_one_by_one_extra_before() {
let mut det = EncodingDetector::new();
det.feed(b" n", false);
det.feed(b".", false);
det.feed(b"\xBA", false);
det.feed(b"1", true);
let enc = det.guess(None, false);
assert_eq!(enc, WINDOWS_1252);
}
#[test]
fn test_streaming_numero_one_before() {
let mut det = EncodingDetector::new();
det.feed(b"n", false);
det.feed(b".\xBA", false);
det.feed(b"1", true);
let enc = det.guess(None, false);
assert_eq!(enc, WINDOWS_1252);
}
#[test]
fn test_streaming_numero_longer_first_buffer() {
let mut det = EncodingDetector::new();
det.feed(b"rrn.", false);
det.feed(b"\xBA", false);
det.feed(b"1", true);
let enc = det.guess(None, false);
assert_eq!(enc, WINDOWS_1252);
}
#[test]
fn test_empty() {
let mut det = EncodingDetector::new();
let seen_non_ascii = det.feed(b"", true);
let enc = det.guess(None, false);
assert_eq!(enc, WINDOWS_1252);
assert!(!seen_non_ascii);
}
#[test]
fn test_fi() {
check("Ääni", WINDOWS_1252);
}
#[test]
fn test_fi_bis() {
check("Tämä", WINDOWS_1252);
}
#[test]
fn test_pt() {
check(
"Este é um teste de codificação de caracteres.",
WINDOWS_1252,
);
}
#[test]
fn test_is() {
check("Þetta er kóðunarpróf á staf. Fyrir sum tungumál sem nota latneska stafi þurfum við meira inntak til að taka ákvörðunina.", WINDOWS_1252);
}
#[test]
fn test_ru_short() {
check("Русский", WINDOWS_1251);
}
#[test]
fn test_ru() {
check("Это тест кодировки символов.", WINDOWS_1251);
}
#[test]
fn test_ru_iso() {
check("Это тест кодировки символов.", ISO_8859_5);
}
#[test]
fn test_ru_ibm() {
check("Это тест кодировки символов.", IBM866);
}
#[test]
fn test_ru_koi() {
check("Это тест кодировки символов.", KOI8_U);
}
#[test]
fn test_uk() {
check("Це тест на кодування символів.", WINDOWS_1251);
}
#[test]
fn test_uk_koi() {
check("Це тест на кодування символів.", KOI8_U);
}
#[test]
fn test_el_short() {
check("Ελληνικά", WINDOWS_1253);
}
#[test]
fn test_el() {
check(
"Πρόκειται για δοκιμή κωδικοποίησης χαρακτήρων: Άρης",
WINDOWS_1253,
);
}
#[test]
fn test_el_iso() {
check(
"Πρόκειται για δοκιμή κωδικοποίησης χαρακτήρων: Άρης",
ISO_8859_7,
);
}
#[test]
fn test_de() {
check("Straße", WINDOWS_1252);
}
#[test]
fn test_en_windows1252() {
// "Don't "
check_bytes(&[68, 111, 110, 180, 116, 32], WINDOWS_1252);
}
#[test]
fn test_he() {
check("\u{5E2}\u{5D1}\u{5E8}\u{5D9}\u{5EA}", WINDOWS_1255);
}
#[test]
fn test_2022() {
check("日本語", ISO_2022_JP);
}
#[test]
fn test_th() {
check("นี่คือการทดสอบการเข้ารหัสอักขระ", WINDOWS_874);
}
#[test]
fn test_vi() {
check("Đây là một thử nghiệm mã hóa ký tự.", WINDOWS_1258);
}
#[test]
fn test_tr() {
check("Bu bir karakter kodlama testidir. Latince karakterleri kullanan bazı dillerde karar vermek için daha fazla girdiye ihtiyacımız var.", WINDOWS_1254);
}
#[test]
fn test_simplified() {
check("这是一个字符编码测试。", GBK);
}
#[test]
fn test_traditional() {
check("這是一個字符編碼測試。", BIG5);
}
#[test]
fn test_ko() {
check("이것은 문자 인코딩 테스트입니다.", EUC_KR);
}
#[test]
fn test_shift() {
check("これは文字実験です。", SHIFT_JIS);
}
#[test]
fn test_euc() {
check("これは文字実験です。", EUC_JP);
}
#[test]
fn test_ar() {
check("هذا هو اختبار ترميز الأحرف.", WINDOWS_1256);
}
#[test]
fn test_ar_iso() {
check("هذا هو اختبار ترميز الأحرف.", ISO_8859_6);
}
#[test]
fn test_fa() {
check("این یک تست رمزگذاری کاراکتر است.", WINDOWS_1256);
}
#[test]
fn test_visual() {
check(".םיוות דודיק ןחבמ והז", ISO_8859_8);
}
#[test]
fn test_yi() {
check("דאָס איז אַ טעסט פֿאַר קאָדירונג פון כאַראַקטער.", WINDOWS_1255);
}
#[test]
fn test_it() {
check("è", WINDOWS_1252);
}
#[test]
fn test_en() {
check("isn’t", WINDOWS_1252);
}
#[test]
fn test_en_bis() {
check("Rock ’n Roll", WINDOWS_1252);
}
#[test]
fn test_ca() {
check("Codificació de caràcters", WINDOWS_1252);
}
#[test]
fn test_et() {
check("või", WINDOWS_1252);
}
#[test]
fn test_pl_iso() {
check("To jest test kodowania znaków. W przypadku niektórych języków, które używają znaków łacińskich, potrzebujemy więcej danych, aby podjąć decyzję.", ISO_8859_2);
}
#[test]
fn test_pl() {
check("To jest test kodowania znaków. W przypadku niektórych języków, które używają znaków łacińskich, potrzebujemy więcej danych, aby podjąć decyzję.", WINDOWS_1250);
}
#[test]
fn test_lt() {
check("Tai simbolių kodavimo testas. Kai kurioms kalboms, naudojančioms lotyniškus rašmenis, mums reikia daugiau informacijos, kad galėtume priimti sprendimą.", WINDOWS_1257);
}
// TODO: Detected as ISO-8859-2.
// #[test]
// fn test_lt_windows_iso_8859_4() {
// check("Tai simbolių kodavimo testas. Kai kurioms kalboms, naudojančioms lotyniškus rašmenis, mums reikia daugiau informacijos, kad galėtume priimti sprendimą.", ISO_8859_4);
// }
#[test]
fn test_lv() {
check("Šis ir rakstzīmju kodēšanas tests. Dažās valodās, kurās tiek izmantotas latīņu valodas burti, lēmuma pieņemšanai mums ir nepieciešams vairāk ieguldījuma.", WINDOWS_1257);
}
#[test]
fn test_lv_iso_8859_4() {
check("Šis ir rakstzīmju kodēšanas tests. Dažās valodās, kurās tiek izmantotas latīņu valodas burti, lēmuma pieņemšanai mums ir nepieciešams vairāk ieguldījuma.", ISO_8859_4);
}
#[test]
fn test_a0() {
// Test that this isn't IBM866. TODO: What about GBK with fully paired 0xA0?
check("\u{A0}\u{A0} \u{A0}", WINDOWS_1252);
}
#[test]
fn test_a0a0() {
// Test that this isn't GBK or EUC-KR.
check("\u{A0}\u{A0}", WINDOWS_1252);
}
#[test]
fn test_space_masculine_space() {
check(" º ", WINDOWS_1252);
}
#[test]
fn test_space_feminine_space() {
check(" ª ", WINDOWS_1252);
}
#[test]
fn test_period_masculine_space() {
check(".º ", WINDOWS_1252);
}
#[test]
fn test_period_feminine_space() {
check(".ª ", WINDOWS_1252);
}
#[test]
fn test_maria() {
check(" Mª ", WINDOWS_1252);
}
#[test]
fn test_dona() {
check(" Dª ", WINDOWS_1252);
}
#[test]
fn test_nuestra() {
check(" Nª ", WINDOWS_1252);
}
#[test]
fn test_senora() {
check(" Sª ", WINDOWS_1252);
}
#[test]
fn test_digit_feminine() {
check(" 42ª ", WINDOWS_1252);
}
#[test]
fn test_digit_masculine() {
check(" 42º ", WINDOWS_1252);
}
#[test]
fn test_roman_feminine() {
check(" XIVª ", WINDOWS_1252);
}
#[test]
fn test_roman_masculine() {
check(" XIVº ", WINDOWS_1252);
}
#[test]
fn test_numero_uno() {
check("Nº1", WINDOWS_1252);
}
#[test]
fn test_numero() {
check("Nº", WINDOWS_1252);
}
#[test]
fn test_euro() {
check(" €9", WINDOWS_1252);
}
#[test]
fn test_shift_jis_half_width_katakana() {
check("ハードウェアハードウェアハードウェアハードウェアハードウェア", SHIFT_JIS);
}
#[test]
fn test_big5_pua() {
let mut v = Vec::new();
for _ in 0..40 {
v.extend_from_slice(b"\xA4\x40");
}
v.extend_from_slice(b"\x81\x40\xA4\x40");
check_bytes(&v, BIG5);
}
#[test]
fn test_big5_single_byte_a0() {
let mut v = Vec::new();
for _ in 0..80 {
v.extend_from_slice(b"\xA4\x40");
}
v.extend_from_slice(b"\x81\x40\xA0 ");
check_bytes(&v, BIG5);
}
#[test]
fn test_big5_single_byte_ff() {
let mut v = Vec::new();
for _ in 0..80 {
v.extend_from_slice(b"\xA4\x40");
}
v.extend_from_slice(b"\x81\x40\xFF ");
check_bytes(&v, BIG5);
}
#[test]
fn test_not_big5() {
let mut v = Vec::new();
for _ in 0..40 {
v.extend_from_slice(b"\xA4\x40");
}
v.extend_from_slice(b"\x81\x40\xA0\xA0");
check_bytes(&v, IBM866);
}
#[test]
fn test_euc_kr_pua() {
let mut v = Vec::new();
v.extend_from_slice(b"\xC9\xA1\xB0\xA1 ");
for _ in 0..40 {
v.extend_from_slice(b"\xC5\xD7\xBD\xBA\xC6\xAE. ");
}
check_bytes(&v, EUC_KR);
}
#[test]
fn test_euc_kr_pua_bis() {
let mut v = Vec::new();
v.extend_from_slice(b"\xFE\xA1\xB0\xA1 ");
for _ in 0..40 {
v.extend_from_slice(b"\xC5\xD7\xBD\xBA\xC6\xAE. ");
}
check_bytes(&v, EUC_KR);
}
#[test]
fn test_euc_kr_single_byte_ff() {
let mut v = Vec::new();
v.extend_from_slice(b"\xFF ");
for _ in 0..40 {
v.extend_from_slice(b"\xC5\xD7\xBD\xBA\xC6\xAE. ");
}
check_bytes(&v, EUC_KR);
}
#[test]
fn test_euc_kr_single_byte_81() {
let mut v = Vec::new();
v.extend_from_slice(b"\x81 ");
for _ in 0..40 {
v.extend_from_slice(b"\xC5\xD7\xBD\xBA\xC6\xAE. ");
}
check_bytes(&v, EUC_KR);
}
#[test]
fn test_euc_kr_single_byte_84() {
let mut v = Vec::new();
v.extend_from_slice(b"\x84 ");
for _ in 0..40 {
v.extend_from_slice(b"\xC5\xD7\xBD\xBA\xC6\xAE. ");
}
check_bytes(&v, EUC_KR);
}
#[test]
fn test_not_euc_kr() {
let mut v = Vec::new();
v.extend_from_slice(b"\xC9\xA0\xB0\xA1 ");
for _ in 0..40 {
v.extend_from_slice(b"\xC5\xD7\xBD\xBA\xC6\xAE. ");
}
check_bytes(&v, GBK);
}
#[test]
fn test_shift_jis_x0213() {
let mut v = Vec::new();
v.extend_from_slice(b"\x87\xE5");
for _ in 0..40 {
v.extend_from_slice(b"\x82\xC9\x82\xD9\x82\xF1\x82\xB2");
}
check_bytes(&v, SHIFT_JIS);
}
#[test]
fn test_shift_jis_single_byte_fd() {
let mut v = Vec::new();
v.extend_from_slice(b"\xFD");
for _ in 0..40 {
v.extend_from_slice(b"\x82\xC9\x82\xD9\x82\xF1\x82\xB2");
}
check_bytes(&v, SHIFT_JIS);
}
#[test]
fn test_not_shift_jis() {
let mut v = Vec::new();
v.extend_from_slice(b"\x84\xE0");
for _ in 0..40 {
v.extend_from_slice(b"\x82\xC9\x82\xD9\x82\xF1\x82\xB2");
}
check_bytes(&v, GBK);
}
#[test]
fn test_not_shift_jis_bis() {
let mut v = Vec::new();
v.extend_from_slice(b"\x87\x7D");
for _ in 0..40 {
v.extend_from_slice(b"\x82\xC9\x82\xD9\x82\xF1\x82\xB2");
}
check_bytes(&v, GBK);
}
#[test]
fn test_euc_jp_x0213() {
let mut v = Vec::new();
v.extend_from_slice(b"\xAD\xBF");
for _ in 0..80 {
v.extend_from_slice(b"\xA4\xCB\xA4\xDB\xA4\xF3\xA4\xB4");
}
check_bytes(&v, EUC_JP);
}
#[test]
fn test_euc_jp_x0213_other_plane() {
let mut v = Vec::new();
v.extend_from_slice(b"\x8F\xFE\xF6");
for _ in 0..80 {
v.extend_from_slice(b"\xA4\xCB\xA4\xDB\xA4\xF3\xA4\xB4");
}
check_bytes(&v, EUC_JP);
}
#[test]
fn test_not_euc_jp() {
let mut v = Vec::new();
v.extend_from_slice(b"\x8F\xFE\xF7");
for _ in 0..80 {
v.extend_from_slice(b"\xA4\xCB\xA4\xDB\xA4\xF3\xA4\xB4");
}
check_bytes(&v, WINDOWS_1252);
}
#[test]
fn test_not_euc_jp_bis() {
let mut v = Vec::new();
v.extend_from_slice(b"\xA8\xDF");
for _ in 0..80 {
v.extend_from_slice(b"\xA4\xCB\xA4\xDB\xA4\xF3\xA4\xB4");
}
check_bytes(&v, BIG5);
}
#[test]
fn test_gbk_single_byte_ff() {
let mut v = Vec::new();
v.extend_from_slice(b"\xFF");
for _ in 0..80 {
v.extend_from_slice(b"\xB5\xC4");
}
check_bytes(&v, GBK);
}
#[test]
fn test_gbk_single_byte_a0() {
let mut v = Vec::new();
v.extend_from_slice(b"\xA0 ");
for _ in 0..80 {
v.extend_from_slice(b"\xB5\xC4");
}
check_bytes(&v, GBK);
}
#[test]
fn test_gbk_single_byte_fe() {
let mut v = Vec::new();
v.extend_from_slice(b"\xFE ");
for _ in 0..80 {
v.extend_from_slice(b"\xB5\xC4");
}
check_bytes(&v, GBK);
}
#[test]
fn test_not_gbk_single_byte_fc() {
let mut v = Vec::new();
v.extend_from_slice(b"\xFC ");
for _ in 0..80 {
v.extend_from_slice(b"\xB5\xC4");
}
check_bytes(&v, ISO_8859_5);
}
}
}
/// Same as [apply_change], but with a wrapped `txn` and `channel`.
pub fn apply_change_arc<T: MutTxnT, P: ChangeStore>(
changes: &P,
txn: &ArcTxn<T>,
channel: &ChannelRef<T>,
hash: &Hash,
) -> Result<(u64, Merkle), ApplyError<P::Error, T::GraphError>> {
apply_change_ws(
changes,
&mut *txn.write(),
&mut *channel.write(),
hash,
&mut Workspace::new(),
)
detone = "1.0"