Relative bzr executable path

Bug #275912 reported by Forage
2
Affects Status Importance Assigned to Milestone
Bazaar Plugin for Eclipse
Triaged
Wishlist
Unassigned

Bug Description

It would be nice to have the ability to specify a relative path to the bzr executable. This would allow you to use bzr and eclipse 'portable'. Currently it's only possible to specify the path using the 'Browse' button. The relative path could be made possible if direct input in the location area was allowed. So if you use the browse feature to find the exe you'd get an absolute path, if you fill in the location by hand (and no drive letter is specified) it'll be treated as a relative path.

As you mentioned in IRC, the question is what to use. The path relative to the Eclipse folder or the workspace. I'd go for the Eclipse folder since that's the most stable factor. Another option would be to only, and automatically, use a relative path only when the bzr folder is locate in the Eclipse folder. This option does not have my preference, I'd like to have the bzr folder elsewhere, but it would be a more foolproof solution. I.e. bzr is more likely to remain available in that location.

Revision history for this message
Craig Hewetson (craighewetson-deactivatedaccount) wrote :

Wouldn't it better if the bzr executable could be determined automatically?
Would an automatic determination suit your use case? I'm not sure that its possible for all supported platforms but it might be effort more well spent and still solve your problem in a better way.

Revision history for this message
Forage (forage) wrote :

Yes, it would make things easier but it would also take a long time before you can do anything if you have to wait for it to search a complete system every time. You'd get in trouble if you have, for what ever reason, multiple versions of bzr on a system as well. This latter isn't unlikely if you have it on an USB stick. You might plug it into a system which already has bzr on it but you want it to use the version on the USB stick.

Revision history for this message
Craig Hewetson (craighewetson-deactivatedaccount) wrote :

agreed.

Ok I'm just throwing some ideas around:

The UI could have a radio button group above the text field:

 O Absolute O Relative
 _________________________________
|_________________________________| [Browse]

If "relative" option is selected then the text would be interpreted as being relative to X (not 100% sure what X will be since the user might have a project on a USB stick and not have an eclipse IDE installed on it, while still having bzr installed on the USB stick.)

Maybe if the relative option is selected, the UI could enable/(or make visable) two radio buttons with in a Group:
                   ______________________________
 O Relative | O Eclipse IDE O Workspace |
                  |______________________________|
______________________________
______________________________| [Browse]

The browse button will open the dialog from the relative starting location as specified above. Additionally the the text field can be edited by hand.

Let me know if this will be adequate? Or if its an overkill or if its missing some scenarios?

Revision history for this message
Craig Hewetson (craighewetson-deactivatedaccount) wrote :

Damb! pretend that the second "Group box" is enclosing the O Eclipse IDE and O Workspace radio options.

Revision history for this message
Forage (forage) wrote :

That will make it mighty complex I think.

I never expected the options of Eclipse to be workspace dependant. Does this go for basically all options in the prefs? If not, how is the distinction made? We might be able to use that.

Specifying something to be relative or absolute isn't really required as far as I can tell. The plugin can determine that instead. At least on Windows, if there isn't a '[drive letter]:\' prefix, we are dealing with a relative path. This can start with '\', '..' or '[folder name]\'. If the plugin deems the path to be relative, enable the suggested radio buttons. If its absolute, disable them. This will prevent wrong use a bit more if people don't have a clue what the difference is (relative vs. absolute).

From the above perspective:
Letting the browse button take you to the location, relative or absolute, can be handy indeed. I wouldn't, however, go as far as allowing you to actually specify a relative path this way. If the browse button is used to specify a location, set it as a absolute location, independent of starting from relative or absolute. This, again, will prevent people from getting confused, not knowing how to get back to an absolute path.

You might argue that doing it this way, only being able to specify a relative path manually, kind of hides the feature. I think it shouldn't be too prominent in the first place. Don't forget that this is more of a power user feature (if there are non-power users using Eclipse in the first place ;-) ). Most users won't make use of it, so not everyone should be bothered with the options they'll never use.
Making it deal with all weird situations (all on USB, half on USB, etc.) won't be possible. Sooner or later it might not be able to find the bzr executable. People working portable know this can happen if they don't keep things simple. It should be up to them to deal with it, the plugin can't, no matter how many options you'll provide.

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Prodoc,
Just to note, As I understand all (if no most) of the eclipse preferences (not only bzr-eclipse) are tied to the workspace, actually if you use the File -> Switch Workspace action, it 'll allow you to copy your preferences and setting to the newly created workspace.

I agree that this is a "power-user" feature.
I don't have an opinion on which is the way to go.
Also, just to help you workaround your current issue, in the meantime this is fixed, you could modifiy the absolute path to a relative in the preferences files stored in the .metadata folder of your workspace.
there are two files that need to be modified in order to this hack/workaround to actually work:
1) <wokrspace>/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.vcs.bazaar.eclipse.core.prefs
2) <wokrspace>/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.vcs.bazaar.eclipse.ui.prefs

both files have similar content, you could modify the EXECUTABLE value of both and make it relative to the wokrspace.

I didn't test this workaround, but I think it *should* work

Cheers,

Changed in bzr-eclipse:
importance: Undecided → Wishlist
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.