Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

manifestdialog: make it a sub command

Changeset 268c0f038bcf

Parent f5977e1979ed

by Yuya Nishihara

Changes to 2 files · Browse files at 268c0f038bcf Showing diff from parent f5977e1979ed Diff from another changeset...

 
21
22
23
24
 
25
26
27
28
29
 
30
31
32
 
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
 
 
 
 
21
22
23
 
24
25
26
27
28
29
30
31
32
33
 
142
143
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
146
147
@@ -21,12 +21,13 @@
 import sys, os  import os.path as osp   -from mercurial import ui, hg, util +from mercurial import ui, util  from mercurial.revlog import LookupError    from PyQt4 import QtGui, QtCore, Qsci  from PyQt4.QtCore import Qt, QSettings   +from tortoisehg.util import paths, thgrepo  from tortoisehg.util.hglib import tounicode    from tortoisehg.hgqt.dialogmixin import HgDialogMixin @@ -141,25 +142,6 @@
  s.setValue('manifest/splitter', self.splitter.saveState())     -if __name__ == '__main__': - from mercurial import ui, hg - from optparse import OptionParser - opt = OptionParser() - opt.add_option('-R', '--repo', - dest='repo', - default='.', - help='Hg repository') - - options, args = opt.parse_args() - if len(args) != 1: - opt.error('Please specify a revision number') - rev = args[0] - - u = ui.ui() - repo = hg.repository(u, options.repo) - app = QtGui.QApplication([]) - - view = ManifestDialog(repo, int(rev)) - view.show() - sys.exit(app.exec_()) - +def run(ui, *pats, **opts): + repo = opts.get('repo') or thgrepo.repository(ui, paths.find_root()) + return ManifestDialog(repo, opts.get('rev'))
 
469
470
471
 
 
 
 
 
472
473
474
 
844
845
846
 
 
 
 
847
848
849
 
469
470
471
472
473
474
475
476
477
478
479
 
849
850
851
852
853
854
855
856
857
858
@@ -469,6 +469,11 @@
  from tortoisehg.hgqt.merge import run   qtrun(run, ui, *pats, **opts)   +def manifest(ui, *pats, **opts): + """display the current or given revision of the project manifest""" + from tortoisehg.hgqt.manifestdialog import run + qtrun(run, ui, *pats, **opts) +  def guess(ui, *pats, **opts):   """guess previous renames or copies"""   from tortoisehg.hgqt.guess import run @@ -844,6 +849,10 @@
  (log,   [('l', 'limit', '', _('limit number of changes displayed'))],   _('thg log [OPTIONS] [FILE]')), + "manifest": + (manifest, + [('r', 'rev', '', _('revision to display'))], + _('thg manifest [-r REV]')),   "^merge":   (merge,   [('r', 'rev', '', _('revision to merge'))],