reviewboard.scmtools.conditions¶
Condition choices and operators for repositories and SCMTools.
- 
class 
RepositoryConditionChoiceMixin[source]¶ Bases:
objectMixin for condition choices that operate off repositories.
This will set state needed to match against the choice.
- 
class 
IsRepositoryPrivateOperator(choice)[source]¶ Bases:
djblets.conditions.operators.BaseConditionOperatorAn operator for matching private repositories.
- 
matches(match_value, **kwargs)[source]¶ Return whether the repository is private.
Parameters: - match_value (reviewboard.scmtools.models.Repository) – The repository to match.
 - **kwargs (dict) – Unused keyword arguments.
 
Returns: Trueif the repository is private.Falseif public.Return type: 
- 
 
- 
class 
IsRepositoryPublicOperator(choice)[source]¶ Bases:
djblets.conditions.operators.BaseConditionOperatorAn operator for matching public repositories.
- 
matches(match_value, **kwargs)[source]¶ Return whether the repository is public.
Parameters: - match_value (reviewboard.scmtools.models.Repository) – The repository to match.
 - **kwargs (dict) – Unused keyword arguments.
 
Returns: Trueif the repository is public.Falseif private.Return type: 
- 
 
- 
class 
RepositoriesChoice(**kwargs)[source]¶ Bases:
reviewboard.scmtools.conditions.RepositoryConditionChoiceMixin,djblets.conditions.choices.BaseConditionModelMultipleChoiceA condition choice for matching repositories.
This is used to match a
Repositoryagainst a list of repositories, against no repository (None), or against a repository public/private state.- 
get_queryset()[source]¶ Return the queryset used to look up repository choices.
Returns: The queryset for repositories. Return type: django.db.models.query.QuerySet 
- 
get_match_value(repository, **kwargs)[source]¶ Return the value used for matching.
This will return the provided repository directly.
Parameters: - repository (reviewboard.scmtools.models.Repository) – The provided repository.
 - **kwargs (dict) – Unused keyword arguments.
 
Returns: The provided repository.
Return type: 
- 
 
- 
class 
RepositoryTypeChoice(**kwargs)[source]¶ Bases:
reviewboard.scmtools.conditions.RepositoryConditionChoiceMixin,djblets.conditions.choices.BaseConditionModelMultipleChoiceA condition choice for matching repository types.
This is used to match a
Repositoryof a certain type (based on theTool).- 
queryset= <ToolQuerySet [<Tool: Bazaar>, <Tool: CVS>, <Tool: ClearCase>, <Tool: Git>, <Tool: Mercurial>, <Tool: Perforce>, <Tool: Subversion>]>[source]¶ 
- 
get_match_value(repository, **kwargs)[source]¶ Return the value used for matching.
This will return the
Toolfor the provided repository.Parameters: - repository (reviewboard.scmtools.models.Repository) – The provided repository.
 - **kwargs (dict) – Unused keyword arguments.
 
Returns: The repository’s tool.
Return type: 
- 
 
- 
class 
RepositoryConditionChoices(choices=[])[source]¶ Bases:
djblets.conditions.choices.ConditionChoicesA standard set of repository condition choices.
This provides a handful of condition choices that are useful for repositories. They can be used in integrations or any other place where conditions are used.