1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-23 05:26:16 +01:00

- do_log: support -r rev1:rev2 (revision ranges)

This obviously only work for "plain" revisions
This commit is contained in:
Marcus Huewe 2011-11-22 20:12:28 +01:00
parent ce1bcee552
commit da745728cc
2 changed files with 7 additions and 4 deletions

View File

@ -5184,7 +5184,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
project = args[0] project = args[0]
package = args[1] package = args[1]
rev, dummy = parseRevisionOption(opts.revision) rev, rev_upper = parseRevisionOption(opts.revision)
if rev and not checkRevision(project, package, rev, apiurl, opts.meta): if rev and not checkRevision(project, package, rev, apiurl, opts.meta):
print >>sys.stderr, 'Revision \'%s\' does not exist' % rev print >>sys.stderr, 'Revision \'%s\' does not exist' % rev
sys.exit(1) sys.exit(1)
@ -5195,7 +5195,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
if opts.xml: if opts.xml:
format = 'xml' format = 'xml'
log = '\n'.join(get_commitlog(apiurl, project, package, rev, format, opts.meta, opts.deleted)) log = '\n'.join(get_commitlog(apiurl, project, package, rev, format, opts.meta, opts.deleted, rev_upper))
run_pager(log) run_pager(log)
def do_service(self, subcmd, opts, *args): def do_service(self, subcmd, opts, *args):

View File

@ -5026,7 +5026,7 @@ def print_jobhistory(apiurl, prj, current_package, repository, arch, format = 't
print '%s %-50s %-16s %-16s %-16s %-16s' % (endtime, package[0:49], reason[0:15], code[0:15], waitbuild, worker) print '%s %-50s %-16s %-16s %-16s %-16s' % (endtime, package[0:49], reason[0:15], code[0:15], waitbuild, worker)
def get_commitlog(apiurl, prj, package, revision, format = 'text', meta = False, deleted = False): def get_commitlog(apiurl, prj, package, revision, format = 'text', meta = False, deleted = False, revision_upper=None):
import time import time
query = {} query = {}
@ -5051,7 +5051,10 @@ def get_commitlog(apiurl, prj, package, revision, format = 'text', meta = False,
rev = int(node.get('rev')) rev = int(node.get('rev'))
#vrev = int(node.get('vrev')) # what is the meaning of vrev? #vrev = int(node.get('vrev')) # what is the meaning of vrev?
try: try:
if revision and rev != int(revision): if revision is not None and revision_upper is not None:
if rev > int(revision_upper) or rev < int(revision):
continue
elif revision is not None and rev != int(revision):
continue continue
except ValueError: except ValueError:
if revision != srcmd5: if revision != srcmd5: