I have a question about merging between branches in TFS 2013, specifically about merge discard, that I haven't been able to find an answer for in other threads.
Scenario: we have two branches, let's call them $North
and $South
- to emphasize they are not to be looked upon as source and target (i.e. merging can be done in both directions). $South
was branched out from $North
.
I check in changeset nr. 1000 to $North
, and the changeset appears expectedly as a merge candidate:
> tf merge /candidate $North $South /recursive
Changeset User Date Comment
1000 Bob ... Updating build script
Then I do a merge discard because this changeset is not relevant to merge to the other branch, in fact it is not application code but rather configuration specific to the branch:
> tf merge /discard /version:C1000~C1000 $North $South /recursive
Resolved file1 as KeepYours
...
I check in the merge discard
resulting in changeset nr. 1001. Now changeset 1000 has disappeared from the merge candidate list:
> tf merge /candidate $North $South /recursive
There are no changes to merge.
BUT, now I check the merge candidates in the reverse direction:
> tf merge /candidate $South $North /recursive
Changeset User Date Comment
1001* Bob ... Merge discard on changeset 1000
I even tried to rollback the merge discard again, because I would rather have the change as merge candidate from $North
to $South
than in the other direction, but the result was just another merge candidate:
> tf merge /candidate $South $North /recursive
Changeset User Date Comment
1002* Bob ... Rollback on merge discard on changeset 1000
1001* Bob ... Merge discard on changeset 1000
Does anyone know if it is possible at all to completely discard a changeset, and also not having the discard itself appear as merge candidate in the other direction?
(Although I don't know if the contents of my initial changeset is relevant, I can add that my actual changeset 1000 was a change in $North
that consisted of a delete on a folder that was also present in $South
, and also a folder add.)
$South
to$North
, and that actually got rid of the merge discard changeset from the merge candidate list from$South
to$North
- without it appearing again on in the reverse merge candidate list. So problem almost solved, but unfortunately this did not work with my real changeset, which was a folder delete and folder add - and got marked with an asterisk as a partial merge after the merge discard. – user3774315