> -----Original Message-----
> From: [email protected] 
> <[email protected]> On Behalf Of Alexander Kanavin
> Sent: den 17 februari 2022 17:09
> To: [email protected]
> Cc: Alexander Kanavin <[email protected]>
> Subject: [OE-core] [PATCH 04/28] devtool: auto-pick 'main' branch in addition 
> to 'master' in upgrades
> 
> Signed-off-by: Alexander Kanavin <[email protected]>
> ---
>  scripts/lib/devtool/upgrade.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
> index 826a3f955f..7957d41192 100644
> --- a/scripts/lib/devtool/upgrade.py
> +++ b/scripts/lib/devtool/upgrade.py
> @@ -192,7 +192,7 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, 
> srcbranch, branch, kee
>              get_branch = [x.strip() for x in check_branch.splitlines()]
>              # Remove HEAD reference point and drop remote prefix
>              get_branch = [x.split('/', 1)[1] for x in get_branch if not 
> x.startswith('origin/HEAD')]
> -            if 'master' in get_branch:
> +            if 'master' in get_branch or 'main' in get_branch:
>                  # If it is master, we do not need to append 'branch=master' 
> as this is default.
>                  # Even with the case where get_branch has multiple objects, 
> if 'master' is one
>                  # of them, we should default take from 'master'
> --
> 2.20.1

This seems incorrect since the branch= parameter is always 
required nowadays. I would more expect the code to look something 
like this:

            if len(get_branch) == 1:
                # If srcrev is on only ONE branch, then use that branch
                srcbranch = get_branch[0]
            elif 'main' in get_branch:
                # If srcrev is on multiple branches, then choose 'main' if it 
is one of them
                srcbranch = 'main'
            elif 'master' in get_branch:
                # Otherwise choose 'master' if it is one of the branches
                srcbranch = 'master'
            else:
                ...

//Peter

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#161847): 
https://lists.openembedded.org/g/openembedded-core/message/161847
Mute This Topic: https://lists.openembedded.org/mt/89212438/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to