5

Mercurial's vast publishing options include HgWeb (and formerly HgWebDir), which is almost perfect for my needs. HgWeb 1.6 supports multiple repositories, including collections.

So hgweb.config could contain something like this:

[collections]
/home/user/collection1 = /home/user/collection1
/home/user/collection2 = /home/user/collection2

So, the above folders (collection1, collection2) might each contain about 10-20 repositories, as subfolders, in the above locations.

My question is, is there any hg extension, or configuration technique that will allow me to push a clone up to a collection being served by hgweb?

My usual approach on Linux is to login remotely using SSH and then do an hg clone of my developer workstation copy, which I momentarily serve up using `hg serve'. I find that I work with some Linux-savvy developers, who have no problem ssh-ing into a box, and doing stuff with hg. But windows users (a) don't grok ssh, and (b) don't know Linux command line environments, and want a way either with their IDE version control plugins, or GUI tools, or with a CGI Page (written by me in python), to remotely pull a clone, giving them effectively a way to push or publish their HG Repository up to a central repository without recourse to any ssh access to the remote server system. In the odd case that a centralized mercurial server was running on Windows, you might not even be ABLE to ssh into the remote server.

It seems to me the answer is "no you can't do this", unless I write my own extension for hgweb, which I am about to do. But if there is a way to do this already in hg, I would like to know it.

Related questions:

Setup of mercurial on shared hosting

Multiple central repositoriess with mercurial

Community
  • 1
  • 1
Warren P
  • 65,725
  • 40
  • 181
  • 316
  • 1
    +0.5 for an interesting question, but some scathing generalizations about us Windows users. Guess that rounds up to +1 :) – icabod Jun 23 '11 at 14:35
  • 1
    Just to confirm, you want to be able to create a new clone of a users repository on an hgweb server? I'm wondering if rather than "push to a new clone" you could configure the hgweb server to "pull to a new clone", making the creation happen on the server-side? – icabod Jun 23 '11 at 14:37
  • 3
    I am an all-day-windows user, who also groks linux, but most of my fellow developers would be resistent to moving to any Mercurial distributed+centralized hybrid corporate workflow that required SSH and command line knowledge. Most of my fellow Windows-using devs are useless on Linux. Not a generalization for all time and space, just the space and time around me. – Warren P Jun 23 '11 at 15:11
  • 1
    icabod - as long as we could configure the remote side to pull to a new clone, via some simple mechanism - I am thinking that a small Python cgi script (PullClone.cgi.py?) could be written. – Warren P Jun 23 '11 at 15:11

1 Answers1

2

The default web interface of Mercurial does not support remote creations of repositories (see Why doesn't Mercurial support remote repository creations over HTTP?). However, if your fellow developers principally are allowed to login to the Mercurial server using SSH and if you have some kind of shared filespace on that server which can be accessed by multiple users, you could clone local repos to the server using an SSH repo URL (see this answer). That should be also easy for Windows users too as the lowlevel SSH stuff is done by Mercurial.

Community
  • 1
  • 1
Oben Sonne
  • 9,893
  • 2
  • 40
  • 61
  • Good find. Well, I intend to write such a feature, since it appears that such an idea was considered and rejected from Mercurial in the past. Features would include one click to clone and publish a new repository, and one click to hide it, so that the profusion of repositories doesn't cause endless confusion. Imagine that Mercurial didn't support remote creation of folders inside the repository; This is just such a failure of orthogonality. – Warren P Jun 23 '11 at 21:15
  • It turns out that you can do this with Kiln, since version 2.0, which is based on mercurial. Since kiln practices "new repository == new branch" as a default branching style, I think it is almost essential to do this. http://kiln.stackexchange.com/questions/1164/can-i-create-a-new-kiln-repository-remotely – Warren P Sep 10 '11 at 16:28