use of org.jboss.fuse.patch.management.Patch in project fuse-karaf by jboss-fuse.
the class AbstractPatchIntegrationTest method rollback.
// Rollback a patch and wait for rollback to complete
protected void rollback(String name) throws Exception {
Patch patch = service.getPatch(name);
service.rollback(patch, false, false);
patch = service.getPatch(name);
long start = System.currentTimeMillis();
while (patch.isInstalled() && System.currentTimeMillis() - start < TIMEOUT) {
patch = service.getPatch(name);
Thread.sleep(100);
}
if (patch.isInstalled()) {
fail(String.format("Patch '%s' did not roll back within %s ms", name, TIMEOUT));
}
}
use of org.jboss.fuse.patch.management.Patch in project fuse-karaf by jboss-fuse.
the class GitConflictResolutionIT method reportForXml.
@Test
public void reportForXml() throws Exception {
prepareChanges3();
RevWalk rw = new RevWalk(git.getRepository());
git.checkout().setName("custom").setCreateBranch(false).call();
ObjectId commit = git.getRepository().resolve("patched");
CherryPickResult result = git.cherryPick().include(commit).call();
RevCommit cMaster = rw.parseCommit(git.getRepository().resolve("master"));
RevCommit cCustom = rw.parseCommit(git.getRepository().resolve("custom"));
RevCommit cPatched = rw.parseCommit(git.getRepository().resolve("patched"));
new GitPatchManagementServiceImpl().handleCherryPickConflict(null, git, result, git.getRepository().parseCommit(commit), true, PatchKind.NON_ROLLUP, "x", false, false);
RevCommit cMerged = git.commit().setMessage("resolved").call();
// we have 4 commits (7349224 is a custom change that's conflicting with "patched" branch):
/*
* 92a9ad8 - (HEAD -> custom) resolved
* 7349224 - custom etc/org.ops4j.pax.logging.cfg
| * 5777547 - (patched) patched etc/org.ops4j.pax.logging.cfg
|/
* 306f328 - (master) original etc/org.ops4j.pax.logging.cfg
*/
FileWriter writer = new FileWriter("target/report2.html");
PatchData pd = new PatchData("my-patch-id2");
PatchResult patchResult = PatchResult.load(pd, getClass().getResourceAsStream("/conflicts/example1/fuse-karaf-7.0.0.fuse-000160.patch.result"));
Set<String> conflicts = new HashSet<>();
conflicts.add("etc/maven-settings.xml");
DiffUtils.generateDiffReport(new Patch(pd, null), patchResult, git, conflicts, cMaster, cCustom, cPatched, cMerged, writer);
writer.close();
}
use of org.jboss.fuse.patch.management.Patch in project fuse-karaf by jboss-fuse.
the class InstallCommand method doExecute.
@Override
protected void doExecute(PatchService service) throws Exception {
Patch patch = super.getPatch(patchId);
PatchResult result = service.install(patch, simulation, synchronous);
}
Aggregations