Tuesday, August 16, 2016

TFS Branching issue: What does Reparenting a branch mean in TFS 2013

I had a strange problem with the TFS branching mechanism and want to set it right, the reparenting of a branch option in TFS 2013 helped me solve it.
This is the branch hierarchy that we setup in tfs source control.

<Project>
| Dev
| > 1
| Trunk
| > 1
| Rel
| > 1

Since, this is a relatively new product development, all developers worked on Dev\1 branch on a single feature. Once the feature is completed, Dev\1 branch will be merged into Trunk\1 and then further again into Rel\1 to get it released for testing. Issues from testing are directly fixed in Rel\1 branch and on success released to production. As you could see this is like any other typical TFS branching for source control.

Now coming back to the problem, we had to do a list of small features clubbed into one backlog item and for clarity sake, lets call it "feature A". While the dev team were almost 75% done on that feature, a new urgent feature request came and the development had to be started concurrently and not wait until "feature A" is completed. Let us call the new feature as "feature B". Since feature B had a dependency on things that are being done in feature A, and since "feature A" isn't yet fully ready to be merged into Trunk\1, We created a Dev\2 branch from Dev\1, instead of the usual branching from Trunk\1. The project hierarchy is now as follows:

<Project>
| Dev
| > 1
| > 2 (Dev\2 is at same level as Dev\1 although its parent is Dev\1 branch, see branch hierarchy screenshot below)
| Trunk
| > 1
| Rel
| > 1

If you click on View Hierarchy TFS context menu for Dev\2 branch it shows as below:


Regular merges happened from branches Dev\1 to Dev\2, but not the other way to avoid release issues for "feature A" and we could release feature A independent of any changes being made in Dev\2.

After sometime, "feature A" was completed, merged into trunk and released. But, If we had to release the feature "feature B" that is being done in Dev\2 then we had to merge it into Dev\1, then into Trunk\1 and further. Instead if we could have a mechanism that would make Trunk\1 as the parent of Dev\2 instead of Dev\1, then the process gets streamlined. It is for this purpose, Reparenting is used.

The option to Reparent is available from the context menu in source control explorer as shown in screenshot below. 


But, when you click the option to reparent, the list view doesn't list Trunk\1 as an option to reparent. So, in order to get that branch name listed as an option in that list, Do a baseless merge either through command line or the UI (It doesn't get listed by default, but you could browse to the location, by using the browse button in the merge dialog, tfs warns that you are doing a baseless merge, which you could safely ignore). After the baseless merge and checkin, the Trunk\1 is now listed as an option as shown in the below screenshot. 

Select Trunk\1 and click Reparent.

VoilĂ ! Trunk\1 branch has now adopted Dev\2 as its child ! ! ! :)

Wednesday, February 20, 2013

Resolving Server Error: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

The Problem
When you create an asp.net mvc application by Visual studio 2010, by default the application services in the web.config is configured to use SqlExpress or some default instance. Now when you replace the connection string and  try to use the actual connection that doesn't have the membership provider stored procs. One situation could be when you try to invoke them by applying   [Authorizeattribute in your controller module and navigate to the Registration page, you will get the below error:

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Source Error: 

Line 80:                 // Attempt to register the user
Line 81:                 MembershipCreateStatus createStatus;
Line 82:                 Membership.CreateUser(model.UserName, model.Password, model.Email, null, null, true, null, out createStatus);
Line 83: 
Line 84:                 if (createStatus == MembershipCreateStatus.Success)
The Solution:
You could resolve it by running aspnet_regsql.exe and follow the wizard directions to configure the relevant Database for your MVC application.

You could also run the below commandline:

aspnet_regsql.exe -S DBServerName -U DBLogin -P DBPassword -A all -d DBName

Tuesday, April 24, 2012

tortoise svn global ignore pattern

Especially it gets messy, when using resharper. On looking up the changed (modified) list of files (or try to do svn commit ) throws up huge list of garbage., I use the below pattern to ignore most of them:

*.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store Thumbs.db *.h2 *.ncb *.opt *.plg *.aps *.suo *_i.c *_p.c *.user *.webinfo Debug DebugD DebugM DebugTst Release ReleaseD ReleaseM ReleaseMinDependency Debug_DLL Release_DLL Debug_DLL_Unicode Release_DLL_Unicode bin obj *.sdf ipch *\bin *\bin\* *\obj *\obj\* *.suo *.user *.bak **.ReSharper** **\_ReSharper.** StyleCop.Cache.


It could be added into the Subversion -> Global ignore pattern of the TortoiseSVN - General dialog
Want to have this somewhere., so posting it here.,

Thursday, September 23, 2010

Some useful chrome tricks

Well, this is my first post. To start with some interesting or useful stuff with chrome, here are some useful features you may consider
  1. Just like the task manager that we have in windows, chrome comes with its own task manger, whereby if you have opened 10 chrome windows (By the way chrome opens it up in a separate process) you can press Shift+Esc and see chrome's task manager. You can very well end process by selecting a chrome window.
  2. Bookmark synchronization. This is a killer feature that made me move away from FireFox. Go to Google chrome options and update the sync entry to sync bookmarks to your google account. Voila ! ! , go any where and just sign in to your google account, you get all your bookmarks synced up automatically. When you add a new bookmark or edit an old one, your bookmarks in your google account get updated.
  3. If you want more towards effectively utilizing your bookmarks, download extensions like Everymark/ Atomic bookmark extensions. They really help you search your existing bookmarks by key word search.
Ok, that's it for now., watch out for Chrome/FireFox plugin development in the next post. Thanks for viewing and bye for now :-)

-Giri