This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 222178 - Patch for: Add Rollback to Previous to line annotation's popup
Summary: Patch for: Add Rollback to Previous to line annotation's popup
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Subversion (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords: PATCH_AVAILABLE
Depends on:
Blocks:
 
Reported: 2012-11-15 09:28 UTC by markiewb
Modified: 2013-02-05 12:38 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Popup with wrong menu entry (31.82 KB, image/png)
2012-11-15 09:28 UTC, markiewb
Details
Proposed patch (3.15 KB, patch)
2012-11-15 23:41 UTC, markiewb
Details | Diff
Patch in action (7.73 KB, image/png)
2012-11-15 23:41 UTC, markiewb
Details

Note You need to log in before you can comment on or make changes to this bug.
Description markiewb 2012-11-15 09:28:08 UTC
[ JDK VERSION : 1.7.9 ]

Given a checkout revision 1.3. Show the annotations in the editor. Right click
on a line with change revision 1.3. A popup is displayed with several menu
items.

ACTUAL: "Rollback to 1.3"-menu item
EXPECTED: "Rollback to 1.2"-menu item

Rollback to the same revision is senseless. I want to rollback to the previous
one (1.2.)

See screenshot
Comment 1 markiewb 2012-11-15 09:28:46 UTC
Created attachment 127837 [details]
Popup with wrong menu entry
Comment 2 Ondrej Vrabec 2012-11-15 11:59:07 UTC
> Rollback to the same revision is senseless.
Why? You want to see how the file looked like in the given revision. True, when the file is currently in 1.3 revision it's useless but when you checkout its latest revision, it makes perfect sense.
But right, we could add another action. Next to "Rollback to 1.3" there could be also "Rollback to 1.2".
Comment 3 markiewb 2012-11-15 23:41:23 UTC
Created attachment 127898 [details]
Proposed patch

(In reply to comment #2)
>True, when the file is currently in 1.3 revision it's useless but when you checkout its latest revision, it makes perfect sense.

Correct.

I like to propose a patch for this. See attachment. Please review, discuss and commit.
Comment 4 markiewb 2012-11-15 23:41:57 UTC
Created attachment 127899 [details]
Patch in action
Comment 5 Ondrej Vrabec 2012-11-16 11:07:30 UTC
thanks for the patch, it looks fine. Just minors:
1) Use simply NbBundle.getMessage(...) instead of
> String format2 = loc.getString("CTL_MenuItem_RollbackToPreviousRevision");
> rollbackToPreviousMenu.setText(MessageFormat.format(format2, new Object [] { prevRevision}));
2) Bundle messages CTL_MenuItem_RollbackToPreviousRevision and CTL_MenuItem_RollbackToRevision are the same, use just one (CTL_MenuItem_RollbackToRevision)

I will integrate after the code freeze, we cannot make it till 7.3, will be in NB after this release.
Comment 6 markiewb 2012-11-18 15:24:44 UTC
(In reply to comment #5)
> thanks for the patch, it looks fine. Just minors:
> 1) Use simply NbBundle.getMessage(...) instead of
> > String format2 = loc.getString("CTL_MenuItem_RollbackToPreviousRevision");
> > rollbackToPreviousMenu.setText(MessageFormat.format(format2, new Object [] { prevRevision}));
> 2) Bundle messages CTL_MenuItem_RollbackToPreviousRevision and
> CTL_MenuItem_RollbackToRevision are the same, use just one
> (CTL_MenuItem_RollbackToRevision)
> 
> I will integrate after the code freeze, we cannot make it till 7.3, will be in
> NB after this release.

Thank you. Don't forget to integrate it for the other SCM-providers like GIT/HG/SVN to get a consistent ui.
Comment 7 Ondrej Vrabec 2012-11-19 10:18:49 UTC
svn and hg use a different concept, there is only a Revert... action that opens a dialog letting you select a preferred revision. In git i will add Checkout Previous action
Comment 8 Ondrej Vrabec 2013-01-28 13:41:07 UTC
applied your patch as http://hg.netbeans.org/core-main/rev/0cd8f9c0002b.
Still svn, hg and git could use the same
Comment 9 Ondrej Vrabec 2013-01-28 18:14:05 UTC
git - core-main #1f443d576094
hg - needs UI, currently displays a dialog
svn - there could be a rollback action same as in search history
Comment 10 Quality Engineering 2013-01-29 03:29:18 UTC
Integrated into 'main-golden', will be available in build *201301290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0cd8f9c0002b
User: Benno Markiewicz <markiewb@netbeans.org>
Log: Issue #222178 - Add Rollback to Previous to line annotation's popup\ncvs implementation
Comment 11 Ondrej Vrabec 2013-02-04 16:59:30 UTC
fix: http://hg.netbeans.org/core-main/rev/65f464c7458e
Comment 12 Quality Engineering 2013-02-05 12:38:08 UTC
Integrated into 'main-golden', will be available in build *201302050917* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/65f464c7458e
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #222178 - Patch for: Add Rollback to Previous to line annotation's popup
adding "rollback to" actions to svn blame/annotation popup