--- a/review/extension_ui.py Sat Mar 27 12:11:12 2010 -0400
+++ b/review/extension_ui.py Sat Mar 27 12:22:04 2010 -0400
@@ -16,9 +16,15 @@
def _web_command(ui, repo, **opts):
ui.note(messages.WEB_START)
read_only = opts.pop('read_only')
+ address = opts.pop('address')
+ port = int(opts.pop('port'))
import web_ui
- web_ui.load_interface(ui, repo, read_only=read_only, open=False)
+ web_ui.load_interface(
+ ui, repo, read_only=read_only,
+ address=address, port=port,
+ open=False
+ )
def _init_command(ui, repo, **opts):
ui.note(messages.INIT_START)
@@ -305,6 +311,8 @@
('U', 'unified', '5', 'number of lines of context to show'),
('w', 'web', False, 'launch the web interface'),
('', 'read-only', False, 'make the web interface read-only'),
+ ('', 'address', '127.0.0.1', 'run the web interface on the specified address'),
+ ('', 'port', '8080', 'run the web interface on the specified port'),
],
'hg review')
}
--- a/review/web_ui.py Sat Mar 27 12:11:12 2010 -0400
+++ b/review/web_ui.py Sat Mar 27 12:22:04 2010 -0400
@@ -128,7 +128,7 @@
-def load_interface(ui, repo, read_only=False, open=False, port=8080):
+def load_interface(ui, repo, read_only=False, open=False, address='127.0.0.1', port=8080):
if open:
import webbrowser
webbrowser.open('http://localhost:%d/' % port)
@@ -137,6 +137,10 @@
'/media': {
'tools.staticdir.on': True,
'tools.staticdir.dir': media_path,
+ },
+ 'global': {
+ 'server.socket_host': address,
+ 'server.socket_port': port,
}
}