Author Topic: Customize Version Control Setup  (Read 3896 times)

crouseb

  • Community Member
  • Posts: 5
  • Hero Points: 0
Customize Version Control Setup
« on: August 20, 2008, 09:28:49 PM »
I am currently using the ClearCase SCC provider to access my source control repository.  However, I would like to customize the way that SlickEdit handles my check-ins and check-out, such as having ClearCase prompt for comments on check-out instead of check-in and added a command to undo the check-out. 

I understand how to do this on the command line, but it doesn't look like I can add VC commands after looking at the setup form for the command line system.  The VC command line setup is handled through the _vc_setup2_form.  Is there any way to add commands to the list box on this form so that the added VC commands can be used when right-clicking on a project file?  Are there other ways to customize the ClearCase VSS provider that I am not thinking of?

THANKS!     

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Customize Version Control Setup
« Reply #1 on: August 20, 2008, 09:41:56 PM »
Using CC SCC provider you've to choose 'Unlock' to 'Undo checkout'. It's a bit misleading...
At the time I had a look at VC customization I only found a way to add some user macros (wrappers for CC tools like clearvtree.exe etc.) to the VC sub-menu in the edit window (default) context menu and (default) context menu in the Project TB. So it's more a patch than a real extension but I'm very happy about my add. 'Apply Label' and 'Version Tree' entries ...
HS2
« Last Edit: August 20, 2008, 09:44:43 PM by hs2 »

crouseb

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: Customize Version Control Setup
« Reply #2 on: August 20, 2008, 09:53:28 PM »
AH!  This is exactly the same thing that I would like to do.  To make sure that I understand - you have added commands to the _vc_menu that run user defined macros.  These macros run the appropriate commands on the command line, but you are using the rest of the standard SCC provider commands, correct?

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: Customize Version Control Setup
« Reply #3 on: August 20, 2008, 10:35:59 PM »
Right. I've even added these macros to explicity invoke the VC menu via button bar (you could add this as button+command):
Code: [Select]
_command void usr_vc_menu_button () name_info (','VSARG2_MARK|VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL|VSARG2_ICON|VSARG2_NOEXIT_SCROLL)
{
   if ( p_window_id==HIDDEN_WINDOW_ID ) p_window_id=_mdi;
   _macro_delete_line ();

   // Find the submenu with caption matching submenu_pos
   int menu_handle=find_index ("_ext_menu_default",oi2type (OI_MENU));
   int vc_index=_menu_find_caption (menu_handle,"Version Control");
   if ( vc_index )
   {
      menu_handle=p_active_form._menu_load (vc_index,'P');

      // Put the menu right on the current mouse pointer location:
      int x = 0, y = 0;
      mou_get_xy (x, y);
      int flags=VPM_CENTERALIGN|VPM_LEFTBUTTON;

      _menu_show (menu_handle,flags,x,y);
      _menu_destroy (menu_handle);
   }
}

or via shortcut NEXT TO the text cursor:
Code: [Select]
_command void usr_vc_menu () name_info (','VSARG2_MARK|VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL|VSARG2_ICON|VSARG2_NOEXIT_SCROLL)
{
   if ( p_window_id==HIDDEN_WINDOW_ID ) p_window_id=_mdi;
   _macro_delete_line ();

   // Find the submenu with caption matching submenu_pos
   int menu_handle=find_index ("_ext_menu_default",oi2type (OI_MENU));
   int vc_index=_menu_find_caption (menu_handle,"Version Control");
   if ( vc_index )
   {
      menu_handle=p_active_form._menu_load (vc_index,'P');

      // Put the menu right on the current mouse pointer location:
      int x=0, y=0;
      _map_xy (p_window_id,0,x,y);
      x+=p_cursor_x + p_font_width;
      y+=p_cursor_y + p_font_height;
      int flags=VPM_LEFTALIGN|VPM_LEFTBUTTON;

      _menu_show (menu_handle,flags,x,y);
      _menu_destroy (menu_handle);
   }
}

Good luck,
HS2