mirror of
https://github.com/openSUSE/osc.git
synced 2025-10-05 00:59:18 +02:00
support operation in checked out package for cat/less/blame
This commit is contained in:
1
NEWS
1
NEWS
@@ -3,6 +3,7 @@
|
|||||||
- add blame command (requires OBS 2.9)
|
- add blame command (requires OBS 2.9)
|
||||||
- results: show multibuild results by default
|
- results: show multibuild results by default
|
||||||
- getbinaries: make .AppImage files executable
|
- getbinaries: make .AppImage files executable
|
||||||
|
- support operation in checked out package for cat/less/blame
|
||||||
|
|
||||||
0.156
|
0.156
|
||||||
- highlight scheduled jobs with dispatch problems (due to constraints)
|
- highlight scheduled jobs with dispatch problems (due to constraints)
|
||||||
|
@@ -7940,11 +7940,18 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
"""${cmd_name}: Output the content of a file to standard output
|
"""${cmd_name}: Output the content of a file to standard output
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
osc cat file
|
||||||
osc cat project package file
|
osc cat project package file
|
||||||
osc cat project/package/file
|
osc cat project/package/file
|
||||||
osc cat http://api.opensuse.org/build/.../_log
|
osc cat http://api.opensuse.org/build/.../_log
|
||||||
osc cat http://api.opensuse.org/source/../_link
|
osc cat http://api.opensuse.org/source/../_link
|
||||||
|
|
||||||
|
osc less file
|
||||||
|
osc less project package file
|
||||||
|
|
||||||
|
osc blame file
|
||||||
|
osc blame project package file
|
||||||
|
|
||||||
${cmd_usage}
|
${cmd_usage}
|
||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
@@ -7957,11 +7964,19 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
opts.file = None
|
opts.file = None
|
||||||
return self.do_api('list', opts, *args)
|
return self.do_api('list', opts, *args)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
args = slash_split(args)
|
args = slash_split(args)
|
||||||
if len(args) != 3:
|
project = package = filename = None
|
||||||
|
if len(args) == 3:
|
||||||
|
project = args[0]
|
||||||
|
package = args[1]
|
||||||
|
filename = args[2]
|
||||||
|
elif len(args) == 1 and is_package_dir(os.getcwd()):
|
||||||
|
project = store_read_project(os.curdir)
|
||||||
|
package = store_read_package(os.curdir)
|
||||||
|
filename = args[0]
|
||||||
|
else:
|
||||||
raise oscerr.WrongArgs('Wrong number of arguments.')
|
raise oscerr.WrongArgs('Wrong number of arguments.')
|
||||||
|
|
||||||
rev, dummy = parseRevisionOption(opts.revision)
|
rev, dummy = parseRevisionOption(opts.revision)
|
||||||
apiurl = self.get_api_url()
|
apiurl = self.get_api_url()
|
||||||
|
|
||||||
@@ -7973,8 +7988,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if opts.revision:
|
if opts.revision:
|
||||||
query['rev'] = opts.revision
|
query['rev'] = opts.revision
|
||||||
if opts.expand:
|
if opts.expand:
|
||||||
query['rev'] = show_upstream_srcmd5(apiurl, args[0], args[1], expand=True, revision=opts.revision, meta=opts.meta)
|
query['rev'] = show_upstream_srcmd5(apiurl, project, package, expand=True, revision=opts.revision, meta=opts.meta)
|
||||||
u = makeurl(apiurl, ['source', args[0], args[1], args[2]], query=query)
|
u = makeurl(apiurl, ['source', project, package, filename], query=query)
|
||||||
try:
|
try:
|
||||||
if subcmd == 'less':
|
if subcmd == 'less':
|
||||||
f = http_GET(u)
|
f = http_GET(u)
|
||||||
@@ -7985,8 +8000,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
except HTTPError as e:
|
except HTTPError as e:
|
||||||
if e.code == 404 and not opts.expand and not opts.unexpand:
|
if e.code == 404 and not opts.expand and not opts.unexpand:
|
||||||
print('expanding link...', file=sys.stderr)
|
print('expanding link...', file=sys.stderr)
|
||||||
query['rev'] = show_upstream_srcmd5(apiurl, args[0], args[1], expand=True, revision=opts.revision)
|
query['rev'] = show_upstream_srcmd5(apiurl, project, package, expand=True, revision=opts.revision)
|
||||||
u = makeurl(apiurl, ['source', args[0], args[1], args[2]], query=query)
|
u = makeurl(apiurl, ['source', project, package, filename], query=query)
|
||||||
if subcmd == "less":
|
if subcmd == "less":
|
||||||
f = http_GET(u)
|
f = http_GET(u)
|
||||||
run_pager(''.join(f.readlines()))
|
run_pager(''.join(f.readlines()))
|
||||||
|
Reference in New Issue
Block a user