merge branches: rename file and then modify it

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
dwenzel
Posts: 18
Joined: Thu Mar 11, 2004 2:25 pm

merge branches: rename file and then modify it

Post by dwenzel » Wed Dec 22, 2004 8:58 pm

I have been using the merge branches feature after I have made a change to a file in the branch. The change I have made has been to rename the file, and then I modified the renamed file. When I go to "merge branches", it detects that the file has been renamed, but since it cannot file the modified (renamed) file in the target, it says that the modification is not applied since the target cannot be found. But, in the end, it appears that the changes made to the modified file after renaming do get carried over after the "merge branches" completes. I believe the same thing happened when I modified a file I had moved on a branch.

dwenzel
Posts: 18
Joined: Thu Mar 11, 2004 2:25 pm

Post by dwenzel » Thu Dec 23, 2004 9:51 am

Just adding a bit more information. This is running Vault 3.0.1. Also, I was not correct in saying that the renamed-then-modified file was correctly getting merge from the origin to the target branch -- it is not. Only the rename part of the operation is getting merged; the modify part is not. I have to perform the "merge branch" operation a second time in order for it to pick up the modified (after rename) file.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Fri Dec 24, 2004 11:19 am

Generally you can't rename and modify a file in the same change set operation. We'll look into whether this should work differently with the Merge Branches wizard.
Linda Bauer
SourceGear
Technical Support Manager

dwenzel
Posts: 18
Joined: Thu Mar 11, 2004 2:25 pm

Post by dwenzel » Tue Dec 28, 2004 8:03 am

It is certainly possible that within a branch, people may rename/move a file and then further modify it. Furthermore, they may modify it before the rename/move, and then further modify it. Or they may rename/move it several times. If this is a limitation of "merge branches", then what is the approach to take when there are more than one rename/move/modify on the same file? Is it to keep executing "merge branches" until you get everything resolved?

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Tue Dec 28, 2004 8:18 am

I agree with you -- merge branches should take all this into account. It's just not clear whether the behavior you are seeing is intended, or a bug.

I'll try to reproduce this in-house. Just to be clear on the steps -- you branched a folder, renamed the file, then modified the file, then merged back into the original folder. Anything else that might be relevant to reproducing this?
Linda Bauer
SourceGear
Technical Support Manager

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Tue Dec 28, 2004 11:41 am

Vault Merge Branches does renames first, then modifications.

I did get the error about not finding the renamed file, but when I doubleclicked the error, the tree view opened with the option to select another file. I selected the renamed file and after the wizard was done, the modified renamed file was in the pending change set, where a Commit updated the file in the target folder. So there is an extra step, but you shouldn't have to run mergebranches twice.

I don't think there's an easy way to change this in the Wizard at this point.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply