comparison 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
comparison
equal deleted inserted replaced
500:465316bf97e8 501:d2f6ab541330
37 import org.tmatesoft.hg.internal.Experimental; 37 import org.tmatesoft.hg.internal.Experimental;
38 import org.tmatesoft.hg.internal.Filter; 38 import org.tmatesoft.hg.internal.Filter;
39 import org.tmatesoft.hg.internal.Internals; 39 import org.tmatesoft.hg.internal.Internals;
40 import org.tmatesoft.hg.internal.RevlogStream; 40 import org.tmatesoft.hg.internal.RevlogStream;
41 import org.tmatesoft.hg.internal.SubrepoManager; 41 import org.tmatesoft.hg.internal.SubrepoManager;
42 import org.tmatesoft.hg.repo.ext.HgExtensionsManager;
42 import org.tmatesoft.hg.util.CancelledException; 43 import org.tmatesoft.hg.util.CancelledException;
43 import org.tmatesoft.hg.util.Pair; 44 import org.tmatesoft.hg.util.Pair;
44 import org.tmatesoft.hg.util.Path; 45 import org.tmatesoft.hg.util.Path;
45 import org.tmatesoft.hg.util.PathRewrite; 46 import org.tmatesoft.hg.util.PathRewrite;
46 import org.tmatesoft.hg.util.ProgressSupport; 47 import org.tmatesoft.hg.util.ProgressSupport;
112 private HgTags tags; 113 private HgTags tags;
113 private HgBranches branches; 114 private HgBranches branches;
114 private HgMergeState mergeState; 115 private HgMergeState mergeState;
115 private SubrepoManager subRepos; 116 private SubrepoManager subRepos;
116 private HgBookmarks bookmarks; 117 private HgBookmarks bookmarks;
118 private HgExtensionsManager extManager;
117 119
118 // XXX perhaps, shall enable caching explicitly 120 // XXX perhaps, shall enable caching explicitly
119 private final HashMap<Path, SoftReference<RevlogStream>> streamsCache = new HashMap<Path, SoftReference<RevlogStream>>(); 121 private final HashMap<Path, SoftReference<RevlogStream>> streamsCache = new HashMap<Path, SoftReference<RevlogStream>>();
120 122
121 private final org.tmatesoft.hg.internal.Internals impl; 123 private final org.tmatesoft.hg.internal.Internals impl;
469 bookmarks = new HgBookmarks(impl); 471 bookmarks = new HgBookmarks(impl);
470 bookmarks.read(); 472 bookmarks.read();
471 } 473 }
472 return bookmarks; 474 return bookmarks;
473 } 475 }
476
477 public HgExtensionsManager getExtensions() {
478 if (extManager == null) {
479 class EM extends HgExtensionsManager {
480 EM() {
481 super(HgRepository.this.getImplHelper());
482 }
483 }
484 extManager = new EM();
485 }
486 return extManager;
487 }
474 488
475 /** 489 /**
476 * @return session environment of the repository 490 * @return session environment of the repository
477 */ 491 */
478 public SessionContext getSessionContext() { 492 public SessionContext getSessionContext() {