Get specific version from source control - Mercurial

A SQL Server Management Studio add-in to source control your database in Subversion or Team Foundation Server.

Moderators: Chris Auckland, David Atkinson, sherr, PhilScrace, andy.campbell.smith

Get specific version from source control - Mercurial

Postby gvar369 » Fri Jun 21, 2013 10:24 pm

Hi,

How can I update my database schema to a specific version from the source control. I only see option to update to the latest version.

Source Control version: 3.4.4.36
Linked to: Mercurial

Let me know if any other information is required related to this question.

Thanks,
Vijay
gvar369
 
Posts: 11
Joined: Wed Feb 23, 2011 5:26 pm

Postby james.billings » Mon Jun 24, 2013 2:17 pm

Thanks for your post.

Currently with Mercurial, we don't offer any of the historical revision options (unlike TFS / SVN) - this is because we are currently simply calling the hg command-line as opposed to having any more indepth integration.

I guess you can work around the issue by using your usual Mercurial client to update your working folder to the revision you want, and then doing a "Get Latest". I'd also ask you to vote up the suggestion for better Mercurial support, here
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Postby gvar369 » Mon Jun 24, 2013 7:28 pm

Thanks for the reply.
I tried using the Mercurial client to update my working folder to the version I needed. But when i tried to get latest, Redgate Source Control would switch back mercurial to the latest version, instead of the version i need.

For ex: My latest version number is 17 and i need to get the code from version 10. I would switch to version 10 in the mercurial client. Later when open get latest tab in Redgate Source control, it doesn't show any of the database schema of version 10. I went back into the mercurial client to check if there were any actual changes in that version. What I observed was that mercurial switched to the latest version 17.

I believe get latest in Redgate Source Control is always looking for the latest version (i.e 17)

Could you suggest any workaround for this.

Thanks,
gvar369
 
Posts: 11
Joined: Wed Feb 23, 2011 5:26 pm

Postby james.billings » Mon Jun 24, 2013 7:32 pm

I think this is because our Get Latest command will call "hg update" with no other parameter, which I think updates you to the latest revision.

You can create your own commandlinehooks file (Mercurial2) by creating a copy of the Mercurial one in c:\\users\\-your username-\\appdata\\local\\red gate\\commandlinehooks, and editing it to:

- change the name to Mercurial2 as well
- remove the "hg update" in the Get Latest part.

Then, unlink your DB, and relink picking the Mercurial2 that should be on the list. When you then Get Latest (after still manually going to revision 10) you should find we don't revert it back to head.

Note, you do need to make a copy of the file and edit it rather than editing an existing one, to avoid your changes being overwritten.
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.


Return to SQL Source Control 3

Who is online

Users browsing this forum: No registered users and 2 guests