mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-07 11:45:48 +02:00
POC for hg merge support
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.spi;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -74,7 +74,11 @@ public class HgDiffCommand extends AbstractCommand implements DiffCommand
|
||||
cmd.git();
|
||||
}
|
||||
|
||||
cmd.change(HgUtil.getRevision(request.getRevision()));
|
||||
if (request.getAncestorChangeset() != null) {
|
||||
cmd.ancestor(request.getRevision(), request.getAncestorChangeset());
|
||||
} else {
|
||||
cmd.change(HgUtil.getRevision(request.getRevision()));
|
||||
}
|
||||
|
||||
InputStream inputStream = null;
|
||||
|
||||
|
||||
@@ -44,13 +44,11 @@ import java.util.Set;
|
||||
public class HgRepositoryServiceProvider extends RepositoryServiceProvider
|
||||
{
|
||||
|
||||
/** Field description */
|
||||
//J-
|
||||
public static final Set<Command> COMMANDS = EnumSet.of(
|
||||
Command.BLAME,
|
||||
Command.BROWSE,
|
||||
Command.BROWSE,
|
||||
Command.CAT,
|
||||
Command.DIFF,
|
||||
Command.DIFF,
|
||||
Command.LOG,
|
||||
Command.TAGS,
|
||||
Command.BRANCH,
|
||||
@@ -59,13 +57,12 @@ public class HgRepositoryServiceProvider extends RepositoryServiceProvider
|
||||
Command.OUTGOING,
|
||||
Command.PUSH,
|
||||
Command.PULL,
|
||||
Command.MODIFY
|
||||
Command.MODIFY,
|
||||
Command.MERGE
|
||||
);
|
||||
//J+
|
||||
|
||||
/** Field description */
|
||||
public static final Set<Feature> FEATURES =
|
||||
EnumSet.of(Feature.COMBINED_DEFAULT_BRANCH);
|
||||
EnumSet.of(Feature.COMBINED_DEFAULT_BRANCH, Feature.INCOMING_REVISION);
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
@@ -272,6 +269,11 @@ public class HgRepositoryServiceProvider extends RepositoryServiceProvider
|
||||
return new HgTagsCommand(context, repository);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MergeCommand getMergeCommand() {
|
||||
return new HgMergeCommand(context, handler.getWorkdirFactory());
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
package sonia.scm.repository.spi.javahg;
|
||||
|
||||
//~--- non-JDK imports --------------------------------------------------------
|
||||
@@ -45,8 +45,8 @@ public final class HgDiffInternalCommand extends AbstractCommand
|
||||
/** Field description */
|
||||
private static final String NAME = "diff";
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
|
||||
//~--- constructors ---------------------------------------------------------
|
||||
/**
|
||||
* Constructs ...
|
||||
*
|
||||
@@ -58,8 +58,8 @@ public final class HgDiffInternalCommand extends AbstractCommand
|
||||
super(repository, NAME);
|
||||
}
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
|
||||
//~--- methods --------------------------------------------------------------
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
@@ -88,6 +88,13 @@ public final class HgDiffInternalCommand extends AbstractCommand
|
||||
return this;
|
||||
}
|
||||
|
||||
public HgDiffInternalCommand ancestor(String revision, String ancestorChangeset) {
|
||||
cmdAppend("--rev", "ancestor(" + ancestorChangeset + ", " + revision + ")");
|
||||
cmdAppend("--rev", revision);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user