public abstract class AbstractRepositoryManager<T extends Repository> extends java.lang.Object implements RepositoryManager<T>
Modifier | Constructor and Description |
---|---|
protected |
AbstractRepositoryManager(AbstractVcs vcs,
java.lang.String repoDirName) |
Modifier and Type | Method and Description |
---|---|
void |
addExternalRepository(VirtualFile root,
T repository)
Registers a repository which doesn't belong to the project.
|
abstract java.util.List<T> |
getRepositories() |
protected java.util.List<T> |
getRepositories(java.lang.Class<T> type) |
T |
getRepositoryForFile(FilePath file)
Returns the
Repository which the given file belongs to, or null if the file is not under any Git ot Hg repository. |
T |
getRepositoryForFile(VirtualFile file)
Returns the
Repository which the given file belongs to, or null if the file is not under any Git or Hg repository. |
T |
getRepositoryForFileQuick(FilePath file) |
T |
getRepositoryForFileQuick(VirtualFile file) |
T |
getRepositoryForRoot(VirtualFile root)
Returns the Repository instance which tracks the VCS repository located in the given root directory,
or
null if the given root is not a valid registered vcs root. |
T |
getRepositoryForRootQuick(VirtualFile root) |
AbstractVcs |
getVcs() |
boolean |
isExternal(T repository) |
boolean |
moreThanOneRoot() |
void |
removeExternalRepository(VirtualFile root)
Removes the repository not from the project, when it is not interesting anymore.
|
boolean |
shouldProposeSyncControl()
Returns true if the synchronous branch control should be proposed for this project,
if the setting was not defined yet, and all repositories are on the same branch.
|
void |
updateAllRepositories() |
void |
updateRepository(VirtualFile root)
Synchronously updates the specified information about repository under the given root.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isSyncEnabled
protected AbstractRepositoryManager(AbstractVcs vcs, java.lang.String repoDirName)
public T getRepositoryForRoot(VirtualFile root)
RepositoryManager
null
if the given root is not a valid registered vcs root.
The method checks both project roots and external roots previously registered
via RepositoryManager.addExternalRepository(VirtualFile, Repository)
.getRepositoryForRoot
in interface RepositoryManager<T extends Repository>
public T getRepositoryForRootQuick(VirtualFile root)
getRepositoryForRootQuick
in interface RepositoryManager<T extends Repository>
public void addExternalRepository(VirtualFile root, T repository)
RepositoryManager
addExternalRepository
in interface RepositoryManager<T extends Repository>
public void removeExternalRepository(VirtualFile root)
RepositoryManager
removeExternalRepository
in interface RepositoryManager<T extends Repository>
public boolean isExternal(T repository)
isExternal
in interface RepositoryManager<T extends Repository>
public T getRepositoryForFile(VirtualFile file)
RepositoryManager
Repository
which the given file belongs to, or null
if the file is not under any Git or Hg repository.getRepositoryForFile
in interface RepositoryManager<T extends Repository>
public T getRepositoryForFileQuick(VirtualFile file)
public T getRepositoryForFile(FilePath file)
RepositoryManager
Repository
which the given file belongs to, or null
if the file is not under any Git ot Hg repository.getRepositoryForFile
in interface RepositoryManager<T extends Repository>
public T getRepositoryForFileQuick(FilePath file)
getRepositoryForFileQuick
in interface RepositoryManager<T extends Repository>
public abstract java.util.List<T> getRepositories()
getRepositories
in interface RepositoryManager<T extends Repository>
public boolean moreThanOneRoot()
moreThanOneRoot
in interface RepositoryManager<T extends Repository>
public void updateRepository(VirtualFile root)
RepositoryManager
updateRepository
in interface RepositoryManager<T extends Repository>
root
- root directory of the vcs repository.public void updateAllRepositories()
updateAllRepositories
in interface RepositoryManager<T extends Repository>
public AbstractVcs getVcs()
getVcs
in interface RepositoryManager<T extends Repository>
public boolean shouldProposeSyncControl()