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