bin/pick: Rename master branch to main

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
This commit is contained in:
Jordan Justen 2021-04-26 12:29:30 -07:00
parent 82f73775ef
commit 6e86d1f503
No known key found for this signature in database
GPG Key ID: 37F99F68CAF992EB
3 changed files with 10 additions and 10 deletions

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:
@ -196,9 +196,9 @@ class Commit:
async def get_new_commits(sha: str) -> typing.List[typing.Tuple[str, str]]:
# Try to get the authoritative upstream master
# Try to get the authoritative upstream main
p = await asyncio.create_subprocess_exec(
'git', 'for-each-ref', '--format=%(upstream)', 'refs/heads/master',
'git', 'for-each-ref', '--format=%(upstream)', 'refs/heads/main',
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.DEVNULL)
out, _ = await p.communicate()

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:

View File

@ -106,8 +106,8 @@ class UI:
"""Main management object.
:previous_commits: A list of commits to master since this branch was created
:new_commits: Commits added to master since the last time this script was run
:previous_commits: A list of commits to main since this branch was created
:new_commits: Commits added to main since the last time this script was run
"""
commit_list: typing.List['urwid.Button'] = attr.ib(factory=lambda: urwid.SimpleFocusListWalker([]), init=False)