Move support flags out of RepositoryInfo into SCMClient.

Review Request #11520 — Created March 12, 2021 and submitted

Information

RBTools
master

Reviewers

RepositoryInfo had two old flags for indicating support for features,
supports_changesets and supports_parent_diffs. Having these in
the RepositoryInfo class was weird, since we have a bunch of other
support flags that live on the SCMClient class. Whether a client
supports these isn't something that might change from repository to
repository, so these should live on the client too.

This change moves those flags over. Unfortunately, unlike a lot of the
recent cleanups, this isn't something that can be done in a soft
deprecation. It seems pretty unlikely that there are custom SCMClient
implementations floating around which use these, but just in case, if
they try to use it after upgrading to RBTools 3.0, it'll spit out a
useful error message telling them how to fix it.

Ran unit tests.

Summary ID
Move support flags out of RepositoryInfo into SCMClient.
`RepositoryInfo` had two old flags for indicating support for features, `supports_changesets` and `supports_parent_diffs`. Having these in the `RepositoryInfo` class was weird, since we have a bunch of other support flags that live on the `SCMClient` class. Whether a client supports these isn't something that might change from repository to repository, so these should live on the client too. This change moves those flags over. Unfortunately, unlike a lot of the recent cleanups, this isn't something that can be done in a soft deprecation. It seems pretty unlikely that there are custom SCMClient implementations floating around which use these, but just in case, if they try to use it after upgrading to RBTools 3.0, it'll spit out a useful error message telling them how to fix it. Testing Done: Ran unit tests.
d0f7498a683486bcbd8449f3da537b12d72b8f93
Description From Last Updated

F821 undefined name 'CommandError'

reviewbotreviewbot

F821 undefined name 'CommandError'

reviewbotreviewbot

Can you add Type: to each of these?

chipx86chipx86

Can you add Version Added and Type here (in that order)?

chipx86chipx86

Rather than outright quit, can we have this raise an exception instead? That'll be a lot nicer on anyone who …

chipx86chipx86

To avoid any confusion, let's say "must instead set the supports_changesets attribute on the class."

chipx86chipx86

Same note here.

chipx86chipx86

While here, can we move this to super()?

chipx86chipx86
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

david
chipx86
  1. 
      
  2. rbtools/clients/__init__.py (Diff revision 2)
     
     

    Can you add Type: to each of these?

  3. rbtools/clients/__init__.py (Diff revision 2)
     
     

    Can you add Version Added and Type here (in that order)?

  4. rbtools/clients/__init__.py (Diff revision 2)
     
     
     
     
     
     
     

    Rather than outright quit, can we have this raise an exception instead? That'll be a lot nicer on anyone who may hit this.

    Same below.

  5. rbtools/clients/__init__.py (Diff revision 2)
     
     
     

    To avoid any confusion, let's say "must instead set the supports_changesets attribute on the class."

  6. rbtools/clients/__init__.py (Diff revision 2)
     
     
     

    Same note here.

  7. 
      
david
chipx86
  1. 
      
  2. rbtools/clients/clearcase.py (Diff revision 3)
     
     

    While here, can we move this to super()?

  3. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (e55e0b6)
Loading...