mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-27 15:06:15 +01:00
osc ls -u -- same logic here as mls suggests for osc cat.
This commit is contained in:
parent
b4364bceff
commit
38c0621a90
2
NEWS
2
NEWS
@ -1,5 +1,5 @@
|
|||||||
- suggest git, svn, ... if indicated, after oscerr.NoWorkingCopy
|
- suggest git, svn, ... if indicated, after oscerr.NoWorkingCopy
|
||||||
- "osc cat" now auto-expands through link.
|
- "osc cat" & "osc ls" now auto-expands through link.
|
||||||
- fixed "osc add" after "osc delete".
|
- fixed "osc add" after "osc delete".
|
||||||
|
|
||||||
0.126
|
0.126
|
||||||
|
@ -199,6 +199,8 @@ class Osc(cmdln.Cmdln):
|
|||||||
help='specify revision (only for sources)')
|
help='specify revision (only for sources)')
|
||||||
@cmdln.option('-e', '--expand', action='store_true',
|
@cmdln.option('-e', '--expand', action='store_true',
|
||||||
help='expand linked package (only for sources)')
|
help='expand linked package (only for sources)')
|
||||||
|
@cmdln.option('-u', '--unexpand', action='store_true',
|
||||||
|
help='always work with unexpanded (source) packages')
|
||||||
@cmdln.option('-v', '--verbose', action='store_true',
|
@cmdln.option('-v', '--verbose', action='store_true',
|
||||||
help='print extra information')
|
help='print extra information')
|
||||||
@cmdln.option('-l', '--long', action='store_true', dest='verbose',
|
@cmdln.option('-l', '--long', action='store_true', dest='verbose',
|
||||||
@ -338,28 +340,40 @@ class Osc(cmdln.Cmdln):
|
|||||||
print '\n'.join(meta_get_packagelist(conf.config['apiurl'], project))
|
print '\n'.join(meta_get_packagelist(conf.config['apiurl'], project))
|
||||||
|
|
||||||
elif len(args) == 2 or len(args) == 3:
|
elif len(args) == 2 or len(args) == 3:
|
||||||
l = meta_get_filelist(conf.config['apiurl'],
|
link_seen = False
|
||||||
|
print_not_found = True
|
||||||
|
for i in [ 1, 2 ]:
|
||||||
|
l = meta_get_filelist(conf.config['apiurl'],
|
||||||
project,
|
project,
|
||||||
package,
|
package,
|
||||||
verbose=opts.verbose,
|
verbose=opts.verbose,
|
||||||
expand=opts.expand,
|
expand=opts.expand,
|
||||||
revision=opts.revision)
|
revision=opts.revision)
|
||||||
if opts.verbose:
|
if opts.verbose:
|
||||||
out = [ '%s %7s %9d %s %s' % (i.md5, i.rev, i.size, shorttime(i.mtime), i.name) \
|
for i in l:
|
||||||
|
if i.name == '_link':
|
||||||
|
link_seen = True
|
||||||
|
out = [ '%s %7s %9d %s %s' % (i.md5, i.rev, i.size, shorttime(i.mtime), i.name) \
|
||||||
for i in l if not fname or fname == i.name ]
|
for i in l if not fname or fname == i.name ]
|
||||||
if len(out) == 0:
|
if len(out) > 0:
|
||||||
|
print_not_found = False
|
||||||
|
print '\n'.join(out)
|
||||||
|
else:
|
||||||
|
if '_link' in l:
|
||||||
|
link_seen = True
|
||||||
if fname:
|
if fname:
|
||||||
print 'file \'%s\' does not exist' % fname
|
if fname in l:
|
||||||
else:
|
print fname
|
||||||
print '\n'.join(out)
|
print_not_found = False
|
||||||
else:
|
|
||||||
if fname:
|
|
||||||
if fname in l:
|
|
||||||
print fname
|
|
||||||
else:
|
else:
|
||||||
print 'file \'%s\' does not exist' % fname
|
print '\n'.join(l)
|
||||||
else:
|
if opts.expand or opts.unexpand or link_seen == 0: break
|
||||||
print '\n'.join(l)
|
m = show_files_meta(conf.config['apiurl'], project, package)
|
||||||
|
xml = ET.fromstring(''.join(m)).find('linkinfo')
|
||||||
|
print "# -> %s %s" % (xml.get('project'), xml.get('package'))
|
||||||
|
opts.expand = True
|
||||||
|
if fname and print_not_found:
|
||||||
|
print 'file \'%s\' does not exist' % fname
|
||||||
|
|
||||||
|
|
||||||
@cmdln.option('-f', '--force', action='store_true',
|
@cmdln.option('-f', '--force', action='store_true',
|
||||||
|
Loading…
Reference in New Issue
Block a user