-
Notifications
You must be signed in to change notification settings - Fork 143
New Source Control option: Revert To Status Branch #227
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
Open
Damon3000s
wants to merge
33
commits into
ProjectBorealis:dev
Choose a base branch
from
TheThreeThousands:revert_to_status_branch_clean_2
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
New Source Control option: Revert To Status Branch #227
Damon3000s
wants to merge
33
commits into
ProjectBorealis:dev
from
TheThreeThousands:revert_to_status_branch_clean_2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ou to "Revert to status branch" (Rollback to Origin) - notably this doesn't actually perform any reverts, it just pulls the latest version of that file from main into your branch
…nly sync files which are actually different - bail if we try to sync a file that we don't have to ability to checkout (It's locked by somebody else or changed in a branch other than status branch). Don't try to checkout files which are already checked out
The issue is that paths are in different formats and comparisons don't work (see comments). This works for the base game but requires more testing for plugin content. Matt has also recommended to look into "CreateStandardFilename" and "MakeStandardFilename" as a better alternative, but I want to get this "working" version in first.
Converting DiffResults to absolute paths is easier than converting absolute paths to git repo relative paths. Less code, less problems.
This will cause the file to be unlinked, reloaded and relinked. This way Unreal won't know the file has changed and stomp it.
The option doesn't work for maps, so better to not show it. It should work for maps that are not One Actor Per File, if the correct options are passed to the reload function, but I haven't gone through the work to attempt to detect that situation.
Also log the operation errors
… into revert_to_status_branch_clean_2
Instead of trying to revert everything that was selected, only try to revert what we tried to sync to status branch
Updated StringId and category
If FilesToSync is no longer a larger list that is stripped then the responsibility is clearer. FilesToDiff is the full list and the value we get back from the git operation is the subset of files we want to operate on (FilesToSync)
It wasn't working and decided it is more effort and risk than it is worth. If the command fails it is better to get the user to inspect the contents before decidding how to progress.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A common situation we have been encountering is pull requests that include intended changes (accidental, not relevant to the PR, etc) and we request that they be reverted before being merged. The only way to ensure the files were removed from the PR is to ensure the uasset files were binary equal and to do that we needed to download the files from the status branch directly, replace them on disk and then commit the new (reverted) file. This was a cumbersome problem and sometimes a tad daunting for team members who were less comfortable browsing branches and downloading files.
The solution we came up with for this problem is to add a new context menu option that will revert the selected files to be a binary equal to what they are in the status branch. As you can see by the commit history this is something we tried to do on and off for a while (competing priorities) but finished and rolled out to the team at the end of August (~2 months ago from now).
Several important things to note about this change