Package org.tmatesoft.hg.internal

Examples of org.tmatesoft.hg.internal.Transaction.prepare()


    assertFalse(f2.exists());
    assertFalse(f3.exists());
    //
    // transaction commit
    Transaction tr1 = f.create(ctx);
    File tf1 = tr1.prepare(f1);
    RepoUtils.modifyFileAppend(tf1, "2");
    tr1.done(tf1);
    File tf2 = tr1.prepare(f2);
    errorCollector.assertTrue(tf2.exists());
    RepoUtils.modifyFileAppend(tf2, "A");
View Full Code Here


    // transaction commit
    Transaction tr1 = f.create(ctx);
    File tf1 = tr1.prepare(f1);
    RepoUtils.modifyFileAppend(tf1, "2");
    tr1.done(tf1);
    File tf2 = tr1.prepare(f2);
    errorCollector.assertTrue(tf2.exists());
    RepoUtils.modifyFileAppend(tf2, "A");
    tr1.done(tf2);
    tr1.commit();
    errorCollector.assertTrue(f1.isFile());
View Full Code Here

    errorCollector.assertEquals("A", read(f2));
    //
    // transaction rollback
    assertFalse(f3.exists());
    Transaction tr2 = f.create(ctx);
    tf1 = tr2.prepare(f1);
    RepoUtils.modifyFileAppend(tf1, "3");
    tr2.done(tf1);
    errorCollector.assertEquals("123", read(tf1));
    tf2 = tr2.prepare(f2);
    RepoUtils.modifyFileAppend(tf2, "B");
View Full Code Here

    Transaction tr2 = f.create(ctx);
    tf1 = tr2.prepare(f1);
    RepoUtils.modifyFileAppend(tf1, "3");
    tr2.done(tf1);
    errorCollector.assertEquals("123", read(tf1));
    tf2 = tr2.prepare(f2);
    RepoUtils.modifyFileAppend(tf2, "B");
    tr2.done(tf2);
    errorCollector.assertEquals("AB", read(tf2));
    File tf3 = tr2.prepare(f3);
    errorCollector.assertTrue(tf3.exists());
View Full Code Here

    errorCollector.assertEquals("123", read(tf1));
    tf2 = tr2.prepare(f2);
    RepoUtils.modifyFileAppend(tf2, "B");
    tr2.done(tf2);
    errorCollector.assertEquals("AB", read(tf2));
    File tf3 = tr2.prepare(f3);
    errorCollector.assertTrue(tf3.exists());
    RepoUtils.modifyFileAppend(tf3, "!");
    tr2.done(tf3);
    errorCollector.assertEquals("!", read(tf3));
    tr2.rollback();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.