mercurial repository import

83 views
Skip to first unread message

Gintas Grigelionis

unread,
Mar 25, 2014, 1:09:28 PM3/25/14
to scmma...@googlegroups.com
Hi,

mercurial repository import in SCM Manager seems to ignore contact and description in hgrc.
It would be nice to replace the default path by ticking a box ("yes/no"), too.
ini4j seems to provide a suitable API. Or is it AbstactImportHandler that is too abst(r)act?

Another misfeature is that if I have repository URLs like http://<host>/scm/hg/<group>/<repo>,
I get 404 on http://<host>/scm/hg/<group> and a redirect to REST API on http://<host>/scm/hg.
Why couldn't the filter just redirect to hgweb CGI?
(And by the way, REST API seems to _not_ respect base URL from configuration.)

Regards, Gintas

Sebastian Sdorra

unread,
Mar 28, 2014, 9:52:30 AM3/28/14
to scmma...@googlegroups.com
Hi,
The mercurial importer is using the description and contact from the web section of the hgrc. Please have a look at https://bitbucket.org/sdorra/scm-manager/src/1.36/scm-plugins/scm-hg-plugin/src/main/java/sonia/scm/repository/HgImportHandler.java?at=default#cl-108

The redirect to the cgi is not possible in this case, because we are not able to use hgwebdir, we have to use hgweb.

What you mean by the rest api does not respect the base url?

Sebastian


--
You received this message because you are subscribed to the Google Groups "scmmanager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scmmanager+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gintas Grigelionis

unread,
Mar 29, 2014, 5:30:39 PM3/29/14
to scmma...@googlegroups.com
Hi,

thanks for the pointer, I stand corrected regarding the import of contact and description.

Yet, hgwebdir was unified with hgweb for mercurial 1.6 (in 2010), maybe it's time to see over the integration.
AFAIK, "modern" hgweb has a config file with paths that are exposed, which could be generated from "public" flags in scm manager
(which correspond to "hidden" in [web] section of hgrc -- an improvement in HgImportHandler?).

As to the last point, scm/hg redirects to scm/api/rest/help/repository-root/hg.html that uses localhost:<port> in URLs although I have an Apache as reverse proxy in front of jetty.
See above for a preferred solution.

Gintas

Sebastian Sdorra

unread,
Apr 1, 2014, 4:07:24 AM4/1/14
to scmma...@googlegroups.com
Hi,
It is nearly impossible to switch to hgwebdir, because of the architecture of SCM-Manager. You must keep in mind SCM-Manager is not just a simple wrapper around hgweb, there are complex filter mechanisms in front of the mercurial cgi. Anyway the goal of SCM-Manager is not to improve the hgweb ui, the goal is to remove the hgweb ui completely and replace it with the one from SCM-Manager. The ui of SCM-Manager is the same for all kind of supported scms (git, subversion and mercurial) and it can be extended and modified by SCM-Manager plugins, which is not possible with the hgweb ui. Hgweb will be removed in version 2.0.0, perhaps we create a plugin to install it again, but it will definitely be removed from the core.

I will check the redirect to the repository root with a reverse proxy.

Sebastian




--

Gintas Grigelionis

unread,
May 4, 2014, 1:50:06 PM5/4/14
to scmma...@googlegroups.com
Hi,

a replacement for hgweb - unified with other scm - would be nice, that removes the dependency on python + modules (I'm using http://www.lfd.uci.edu/~gohlke/pythonlibs/ for 64-bit binaries, by the way).

Before 2.0.0, would you consider replacing hgwebdir with a servlet?

Gintas

Sebastian Sdorra

unread,
May 6, 2014, 1:58:25 AM5/6/14
to scmma...@googlegroups.com
Hi,
What you mean by replacing hgweb with a servlet? hgweb is called by a servlet. Replacing hgweb with a java only servlet, would mean implementing the whole mercurial wire protocol by myself.

Note: there is already a unified ui for all kinds of repositories (source and commits link at the bottom of the repository grid after selecting a repository). With 2.0.0 i will show the unified ui (which will be completely redesigned for 2.0.0) on the urls of hgweb.

Sebastian



--

Gintas Grigelionis

unread,
May 15, 2014, 11:18:08 AM5/15/14
to scmma...@googlegroups.com
Hi,

isn't it confusing: when I mention hgweb for directories (where it only displays "name - description - contact - last modified - zip - rss"), you call it hgwebdir; when I mention hgwebdir, you talk about hgweb.

One of my nits was that scm manager answers with 404 rather than presenting something that emulates hgweb for directories (except for the root where it redirects to something akin to a static html page with links that are not always correct (pointing to localhost).
My question was about whether that could be addressed separately - before 2.0.0

As to implementing Mercurial in Java - what about http://code.google.com/p/hg4j/?

Gintas


Den tisdagen den 6:e maj 2014 kl. 07:58:25 UTC+2 skrev Sebastian Sdorra:
Hi,

Sebastian Sdorra

unread,
May 20, 2014, 11:06:42 AM5/20/14
to scmma...@googlegroups.com
Hi,
Sorry, but i will not change the handling of mercurial repositories before version 2.0.0. I've already tested hg4j, but it is not ready for scm-manager. Too many missing functions and to slow for some operations, but i have an eye of it.

Sebastian


Gintas Grigelionis

unread,
Jan 10, 2015, 4:42:35 AM1/10/15
to scmma...@googlegroups.com
I have found the following solution for the "localhost:8080" appearing in all links in /scm/api/rest/help/repository-root/hg.html

I deployed SCM Manager in Tomcat, and its documentation suggests adding proxyHost and proxyPort to <Connector />, see
Reply all
Reply to author
Forward
0 new messages