pick-ui & .pick_status.json: rename master_sha to main_sha

I should've done that instead of the change I did in
b125ee559a ("bin/pick: Rename master branch to main").
This commit is contained in:
Eric Engestrom 2021-05-25 10:06:38 +02:00
parent acb53b268f
commit 5eeedb6e9f
3 changed files with 1640 additions and 1640 deletions

File diff suppressed because it is too large Load diff

View file

@ -42,7 +42,7 @@ if typing.TYPE_CHECKING:
nominated: bool
nomination_type: typing.Optional[int]
resolution: typing.Optional[int]
master_sha: typing.Optional[str]
main_sha: typing.Optional[str]
because_sha: typing.Optional[str]
IS_FIX = re.compile(r'^\s*fixes:\s*([a-f0-9]{6,40})', flags=re.MULTILINE | re.IGNORECASE)
@ -118,7 +118,7 @@ class Commit:
nominated: bool = attr.ib(False)
nomination_type: typing.Optional[NominationType] = attr.ib(None)
resolution: Resolution = attr.ib(Resolution.UNRESOLVED)
master_sha: typing.Optional[str] = attr.ib(None)
main_sha: typing.Optional[str] = attr.ib(None)
because_sha: typing.Optional[str] = attr.ib(None)
def to_json(self) -> 'CommitDict':
@ -131,7 +131,7 @@ class Commit:
@classmethod
def from_json(cls, data: 'CommitDict') -> 'Commit':
c = cls(data['sha'], data['description'], data['nominated'], master_sha=data['master_sha'], because_sha=data['because_sha'])
c = cls(data['sha'], data['description'], data['nominated'], main_sha=data['main_sha'], because_sha=data['because_sha'])
if data['nomination_type'] is not None:
c.nomination_type = NominationType(data['nomination_type'])
if data['resolution'] is not None:

View file

@ -34,7 +34,7 @@ class TestCommit:
@pytest.fixture
def unnominated_commit(self) -> 'core.Commit':
return core.Commit('abc123', 'sub: A commit', master_sha='45678')
return core.Commit('abc123', 'sub: A commit', main_sha='45678')
@pytest.fixture
def nominated_commit(self) -> 'core.Commit':
@ -48,7 +48,7 @@ class TestCommit:
v = c.to_json()
assert v == {'sha': 'abc123', 'description': 'sub: A commit', 'nominated': False,
'nomination_type': None, 'resolution': core.Resolution.UNRESOLVED.value,
'master_sha': '45678', 'because_sha': None}
'main_sha': '45678', 'because_sha': None}
def test_nominated(self, nominated_commit: 'core.Commit'):
c = nominated_commit
@ -58,7 +58,7 @@ class TestCommit:
'nominated': True,
'nomination_type': core.NominationType.CC.value,
'resolution': core.Resolution.UNRESOLVED.value,
'master_sha': None,
'main_sha': None,
'because_sha': None}
class TestFromJson: