review/extension_ui.py @ d02c0ed2f109
Rename the API module.
| author | Steve Losh <steve@stevelosh.com> |
|---|---|
| date | Sun, 04 Oct 2009 16:25:22 -0400 |
| parents | 11f42ea0fcf5 |
| children | 9639f74d4c7f |
'''The review extension's UI.''' import messages from api import * from mercurial import util def review(ui, repo, *fnames, **opts): '''code review a changeset in the current repository ''' if opts.pop('init'): ui.note(messages.INIT_START) try: datastore = ReviewDatastore(ui, repo, lpath=opts.pop('local_path'), rpath=opts.pop('remote_path'), create=True) ui.status(messages.INIT_SUCCESS) return except PreexistingDatastore, e: if e.committed: ui.note(messages.INIT_EXISTS_COMMITTED) else: raise util.Abort(messages.INIT_EXISTS_UNCOMMITTED) cmdtable = { 'review': (review, [ ('i', 'init', False, 'start code reviewing this repository'), ('', 'local-path', '', 'the local path to the code review data'), ('', 'remote-path', '', 'the remote path to code review data'), ], 'hg review') }