Package org.tmatesoft.hg.internal

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


    //
    // 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();
View Full Code Here


    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());
    errorCollector.assertTrue(f2.isFile());
    errorCollector.assertEquals("12", read(f1));
    errorCollector.assertEquals("A", read(f2));
View Full Code Here

    // 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");
    tr2.done(tf2);
    errorCollector.assertEquals("AB", read(tf2));
View Full Code Here

    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());
    RepoUtils.modifyFileAppend(tf3, "!");
    tr2.done(tf3);
View Full Code Here

    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();
    errorCollector.assertTrue(f1.isFile());
    errorCollector.assertTrue(f2.isFile());
    errorCollector.assertFalse(f3.isFile());
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.