lyt23 / filesync4eclipse

Automatically exported from code.google.com/p/filesync4eclipse
1 stars 0 forks source link

Cannot use path variable in output folder #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a path variable (e.g. VAR) that points to a valid place.
2. Create a mapping for a project using the path variable as the first segment 
of the target path, e.g. VAR/subdir1/subdir2
3. Press ok to validate entry

What is the expected output? What do you see instead?
Sync should happen since mapping has changed.
Instead, it fails with the following errors:
No valid FileMapping for project 'P/Test FileSync'
Could not create directory 'VAR/subdir1/subdir2'

When returning to FileSync propertied page for the project, target path has 
been changed to /VAR/subdir1/subdir2 (leading / added).

What version of the product are you using? On what operating system?
Eclipse 3.6
FileSync 1.3.6.201005301956
Arch Linux 64 bit

Please provide any additional information below.
Usage page on the web indicates:
> One could also use path variables for %destination folder%  or first part
> of it. This path variables are listed under "Window ->Preferences
> ->General ->Workspace->Linked resources-> Defined path variables". Usage
> is restricted to the first path segment only, see Javadoc for
> IPathVariableManager.resolvePath() on Eclipse site.

The latter mentioned method is now obsolete. Somehow, just like for issue #19, 
the code needs to be modified to use new api that takes into account variables 
path (has it ever worked?)

Furthermore, the target folder widget would also benefit from a refresh, using 
as example org.eclipse.ui.internal.ide.dialogs.PathVariableDialog. (Variable... 
and Browse... buttons)

Original issue reported on code.google.com by fmjrey on 25 Aug 2010 at 4:31

GoogleCodeExporter commented 8 years ago
With some debugging it seems to be related to the fact that the path variable I 
created in my test case is stored in the project properties, not the workspace. 
The code us using the workspace PathVariableManager instead of the Project's 
PathVariableManager.

Original comment by fmjrey on 25 Aug 2010 at 6:16

GoogleCodeExporter commented 8 years ago
Revision with my changes to fix this issue here:

http://code.google.com/a/eclipselabs.org/r/fmjrey-pathvars-rse/source/detail?r=9
4f0e13dbf51a04e830f0c67597e2219961efa88

Since 3.6 path variables can be stored at the project level in addition to 
workspace level. When modifying the code to take into account this change, I 
ran into other problems that make me wonder if using path variables really 
worked properly in FileSync.

For example, ProjectSyncPropertyPage.getDefaultDestinationPath() call 
makeAbsolute() on the created IPath, and this adds a leading "/" in front of 
any path variable. Hg does not show the revision where this makeAbsolute() has 
been added, it's been there before importing the project into hg, so I have no 
clue where it comes from.

Therefore I'm not sure of the impact of my changes. It works fine for my 
project which has many linked folders and files, and targets a directory 
relative to a project path variable.

Original comment by fmjrey on 26 Aug 2010 at 5:46

GoogleCodeExporter commented 8 years ago
Thanks, I will look at this.
Regards,
Andrei

Original comment by iloveeclipse on 1 Oct 2010 at 9:12

GoogleCodeExporter commented 8 years ago
Hi Andrey,

I'm really interested in the fix. I have the same problem in the latest version.

Thanks in advanced!
Best regards,
Karol

Original comment by pawelski...@gmail.com on 22 Jun 2012 at 8:54

GoogleCodeExporter commented 8 years ago
I'm also interested in this fix

Thank you!!!

Rafael Fresno

Original comment by rfre...@gmail.com on 20 Sep 2013 at 12:53

GoogleCodeExporter commented 8 years ago
yes, it's a very good idea to support eclipse variables like "External Tools 
Configuration".
Thank you.

Original comment by August.z...@gmail.com on 5 Aug 2014 at 7:27