Skip to content

Commit

Permalink
Correctly render stacks when state changes (#34)
Browse files Browse the repository at this point in the history
---
fel-version: 0.3.2
fel-stack: devel
fel-stack-index: 0
fel-branch: fel/devel/0
fel-amended-from: 8ca89f6
fel-pr: 34
  • Loading branch information
Zabot committed Jun 11, 2021
1 parent 9fc8cf6 commit 0faefc3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions fel/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def do_annotate(sha, commit, meta):

# Run do_annotate over all of the commits in this stack
self.filter(do_annotate)
progress.update()

# TODO Whitelist to only push certain commits
def push(self, progress):
Expand Down Expand Up @@ -182,9 +183,8 @@ def push(self, progress):
else:
info_summary = wrap(info_summary, fail)

progress[commit] = "{}{}{} {} {}".format(
context, pr, default, info_summary, commit.summary
)
p = f"{context}{pr}{default} {info_summary} {commit.summary}"
progress[commit] = p

def render_stack(self, callback, color):
# Use git log to print an ASCII graph of the tree using only full shas
Expand Down Expand Up @@ -231,6 +231,8 @@ def __init__(self, stack, write, color=context, verbose=True):
self.commits = {}
self.verbose = verbose
self.hide_tree = False
self.stack = stack
self.color = context

skeleton_tree, commits = stack.render_stack(lambda x: None, color)
for c in commits:
Expand All @@ -239,6 +241,13 @@ def __init__(self, stack, write, color=context, verbose=True):

self.skeleton_tree = skeleton_tree

def update(self):
skeleton_tree, commits = self.stack.render_stack(lambda x: None, self.color)
for c in commits:
if c not in self.commits:
self.commits[c] = simple_info(c)
self.skeleton_tree = skeleton_tree

def all(self, text):
self.hide_tree = False
for commit in self.commits.keys():
Expand Down
1 change: 1 addition & 0 deletions fel/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def update_commit(sha, commit, meta):
pass

stack.filter(update_commit)
progress.update()


# This is a race condition because there is no way to create a PR without a
Expand Down

0 comments on commit 0faefc3

Please sign in to comment.