On Tuesday 07 September 2010 10:02:44 Marcus Hüwe wrote:
On 2010-09-06 20:24:01 +0200, OBS build-service wrote: ...
- # for requests accepted with OBS 2.0 and before, this can not work in all cases - path = "/source/%s/%s?oproject=%s&opackage=%s&cmd=diff&expand=1" % - [CGI.escape(action.source.project), CGI.escape(action.source.package), CGI.escape(action.target.project), CGI.escape(action.target.package)] - if action.source.data['rev'] - path += "&rev=#{action.source.rev}" + # for requests not yet accepted or accepted with OBS 2.0 and before + if DbPackage.find_by_project_and_name( action.target.project, action.target.package ) + path = "/source/%s/%s?oproject=%s&opackage=%s&cmd=diff&expand=1" % + [CGI.escape(action.source.project), CGI.escape(action.source.package), CGI.escape(action.target.project), CGI.escape(action.target.package)] + if action.source.data['rev'] + path += "&rev=#{action.source.rev}" + end + else + diff_text = "New package: " + action.target.project + "/" + action.target.package + "\n" + diff_text Hmm there's no need for this check. If we pass the "missingok=1" query parameter to the backend we should be able to diff against a "missing"/non-existent package.
hm, good point, but that would lead to a full diff of the new packages, right ? In this way the new packages would mentioned on top of the diff to make it obvious. It is not important for the webui though, because it has an extra handling. Is osc showing new packages also explicit somehow ? -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org