Reverting a Merge TFS 2015 - tfs

I have two branches say Branch Child and Parent.
Changesets in Branch Child : 200,201,202,203,204(contain .Net and VB codes)
I have merged up from child to parent containing all these changeset and TFS2015 gives me a changeset number for parent Branch as 300.
Now later i decide that changeset number 201,202 is not required for Branch Parent for now(will be used later)
Is there any way to roll back only changes pertaining to 201,202 from Parent Branch?
What i have tried : i tried rolling back the entire change set number 300. I get error message that revert failed due to dependency on other applications. I am not sure why this error is occurring.

Try to use Rollback Command to see whether you can revert the changeset:
tf rollback /changeset:C300

Related

How do I preserve an approval in Gerrit with new patchset

I'm setting up a Gerrit server for the team. I've used Gerrit in the past, but I've never set one up.
One feature I know I've used in the past is, once I get a CL approved, I can rebase the branch without losing the approval. I assume this is a setting somewhere, but I can't find it.
You need to set the "Submit Type" of the repository (in the repository configuration page) to one of these:
Rebase If Necessary
If the change being submitted is a strict superset of the destination branch, then the branch is fast-forwarded to the change. If not, then the change is automatically rebased and then the branch is fast-forwarded to the change.
When Gerrit tries to do a merge, by default the merge will only succeed if there is no path conflict. A path conflict occurs when the same file has also been changed on the other side of the merge.
Rebase Always
Basically, the same as Rebase If Necessary, but it creates a new patchset even if fast forward is possible AND like Cherry Pick it ensures footers such as Change-Id, Reviewed-On, and others are present in resulting commit that is merged.
Thus, Rebase Always can be considered similar to Cherry Pick, but with the important distinction that Rebase Always does not ignore dependencies.
See more details in the Gerrit documentation here.
I think you are looking for the Copy All Score On Trivial Rebase labels.
The example below is from our project.config. For the Verified label the scores will be copied if there is a Trivial Rebase or a No Code Change patchset added, the No Code Change basically means an updated commit message.
[label "Verified"]
function = MaxWithBlock
value = -1 Fails
value = 0 No score
value = +1 Verified
copyAllScoresIfNoCodeChange = true
copyAllScoresOnTrivialRebase = true
defaultValue = 0

Bitbucket 2.0 API get all commits merged to master

I am trying to create a utility tool for which I need to get the list of all commits that have been merged to master from the feature branch on Bitbucket. As you can see in the picture, the commit that has "M" label after the commit id is the one that I need. However, when I use the endpoint - https://api.bitbucket.org/2.0/repositories/user-name/repo-name/commits/master - it returns me a list of all the commits including the ones that do not have the label 'M'.
Is there any way I can get a list of only the commits that have been merged to master?
Click here to view the image
to get only the merge commits the parameter "merger is used".
https://api.bitbucket.org/2.0/repositories/user-name/repo-name/commits/master/merge=only

Merge a source branch to a target branch is both ways or only one way

When I merge a source branch 'Branch1' to a target branch 'IntegrationBranch', then changes are only done to 'IntegrationBranch' as a result ( i.e. one-way operation) OR even 'Branch1' may get changed in this merge operation (two-way operation)?
I am using TFS 2010.
Only the target branch is changed in a merge. So only IntegrationBranch in your example.

TFS - is it possible to delete merge flag from files and send commit just like a normal changeset?

Let's say I have two branches: A and child branch B. I wanna merge one changeset from branch A to B, but with one detail: I don't want flag [merge] for files in this changeset, it must look just like I edit files manualy and don't have a link on changeset from branch A. Is it possible?
Yes, the general idea is to generate a diff on the source branch with the following command
tf.exe diff [...] /recursive /format:unified /version:[...] >> diff.patch
Replace the [...] with the actual values (branch folder and versions). The documentation is on MSDN
Then use the patch utility (from sourceforge.net) to apply it the other branch:
patch.exe -p0 < diff.patch
Then check in.

Branch moved folder based on label or date

I've moved a folder in tfs using the "move" command but now I cannot create branches off the moved folder based on date or label (label was created when source was in the old folder). I can however create a branch based on "latest version". I get an error message "no items match in if I try to branch of a label. I'm guessing the label references files using the old folder before I moved it. I also get no files if I try to "get specific version" by either date or label.
I've tried to roll back moving the folder but this gives me errors such as "An unexpected error occured".
If you need to branch from points in time prior to the move, you need to specify the old name.
# fails
tf branch $/project/folder-newname $/project/folder-somebranch /version:Loldlabel
# should work
tf branch $/project/folder-oldname $/project/folder-somebranch /version:Loldlabel
The error related to rollback was that I had to roll back a folder rename first. I could then roll back moving the folder.

Resources