diff --git a/pom.xml b/pom.xml index e04a47ef41..5b300fb634 100644 --- a/pom.xml +++ b/pom.xml @@ -386,7 +386,7 @@ com.github.sdorra buildfrontend-maven-plugin - 2.1.1 + 2.2.0 org.apache.maven.plugins @@ -817,6 +817,10 @@ **/*StoreFactory.java,**/*UserPassword.js + 8.11.4 + ./scm-ui/target/frontend/buildfrontend-node/node-v${node.version}-linux-x64/bin/node + + diff --git a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgModificationsCommand.java b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgModificationsCommand.java index c67b9ff5d9..f9a67f8656 100644 --- a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgModificationsCommand.java +++ b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/HgModificationsCommand.java @@ -4,8 +4,6 @@ import sonia.scm.repository.Modifications; import sonia.scm.repository.Repository; import sonia.scm.repository.spi.javahg.HgLogChangesetCommand; -import java.text.MessageFormat; - public class HgModificationsCommand extends AbstractCommand implements ModificationsCommand { HgModificationsCommand(HgCommandContext context, Repository repository) { @@ -17,8 +15,7 @@ public class HgModificationsCommand extends AbstractCommand implements Modificat public Modifications getModifications(String revision) { com.aragost.javahg.Repository repository = open(); HgLogChangesetCommand hgLogChangesetCommand = HgLogChangesetCommand.on(repository, getContext().getConfig()); - int hgRevision = hgLogChangesetCommand.rev(revision).singleRevision(); - Modifications modifications = hgLogChangesetCommand.rev(MessageFormat.format("{0}:{0}", hgRevision)).extractModifications(); + Modifications modifications = hgLogChangesetCommand.rev(revision).extractModifications(); modifications.setRevision(revision); return modifications; } diff --git a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/javahg/HgLogChangesetCommand.java b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/javahg/HgLogChangesetCommand.java index f57c2a63d9..12a77ac717 100644 --- a/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/javahg/HgLogChangesetCommand.java +++ b/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/spi/javahg/HgLogChangesetCommand.java @@ -1,19 +1,19 @@ /** * Copyright (c) 2010, Sebastian Sdorra * All rights reserved. - * + *

* Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + *

* 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. * 3. Neither the name of SCM-Manager; nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + *

* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -24,99 +24,64 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + *

* http://bitbucket.org/sdorra/scm-manager - * */ - package sonia.scm.repository.spi.javahg; -//~--- non-JDK imports -------------------------------------------------------- - import com.aragost.javahg.Repository; import com.aragost.javahg.internals.HgInputStream; import com.aragost.javahg.internals.Utils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sonia.scm.repository.Changeset; import sonia.scm.repository.HgConfig; import sonia.scm.repository.Modifications; +import java.io.IOException; import java.util.List; -//~--- JDK imports ------------------------------------------------------------ - /** - * * @author Sebastian Sdorra */ -public class HgLogChangesetCommand extends AbstractChangesetCommand -{ +public class HgLogChangesetCommand extends AbstractChangesetCommand { - /** - * Constructs ... - * - * - * @param repository - * @param config - */ - private HgLogChangesetCommand(Repository repository, HgConfig config) - { + private static final Logger LOG = LoggerFactory.getLogger(HgLogChangesetCommand.class); + + private HgLogChangesetCommand(Repository repository, HgConfig config) { super(repository, config); } - //~--- methods -------------------------------------------------------------- - /** - * Method description - * - * - * @param repository - * @param config - * - * @return - */ - public static HgLogChangesetCommand on(Repository repository, HgConfig config) - { + public static HgLogChangesetCommand on(Repository repository, HgConfig config) { return new HgLogChangesetCommand(repository, config); } - /** - * Method description - * - * - * @param branch - * - * @return - */ - public HgLogChangesetCommand branch(String branch) - { + + public HgLogChangesetCommand branch(String branch) { cmdAppend("-b", branch); return this; } - /** - * Method description - * - * - * @param files - * - * @return - */ - public List execute(String... files) - { + + public List execute(String... files) { return readListFromStream(getHgInputStream(files, CHANGESET_EAGER_STYLE_PATH)); } - /** - * Extract Modifications from the Repository files - * - * @param files repo files - * @return modifications - */ public Modifications extractModifications(String... files) { - return readModificationsFromStream(getHgInputStream(files, CHANGESET_EAGER_STYLE_PATH)); + HgInputStream hgInputStream = getHgInputStream(files, CHANGESET_EAGER_STYLE_PATH); + try { + return readModificationsFromStream(hgInputStream); + } finally { + try { + hgInputStream.close(); + } catch (IOException e) { + LOG.error("Could not close HgInputStream", e); + } + } } HgInputStream getHgInputStream(String[] files, String changesetStylePath) { @@ -124,93 +89,39 @@ public class HgLogChangesetCommand extends AbstractChangesetCommand return launchStream(files); } - /** - * Method description - * - * - * @param limit - * - * @return - */ - public HgLogChangesetCommand limit(int limit) - { + public HgLogChangesetCommand limit(int limit) { cmdAppend("-l", limit); return this; } - /** - * Method description - * - * - * @param files - * - * @return - */ - public List loadRevisions(String... files) - { + + public List loadRevisions(String... files) { return loadRevisionsFromStream(getHgInputStream(files, CHANGESET_LAZY_STYLE_PATH)); } - /** - * Method description - * - * - * @param rev - * - * @return - */ - public HgLogChangesetCommand rev(String... rev) - { + public HgLogChangesetCommand rev(String... rev) { cmdAppend("-r", rev); return this; } - /** - * Method description - * - * - * @param files - * - * @return - */ - public Changeset single(String... files) - { + public Changeset single(String... files) { return Utils.single(execute(files)); } - /** - * Method description - * - * - * @param files - * - * @return - */ - public int singleRevision(String... files) - { + public int singleRevision(String... files) { Integer rev = Utils.single(loadRevisions(files)); - if (rev == null) - { + if (rev == null) { rev = -1; } return rev; } - //~--- get methods ---------------------------------------------------------- - - /** - * Method description - * - * - * @return - */ @Override - public String getCommandName() - { + public String getCommandName() { return "log"; } } diff --git a/scm-ui-components/packages/ui-components/src/LinkPaginator.js b/scm-ui-components/packages/ui-components/src/LinkPaginator.js index aaf13d7b15..d09306e04c 100644 --- a/scm-ui-components/packages/ui-components/src/LinkPaginator.js +++ b/scm-ui-components/packages/ui-components/src/LinkPaginator.js @@ -25,13 +25,13 @@ class LinkPaginator extends React.Component { ); } - renderPreviousButton(label?: string) { + renderPreviousButton(className: string, label?: string) { const { page } = this.props; const previousPage = page - 1; return (