开发者

Can I use Mercurial for multiple projects (in an approximately the same way as SVN)?

I have a private SVN repository that I use for all of my projects. It is backed up regularly, and I like being able to browse it over the web, when I need a little snippet of code.

Now, I would like to move to a more modern platform for source control (say, Git or Mercurial), but I also like having all of my projects in one place.

Is there a way to store multiple repositories in the same location with Mercurial?

Something like a personal Github or somet开发者_Go百科hing?

Or, should I just continue to use SVN as the backing store, and use Mercurial to push and pull?


Mercurial and Git are generally oriented towards 1-repository-per-project models. However, you could still have a bunch of repositories all grouped together in their own subdirectories within a directory, effectively having them mostly in the same place, and serve the entire top-level directory via a webserver.


The short answer is no, DVCS repos aren't really set up to be used with multiple projects.

See my answer at the Kiln Stack Exchange on Should I use more than one repository? for the long version.

If this is just for your personal code that you aren't really working on with someone else, you can put them up on Kiln (backed by Mercurial) for free by using the "Student and Startup Edition". (Full disclosure: I'm a dev on Kiln.) BitBucket is also a good option.


As an alternative, you can use hg-app http://hg.python-works.com it's hgwebdir replacement written entirely in pylons.

  • has it's own middleware to handle mercurial protocol request each request can be logged and authenticated + threaded performance unlikely to hgweb
  • full permissions per project read/write/admin access even on mercurial request
  • mako templates let's you cusmotize look and feel of application.
  • diffs annotations and source code all colored by pygments.
  • mercurial branch graph and yui-flot powered graphs
  • admin interface for performing user/permission managments as well as repository managment.
  • Additional settings for mercurial web, (hooks editable from admin panel !) also manage paths, archive, remote messages
  • backup scripts can do backup of whole app and send it over scp to desired location
  • setup project descriptions and info inside built in db for easy, non file-system operations
  • Full search text on repository codes
  • added cache with invalidation on push/repo managment for high performance and always upto date data.
  • rss / atom feeds, gravatar support
  • based on pylons 1.0 / sqlalchemy 0.6


You can create new remote repositories over ssh using clone-to-remote like this:

hg init
hg clone ssh://remote//path/to/repos

after which you can browse and push via http if you have hgweb setup.

I wrote a cheesy little script to show how easy it would be to enable remote creation over http if ssh is undoable, but without some new configuration or software you'll find you're not able to create new remote repos without shell access of some sort.


Yes and no. See the hgweb.cgi file.

Here's a link to the Dreamwidth project with multiple repos on a website (note, this isn't the default formatting, but it's the only one I could think of off the top of my head.

Oh - turns out Debian uses hg and has a web-facing cgi - http://hg.debian.org/hg/

The default setup of the hgweb will give you - for all your repos - version tree, commit logs, push/pull functionality.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜