diff src/org/tmatesoft/hg/repo/HgRepository.java @ 501:d2f6ab541330

Change the way extensions are accessed (with ExtensionsManager now), add preliminary Rebase extension support
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 29 Oct 2012 19:04:13 +0100
parents ba36f66c32b4
children bf352ce2b97f
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgRepository.java	Mon Oct 29 18:16:21 2012 +0100
+++ b/src/org/tmatesoft/hg/repo/HgRepository.java	Mon Oct 29 19:04:13 2012 +0100
@@ -39,6 +39,7 @@
 import org.tmatesoft.hg.internal.Internals;
 import org.tmatesoft.hg.internal.RevlogStream;
 import org.tmatesoft.hg.internal.SubrepoManager;
+import org.tmatesoft.hg.repo.ext.HgExtensionsManager;
 import org.tmatesoft.hg.util.CancelledException;
 import org.tmatesoft.hg.util.Pair;
 import org.tmatesoft.hg.util.Path;
@@ -114,6 +115,7 @@
 	private HgMergeState mergeState;
 	private SubrepoManager subRepos;
 	private HgBookmarks bookmarks;
+	private HgExtensionsManager extManager;
 
 	// XXX perhaps, shall enable caching explicitly
 	private final HashMap<Path, SoftReference<RevlogStream>> streamsCache = new HashMap<Path, SoftReference<RevlogStream>>();
@@ -471,6 +473,18 @@
 		}
 		return bookmarks;
 	}
+	
+	public HgExtensionsManager getExtensions() {
+		if (extManager == null) {
+			class EM extends HgExtensionsManager {
+				EM() {
+					super(HgRepository.this.getImplHelper());
+				}
+			}
+			extManager = new EM();
+		}
+		return extManager;
+	}
 
 	/**
 	 * @return session environment of the repository