mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-05 03:40:56 +01:00
There was previously a weird duality where a simple push to or pull from a repository hosted by SCM-Manager would load all of the system and user level config files, but they were ignored when importing a repository. I found this out when importing an LFS repo, and it eventually failed with a message that the LFS extension needs to be enabled, even though it was enabled globally. The global config should typically never be ignored, because some repositories are unreadable without certain extensions or configurations. The JavaHg API here mirrors the hg behavior for the `HGRCPATH` environment variable- not setting it (or null here) uses the default config resolution, and `""` (the default in JavaHg for some reason) disables default config resolution. The repository initialization code in JavaHg also uses `""`, and there's no way to alter that from the outside. But that appears to be harmless, so I'm ignoring that for now. Note that this may only have been a problem on non-Windows systems- setting an environment variable to empty on Windows *unsets* the variable, even in the `_wputenv()` API, which is what we want. After this, normal push/pull operations continue to use the global config. But now imports from the SCM-Manager UI, the hooks run during a push, and any other commands that are run through JavaHg will see a consistent configuration. LFS (and maybe largefiles- I haven't tested it) repository imports now work. (I wouldn't say "supported" yet because it doesn't pull the blobs. The largefiles extension has a command for doing this, but the LFS extension doesn't. The stopgap for this is to run `hg verify` to download the blobs, but that won't work here with the way subrepos aren't nested as expected. I can work on a command on the hg side to fill this gap.) One final thing to note here- as I was testing, I initially got authentication failures when trying to pull. It happened several times as I added more and more logging, then disappeared, and I wasn't able to trigger it again as I backed off the logging to get to this change alone. The auth info is written to the repository's hgrc file, so a change to whether or not the global configuration is processed is irrelevant. The next couple of commits will try to improve the related code.
Plugins moved see https://github.com/scm-manager/scm-manager/blob/develop/docs/scm-plugins.md for details.