Options

Access to files for uncommitted changes

joejfjoejf Posts: 13 Bronze 2
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?

Comments

  • Options
    datacentricitydatacentricity Posts: 28 Bronze 2
    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
  • Options
    joejfjoejf Posts: 13 Bronze 2
    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 \"^<enter description here^>\", \"($Message)\" } | p4 change -i; exit"</CommandLine>
  • Options
    Strange that the powershell isn't ending. Have you tried not using powershell and just plain old batch file commands?
    David Atkinson
    Product Manager
    Redgate Software
  • Options
    joejfjoejf Posts: 13 Bronze 2
    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.
  • Options
    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 :)
    SQL Source Control Product Manager
    Thank you!
    Stephanie M. Herr    :-)
    Product Manager Database DevOps
Sign In or Register to comment.