#518 Improve invalid branch name error message
Merged by onosek. Opened by oturpe.
oturpe/fedpkg improve-load-rpmdefines-error-message  into  master

Download 518.patch

Currently, if the resolved release name does not match any supported pattern (rawhide', f38 or so),
the following error is printed:

(foo) $ fedpkg prep
Could not execute prep: Could not find the release/dist from branch name foo
Please specify with --release

This is fine when the current Git branch name was used when resolving the release.
However, the exact same error is printed even if the --release option was used, like this:

$ fedpkg --release foo prep
Could not execute prep: Could not find the release/dist from branch name foo
Please specify with --release

The error message is split into two cases depending on if --release was used
(detected by checking if self.dist is truthy):

(foo) $ fedpkg prep
Could not execute prep: Could not find release from branch name 'foo'. Please specify with --release.
$ fedpkg --release foo prep
Could not execute prep: Invalid release 'foo'.

Signed-off-by: Otto Liljalaakso otto.liljalaakso@iki.fi

rebased onto e6faa11555103b99739dac509b08871ba6d8573c

The new behavior looks like a net improvement, thanks!

rebased onto dea695ce2cb0a0f734c8c00069554fc73cb826df

Commit 6a381fd9 fixes this pull-request

Pull-Request has been merged by onosek

Thanks for the PR.
I just did small updates and made unit tests pass:
https://jenkins-fedora-infra.apps.ocp.cloud.ci.centos.org/job/fedpkg-pipeline/99/

Metadata