Skydio / revup

Effortlessly create and manage pull requests without changing branches. Powers a stacked diffs workflow with python and git "plumbing" commands.
https://github.com/Skydio/revup
MIT License
309 stars 59 forks source link

[upload] rebase detection does not propagate PUSHED back down a related graph #163

Open jerry-skydio opened 6 months ago

jerry-skydio commented 6 months ago

Have a graph of related PRs with several branches. Rebase the whole thing, then modify one of the leaves. We should be marking the whole graph as PUSH but currently only do that for one branch because this loop only goes backwards, not forwards

                while cur_topic is not None:
                    cur_review = cur_topic.reviews[base_branch]
                    if cur_review.push_status == PushStatus.REBASE:
                        cur_review.push_status = PushStatus.PUSHED
                        if cur_review.status == PrStatus.MERGED:
                            # User has changed the base of an already merged commit, but hasn't
                            # moved forward enough such that the commit would be dropped. There
                            # isn't any way for us to handle this that wouldn't potentially
                            # generate a conflict or show the incorrect commit diff. We settle
                            # with showing the wrong diff and warning the user.
                            # This should be relatively uncommon
                            logging.warning(
                                f"Attempted to rebase an already merged PR {cur_topic.name}"
                            )
                            logging.warning("'git pull' and upload again to fix this.")

                        cur_topic = cur_topic.relative_topic
                    else:
                        break