summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2021-04-26 12:29:30 -0700
committerJordan Justen <jordan.l.justen@intel.com>2021-05-05 12:20:11 -0700
commit6e86d1f503d8b017bd6679a4db70fef532595f65 (patch)
tree51c12d651b496676bcb6eff01d50ca8482a24b3b /bin
parent82f73775efa989fca6376b6de2d39e7dd06724fc (diff)
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>
Diffstat (limited to 'bin')
-rw-r--r--bin/pick/core.py10
-rw-r--r--bin/pick/core_test.py6
-rw-r--r--bin/pick/ui.py4
3 files changed, 10 insertions, 10 deletions
diff --git a/bin/pick/core.py b/bin/pick/core.py
index 9b8926224b8..de5d0715cee 100644
--- a/bin/pick/core.py
+++ b/bin/pick/core.py
@@ -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()
diff --git a/bin/pick/core_test.py b/bin/pick/core_test.py
index 6ac186801ab..a7d14d04d24 100644
--- a/bin/pick/core_test.py
+++ b/bin/pick/core_test.py
@@ -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:
diff --git a/bin/pick/ui.py b/bin/pick/ui.py
index 3afd05e0ca2..de9fafd8249 100644
--- a/bin/pick/ui.py
+++ b/bin/pick/ui.py
@@ -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)