During project import, SCM needs to be included. Since Google Code only supports a single repository at a time, we should just have a single Code Importer that checks the project to discover the repo type and passes that information to the appropriate SCM tool's clone_from_url
method.
One way to discover the repo type would be to load https://code.google.com/p/%s/source/browse/
and get the text of the item id="crumb_root"
, which will be one of " git/ "
, " hg/ "
, or " svn/ "
.
forge:tv/6463
How do I invoke it? I don't see any new admin options, and it doesn't run when I do a google code import from
/p/import_project/google-code/
Does it need a[allura.importers]
entry?We can't add a hard dependency on ForgeHg. Could ForgeHg have its own importer? Something good (not hacky) would be best here, since other importers may need to dynamically select the right SCM tool too. (Yet another entry point?) Somewhat similarly, we also need to gracefully not support svn & git imports if those tools are not set up.
Thinking a bit more about this, I don't think we need anything fancy & fully dynamic like new entry points for SCM types. Since Google Code only has SVN, git and hg, we can reference those tools directly. Just catch ImportErrors so they're all optional.
Rebased to master and force-pushed.
Added import guards and entry point, and moved
get_repo_type()
under the Extractor per Cory's suggestion.New commit on forge:tv/6463
Hello, is the google code importer avalable? All I found in the allura plugins is only the google wiki importer but I also need to import the full project such as the source code. Thanks.
The other Google Code importers are included in Allura core (not separate plugins), however they were built to import from the regular Google Code site, and do not work with the archived format that Google Code is in now.
If you want to import a code repo, it is still possible. For Git & Hg repos you can just get a local copy and push it up to an empty repo on Allura. For SVN you can import it server-side, or get your own SVN service running and then use the Allura web interface to import from there.