Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

hgtk: add option listfile for passing file list

accept - for stdin

Changeset c405ae14d089

Parent 41910761f1a1

by Simon Heimberg

Changes to one file · Browse files at c405ae14d089 Showing diff from parent 41910761f1a1 Diff from another changeset...

Change 1 of 3 Show Entire File contrib/​hgtk Stacked
 
45
46
47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
49
50
 
78
79
80
 
 
 
 
 
 
81
82
83
 
488
489
490
 
491
492
493
 
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
 
92
93
94
95
96
97
98
99
100
101
102
103
 
508
509
510
511
512
513
514
@@ -45,6 +45,20 @@
  return -1   return _runcatch(u, args)   +def get_list_from_file(filename): + try: + if filename == '-': + lines = [ x.replace("\n", "") for x in sys.stdin.readlines() ] + else: + fd = open(filename, "r") + lines = [ x.replace("\n", "") for x in fd.readlines() ] + fd.close() + os.unlink(listfile) + return lines + except IOError, e: + sys.stderr.write(_('can not read file "%s". Ignored.\n') % filename) + return [] +  def _parse(ui, args):   options = {}   cmdoptions = {} @@ -78,6 +92,12 @@
  options[n] = cmdoptions[n]   del cmdoptions[n]   + listfile = options.get('listfile') + if listfile: + del options['listfile'] + args += get_list_from_file(listfile) + + print 'args=', args, '\noptions=', options, '\ncmdoptions=', cmdoptions ###   return (cmd, cmd and i[0] or None, args, options, cmdoptions)    def _runcatch(ui, args): @@ -488,6 +508,7 @@
  _('repository root directory or symbolic path name')),   ('v', 'verbose', None, _('enable additional output')),   ('h', 'help', None, _('display help and exit')), + ('l', 'listfile', '', _('read file list from file')),  ]    table = {