Red Gate forums :: View topic - Access to files for uncommitted changes
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Source Control 3
SQL Source Control 3 forum

Access to files for uncommitted changes

Search in SQL Source Control 3 forum
Post new topic   Reply to topic
Jump to:  
Author Message
joejf



Joined: 11 Nov 2010
Posts: 8

PostPosted: Thu Jun 06, 2013 10:44 pm    Post subject: Access to files for uncommitted changes Reply with quote

Is there any way to get access to the new or updated file for uncommitted changes?

In our company we peer review SQL code before submitting to version control (Perforce). Does anyone know of a way get access to the files before SQL Source commits them?
Back to top
View user's profile Send private message
datacentricity



Joined: 18 Jul 2012
Posts: 18
Location: London

PostPosted: Fri Jun 07, 2013 8:40 am    Post subject: SSC Working Copies Reply with quote

On XP, you'll find theme here:

C:\Documents and Settings\<loginName>\Local Settings\Application Data\Red Gate\SQL Source Control 3\WorkingBases

The WC folder names bear no relation to the project names but you can map them from here:

C:\Documents and Settings\<loginName>\Local Settings\Application Data\Red Gate\SQL Source Control 3\LinkedDatabases.xml

There may be a better approach than this.

I have considered re-pointing the paths in LinkedDatabases.xml to a regular working copy and although that does work, I do not know what the impact would be if changes were made in that WC as well as the dev database itself.
_________________
"Your mind is like a parachute, it works best when open" Frank Zappa
"Be wary of strong drink. It can make you shoot at tax collectors…and miss" Robert Heinlein
blog: http://datacentricity.net
twitter: @datacentricity
Back to top
View user's profile Send private message
joejf



Joined: 11 Nov 2010
Posts: 8

PostPosted: Fri Jun 07, 2013 5:39 pm    Post subject: Reply with quote

Thanks datacentricity.

Something else I toyed with today is modifying CommandLineHooks.xml to convert the default changelist to a pending changelist for the commit command (instead of actually committing). I tried this with powershell for a quick test. This works but for some reason the powershell.exe process is not ending and I have to cancel the commit. But, before cancelling I can see in my Perforce client that the new changelist has been created with the correct files.

I think this approach could work.

<CommandLine>powershell -Command "p4 change -o | ForEach-Object { $_ -replace \"^&lt;enter description here^&gt;\", \"($Message)\" } | p4 change -i; exit"</CommandLine>
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1123
Location: Twitter: @dtabase

PostPosted: Fri Jun 07, 2013 5:44 pm    Post subject: Reply with quote

Strange that the powershell isn't ending. Have you tried not using powershell and just plain old batch file commands?
Back to top
View user's profile Send private message Send e-mail
joejf



Joined: 11 Nov 2010
Posts: 8

PostPosted: Fri Jun 07, 2013 5:55 pm    Post subject: Reply with quote

I have not tried plain old batch commands. The best way to accomplish this is using the print output of the default change as the input of the new change and replace the description placeholder. Powershell was the quickest way to test this inline replace. But, I think this exercise did prove that it can be done with the CommandLineHooks.xml file. I may look into this more in the next few weeks.
Back to top
View user's profile Send private message
sherr



Joined: 19 Mar 2009
Posts: 125
Location: Cambridge

PostPosted: Mon Jun 10, 2013 10:10 am    Post subject: SSC Working Copies Reply with quote

Hello.

You can modify the CommandLineHooks.xml to do nothing in the commit. This will just save the files to your working folder. You'll need to add them to the changelist and commit using your own tool.

You can also use the new link to "Working Folder" option. This option just scripts out the files and saves them to this folder from the commit tab. In SQL Source Control, the button on the commit tab is actually changed to say "Save." You would then use your own version control system's tool to add the files to the pending changelist and commit them.

Strange that the powershell is not exiting.

Cheers!
Stephanie Herr Smile
SQL Source Control Product Manager
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group