mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-28 15:36:13 +01:00
- added revision option to do_cat()
This commit is contained in:
parent
c6249087f9
commit
a8788c2c4e
@ -1909,6 +1909,8 @@ class Osc(cmdln.Cmdln):
|
|||||||
print ', '.join(maintainers)
|
print ', '.join(maintainers)
|
||||||
|
|
||||||
|
|
||||||
|
@cmdln.option('-r', '--revision', metavar='rev',
|
||||||
|
help='print out the specified revision')
|
||||||
def do_cat(self, subcmd, opts, *args):
|
def do_cat(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: Output the content of a file to standard output
|
"""${cmd_name}: Output the content of a file to standard output
|
||||||
|
|
||||||
@ -1924,11 +1926,13 @@ class Osc(cmdln.Cmdln):
|
|||||||
if len(args) != 3:
|
if len(args) != 3:
|
||||||
print >>sys.stderr, 'error - incorrect number of arguments'
|
print >>sys.stderr, 'error - incorrect number of arguments'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
rev, dummy = parseRevisionOption(opts.revision)
|
||||||
|
|
||||||
import tempfile
|
import tempfile
|
||||||
(fd, filename) = tempfile.mkstemp(prefix = 'osc_%s.' % args[2], dir = '/tmp')
|
(fd, filename) = tempfile.mkstemp(prefix = 'osc_%s.' % args[2], dir = '/tmp')
|
||||||
|
|
||||||
get_source_file(conf.config['apiurl'], args[0], args[1], args[2], targetfilename=filename)
|
get_source_file(conf.config['apiurl'], args[0], args[1], args[2],
|
||||||
|
targetfilename=filename, revision=rev)
|
||||||
|
|
||||||
if binary_file(filename):
|
if binary_file(filename):
|
||||||
print >>sys.stderr, 'error - cannot display binary file \'%s\'' % args[2]
|
print >>sys.stderr, 'error - cannot display binary file \'%s\'' % args[2]
|
||||||
|
Loading…
Reference in New Issue
Block a user