mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove other.xml if was added by incorrect component roaming type
This commit is contained in:
@@ -130,7 +130,7 @@ abstract class BaseRepositoryManager(protected val dir: Path) : RepositoryManage
|
||||
*/
|
||||
protected abstract fun addToIndex(file: Path, path: String, content: ByteArray, size: Int)
|
||||
|
||||
override fun delete(path: String) {
|
||||
override fun delete(path: String): Boolean {
|
||||
LOG.debug { "Remove $path"}
|
||||
|
||||
lock.write {
|
||||
@@ -138,8 +138,11 @@ abstract class BaseRepositoryManager(protected val dir: Path) : RepositoryManage
|
||||
// delete could be called for non-existent file
|
||||
if (file.exists()) {
|
||||
delete(file, path)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
private fun delete(file: Path, path: String) {
|
||||
|
||||
@@ -242,23 +242,26 @@ class IcsApplicationLoadListener : ApplicationLoadListener {
|
||||
|
||||
val repositoryManager = icsManager.repositoryManager
|
||||
if (repositoryManager.isRepositoryExists() && repositoryManager is GitRepositoryManager) {
|
||||
if (repositoryManager.renameDirectory(linkedMapOf(
|
||||
Pair("\$ROOT_CONFIG$", null),
|
||||
Pair("_mac/\$ROOT_CONFIG$", "_mac"),
|
||||
Pair("_windows/\$ROOT_CONFIG$", "_windows"),
|
||||
Pair("_linux/\$ROOT_CONFIG$", "_linux"),
|
||||
Pair("_freebsd/\$ROOT_CONFIG$", "_freebsd"),
|
||||
Pair("_unix/\$ROOT_CONFIG$", "_unix"),
|
||||
Pair("_unknown/\$ROOT_CONFIG$", "_unknown"),
|
||||
val migrateSchemes = repositoryManager.renameDirectory(linkedMapOf(
|
||||
Pair("\$ROOT_CONFIG$", null),
|
||||
Pair("_mac/\$ROOT_CONFIG$", "_mac"),
|
||||
Pair("_windows/\$ROOT_CONFIG$", "_windows"),
|
||||
Pair("_linux/\$ROOT_CONFIG$", "_linux"),
|
||||
Pair("_freebsd/\$ROOT_CONFIG$", "_freebsd"),
|
||||
Pair("_unix/\$ROOT_CONFIG$", "_unix"),
|
||||
Pair("_unknown/\$ROOT_CONFIG$", "_unknown"),
|
||||
|
||||
Pair("\$APP_CONFIG$", null),
|
||||
Pair("_mac/\$APP_CONFIG$", "_mac"),
|
||||
Pair("_windows/\$APP_CONFIG$", "_windows"),
|
||||
Pair("_linux/\$APP_CONFIG$", "_linux"),
|
||||
Pair("_freebsd/\$APP_CONFIG$", "_freebsd"),
|
||||
Pair("_unix/\$APP_CONFIG$", "_unix"),
|
||||
Pair("_unknown/\$APP_CONFIG$", "_unknown")
|
||||
))) {
|
||||
Pair("\$APP_CONFIG$", null),
|
||||
Pair("_mac/\$APP_CONFIG$", "_mac"),
|
||||
Pair("_windows/\$APP_CONFIG$", "_windows"),
|
||||
Pair("_linux/\$APP_CONFIG$", "_linux"),
|
||||
Pair("_freebsd/\$APP_CONFIG$", "_freebsd"),
|
||||
Pair("_unix/\$APP_CONFIG$", "_unix"),
|
||||
Pair("_unknown/\$APP_CONFIG$", "_unknown")
|
||||
))
|
||||
|
||||
val removeOtherXml = repositoryManager.delete("other.xml")
|
||||
if (migrateSchemes || removeOtherXml) {
|
||||
// schedule push to avoid merge conflicts
|
||||
application.invokeLater({ icsManager.autoSyncManager.autoSync(force = true) })
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ interface RepositoryManager {
|
||||
*/
|
||||
fun write(path: String, content: ByteArray, size: Int): Boolean
|
||||
|
||||
fun delete(path: String)
|
||||
fun delete(path: String): Boolean
|
||||
|
||||
fun processChildren(path: String, filter: (name: String) -> Boolean, processor: (name: String, inputStream: InputStream) -> Boolean)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user