Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.7, 0.7.1, and 0.7.2

hgtk: add version command

Changeset 43bbe70c9c30

Parent 1fa6b2db0015

by Steve Borho

Changes to one file · Browse files at 43bbe70c9c30 Showing diff from parent 1fa6b2db0015 Diff from another changeset...

Change 1 of 5 Show Entire File contrib/​hgtk Stacked
 
2
3
4
5
 
6
7
8
9
 
 
 
 
 
 
 
 
10
11
12
 
322
323
324
325
 
326
327
328
 
439
440
441
442
 
443
444
445
 
473
474
475
476
 
477
478
 
 
 
479
480
481
 
507
508
509
 
 
 
510
511
512
 
2
3
4
 
5
6
7
 
 
8
9
10
11
12
13
14
15
16
17
18
 
328
329
330
 
331
332
333
334
 
445
446
447
 
448
449
450
451
 
479
480
481
 
482
483
 
484
485
486
487
488
489
 
515
516
517
518
519
520
521
522
523
@@ -2,11 +2,17 @@
 #  # front-end script for TortoiseHg dialogs  # -# Copyright (C) 2008 Steve Borho <steve@borho.org> +# Copyright (C) 2008-9 Steve Borho <steve@borho.org>  # Copyright (C) 2008 TK Soh <teekaysoh@gmail.com>   -# set TORTOISEHG_PATH in your environment to point the location -# of your tortoisehg repository, or modify 'tortoisehg_dir' below: +shortlicense = '''\ +Copyright (C) 2009 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +''' + +# The recommended usage is to symlink this file into your path. +# alternatively, you can change this line or set TORTOISEHG_PATH  tortoisehg_dir = '~/tools/tortoisehg-dev'    import os @@ -322,7 +328,7 @@
    def helpcmd(name):   if with_version: - version_(ui) + version(ui)   ui.write('\n')   aliases, i = cmdutil.findcmd(name, table)   # synopsis @@ -439,7 +445,7 @@
  else:   # program name   if ui.verbose or with_version: - version_(ui) + version(ui)   else:   ui.status(_("Hgtk - TortoiseHg's GUI tools for Mercurial SCM (Hg)\n"))   ui.status('\n') @@ -473,9 +479,11 @@
  else:   ui.write("%s\n" % first)   -def version_(ui): +def version(ui, **opts):   """output version and copyright information""" - pass + import hggtk.shlib + ui.write("%s\n" % hggtk.shlib.version()) + if ui.verbose: ui.write(shortlicense)    globalopts = [   ('R', 'repository', '', @@ -507,6 +515,9 @@
  [('', 'webdir-conf', '', _('name of the webdir config file'))],   _('hgtk serve [OPTION]...')),   "^update|checkout|co": (update, [], _('hgtk update')), + "^version": (version, + [('v', 'verbose', None, _('print license'))], + _('hgtk version [OPTION]')),   "help": (help_, [], _('hgtk help [COMMAND]')),  }