Mercurial > hg > gitweb
diff hg @ 158:be7103467d2e
Add 'hg serve' command for stand-alone server
This adds a simple stand-alone web server mode to hg that exports the
current repo for merging and browsing. The default port is 8000.
author | mpm@selenic.com |
---|---|
date | Wed, 25 May 2005 16:27:10 -0800 |
parents | 083c38bdfa64 |
children | 5dcbe4d9a30c |
line wrap: on
line diff
--- a/hg Wed May 25 16:21:06 2005 -0800 +++ b/hg Wed May 25 16:27:10 2005 -0800 @@ -37,6 +37,7 @@ log <file> show revision history of a single file merge <path> merge changes from <path> into local repository remove [files...] remove the given files in the next commit + serve export the repository via HTTP status show new, missing, and changed files in working dir tags show current changeset tags """ @@ -548,6 +549,22 @@ if errors: ui.warn("%d integrity errors encountered!\n" % errors) sys.exit(1) + +elif cmd == "serve": + from mercurial import hgweb + + soptions = {} + opts = [('p', 'port', 8000, 'listen port'), + ('a', 'address', '', 'interface address'), + ('n', 'name', os.getcwd(), 'repository name'), + ('t', 'templates', "", 'template map') + ] + + args = fancyopts.fancyopts(args, opts, soptions, + 'hg serve [options]') + + hgweb.server(repo.root, soptions["name"], soptions["templates"], + soptions["address"], soptions["port"]) else: print "unknown command\n"