Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Conversation

@StanleyGoldman
Copy link
Contributor

@StanleyGoldman StanleyGoldman commented Jun 26, 2017

Fixes: #14

This is an initial pass at the interaction to reverting a commit in Unity:

  1. In the history tab, right click to reveal a "Revert" command
  2. Display a dialog confirming revert
  3. Handle reverting. (Needs implementation)

Gif for explanation:

reverting

Are there other pieces of information that we should surface to the user so that they're confident with reverting a commit?

Copy link
Member

@shana shana left a 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);
Copy link
Member

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.

Copy link
Contributor Author

@StanleyGoldman StanleyGoldman Jun 27, 2017

Choose a reason for hiding this comment

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

else if (Event.current.type == EventType.ContextClick && entryRect.Contains(Event.current.mousePosition))
{
GenericMenu menu = new GenericMenu();
menu.AddItem(new GUIContent("Revert"), false, RevertCommit);
Copy link
Member

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);
Copy link
Member

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"))
Copy link
Member

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)

@StanleyGoldman StanleyGoldman merged commit 5570e69 into master Jul 3, 2017
@StanleyGoldman StanleyGoldman deleted the ui/i-made-a-huge-mistake branch July 3, 2017 18:05
@StanleyGoldman StanleyGoldman modified the milestone: 0.14 Sep 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants