Compare one source control HEAD revision to another?
Giorgi
Posts: 18 Bronze 3
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
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
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?
Redgate Software
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,
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: (where you will need to substitute whatever version control system you actually use)
Does this help?
Redgate Software
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
Redgate Software
Yes that solved my problem,
Sorry for late response,
Thank you,