Options

Compare one source control HEAD revision to another?

GiorgiGiorgi Posts: 18 Bronze 3
edited December 6, 2016 8:29AM in SQL Compare 11
Is there any way to compare HEAD revision of master database (source control) to HEAD revision of branch database (source control) and get deployment script with SQL Compare command line?
This is absolutely possible with SQL Compare UI, but I cannot find the way to do this via command line, because there can be only one ScriptsFolderXML argument for command line

Comments

  • Options
    Hi Giorgi,

    There are a few ways of comparing different revisions, I'm not sure which would suit you best:

    - If you have a database linked to your repository, you can point the command line at this database and use the /revision1 and /revision2 switches to compare past revisions.
    - Otherwise, you can manually checkout the two revisions in separate locations and compare them as ordinary scripts folders.
    - You can also save a project in the UI and use the /project command line switch to load it, although this has side effects such as saving your selection state.

    Does one of these methods solve your problem?
    Software Developer
    Redgate Software
  • Options
    GiorgiGiorgi Posts: 18 Bronze 3
    Hello Sam,

    Unfortunately not, because:
    If I compare one source control's two different revisions, I can set up it with SQL Compare Command line this way:
    (I am using xml file to pass arguments)

    <SourceControl1 />
    <Revision1>HEAD</Revision1>
    <SourceControl2 />
    <Revision2>1525</Revision2>
    <ScriptsFolderXML>SourceControlAddress 2160320.xml</ScriptsFolderXML>
    where 1525 is some older Changeset number

    but this approach will work for only one database (db repository) pointed in file "SourceControlAddress 2160320.xml" (in this case branch - db 2160320, that we are release fixes from)
    but we also have development database, called Trunk and when major release approaches, we want to compare Trunk to the branch (db 2160320) and issue the change as deployment script,
    and if I had something like ScriptsFolderXML1, ScriptsFolderXML2, for SQL Compare command line, I would configure it something like this:

    <SourceControl1 />
    <Revision1>HEAD</Revision1>
    <SourceControl2 />
    <Revision2>HEAD</Revision2>
    <ScriptsFolderXML1>SourceControlAddress 2160320.xml</ScriptsFolderXML1>
    <ScriptsFolderXML2>SourceControlAddress Trunk.xml</ScriptsFolderXML2>

    The scenario is absolutely possible by SQL Compare UI,
    but for automation reasons we need it to be supported by SQL Compare command line

    Thank you,
  • Options
    Hello Giorgi,

    I can see that the command line interface could be improved here, so I've created a bug (SC-8950) describing the problem. However it looks like the workarounds I suggested should work. For example, you could checkout the scripts folders manually and compare them:
    $folder1 = "C:folder1"
    $folder2 = "C:folder2"
    cd $folder1
    svn checkout http://repo1...
    svn update -r 1234
    cd $folder2
    svn checkout http://repo2...
    svn update -r 5678
    sqlcompare.exe -Scripts1:$folder1 -Scripts2:$folder2
    
    (where you will need to substitute whatever version control system you actually use)

    Does this help?
    Software Developer
    Redgate Software
  • Options
    GiorgiGiorgi Posts: 18 Bronze 3
    Hello Sam,
    We will consider the method described by you, but frankly, creating additional step it's not preferable option for us,
    as we've automated the process

    Thank you,
    Giorgi Abashidze
  • Options
    We've released version 12.0.40 to our frequent updates channel, which allows /scriptsfolderxml1 and /scriptsfolderxml2 to be specified separately. Does this solve your problem?
    Software Developer
    Redgate Software
  • Options
    GiorgiGiorgi Posts: 18 Bronze 3

    Yes that solved my problem,
    Sorry for late response,
    Thank you,

Sign In or Register to comment.