/** * Pass through to {@link StagingDatabase}, replacing the namespace with the transaction * namespace. */ @Override public void removeConflicts(@Nullable String namespace) { database.removeConflicts(txNamespace); }
/** * Pass through to {@link StagingDatabase}, replacing the namespace with the transaction * namespace. */ @Override public void removeConflicts(@Nullable String namespace) { database.removeConflicts(txNamespace); }
@Override public void removeConflicts(@Nullable String namespace, Iterable<String> paths) { database.removeConflicts(txNamespace, paths); }
@Override public void removeConflicts(@Nullable String namespace, Iterable<String> paths) { database.removeConflicts(txNamespace, paths); }
public void close() { transactionBlobStore.removeBlobs(transactionId.toString()); transactionRefDatabase.close(); transactionIndex.conflictsDatabase().removeConflicts(null); }
public void close() { transactionBlobStore.removeBlobs(transactionId.toString()); transactionRefDatabase.close(); transactionIndex.conflictsDatabase().removeConflicts(null); }
private MergeReport abort() { command(CleanRefsOp.class).call(); conflictsDatabase().removeConflicts(null); return null; }
@Test public void removeConflictsExecutionException() throws SQLException { when(mockSource.getConnection().prepareStatement(anyString())) .thenThrow(new SQLException("propagate this message")); try { mockSourceConflicts.removeConflicts(null); fail("expected RTE"); } catch (RuntimeException e) { assertTrue(e.getMessage().contains("propagate this message")); } verify(mockConnection, times(1)).setAutoCommit(eq(false)); verify(mockConnection, times(1)).rollback(); verify(mockConnection, times(1)).setAutoCommit(eq(true)); }
@Test public void removeConflictsConnectException() throws SQLException { when(mockSource.getConnection()).thenThrow(new SQLException("connection error")); expected.expect(RuntimeException.class); expected.expectMessage("connection error"); mockSourceConflicts.removeConflicts(null); }
@Test public void testRemoveConflictsIterableDefaultNS() { final String ns = UUID.randomUUID().toString(); add(ns, c1, c2, c3); add(null, c1, c2, c3); conflicts.removeConflicts(null, ImmutableList.of(c3.getPath(), c2.getPath())); assertTrue(conflicts.getConflict(null, c1.getPath()).isPresent()); assertFalse(conflicts.getConflict(null, c2.getPath()).isPresent()); assertFalse(conflicts.getConflict(null, c3.getPath()).isPresent()); assertEquals(3, conflicts.getCountByPrefix(ns, null)); }
@Test public void testRemoveConflictsIterableNS() { final String ns = UUID.randomUUID().toString(); add(ns, c1, c2, c3); add(null, c1, c2, c3); conflicts.removeConflicts(ns, ImmutableList.of(c3.getPath(), c2.getPath())); assertTrue(conflicts.getConflict(ns, c1.getPath()).isPresent()); assertFalse(conflicts.getConflict(ns, c2.getPath()).isPresent()); assertFalse(conflicts.getConflict(ns, c3.getPath()).isPresent()); assertEquals(3, conflicts.getCountByPrefix(null, null)); }
@Test public void testRemoveConflictsIterableDefaultNS() { final String ns = UUID.randomUUID().toString(); add(ns, c1, c2, c3); add(null, c1, c2, c3); conflicts.removeConflicts(null, ImmutableList.of(c3.getPath(), c2.getPath())); assertTrue(conflicts.getConflict(null, c1.getPath()).isPresent()); assertFalse(conflicts.getConflict(null, c2.getPath()).isPresent()); assertFalse(conflicts.getConflict(null, c3.getPath()).isPresent()); assertEquals(3, conflicts.getCountByPrefix(ns, null)); }
@Test public void testRemoveConflictsIterableNS() { final String ns = UUID.randomUUID().toString(); add(ns, c1, c2, c3); add(null, c1, c2, c3); conflicts.removeConflicts(ns, ImmutableList.of(c3.getPath(), c2.getPath())); assertTrue(conflicts.getConflict(ns, c1.getPath()).isPresent()); assertFalse(conflicts.getConflict(ns, c2.getPath()).isPresent()); assertFalse(conflicts.getConflict(ns, c3.getPath()).isPresent()); assertEquals(3, conflicts.getCountByPrefix(null, null)); }
command(UpdateSymRef.class).setName(Ref.HEAD).setNewValue(currentBranch).call(); conflictsDatabase().removeConflicts(null); if (clean) { command(CleanRefsOp.class).call();
@Test public void testRemoveConflicts() { final String ns = UUID.randomUUID().toString(); add(null, c1, c3); add(ns, c2, c3); assertTrue(conflicts.hasConflicts(null)); assertTrue(conflicts.hasConflicts(ns)); conflicts.removeConflicts(null); assertFalse(conflicts.hasConflicts(null)); assertTrue(conflicts.hasConflicts(ns)); add(null, c1); conflicts.removeConflicts(ns); assertTrue(conflicts.hasConflicts(null)); assertFalse(conflicts.hasConflicts(ns)); }
@Test public void testRemoveConflicts() { final String ns = UUID.randomUUID().toString(); add(null, c1, c3); add(ns, c2, c3); assertTrue(conflicts.hasConflicts(null)); assertTrue(conflicts.hasConflicts(ns)); conflicts.removeConflicts(null); assertFalse(conflicts.hasConflicts(null)); assertTrue(conflicts.hasConflicts(ns)); add(null, c1); conflicts.removeConflicts(ns); assertTrue(conflicts.hasConflicts(null)); assertFalse(conflicts.hasConflicts(ns)); }
command(UpdateSymRef.class).setName(Ref.HEAD).setNewValue(currentBranch).call(); conflictsDatabase().removeConflicts(null); if (clean) { command(CleanRefsOp.class).call();
private void cancel() { // Restore original refs if (origHead != null) { if (origHead instanceof SymRef) { command(UpdateRef.class).setName(origCurrentBranch.getName()) .setNewValue(origCurrentBranch.getObjectId()).call(); } else { command(UpdateRef.class).setName(origHead.getName()) .setNewValue(origHead.getObjectId()).call(); } } if (origWorkHead != null) { command(UpdateRef.class).setName(origWorkHead.getName()) .setNewValue(origWorkHead.getObjectId()).call(); } if (origStageHead != null) { command(UpdateRef.class).setName(origStageHead.getName()) .setNewValue(origStageHead.getObjectId()).call(); } // Remove any conflicts that were generated. conflictsDatabase().removeConflicts(null); }
private void cancel() { // Restore original refs if (origHead != null) { if (origHead instanceof SymRef) { command(UpdateRef.class).setName(origCurrentBranch.getName()) .setNewValue(origCurrentBranch.getObjectId()).call(); } else { command(UpdateRef.class).setName(origHead.getName()) .setNewValue(origHead.getObjectId()).call(); } } if (origWorkHead != null) { command(UpdateRef.class).setName(origWorkHead.getName()) .setNewValue(origWorkHead.getObjectId()).call(); } if (origStageHead != null) { command(UpdateRef.class).setName(origStageHead.getName()) .setNewValue(origStageHead.getObjectId()).call(); } // Remove any conflicts that were generated. conflictsDatabase().removeConflicts(null); }