Coverage for src/P4OO/Branch.py: 0%

10 statements  

« prev     ^ index     » next       coverage.py v7.4.1, created at 2024-09-07 17:17 +0000

1###################################################################### 

2# Copyright (c)2011-2012,2015,2024 David L. Armstrong. 

3# 

4# P4OO.Branch.py 

5# 

6###################################################################### 

7 

8from dataclasses import dataclass, field 

9 

10from P4OO._SpecObj import _P4OOSpecObj 

11from P4OO._Set import _P4OOSet 

12 

13@dataclass(unsafe_hash=True) 

14class P4OOBranch(_P4OOSpecObj): 

15 """ 

16 Perforce Branch Spec Object 

17 

18 id Required: Yes 

19 

20 Forcible: Yes 

21 

22 

23 Attributes: 

24 branch (str): Name of the branch 

25 owner (P4OOUser): User that created the branch spec 

26 description (str): Description field 

27 options (str): [unlocked|locked] 

28 view (str): View spec mappings 

29 update (datetime): Time of last update to the spec 

30 access (datetime): Time of last access of the spec 

31 

32 See Also: 

33 Perforce Helix Core Command Reference: 

34 https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_branch.html 

35 """ 

36 

37 # Subclasses must define SPECOBJ_TYPE 

38 _SPECOBJ_TYPE = 'branch' 

39 

40@dataclass 

41class P4OOBranchSet(_P4OOSet): 

42 """ `P4OOSet` of `P4OOBranch` objects """ 

43 

44 def query(self, user: str=None, maxresults: int=None, 

45 namefilter: str=None, **kwargs): 

46 """ 

47 Executes `p4 branches` query 

48 

49 Args: 

50 user (P4OOUser | str, optional): The user that created the branch 

51 maxresults (int, optional): Return only the first <max> results 

52 namefilter (str, optional): Case-sensitive filter on branch name 

53 

54 Returns: 

55 (P4OOBranchSet): `P4OOSet` of `P4OOBranch` objects matching query 

56 parameters 

57 

58 See Also: 

59 Perforce Helix Core Command Reference: 

60 https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_branches.html 

61 """ 

62 

63 return self._query(setObjType='branches', user=user, 

64 maxresults=maxresults, namefilter=namefilter, 

65 **kwargs)