Red Gate forums :: View topic - Get specific version from source control - Mercurial
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

Get specific version from source control - Mercurial

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



Joined: 23 Feb 2011
Posts: 11

PostPosted: Fri Jun 21, 2013 10:24 pm    Post subject: Get specific version from source control - Mercurial Reply with quote

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
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Mon Jun 24, 2013 2:17 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
gvar369



Joined: 23 Feb 2011
Posts: 11

PostPosted: Mon Jun 24, 2013 7:28 pm    Post subject: Reply with quote

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,
Back to top
View user's profile Send private message
james.billings



Joined: 16 Jun 2010
Posts: 1123
Location: My desk.

PostPosted: Mon Jun 24, 2013 7:32 pm    Post subject: Reply with quote

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.
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