-
Notifications
You must be signed in to change notification settings - Fork 448
Adding functionality to revert a commit in HistoryView #12
Conversation
shana
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some string issues that need fixing. Can either do it on this PR or on a separate one.
| var selection = history[selectionIndex]; | ||
|
|
||
| var dialogTitle = "Revert commit"; | ||
| var dialogBody = string.Format(@"Are you sure you want to revert the following commit:""{0}""", selection.Summary); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these strings need to go into the Localization.resx file. We'll need to do a pass on this, we're accumulating way too many strings all over the place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Move strings for labels and prompts in code to resource Move strings for labels and prompts in code to resource #36
| else if (Event.current.type == EventType.ContextClick && entryRect.Contains(Event.current.mousePosition)) | ||
| { | ||
| GenericMenu menu = new GenericMenu(); | ||
| menu.AddItem(new GUIContent("Revert"), false, RevertCommit); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This string should be in the localization resources file
| if (!success) | ||
| { | ||
| EditorUtility.DisplayDialog(dialogTitle, | ||
| "Error reverting commit: " + e.Message, Localization.Cancel); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for this error message
| var dialogTitle = "Revert commit"; | ||
| var dialogBody = string.Format(@"Are you sure you want to revert the following commit:""{0}""", selection.Summary); | ||
|
|
||
| if (EditorUtility.DisplayDialog(dialogTitle, dialogBody, "Revert", "Cancel")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for these strings (and we already have Localization.Cancel for the cancel buttton)
Fixes: #14
This is an initial pass at the interaction to reverting a commit in Unity:
Gif for explanation:
Are there other pieces of information that we should surface to the user so that they're confident with reverting a commit?