Unconditionally try to load the SCM client when TREES is defined.

Review Request #14345 — Created Feb. 13, 2025 and submitted

Information

RBTools
release-5.x

Reviewers

When someone is using the TREES setting for RBTools, it's common that
they'll be using repository paths as the keys to that. In this case, a
command like rbt patch --print would fail because it was trying to
avoid initializing the scmtool, and then we never got the correct server
URL.

This makes it so if TREES is present in the configuration (and now
also actually populated with data, since the default value will be {}),
and we otherwise did not need the scmtool, we'll still attempt to
initialize it. If we get it, then great, we can use it for TREES. If we
don't, we ignore that and proceed as previous.

  • Ran unit tests.
  • Verified that when TREES was defined, we now were initializing the
    scmtool when running rbt patch --print.
Summary ID
Unconditionally try to load the SCM client when TREES is defined.
When someone is using the `TREES` setting for RBTools, it's common that they'll be using repository paths as the keys to that. In this case, a command like `rbt patch --print` would fail because it was trying to avoid initializing the scmtool, and then we never got the correct server URL. This makes it so if `TREES` is present in the configuration (and now also actually populated with data, since the default value will be {}), and we otherwise did not need the scmtool, we'll still attempt to initialize it. If we get it, then great, we can use it for TREES. If we don't, we ignore that and proceed as previous. Testing Done: - Ran unit tests. - Verified that when TREES was defined, we now were initializing the scmtool when running `rbt patch --print`.
f26d447ed606ef248544b5b016afcc51c97ba7c6
Description From Last Updated

Could shorten the if condition to just if trees := self.config.get('TREES')

maubinmaubin

Could probably just be: if trees := self.config.get('TREES'):

chipx86chipx86

Let's make this keyword-only.

chipx86chipx86

Missing Version Added.

chipx86chipx86
maubin
  1. 
      
  2. rbtools/commands/base/commands.py (Diff revision 1)
     
     
     
    Show all issues

    Could shorten the if condition to just if trees := self.config.get('TREES')

  3. 
      
chipx86
  1. 
      
  2. rbtools/commands/base/commands.py (Diff revision 1)
     
     
     
    Show all issues

    Could probably just be:

    if trees := self.config.get('TREES'):
    
  3. rbtools/commands/base/commands.py (Diff revision 1)
     
     
    Show all issues

    Let's make this keyword-only.

  4. rbtools/commands/base/commands.py (Diff revision 1)
     
     
     
    Show all issues

    Missing Version Added.

  5. 
      
david
maubin
  1. Ship It!
  2. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to release-5.x (df18c0c)