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 198995 - Repository file default
Summary: Repository file default
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Subversion (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords: PLAN
Depends on:
Blocks:
 
Reported: 2011-05-30 10:13 UTC by ricktw
Modified: 2011-08-16 06:52 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
mockup of the merge UI (46.42 KB, image/png)
2011-05-30 10:37 UTC, ricktw
Details
merge dialog with branch picker button (72.73 KB, image/png)
2011-08-08 12:58 UTC, Ondrej Vrabec
Details
New mockup with branch suggestions (62.42 KB, image/png)
2011-08-08 14:28 UTC, ricktw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ricktw 2011-05-30 10:13:15 UTC
When following normal release management processes, it is quite normal to branch (or tag) trunk with each release.
When fixes (patches) are needed in a branch they are probably merged back to trunk (or to other branches). 
The files to be merged do (always) have the same path 
(e.g. merging [branchX]/src/your/business/package/YourClass.java to trunk/src/your/business/package/YourClass.java).

Thats why it would be very useful if the 'Repository File' would have a handy default.

One solution would be to have a default like 'branches/[BRANCH]/src/your/business/package/YourClass.java'. You can easily replace the [BRANCH] keyword with the branch you would like to merge.
Another solution would be to offer a branch picker so one could select a branch and the 'Repository File' (default) can be automatically generated.
Comment 1 ricktw 2011-05-30 10:37:28 UTC
Created attachment 108591 [details]
mockup of the merge UI
Comment 2 ricktw 2011-05-30 14:34:31 UTC
Another solution would be to get rid of the 'Repository File' altogether and just offer a branch picker. 
In this case the same file in the selected branch can be merged.
Comment 3 erubio 2011-05-30 14:37:50 UTC
This would indeed be very handy!!
Comment 4 Ondrej Vrabec 2011-06-01 15:27:07 UTC
ok, what about this? http://hg.netbeans.org/core-main/rev/fd30d29ca866 - implements your suggestions from the screenshot
If a repository follows the recommended structure (branches/BRANCH/..., tags/TAG/..., trunk/...) the offered and preselected text in the combo is: branches/[BRANCH_NAME]/repository_path. Try the latest dev build to see the effect.
Comment 5 Quality Engineering 2011-06-02 20:13:58 UTC
Integrated into 'main-golden', will be available in build *201106021001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/fd30d29ca866
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: Issue #198995 - Repository file default
offering template paths in copy/switch/merge dialogs:
branches/[BRANCH]/...
trunk/...
Comment 6 erubio 2011-06-03 06:53:57 UTC
That is already a big improvement, but what about having also a 'branch selector' so that it is not necessary to type the name? The default could be the last selected branch...

But many thanks for the improvement anyway!
Comment 7 ricktw 2011-06-03 06:55:39 UTC
wow, thats fast!
It works perfectly especially because when you use the pulldown it selects the '[BRANCH_NAME]' part...

Thanks a lot.
Comment 8 Ondrej Vrabec 2011-06-03 07:01:02 UTC
> but what about having also a 'branch selector' so that it is not necessary to type the name
I'll think about that...
Comment 9 ricktw 2011-06-30 08:49:59 UTC
Can this be released in 7.0.1 instead of 7.1?
I'm using it quite a lot :-)
Comment 10 Ondrej Vrabec 2011-08-08 12:58:25 UTC
proposal: we can add a button "Branch..." that opens a branch picker where you could select a required branch, tag or trunk. However i as you can see in the attached screenshot, the dialog looks kind of over-buttoned (there are really too many of them, IMO)
Comment 11 Ondrej Vrabec 2011-08-08 12:58:30 UTC
Created attachment 109857 [details]
merge dialog with branch picker button
Comment 12 Ondrej Vrabec 2011-08-08 13:02:28 UTC
proposal: another possibility would be to offer all branches and tags at the end of the combo-box (Repository Folder). But there could be dozens maybe even hundreds of branches and tags and this solution would change the meaning of the combo. It was meant and designed to be combo with *recently used URLs*.
Any suggestions?
Comment 13 ricktw 2011-08-08 13:15:56 UTC
adding it to the end of the pull down menu is not really an option I think.
the comment of the additional button is true (many buttons) but I think it will not look too bad.

Maybe we should forget about the 'branch selector' in any form and just add a additional feature to the current implementation: instead of always using the template ...[branch_name]... the last selected branch should be used?

What do you think about that?
Comment 14 Ondrej Vrabec 2011-08-08 13:26:24 UTC
> What do you think about that?
But this solution would not improve behavior of the Switch dialog, you probably don't want to switch to the last used branch but to select a completely different branch instead. Otherwise i have no problem with this suggestion.
Comment 15 ricktw 2011-08-08 13:47:49 UTC
(In reply to comment #14)
> But this solution would not improve behavior of the Switch dialog, you probably
> don't want to switch to the last used branch but to select a completely
> different branch instead. 

I'm not sure If I follow?
Let me clarify using an use case:

1) User clicks the pulldown for the first time, this is what is displayed:
branches/[BRANCH]/src/your/business/package/YourClass.java
When the user clicks on the pulldown '[BRANCH]' is selected and can be replaced by a branch name (e.g. 'Branch_XYZ').

2) On another merge operation (i.e. other file), this is what is displayed:
branches/Branch_XYZ/src/your/business/package/YourOtherClass.java
note: '[BRANCH]' is replaced by the last used branch

This way the 'repository file url' is already correct and the merge can begin. When clicking on the pulldown again, than 'Branch_XYZ' would be selected (just like '[BRANCH]' is selected the first time) and can be changed to any other branch when needed.

This way the 'selecting of the branch logic' will still be in place with just a small adjustment (last used branch name).
Comment 16 ricktw 2011-08-08 13:51:24 UTC
Maybe we both have different use cases in mind:
mine would be merging several files from branch one to branch two,
yours would be to merge one file across multiple branches?
Comment 17 Ondrej Vrabec 2011-08-08 14:07:05 UTC
(In reply to comment #15)
sure, i agree.
I just wanted to note that the repository url selector is used in other dialogs (like the switch one) and i would like to find a common suitable solutions for all of them. Yours suggestion is good and correct and makes sense (i'll code it) but *only* for the merge dialog. I would like to offer a quick easy way to select ANY branch (even the one not yet opened) for also in the switch dialog.
Comment 18 ricktw 2011-08-08 14:28:00 UTC
Created attachment 109860 [details]
New mockup with branch suggestions

Maybe the new mockup is a solution for all dialogs?
The idea is to have a section in the pulldown which holds suggestions (three?) for the current file to be merged for the last used branches.
see NEW mockup of the merge UI.png
Next to the new section in the pulldown are the normal history items.

This combined with my suggestion of replaced '[BRANCH]' with the last used branch would be ideal?
Comment 19 Ondrej Vrabec 2011-08-09 08:39:53 UTC
Now here's our proposal jrojcek and i agreed upon:

---
trunk/198995/src/pkg198995
---
branches/HEAD/198995/src/pkg198995
branches/some-branch/198995/src/pkg198995
branches/another-branch1/198995/src/pkg198995
branches/another-branch2/198995/src/pkg198995
branches/another-branch3/198995/src/pkg198995
branches/another-branch4/198995/src/pkg198995
tags/TAG1/198995/src/pkg198995
tags/TAG2/198995/src/pkg198995
More Branches and Tags...
---------------------------------------------
somefolder/somefolder2/.../pkg198995

- More Branches and Tags opens another dialog where you can select *any* branch or tag - satisfies Switch To dialog
- offered branches and tags are the recently used ones, so you'll have quickly at hand the most often used branches in the merge dialog - satisfies merge
- at last an additional list of urls that end with the same filename as the selected file/folder in the IDE - for repositories that do not follow the recommended structure and keep branches somewhere else that under /branches
Comment 20 Ondrej Vrabec 2011-08-09 08:40:33 UTC
and of course the last used url is preselected in the combo
Comment 21 ricktw 2011-08-09 08:45:16 UTC
Nice, looks like a good approach.
Comment 22 Ondrej Vrabec 2011-08-12 07:50:02 UTC
fix: http://hg.netbeans.org/core-main/rev/4d901d9af9cf
Comment 23 Quality Engineering 2011-08-13 14:15:41 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/4d901d9af9cf
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #198995 - Repository file default
Comment 24 ricktw 2011-08-16 06:52:24 UTC
I've tested the nightly build; it works perfectly!
It's really intuitive and the browse button in the pulldown is really smart (doesn't ruin the UI).

Thanks a lot again!