Author Topic: Version Control Commandline macros  (Read 3182 times)

quack

  • Community Member
  • Posts: 18
  • Hero Points: 1
Version Control Commandline macros
« on: December 13, 2012, 09:26:24 PM »
Hi I'm setting up perforce to run via commandline in slickedit 2011. When clicking setup and entering to command to call there isn't a macro to get the full filename. There is only path,filename, or relative filename. Cating the path and filename together will have ../ in between the path and filename. Is there a %? to write that will give me the filename like C:\test\myfile.cpp .  The reason I cannot use relative paths is because one of the source tools requires a full path to work. thx Quack

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Version Control Commandline macros
« Reply #1 on: December 15, 2012, 12:32:16 AM »
Hi I'm setting up perforce to run via commandline in slickedit 2011. When clicking setup and entering to command to call there isn't a macro to get the full filename. There is only path,filename, or relative filename. Cating the path and filename together will have ../ in between the path and filename. Is there a %? to write that will give me the filename like C:\test\myfile.cpp .  The reason I cannot use relative paths is because one of the source tools requires a full path to work. thx Quack

I think the function that does the parsing for this is called _vcparse_command in slick macro file vc.e
Type fp _vcparse_command on the slick command line to go to the source code for it.

If you haven't actually tried %f you should try it  - it looks like it should give you a fully qualified filename, including path  - but it may give you a path that is relative to the current directory - it's a bit hard to tell.

If it doesn't give you what you need, you can actually modify the _vcparse_command function yourself if you want.  If you're gonna do that, copy the vc.e file from the slick macros folder to a folder of your own and modify it there.  Also first check the hotfixes folder in your configuration folder and if there's a later vc.e there, use it instead of slick macros vc.e.
After you've copied vc.e to a folder of your own, you can modify it and load it and it will override the current vc.e

To modify the function, use selective display to collapse everything (use "multi-level") then expand the outer braces of the function, then expand the for loop.  You can then easily see the characters that it's looking for  -  Q D F N C E etc.  e.g. if you expand 'E' (extension), you'll see this

       s=strip(get_extension(buf_name,1),'B','"');

So you could add your own option e.g. option Z
Code: [Select]
} else if (ch=='Z'}
     s = buf_name;


If buf_name has spaces in it, you might need to use maybe_quote_filename(bufname) instead of just bufname.  To load your version of vc.e, with the file open, use the load command on the macro menu.  To revert to the original vc.e, open the original version of vc.e and load it with the load command on the macro menu.


« Last Edit: December 15, 2012, 12:34:10 AM by Graeme »

quack

  • Community Member
  • Posts: 18
  • Hero Points: 1
Re: Version Control Commandline macros
« Reply #2 on: December 15, 2012, 02:30:01 AM »
Sweet thx, I added the new item like you mentioned and it worked like a champ!