Examples of KeepDeleteConflict


Examples of com.aragost.javahg.merge.KeepDeleteConflict

        GraftContext ctx = GraftCommand.on(repo).execute(changed);
        Assert.assertNotNull(ctx);
        Assert.assertTrue(ctx.getFlagConflicts().isEmpty());
        Assert.assertTrue(ctx.getMergeConflicts().isEmpty());
        KeepDeleteConflict kdc = Utils.single(ctx.getKeepDeleteConflicts());
        Assert.assertNotNull(kdc);
        Assert.assertSame(removed, repo.tip());
        Assert.assertEquals("file", kdc.getFilename());
        Assert.assertSame(changed, ctx.getSource());
        kdc.delete();
        // TODO commiting results in an error, see issue 3261
        // Changeset cs = ctx.commit();
        // Assert.assertNotNull(cs);
    }
View Full Code Here

Examples of com.aragost.javahg.merge.KeepDeleteConflict

        repo.workingCopy().remove("a");
        Changeset p1 = commit();

        ConflictResolvingContext ms = repo.workingCopy().merge(p2);
        Assert.assertEquals(1, ms.getKeepDeleteConflicts().size());
        KeepDeleteConflict keepDeleteConflict = ms.getKeepDeleteConflicts().iterator().next();
        Assert.assertEquals(KeepDeleteConflict.State.KEEP, keepDeleteConflict.getState());
        Assert.assertEquals("a", keepDeleteConflict.getFilename());
        Assert.assertEquals(p2, keepDeleteConflict.getKeepParent());

        update(p2);
        ms = repo.workingCopy().merge(p1);
        Assert.assertEquals(1, ms.getKeepDeleteConflicts().size());
        keepDeleteConflict = ms.getKeepDeleteConflicts().iterator().next();
        Assert.assertEquals(KeepDeleteConflict.State.KEEP, keepDeleteConflict.getState());
        Assert.assertEquals("a", keepDeleteConflict.getFilename());
        Assert.assertEquals(p2, keepDeleteConflict.getKeepParent());

        File a = getTestRepository().file("a");
        Assert.assertTrue(a.exists());
        keepDeleteConflict.delete();
        Assert.assertFalse(a.exists());
        StatusResult status1 = repo.workingCopy().status();
        Assert.assertArrayEquals(new String[] { "a" }, status1.getRemoved().toArray());
        StatusResult status2 = repo.workingCopy().parent2Status();
        Assert.assertTrue(status2.getRemoved().isEmpty());

        keepDeleteConflict.keep();
        Assert.assertTrue(a.exists());
        status1 = repo.workingCopy().status();
        Assert.assertTrue(status1.getRemoved().isEmpty());
        status2 = repo.workingCopy().parent2Status();
        Assert.assertTrue(status2.getRemoved().isEmpty());
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.