-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#129] Implement conflict resolver accessors
Fixes #129
- Loading branch information
1 parent
57a2137
commit 33d7c2e
Showing
3 changed files
with
109 additions
and
6 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
...nkit1_10/src/ru/arsysop/svn/connector/internal/adapt/svjhl/ConflictResolutionAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2023, 2025 ArSysOp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*/ | ||
|
||
package ru.arsysop.svn.connector.internal.adapt.svjhl; | ||
|
||
import org.apache.subversion.javahl.ConflictResult; | ||
import org.eclipse.team.svn.core.connector.SVNConflictResolution; | ||
|
||
import ru.arsysop.svn.connector.internal.adapt.SvnNullableConstructor; | ||
|
||
public final class ConflictResolutionAdapter extends SvnNullableConstructor<SVNConflictResolution, ConflictResult> { | ||
|
||
public ConflictResolutionAdapter(SVNConflictResolution source) { | ||
super(source); | ||
} | ||
|
||
@Override | ||
protected ConflictResult adapt(SVNConflictResolution source) { | ||
return new ConflictResult(new ChoiceAdapter(source.choice).adapt(), source.mergedPath); | ||
} | ||
|
||
} |
58 changes: 58 additions & 0 deletions
58
.../src/ru/arsysop/svn/connector/internal/adapt/svjhl/ConflictResolutionCallbackAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (c) 2023, 2025 ArSysOp | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*/ | ||
|
||
package ru.arsysop.svn.connector.internal.adapt.svjhl; | ||
|
||
import org.apache.subversion.javahl.ClientException; | ||
import org.apache.subversion.javahl.ConflictDescriptor; | ||
import org.apache.subversion.javahl.ConflictResult; | ||
import org.apache.subversion.javahl.SubversionException; | ||
import org.apache.subversion.javahl.callback.ConflictResolverCallback; | ||
import org.eclipse.team.svn.core.connector.ISVNConflictResolutionCallback; | ||
import org.eclipse.team.svn.core.connector.SVNConnectorException; | ||
|
||
import ru.arsysop.svn.connector.internal.adapt.SvnNullableConstructor; | ||
import ru.arsysop.svn.connector.internal.adapt.jhlsv.ConflictDescriptorNullableAdapter; | ||
|
||
public final class ConflictResolutionCallbackAdapter | ||
extends SvnNullableConstructor<ISVNConflictResolutionCallback, ConflictResolverCallback> { | ||
|
||
public ConflictResolutionCallbackAdapter(ISVNConflictResolutionCallback source) { | ||
super(source); | ||
} | ||
|
||
@Override | ||
protected ConflictResolverCallback adapt(ISVNConflictResolutionCallback source) { | ||
return new ConflictResolverCallback() { | ||
|
||
public ConflictResult resolve(ConflictDescriptor descrip) throws SubversionException { | ||
try { | ||
return new ConflictResolutionAdapter( | ||
source.resolve(new ConflictDescriptorNullableAdapter(descrip).adapt())).adapt(); | ||
} catch (SVNConnectorException ex) { | ||
throw ClientException.fromException(ex); | ||
} | ||
} | ||
|
||
}; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters