changeset 613:f41dd9a3b8af v1.1m4

Remove few Experimental annotations as the API they've marked graduates
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 10 May 2013 17:31:27 +0200
parents dca70c0b1f74
children 1d1e96f5a908
files build.xml src/org/tmatesoft/hg/core/HgAddRemoveCommand.java src/org/tmatesoft/hg/core/HgAnnotateCommand.java src/org/tmatesoft/hg/core/HgCheckoutCommand.java src/org/tmatesoft/hg/core/HgRepositoryLockException.java src/org/tmatesoft/hg/core/HgRevertCommand.java src/org/tmatesoft/hg/internal/CommitFacility.java src/org/tmatesoft/hg/internal/IntMap.java src/org/tmatesoft/hg/internal/IntVector.java src/org/tmatesoft/hg/repo/HgBookmarks.java src/org/tmatesoft/hg/repo/HgRepository.java src/org/tmatesoft/hg/repo/HgRepositoryLock.java src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java test/org/tmatesoft/hg/test/TestCommit.java
diffstat 14 files changed, 17 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/build.xml	Fri May 10 14:29:35 2013 +0200
+++ b/build.xml	Fri May 10 17:31:27 2013 +0200
@@ -149,7 +149,7 @@
 
 	<target name="build-tests" depends="build-lib">
 		<mkdir dir="bin" />
-		<javac srcdir="test" destdir="bin" debug="${compile-with-debug}" >
+		<javac srcdir="test" destdir="bin" debug="${compile-with-debug}" includeantruntime="no">
 			<classpath>
 				<pathelement location="${hg4j.jar}"/>
 				<pathelement location="${junit.jar}"/>
@@ -165,7 +165,7 @@
 
 	<target name="build-cmdline" depends="build-lib">
 		<mkdir dir="bin" />
-		<javac srcdir="cmdline" destdir="bin" debug="${compile-with-debug}">
+		<javac srcdir="cmdline" destdir="bin" debug="${compile-with-debug}" includeantruntime="no">
 			<classpath>
 				<pathelement location="${hg4j.jar}"/>
 				<pathelement location="${junit.jar}"/>
--- a/src/org/tmatesoft/hg/core/HgAddRemoveCommand.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/core/HgAddRemoveCommand.java	Fri May 10 17:31:27 2013 +0200
@@ -20,7 +20,6 @@
 
 import org.tmatesoft.hg.internal.DirstateBuilder;
 import org.tmatesoft.hg.internal.DirstateReader;
-import org.tmatesoft.hg.internal.Experimental;
 import org.tmatesoft.hg.internal.Internals;
 import org.tmatesoft.hg.repo.HgManifest.Flags;
 import org.tmatesoft.hg.repo.HgRepository;
@@ -31,8 +30,6 @@
 import org.tmatesoft.hg.util.ProgressSupport;
 
 /**
- * WORK IN PROGRESS
- * 
  * Schedule files for addition and removal 
  * XXX and, perhaps, forget() functionality shall be here as well?
  * 
@@ -40,7 +37,6 @@
  * @author Artem Tikhomirov
  * @author TMate Software Ltd.
  */
-@Experimental(reason="Work in progress")
 public class HgAddRemoveCommand extends HgAbstractCommand<HgAddRemoveCommand> {
 	
 	private final HgRepository repo;
--- a/src/org/tmatesoft/hg/core/HgAnnotateCommand.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/core/HgAnnotateCommand.java	Fri May 10 17:31:27 2013 +0200
@@ -35,13 +35,11 @@
 import org.tmatesoft.hg.util.ProgressSupport;
 
 /**
- * WORK IN PROGRESS. UNSTABLE API
- * 
  * 'hg annotate' counterpart, report origin revision and file line-by-line 
  * 
+ * @since 1.1
  * @author Artem Tikhomirov
  * @author TMate Software Ltd.
- * @since 1.1
  */
 @Experimental(reason="Work in progress. Unstable API")
 public class HgAnnotateCommand extends HgAbstractCommand<HgAnnotateCommand> {
--- a/src/org/tmatesoft/hg/core/HgCheckoutCommand.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/core/HgCheckoutCommand.java	Fri May 10 17:31:27 2013 +0200
@@ -28,7 +28,6 @@
 import org.tmatesoft.hg.internal.CsetParamKeeper;
 import org.tmatesoft.hg.internal.DirstateBuilder;
 import org.tmatesoft.hg.internal.EncodingHelper;
-import org.tmatesoft.hg.internal.Experimental;
 import org.tmatesoft.hg.internal.Internals;
 import org.tmatesoft.hg.internal.WorkingDirFileWriter;
 import org.tmatesoft.hg.repo.HgDataFile;
@@ -46,8 +45,6 @@
 import org.tmatesoft.hg.util.ProgressSupport;
 
 /**
- * WORK IN PROGRESS.
- * 
  * Update working directory to specific state, 'hg checkout' counterpart.
  * For the time being, only 'clean' checkout is supported ('hg co --clean')
  * 
@@ -55,7 +52,6 @@
  * @author Artem Tikhomirov
  * @author TMate Software Ltd.
  */
-@Experimental(reason="Work in progress")
 public class HgCheckoutCommand extends HgAbstractCommand<HgCheckoutCommand>{
 
 	private final HgRepository repo;
--- a/src/org/tmatesoft/hg/core/HgRepositoryLockException.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/core/HgRepositoryLockException.java	Fri May 10 17:31:27 2013 +0200
@@ -16,7 +16,6 @@
  */
 package org.tmatesoft.hg.core;
 
-import org.tmatesoft.hg.internal.Experimental;
 import org.tmatesoft.hg.repo.HgRepositoryLock;
 
 /**
@@ -26,7 +25,6 @@
  * @author TMate Software Ltd.
  */
 @SuppressWarnings("serial")
-@Experimental(reason="Work in progress")
 public class HgRepositoryLockException extends HgException {
 	
 	public HgRepositoryLockException(String message) {
--- a/src/org/tmatesoft/hg/core/HgRevertCommand.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/core/HgRevertCommand.java	Fri May 10 17:31:27 2013 +0200
@@ -24,7 +24,6 @@
 import org.tmatesoft.hg.internal.CsetParamKeeper;
 import org.tmatesoft.hg.internal.DirstateBuilder;
 import org.tmatesoft.hg.internal.DirstateReader;
-import org.tmatesoft.hg.internal.Experimental;
 import org.tmatesoft.hg.internal.Internals;
 import org.tmatesoft.hg.repo.HgManifest;
 import org.tmatesoft.hg.repo.HgManifest.Flags;
@@ -36,14 +35,12 @@
 import org.tmatesoft.hg.util.ProgressSupport;
 
 /**
- * WORK IN PROGRESS.
- * 
  * Restore files to their checkout state, 'hg revert' counterpart.
  * 
+ * @since 1.1
  * @author Artem Tikhomirov
  * @author TMate Software Ltd.
  */
-@Experimental(reason="Work in progress")
 public class HgRevertCommand extends HgAbstractCommand<HgRevertCommand> {
 
 	private final HgRepository repo;
--- a/src/org/tmatesoft/hg/internal/CommitFacility.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/CommitFacility.java	Fri May 10 17:31:27 2013 +0200
@@ -43,14 +43,12 @@
 import org.tmatesoft.hg.util.Path;
 
 /**
- * WORK IN PROGRESS
  * Name: CommitObject, FutureCommit or PendingCommit
- * Only public API now: {@link HgCommitCommand}.
+ * The only public API now: {@link HgCommitCommand}.
  * 
  * @author Artem Tikhomirov
  * @author TMate Software Ltd.
  */
-@Experimental(reason="Work in progress")
 public final class CommitFacility {
 	private final Internals repo;
 	private final int p1Commit, p2Commit;
--- a/src/org/tmatesoft/hg/internal/IntMap.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/IntMap.java	Fri May 10 17:31:27 2013 +0200
@@ -136,7 +136,6 @@
 	/**
 	 * Forget first N entries (in natural order) in the map.
 	 */
-	@Experimental
 	public void removeFromStart(int count) {
 		if (count > 0 && count <= size) {
 			if (count < size) {
--- a/src/org/tmatesoft/hg/internal/IntVector.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/IntVector.java	Fri May 10 17:31:27 2013 +0200
@@ -130,7 +130,6 @@
 	/**
 	 * Use only when this instance won't be used any longer
 	 */
-	@Experimental
 	int[] toArray(boolean internalIfSizeMatchCapacity) {
 		if (count == data.length) {
 			return data;
--- a/src/org/tmatesoft/hg/repo/HgBookmarks.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/repo/HgBookmarks.java	Fri May 10 17:31:27 2013 +0200
@@ -30,7 +30,6 @@
 import org.tmatesoft.hg.core.HgIOException;
 import org.tmatesoft.hg.core.HgRepositoryLockException;
 import org.tmatesoft.hg.core.Nodeid;
-import org.tmatesoft.hg.internal.Experimental;
 import org.tmatesoft.hg.internal.FileChangeMonitor;
 import org.tmatesoft.hg.internal.Internals;
 import org.tmatesoft.hg.internal.LineReader;
@@ -162,7 +161,6 @@
 	 * @throws HgIOException if failed to write updated bookmark information 
 	 * @throws HgRepositoryLockException  if failed to lock repository for modifications
 	 */
-	@Experimental(reason="Provisional API")
 	public void updateActive(Nodeid p1, Nodeid p2, Nodeid child) throws HgIOException, HgRepositoryLockException {
 		if (activeBookmark == null) {
 			return;
--- a/src/org/tmatesoft/hg/repo/HgRepository.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/repo/HgRepository.java	Fri May 10 17:31:27 2013 +0200
@@ -31,7 +31,6 @@
 import org.tmatesoft.hg.core.SessionContext;
 import org.tmatesoft.hg.internal.ConfigFile;
 import org.tmatesoft.hg.internal.DirstateReader;
-import org.tmatesoft.hg.internal.Experimental;
 import org.tmatesoft.hg.internal.Filter;
 import org.tmatesoft.hg.internal.Internals;
 import org.tmatesoft.hg.internal.PropertyMarshal;
@@ -110,6 +109,8 @@
 	private HgIgnore ignore;
 	private HgRepoConfig repoConfig;
 	
+	private HgRepositoryLock wdLock, storeLock;
+
 	private final org.tmatesoft.hg.internal.Internals impl;
 	
 	/*
@@ -384,11 +385,7 @@
 		}
 	}
 
-	private HgRepositoryLock wdLock, storeLock;
-
 	/**
-	 * PROVISIONAL CODE, DO NOT USE
-	 * 
 	 * Access repository lock that covers non-store parts of the repository (dirstate, branches, etc - 
 	 * everything that has to do with working directory state).
 	 * 
@@ -397,7 +394,6 @@
 	 *   
 	 * @return lock object, never <code>null</code>
 	 */
-	@Experimental(reason="WORK IN PROGRESS")
 	public HgRepositoryLock getWorkingDirLock() {
 		if (wdLock == null) {
 			int timeout = getLockTimeout();
@@ -411,7 +407,11 @@
 		return wdLock;
 	}
 
-	@Experimental(reason="WORK IN PROGRESS")
+	/**
+	 * Access repository lock that covers repository intrinsic files, unrelated to 
+	 * the state of working directory
+	 * @return lock object, never <code>null</code>
+	 */
 	public HgRepositoryLock getStoreLock() {
 		if (storeLock == null) {
 			int timeout = getLockTimeout();
--- a/src/org/tmatesoft/hg/repo/HgRepositoryLock.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/repo/HgRepositoryLock.java	Fri May 10 17:31:27 2013 +0200
@@ -26,12 +26,9 @@
 import java.nio.channels.FileChannel;
 
 import org.tmatesoft.hg.core.HgRepositoryLockException;
-import org.tmatesoft.hg.internal.Experimental;
 import org.tmatesoft.hg.internal.Internals;
 
 /**
- * NOT SAFE FOR MULTITHREAD USE!
- * 
  * <p>Usage:
  * <pre>
  * HgRepositoryLock lock = hgRepo.getWorkingDirLock();
@@ -52,11 +49,13 @@
  * 
  * Unlike original mechanism, we don't use symlinks, rather files, as it's easier to implement
  * 
+ * <p>
+ * NOT SAFE FOR MULTITHREAD USE!
+ * 
  * @see http://code.google.com/p/hg4j/issues/detail?id=35
  * @author Artem Tikhomirov
  * @author TMate Software Ltd.
  */
-@Experimental(reason="Work in progress")
 public class HgRepositoryLock {
 	/*
 	 * Lock .hg/ except .hg/store/      .hg/wlock (new File(hgRepo.getRepoRoot(),"wlock"))
--- a/src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java	Fri May 10 14:29:35 2013 +0200
+++ b/src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java	Fri May 10 17:31:27 2013 +0200
@@ -34,7 +34,6 @@
 import org.tmatesoft.hg.core.Nodeid;
 import org.tmatesoft.hg.core.SessionContext;
 import org.tmatesoft.hg.internal.ByteArrayChannel;
-import org.tmatesoft.hg.internal.Experimental;
 import org.tmatesoft.hg.internal.FilterByteChannel;
 import org.tmatesoft.hg.internal.Internals;
 import org.tmatesoft.hg.internal.ManifestRevision;
@@ -333,7 +332,6 @@
 	 * @param fileInfo file content mediator 
 	 * @return <code>true</code> when content in working dir differs from that of manifest-recorded revision 
 	 */
-	@Experimental(reason="Perhaps, HgDataFile#isWorkingCopyChanged() would be better - no need to pass any arguments?")
 	public boolean hasTangibleChanges(Path fname, FileInfo fileInfo) throws HgRuntimeException {
 		// see #checkLocalStatusAgainstFile() below for the origin of changed file check
 		HgDataFile df = repo.getFileNode(fname);
--- a/test/org/tmatesoft/hg/test/TestCommit.java	Fri May 10 14:29:35 2013 +0200
+++ b/test/org/tmatesoft/hg/test/TestCommit.java	Fri May 10 17:31:27 2013 +0200
@@ -115,7 +115,7 @@
 	
 	@Test
 	public void testCommitIntoBranch() throws Exception {
-		File repoLoc = RepoUtils.cloneRepoToTempLocation("log-1", "test-add-remove-commit", false);
+		File repoLoc = RepoUtils.cloneRepoToTempLocation("log-1", "test-commit2branch", false);
 		HgRepository hgRepo = new HgLookup().detect(repoLoc);
 		HgDataFile dfD = hgRepo.getFileNode("d");
 		assertTrue("[sanity]", dfD.exists());
@@ -160,7 +160,6 @@
 		cf.forget(hgRepo.getFileNode("d"));
 		Nodeid commitRev = cf.commit("Commit with add/remove cmd");
 		contentProvider.done();
-		// Note, working directory still points to original revision, CommitFacility doesn't update dirstate
 		//
 		List<HgChangeset> commits = new HgLogCommand(hgRepo).changeset(commitRev).execute();
 		HgChangeset cmt = commits.get(0);
@@ -179,7 +178,7 @@
 	 */
 	@Test
 	public void testSequentialCommits() throws Exception {
-		File repoLoc = RepoUtils.cloneRepoToTempLocation("log-1", "test-add-remove-commit", false);
+		File repoLoc = RepoUtils.cloneRepoToTempLocation("log-1", "test-sequential-commits", false);
 		HgRepository hgRepo = new HgLookup().detect(repoLoc);
 		HgDataFile dfD = hgRepo.getFileNode("d");
 		assertTrue("[sanity]", dfD.exists());