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:
parent
82f73775ef
commit
6e86d1f503
|
@ -42,7 +42,7 @@ if typing.TYPE_CHECKING:
|
||||||
nominated: bool
|
nominated: bool
|
||||||
nomination_type: typing.Optional[int]
|
nomination_type: typing.Optional[int]
|
||||||
resolution: typing.Optional[int]
|
resolution: typing.Optional[int]
|
||||||
master_sha: typing.Optional[str]
|
main_sha: typing.Optional[str]
|
||||||
because_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)
|
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)
|
nominated: bool = attr.ib(False)
|
||||||
nomination_type: typing.Optional[NominationType] = attr.ib(None)
|
nomination_type: typing.Optional[NominationType] = attr.ib(None)
|
||||||
resolution: Resolution = attr.ib(Resolution.UNRESOLVED)
|
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)
|
because_sha: typing.Optional[str] = attr.ib(None)
|
||||||
|
|
||||||
def to_json(self) -> 'CommitDict':
|
def to_json(self) -> 'CommitDict':
|
||||||
|
@ -131,7 +131,7 @@ class Commit:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_json(cls, data: 'CommitDict') -> 'Commit':
|
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:
|
if data['nomination_type'] is not None:
|
||||||
c.nomination_type = NominationType(data['nomination_type'])
|
c.nomination_type = NominationType(data['nomination_type'])
|
||||||
if data['resolution'] is not None:
|
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]]:
|
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(
|
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,
|
stdout=asyncio.subprocess.PIPE,
|
||||||
stderr=asyncio.subprocess.DEVNULL)
|
stderr=asyncio.subprocess.DEVNULL)
|
||||||
out, _ = await p.communicate()
|
out, _ = await p.communicate()
|
||||||
|
|
|
@ -34,7 +34,7 @@ class TestCommit:
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def unnominated_commit(self) -> 'core.Commit':
|
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
|
@pytest.fixture
|
||||||
def nominated_commit(self) -> 'core.Commit':
|
def nominated_commit(self) -> 'core.Commit':
|
||||||
|
@ -48,7 +48,7 @@ class TestCommit:
|
||||||
v = c.to_json()
|
v = c.to_json()
|
||||||
assert v == {'sha': 'abc123', 'description': 'sub: A commit', 'nominated': False,
|
assert v == {'sha': 'abc123', 'description': 'sub: A commit', 'nominated': False,
|
||||||
'nomination_type': None, 'resolution': core.Resolution.UNRESOLVED.value,
|
'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'):
|
def test_nominated(self, nominated_commit: 'core.Commit'):
|
||||||
c = nominated_commit
|
c = nominated_commit
|
||||||
|
@ -58,7 +58,7 @@ class TestCommit:
|
||||||
'nominated': True,
|
'nominated': True,
|
||||||
'nomination_type': core.NominationType.CC.value,
|
'nomination_type': core.NominationType.CC.value,
|
||||||
'resolution': core.Resolution.UNRESOLVED.value,
|
'resolution': core.Resolution.UNRESOLVED.value,
|
||||||
'master_sha': None,
|
'main_sha': None,
|
||||||
'because_sha': None}
|
'because_sha': None}
|
||||||
|
|
||||||
class TestFromJson:
|
class TestFromJson:
|
||||||
|
|
|
@ -106,8 +106,8 @@ class UI:
|
||||||
|
|
||||||
"""Main management object.
|
"""Main management object.
|
||||||
|
|
||||||
:previous_commits: A list of commits to master since this branch was created
|
:previous_commits: A list of commits to main since this branch was created
|
||||||
:new_commits: Commits added to master since the last time this script was run
|
: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)
|
commit_list: typing.List['urwid.Button'] = attr.ib(factory=lambda: urwid.SimpleFocusListWalker([]), init=False)
|
||||||
|
|
Loading…
Reference in New Issue