1

Let say I have checked out a file "file.c" from main line. In that file suppose there is only one function say "add()".

I am going to implement one more function in that file say "subtract()" for that I checked out the file and I've implemented "subtract()" function.

Now, suppose in the same file another person implemented a new function say "multiply()" and he check in that file to main line and the new version is created for that file in the main line.

My question is: the file which I've checked out in my activity branch is having two function one is "add()" which was already there and one function is "subtract()" which is implemented by me.

I want the third function i.e. "multiply()" in my file without affecting my changes in my activity branch. I don't want to do check in to the main line, just I want all three functions in my checked out file.
So my file will contain three functions add(), subtract(), and multiply().

How can I do that (without a checking triggering the mergetool)?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
vivek
  • 467
  • 2
  • 6
  • 18

1 Answers1

1

The easiest way is to:

  • have a separate dynamic view, which reflects at all times the latest (including the file with multiply in it)
  • make a simple copy-paste of the section of interest of that file to your checked out file

That way, you don't have to check-in immediately.

If there are too many change to copy manually, use a diff tool in order to detect changes between the file from the dynamic view and the one in your view, currently checked out.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for your response von. But what if there are too many changes in the main line, and those changes are not present in my checked out file. So how can I bring those changes to my checked out file so that it would not affect my changes and new changes should also be there in my checked out file. – vivek Jun 16 '17 at 07:55
  • You mean too many changes to be copied over manually? Then you would use a diff tool, like beyond compare, kdiff3 or winmerge, in order to visualize, select and copy those changes. – VonC Jun 16 '17 at 08:06