summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDylan Baker <dylan.c.baker@intel.com>2022-03-17 10:46:02 -0700
committerDylan Baker <dylan.c.baker@intel.com>2022-03-23 09:10:04 -0700
commitb25f04acbe53b9194288da0950616963f39f61df (patch)
tree747afaeaeb5ff93f574afc1382c8c2b4e5fc1783 /bin
parent1178741fd0bb6ca6e4af047ba33ef754d8352b31 (diff)
core: don't pass the ui back into commit.apply
Diffstat (limited to 'bin')
-rw-r--r--bin/pick/core.py7
-rw-r--r--bin/pick/ui.py4
2 files changed, 5 insertions, 6 deletions
diff --git a/bin/pick/core.py b/bin/pick/core.py
index 98bd0bd9dcf..0f5b73f74be 100644
--- a/bin/pick/core.py
+++ b/bin/pick/core.py
@@ -20,6 +20,7 @@
"""Core data structures and routines for pick."""
+from __future__ import annotations
import asyncio
import enum
import itertools
@@ -146,7 +147,7 @@ class Commit:
stderr=subprocess.DEVNULL
).decode("ascii").strip()
- async def apply(self, ui: 'UI') -> typing.Tuple[bool, str]:
+ async def apply(self) -> typing.Tuple[bool, str]:
# FIXME: This isn't really enough if we fail to cherry-pick because the
# git tree will still be dirty
async with COMMIT_LOCK:
@@ -161,10 +162,6 @@ class Commit:
return (False, err.decode())
self.resolution = Resolution.MERGED
- await ui.feedback(f'{self.sha} ({self.description}) applied successfully')
-
- # Append the changes to the .pickstatus.json file
- ui.save()
v = await commit_state(amend=True)
return (v, '')
diff --git a/bin/pick/ui.py b/bin/pick/ui.py
index 8eda8a0d1a5..adee10cfa77 100644
--- a/bin/pick/ui.py
+++ b/bin/pick/ui.py
@@ -74,10 +74,12 @@ class CommitWidget(urwid.Text):
async def apply(self) -> None:
async with self.ui.git_lock:
- result, err = await self.commit.apply(self.ui)
+ result, err = await self.commit.apply()
if not result:
self.ui.chp_failed(self, err)
else:
+ self.ui.feedback(f'{self.commit.sha} ({self.commit.description}) applied successfully.')
+ self.ui.save()
self.ui.remove_commit(self)
async def denominate(self) -> None: