Get specific Version from Source control - visual-studio-2012

I have 34 word templates in TFS and I'm suing VS2012.
Only 32 have been modified and saved under a change set.
I wanted to just extract those modified by that change set.
I made sure my mapped folder was empty before I started.
I used Advanced/Get Specific and then did a get using the changeset number
However, all 34 templates were downloaded into my folder.
The changeset get seems to get all files modified before and up to the change set I requested.
In my case I can pick out the 2 files and remove them. But if I had hundreds of files spread over a dozen folder it would be a nightmare.
Is there a way to get only those files modified by a specific changeset files ?

"Get Specific" means getting all the files as how they were at the time when ChangeSet was created. It doesn't mean getting only changed files.
Since you are using VS 2012, you could use Team Foundation Power Tools' tfpt GetCS command:
The GetCS tool retrieves all items listed in a changeset for a
given changeset version.
This is useful when a co-worker checks in a change that you need to
have in your workspace, but you cannot upgrade your entire workspace
to the latest version. Use the GetCS tool to get just the items
affected by your co-worker’s changeset. You can do this without
inspecting the changeset to manually list the changed files when using
a getcs command.
There is no graphical user interface for the GetCS tool. To invoke
the GetCS, type the following command. The parameter
changesetnum specifies the changeset number.
tfpt GetCS /changeset:changesetnum

Related

Can you remove NetSuite Bundles after installation

I am working on a NetSuite instance that had custom(contractor/SuiteScript) work installed via a bundle, but it is not a third party product but made for this system. Now there are 2 listings in the dropdown for each file. In other words, if I am adding a file as a library, it shows up twice and I don't know which reference is the correct one to choose. I used search to find the duplicate file name is in the bundle install. Can I safely remove or delete the bundle? thanks any help is appreciated.
You cannot typically remove individual files from a bundle. If you do not need the functionality of the bundle anymore than you can remove it at your discretion by going to Customization>SuiteBundler>Search & Install Bundles>List, then under the action icon click 'Uninstall'.
I wouldn't try to delete a script library from a bundle folder. Even if you are uploading an identical library there may be references in the bundle scripts to the original library that will be broken when if you delete it.
If you are wondering which one you are selecting from the drop down one thing you could do is figure out the internal id of your library file then run a search on your script file that pulls in the library file id's and make sure that they match.

TFS cannot rollback: "The item being rolled back has changed in a later version"

The Scenario
I want to rollback a changeset.
The Problem
When I perform Rollback Entire Changeset from my $/SAM/Main branch using the VS2012 IDE, the Resolve Conflicts tab displays, and ALL of the files I'm trying to rollback have the following message associated with them:
The item being rolled back has changed in a later version
Changes being rolled back: 54460~54460 Your workspace version is: 54460
You have a pending change on the item
At this point, the only option available to me in the Resolve Conflicts tab is an Undo Rollback button.
Things to Note
CS54460 was created using the following command line:
merge $/SAM/Dev $/SAM/Main /discard /recursive /version:C54426~C54426
CS54460, when viewing the Changeset Details, performs a [merge, branch, delete] on ALL the files.
Why I Need to Do This
I need to do this, because I need to merge CS54426 from the $/SAM/Dev branch up to the $/SAM/Main branch.
Don't use rollback, just do it manually:
get the version you want to roll back to
back up the changed files
check out the changed files. If you're lucky the old code will be preserved but the checkout may force you back to the newest version.
so if necessary copy the backups over the master source files again
test and check in
My problem was solved by using the following command:
merge $/SAM/Dev $/SAM/Main /recursive **/force** /version:C54426~C54426
This forced the changeset I needed in $/SAM/Dev to disregard the "Keep Yours" changeset in $/SAM/Main, thus merging the code I needed up to the $/SAM/Main branch.
I was getting the error "TF203051: Cannot rollback item XYZ because the workspace version of the item is at or older than the version to which you are trying to rollback to. Update the version in your workspace to a newer version than the version to which you are trying to rollback to and then retry your operation." when attempting to roll back to a specific version in the history in VS2017.
The problem was that file XYZ, one of the files was included in multiple changesets, a second one was more recent than the one I was trying to roll back.
Luckily I needed to roll back that too. So the solution was to roll back both versions at the same time by selecting them together in the history view of Source Control Explorer.

Why merging changes between labels for specific file not working?

Assume I have two branches UK_SYS and ASIA_SYS (related but not coming from a simple copy/integrate from common ancestor), e.g.
[UK_SYS/branches/v1.0]
-----------#-----------#-----------#------>
#uk-1.0 #uk-1.0.1 #uk-1.0.2
[ASIA_SYS/branches/v1.0]
-----------#-----------#------------------>
#asia-1.0 #asia-1.0.1
There are changes from a specific file (say, foo.txt) from UK_SYS #uk-1.0 to #uk-1.0.1 that I want to bring to ASIA_SYS.
In P4V, I am clicking on foo.txt, and click Merge/Integrate.
I specified //depot/UK_SYS/branches/v1.0/foo.txt as Source file/folders, and //depot/Asia_SYS/branches/v1.0/foo.txt as Choose target files/folders.
In Options -> Filter, I specified Revisions from/to and put From as Label, uk-1.0 and To as Label, uk-1.0.1
However, when I click on Merge or Preview, P4V complains me for The operation cannot be completed because you cannot limit to and from a label. I have no idea why it does not work as it should essentially means "Find the changes of //depot/UK_SYS/branches/v1.0/foo.txt, between file revision labelled at #uk-1.0 and file revision labelled at #uk-1.0.1. Then merge the change to //depot/ASIA_SYS/branches/v1.0/foo.txt".
If I manually find out the file revision of foo.txt using the label #uk-1.0 and #uk-1.0.1, and use the revisions as From/To, it seems working (either one will already work), but it is tedious to do the same for a bunch of files.
What is the appropriate way to do such merging? (P4V client I am using is dated 2015 Feb 04, Rev. Perforce Visual Client/NTX64/2014.3/998867)

Modify .csproj in pre-build event

tl;dr: How to modify the .csproj file during publishing with ClickOnce while executing pre-build events?
Long:
I'm using TFS hosted by Microsoft for version control of my solution.
When publishing with ClickOnce, I get the latest revision number + 1 without problems. I also can successfully write the new version number into the .csproj file outside my build-process.
The problem is, that the .csproj file doesn't get updated during the build process - it might be in a write-lock. I get a notification inside Notepad++ about the modification of the file, but the file still contains the old version and VS didn't notice any changes.
The only solution by now I found to resolve this issue:
Move the revision update into the post-build events and add 2 instead of one to the actual revision number. Unfortunately this would cause that revision number would be out of date whenever other developers check-in code.
Ok, strike that... :(.
After some more diffing, you'll need to override the GenerateApplicationManifest target to get this to work. That target doesn't use a *DependsUpon propertygroup, so it's harder to overwrite. The whole flow is defined in the Microsoft.Common.Targets file which you can find in the %windir%\Microsoft.NET\Framework{cpu}\{version} folder.
See also:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/3a94df52-74c1-4fca-a830-ab530ec49207/use-msbuild-to-create-clickonce-app-files-in-alternate-location

Get latest version of tag from SVN

I’m going to create a tool to packaging some of SVN tagged files. Hence my approach is to give the SVN trunk path of the folder I need to package and tool will identify the latest tag location from that folder. So is there any way to get latest tag path of the trunk folder.
Eg: Let’s say my trunk folder is “abcd”. And I have tagged 2 times as follows.
abcd-1.0.0.1-QA
abcd-1.0.0.2-QA
So I need to get abcd-1.0.0.2-QA for my package.
I’m using “TortoiseSVN 1.2.6, Build 4786 - 32 Bit” and MS VS 2010.
I develop my tool by C#.
Thanx in advance.
you should look for the highest SVN version number of your tags. you can use svn info on your tag local folders and parse the returns stdout for the "Revision" statement (use perl)

Resources