Package org.omegat.core.team2
Class RemoteRepositoryProvider
java.lang.Object
org.omegat.core.team2.RemoteRepositoryProvider
Class for process some repository commands.
Path, local path, repository path can be directory or one file only. Directory should be declared like 'source/', file should be declared like 'source/text.po'.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRemoteRepositoryProvider(File projectRoot, List<RepositoryDefinition> repositoriesDefinitions) RemoteRepositoryProvider(File projectRoot, List<RepositoryDefinition> repositoriesDefinitions, ProjectProperties props) -
Method Summary
Modifier and TypeMethodDescriptionvoidcommitFileAfterVersion(String path, String commentText, String... onVersions) Commit specific file after rebase.voidcommitFiles(String path, String commentText) Commit set of files without rebase - just local version.voidcopyFilesFromProjectToRepos(String localPath, @Nullable String eolConversionCharset) Copy all mappings that under specified directory path into repository directory.voidcopyFilesFromReposToProject(String localPath) Copies all files under specified path that are mapped to local directory.voidcopyFilesFromReposToProject(String localPath, String postfix, boolean propagateDelete) Copies all files under specified path that are mapped to local directory.getVersion(String file) Get version of specified file.booleanbooleanisUnderMapping(String path) Checks if path is under mapping.voidvoidSwitch all repositories into latest version.switchToVersion(String filePath, @Nullable String version) Switch repository that contains path to specified version.toPrepared(File inFile) Saves file into 'prepared' dir.
-
Field Details
-
REPO_SUBDIR
- See Also:
-
REPO_PREPARE_SUBDIR
- See Also:
-
REPO_GIT_SUBDIR
- See Also:
-
REPO_SVN_SUBDIR
- See Also:
-
-
Constructor Details
-
RemoteRepositoryProvider
public RemoteRepositoryProvider(File projectRoot, List<RepositoryDefinition> repositoriesDefinitions, ProjectProperties props) -
RemoteRepositoryProvider
public RemoteRepositoryProvider(File projectRoot, List<RepositoryDefinition> repositoriesDefinitions)
-
-
Method Details
-
isManaged
public boolean isManaged() -
setForceExcludesFromProjectProperties
-
getTeamSettings
-
isUnderMapping
Checks if path is under mapping. -
cleanPrepared
- Throws:
IOException
-
toPrepared
Saves file into 'prepared' dir.- Throws:
IOException
-
switchAllToLatest
Switch all repositories into latest version. Will continue in the event of an error, unless that error is aIRemoteRepository2.NetworkExceptionin which case it will throw immediately. If any other exceptions occur while updating the repos, the first will be thrown after all repos have been processed.- Throws:
Exception
-
switchToVersion
Switch repository that contains path to specified version. If version is null, need to switch to latest version. Returns the path in the remote repository ( /path/to/omegatproject/.repositories/url/filepath- Throws:
Exception
-
commitFileAfterVersion
public String commitFileAfterVersion(String path, String commentText, String... onVersions) throws Exception Commit specific file after rebase. Used for omegat/project_save.tmx, glossaries, etc.- Throws:
Exception
-
commitFiles
Commit set of files without rebase - just local version. Used for target/*, etc.- Throws:
Exception
-
copyFilesFromReposToProject
Copies all files under specified path that are mapped to local directory. If path is empty (i.e. full project), also file deletions since last copy are propagated, i.e. if remote repo has file deletions, those files are deleted locally as well.- Parameters:
localPath- directory name or file name- Throws:
IOException
-
copyFilesFromReposToProject
public void copyFilesFromReposToProject(String localPath, String postfix, boolean propagateDelete) throws IOException Copies all files under specified path that are mapped to local directory.If propagateDelete flag is set true and path is empty (i.e. full project), also file deletions since last copy are propagated, i.e. if remote repo has file deletions, those files are deleted locally as well.
- Parameters:
localPath- directory name or file name- Throws:
IOException
-
copyFilesFromProjectToRepos
public void copyFilesFromProjectToRepos(String localPath, @Nullable @Nullable String eolConversionCharset) throws Exception Copy all mappings that under specified directory path into repository directory.- Parameters:
localPath- directory name or file nameeolConversionCharset- not null if EOL conversion required. EOL will be converted to repository-specific for existing files, and to platform-specific for new files- Throws:
Exception
-
getVersion
Get version of specified file.- Throws:
Exception
-