Author Topic: Moving the Workspace Tag File?  (Read 6604 times)

pmwhite

  • Community Member
  • Posts: 98
  • Hero Points: 7
Moving the Workspace Tag File?
« on: April 22, 2012, 10:24:50 pm »
Is it possible to move my Workspace Tag File to location other than in the workspace directory? I have my workspace directory on a network drive for backup purposes, whereas I want the tag file on the local hard drive for speed.

hs2

  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: Moving the Workspace Tag File?
« Reply #1 on: April 22, 2012, 10:48:38 pm »
This is not supported. Consider to move your workspace files along with the tagfiles to your local drive. The workspace files are more or less containers for the precious project files. Ok - except some environment variables if any.
Alternatively and if you're using e.g. Linux, MacOSX, Win7, ?? you can symlink your tagfiles moved to another location.
Not a big deal, but requires manual housekeeping for each (new) workspace or a nice  shell script.
HS2

rowbearto

  • Senior Community Member
  • Posts: 1996
  • Hero Points: 123
Re: Moving the Workspace Tag File?
« Reply #2 on: February 16, 2014, 05:49:46 pm »
The tie-ing of the tag file location to the workspace directory is causing me really big headaches.

I would REALLY REALLY like to be able to configure the tag file directory to be in a directory on my local hard disk, while having the workspace file on my networked drive !!!

In my (very large) company, it is most convenient to work with the source controlled files on a networked drive (for un-writeprotect via clearcase checkout).  This is very unfortunate, but I can't get the company to change to something like git right away.

I want to keep my .vpw file under source control, but if I do, it will end up on a network drive, and hence, the tag file will be on the network drive, and this slows down SE significantly.

If I don't have the .vpw file under source control, I need to manually create it each time.  This involves inserting various projects from different locations, involving lots of gui navigating.  It is very annoying to keep repeating.

I'd rather have a way to specify with something like an environment variable the path on my local hard disk where to store all workspace tag files.

But since hs2 mentioned a shell script, I wonder if anybody has one out there?  I guess I could store a template .vpw file in source control, then have a shell script copy it to the hard disk, modify the relative paths in the new .vpw file?

Rather than work on a shell script that does this, was wondering if someone wrote one like this that they could share?

hs2

  • Senior Community Member
  • Posts: 2754
  • Hero Points: 291
Re: Moving the Workspace Tag File?
« Reply #3 on: February 16, 2014, 06:28:47 pm »
To avoid manual scripting consider to make use of symlinks. Win7 and later support symlinked files on network shares
e.g. 'mklink C:\local\workspaces\work.vpw \\server\workspaces\work.vpw'. Unix OSes support this since decades.
However, the most simple script could be a batch just copying over the vpw file(s) from server to local drive and launch SE.
HS2

Graeme

  • Senior Community Member
  • Posts: 2683
  • Hero Points: 335
Re: Moving the Workspace Tag File?
« Reply #4 on: February 17, 2014, 09:55:21 am »
If I don't have the .vpw file under source control, I need to manually create it each time.  This involves inserting various projects from different locations, involving lots of gui navigating.  It is very annoying to keep repeating.

"You need to manually create it each time"  - each time you what ?  Each time you open slickedit?  Each time you do some work on that workspace?

Does anyone else besides you modify the files and projects associated with that workspace - either concurrently or non-concurrently?

Quote
I guess I could store a template .vpw file in source control, then have a shell script copy it to the hard disk, modify the relative paths in the new .vpw file?

Where are the project files (vpj) stored.  If they're on the server with the source files, then they will have relative paths.  Why can't you create the workspace file on your hard drive (c:/my-slick-workspace-files) and copy it to the server whenever it changes?  If none of the project files are on your hard drive then the workspace file would have absolute paths in it, not relative paths.

There's also a .vpwhist file associated with a workspace that has a list of files open for that workspace, plus bookmarks and other stuff and not recommended to be in version control.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3470
  • Hero Points: 466
Re: Moving the Workspace Tag File?
« Reply #5 on: February 17, 2014, 01:11:56 pm »
hs2 is correct that there are numerous ways to work around this through clever use of symbol links or relative project paths.

Good news is that SlickEdit 2014 (version 19) will have a workspace properties option to specify the location of the workspace tag file(s).  It will also have an project option so that individual project will be able to have their own tag files instead of being lumped into the workspace tag file.  My current working configuration is my development copy of version 19 puts my workspace tag files on a ram disk, which is giving me great performance even with a smaller tag file cache.

rowbearto

  • Senior Community Member
  • Posts: 1996
  • Hero Points: 123
Re: Moving the Workspace Tag File?
« Reply #6 on: February 17, 2014, 05:33:49 pm »
Thanks Dennis!  This will be a great improvement.  I look forward to the next version of SE.

Since this will be added to next version of SE, it will solve my issues. 

In the meantime, I think I will need to create a script.

I answer Graeme's questions below.

If I don't have the .vpw file under source control, I need to manually create it each time.  This involves inserting various projects from different locations, involving lots of gui navigating.  It is very annoying to keep repeating.

"You need to manually create it each time"  - each time you what ?  Each time you open slickedit?  Each time you do some work on that workspace?

Basically every time I need to create a new clearcase view (basically different directory).  Sometimes a colleague reports an error with his code, which will be on a different stream then mine, so I need to create a clearcase view with his code so I can reproduce his issue.

So my view would have my code here:  /view/rowbearto_view/source_code_tree
But when I need to use my colleague's view, it is here /view/colleague_view/source_code_tree

Since the .vpw can't be in the workspace, otherwise the tag file is on the network, I need to create a new workspace that points to the source code in /view/colleague_view/...

So I need to either manually create this workspace, or script its creation.


Quote
Quote
I guess I could store a template .vpw file in source control, then have a shell script copy it to the hard disk, modify the relative paths in the new .vpw file?

Where are the project files (vpj) stored.  If they're on the server with the source files, then they will have relative paths.  Why can't you create the workspace file on your hard drive (c:/my-slick-workspace-files) and copy it to the server whenever it changes?  If none of the project files are on your hard drive then the workspace file would have absolute paths in it, not relative paths.

Yes, .vpj is in source control.  The problem with having the workspace file on the hard drive is that the absolute paths point only to one view (for example, /view/rowbearto/source_tree), but then when I debug a colleague's view or an older version of the code, the absolute path will need to change to /view/colleague_view/source_tree.  So I will need a new .vpw file to point to the new absolute paths.

I'm also having a work colleague moving to SlickEdit, and he will need to use a different .vpw file then mine.  So number of .vpw files is proliferating and maintainence is becoming difficult.  A script to create one will be a good interim solution until the next version of SE.

Quote
There's also a .vpwhist file associated with a workspace that has a list of files open for that workspace, plus bookmarks and other stuff and not recommended to be in version control.

Yes, agreed.  I don't plan on having .vpwhist in version control.

rowbearto

  • Senior Community Member
  • Posts: 1996
  • Hero Points: 123
Re: Moving the Workspace Tag File?
« Reply #7 on: February 17, 2014, 06:12:01 pm »
I wonder if I will still have an issue even with SE 19?

In my situation, I will have my .vpw in the clearcase source control, and this file will have the same name, even when I create different clearcase views.

So in my view, it would be:

/view/rowbearto_view/source_tree/workspace.vpw

and in a view I have of old code that I am debugging, it will be:

/view/rowbearto_old_view/source_tree/workspace.vpw

Now if I specify the tag file location in both of these workspaces, and the .vpw files are identical, then they will use the same tag file on my hard disk?

How could it be possible to use a different tag file, even though the 2 workspaces have the same name?  For example, I would like to have my view name somehow be part of the tag file name/location.  For example if I have 2 views, where the contents of the workspace.vpw, project1.vpj, project2.vpj are identical (but source code is different):

/view/rowbearto_view/source_tree/workspace.vpw
/view/rowbearto_view/source_tree/project1.vpj
/view/rowbearto_view/source_tree/project2.vpj
/view/rowbearto_old_code_view/source_tree/workspace.vpw
/view/rowbearto_old_code_view/source_tree/project1.vpj
/view/rowbearto_old_code_view/source_tree/project2.vpj

If the tag file location is hardcoded in the workspace.vpw file, then if I have 2 different clearcase views, both using their local workspace.vpw, then they may both point to the same tagfile location?

In my case, I would want to use tag files named:

/harddisk/rowbearto_view/project1.vtg
/harddisk/rowbearto_view/project2.vtg
/harddisk/rowbearto_old_code_view/project1.vtg
/harddisk/rowbearto_old_code_view/project2.vtg

But how would it be accomplished if the .vpj/.vpw files in the source tree have identical contents?

Graeme

  • Senior Community Member
  • Posts: 2683
  • Hero Points: 335
Re: Moving the Workspace Tag File?
« Reply #8 on: February 17, 2014, 08:41:22 pm »
Maybe you could use drive mapping.

rowbearto

  • Senior Community Member
  • Posts: 1996
  • Hero Points: 123
Re: Moving the Workspace Tag File?
« Reply #9 on: February 17, 2014, 08:47:38 pm »
For SE 19, could there be a way to specify that the location of the tag file uses 'the 2nd directory name' in the full path where the .vpw file is?

For example, if my .vpw is located at:

/dir1/dir2/dir3/dir4/workspace.vpw

Could there be a way to tell SE to place the .vpw file at /harddisk/dir2 ?

SE would need a way to extract the directory name of the 2nd directory in the full path to the .vpw file, and use it in the path to the .vtg file.

Graeme: I don't see how drive mapping can help, especially on Linux where I also work.

rowbearto

  • Senior Community Member
  • Posts: 1996
  • Hero Points: 123
Re: Moving the Workspace Tag File?
« Reply #10 on: February 17, 2014, 10:27:10 pm »
Maybe another possible option for SE 19 tag file location could be that the user can specify the directory for tagfiles, but SE picks the name of the tagfile.  The name could be something unique depending on the path to the .vpj file.

This would allow to have the same named .vpj files in different directories (due to version control), but then SE can pick a tag file name that somehow incorporates the path to the .vpj file, so that the tag file names of these 2 projects with same name but different directory will not conflict.

rowbearto

  • Senior Community Member
  • Posts: 1996
  • Hero Points: 123
Re: Moving the Workspace Tag File?
« Reply #11 on: February 18, 2014, 02:45:18 am »
Also for multiple users of identical .vpw/.vpj files stored in version control, being able to use an env var in the path to the tag file could be very helpful.

This way, each user can configure different location and re-use same .vpw/.vpj file.

Maybe all the options from the attached screenshot, like %(EnvVarName), etc., could be available for specifying the path to the tag file?

SE can manage how it stores tagfiles under this path - maybe even reuse the dir structure?

For example, if I have 2 different views of the source code in my file system:

/view/<view1>/sourcecode
/view/<view2>/sourcecode

Then SE could manage the tag file dir contents, such that the user specifies the <path_to_tagfile>, and SE mirrors the dir structure under there to avoid conflict:

<path_to_tagfile>/view/<view1>/sourcecode/sourcecode.vtg
<path_to_tagfile>/view/<view2>/sourcecode/sourcecode.vtg

Also if better way exists to avoid conflict besides dir structure, such as inode# or something unique that is cross-platform, that could also be useful.  SE developers can decide best way to do it - just let the user specify the <path_to_tagfile> with power to use env vars and portions of the path to the .vpj/.vpw, etc.  Maybe specify new % var that says which portion of the .vpj basepath to use, such as %p2 would to use path2 of /path1/path2.

Thanks for listening!

Rob

rowbearto

  • Senior Community Member
  • Posts: 1996
  • Hero Points: 123
Re: Moving the Workspace Tag File?
« Reply #12 on: February 18, 2014, 02:59:25 am »
We could say

%rp1 = dir1 of /dir1/dir2/project_file.vpj
%rp2 = dir2 of /dir1/dir2/project_file.vpj

If specify directory that is not there, such as:

%rp3 = ? of /dir1/dir2/project_file.vpj

then throw a warning to the user and reject the project file.

Can also use similar for workspace, %rw1, %rw2, etc.

rowbearto

  • Senior Community Member
  • Posts: 1996
  • Hero Points: 123
Re: Moving the Workspace Tag File?
« Reply #13 on: February 18, 2014, 03:03:05 am »
Also, opposite way with reverse path:

%rp-1 = dir-1 of .../dir-2/dir-1/project_file.vpj
%rp-2 = dir-2 of .../dir-2/dir-1/project_file.vpj

This may be even more useful!