Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "move_repo_to_merging_state". Resolving conflicts not implemented #80

Merged
merged 1 commit into from
May 13, 2020

Conversation

olsen232
Copy link
Collaborator

Running "sno merge <other_branch> will merge other branch, unless there are conflicts.
In which case, it will put the repository into a merging state.

~/mysnorepo (BARE:mybranch) $ sno merge other
~/mysnorepo (BARE:mybranch|MERGING) $

Unfortunately, since conflicts cannot be resolved, the only option is to abandon the merging state.

~/mysnorepo (BARE:mybranch|MERGING) $ sno merge --abort
~/mysnorepo (BARE:mybranch) $

However, the merging state is real, and contains (most of?) the information we will need to make step-by-step resolution of conflicts possible. Resolving conflicts is to be done in a follow up PR.

Also still to be done is a way to display the merging state including conflicts / summary of conflicts. Running sno status and sno show right now doesn't mention that you are in merging state. This is to be done in a follow up PR.
Other commands may also have to be deactivated, since they make no sense in the context of a merge.

Some tidying:

  • Added a new file sno/repo_files.py to make it easier to read and write files inside the bare repository. Modified commit.py to use this functionality.
  • Changed the JSON output of merge.py to focus on commits, not commits + branches. Commits are what is actually merged, and the branch head may have moved on by the the merge is complete.

sno/repo_files.py Outdated Show resolved Hide resolved
sno/repo_files.py Outdated Show resolved Hide resolved
Copy link
Member

@rcoup rcoup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@olsen232 olsen232 merged commit 1fba96d into master May 13, 2020
@olsen232 olsen232 deleted the merge_state branch May 13, 2020 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants