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.
Created attachment 108591 [details]
mockup of the merge UI
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.
This would indeed be very handy!!
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.
Integrated into 'main-golden', will be available in build *201106021001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Ondrej Vrabec <firstname.lastname@example.org>
Log: Issue #198995 - Repository file default
offering template paths in copy/switch/merge dialogs:
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!
wow, thats fast!
It works perfectly especially because when you use the pulldown it selects the '[BRANCH_NAME]' part...
Thanks a lot.
> but what about having also a 'branch selector' so that it is not necessary to type the name
I'll think about that...
Can this be released in 7.0.1 instead of 7.1?
I'm using it quite a lot :-)
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)
Created attachment 109857 [details]
merge dialog with branch picker button
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*.
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?
> 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.
(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:
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:
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).
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?
(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.
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?
Now here's our proposal jrojcek and i agreed upon:
More Branches and Tags...
- 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
and of course the last used url is preselected in the combo
Nice, looks like a good approach.
Integrated into 'main-golden'
User: Ondrej Vrabec <email@example.com>
Log: #198995 - Repository file default
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!