Request: Apply changes from both Left and Right

Support for our DiffMerge utility.

Moderator: SourceGear

Post Reply
scottbessler
Posts: 4
Joined: Sun Jan 10, 2010 8:04 pm

Request: Apply changes from both Left and Right

Post by scottbessler » Sun Jan 10, 2010 8:08 pm

Many merge tools have some method to add from both left and right, and it would be awfully nice to have a button/kb shortcut to do that instead of being forced to copy and paste one of the two sides into the middle.

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

Re: Request: Apply changes from both Left and Right

Post by lbauer » Mon Jan 11, 2010 11:03 am

If you're working with the results of a "show merge" you're merging a local working copy with the repository version. It's not possible to use the merge tool to update the repository version directly. That's why you merge changes into a third pane.

If you're trying to diff two files on disk, then you could use just the Diff, whic will allow you to apply changes to both left and write.
Linda Bauer
SourceGear
Technical Support Manager

scottbessler
Posts: 4
Joined: Sun Jan 10, 2010 8:04 pm

Re: Request: Apply changes from both Left and Right

Post by scottbessler » Mon Jan 11, 2010 11:07 am

Actually I'm using a 3-way merge where the left is my local copy, the right is the other change, and the middle is the output. Further I'm specifying a base which is the changeset which is the parent to both the left and right panes.

To clarify further, this is for use with a dvcs, namely Hg. Also, for an example of how this function could work you can reference KDiff3 which has buttons for Left and Right (they call it A and B) which are toggles to include the changes from A,B, or both. I like everything else about DiffMerge better than KDiff3 except for this feature.

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: Request: Apply changes from both Left and Right

Post by jeffhostetler » Mon Jan 11, 2010 11:52 am

If you right-click on a conflict-type change, the context menu has options for
append/prepend/replace from the left and/or right and etc. And if you CTRL-right-click
you can do it on a line-by-line basis.

Hope this helps (and let me know if this doesn't get you what you need and we can talk
about a feature request),

jeff

scottbessler
Posts: 4
Joined: Sun Jan 10, 2010 8:04 pm

Re: Request: Apply changes from both Left and Right

Post by scottbessler » Mon Jan 11, 2010 11:59 am

If I right click:

On the left pane in the area of the conflict I get "Insert This"
On the right pane in the area of the conflict I get "Insert This"
On the middle pane in the area of the conclict I get 2 entries, "Insert from Left" and "Insert from Right"

As soon as I pick any one of those options it removes the conclict and I am unable to pick the other. (At which point I am able to copy and paste from the one I didn't pick, but this is more cumbersome than a single kb shortcut and/or button click)

If when I right clicked on the middle pane I had an option to "Insert Both" that would solve my issue.

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: Request: Apply changes from both Left and Right

Post by jeffhostetler » Mon Jan 11, 2010 12:54 pm

OK, now I understand. You're looking at a blank/void in the center and
an added line on the left and a different added line on the right.
I was looking at the other types of conflicts when I made my previous post.

Yeah, I'll add "Insert both left then right" and "Insert both right then left"
menu options.

BTW, you should be able to right click on the middle and do the "Insert From Left"
and then right click on the middle again and do an "Append/Prepend from Right".
Granted, it is 2 clicks, but it beats copy-n-paste.

jeff

15166

scottbessler
Posts: 4
Joined: Sun Jan 10, 2010 8:04 pm

Re: Request: Apply changes from both Left and Right

Post by scottbessler » Mon Jan 11, 2010 1:48 pm

First I wanted to say thank you and let you know how much I appreciate your effort on supporting this free application. :)


And yeah, I see the append now, but it actually won't work for me, I've shown why below:

before:
step1.png
step1.png (163.02 KiB) Viewed 10529 times
then i insert from one side
step2.png
step2.png (147.3 KiB) Viewed 10529 times
then i try appending, but it is in the middle of the results from the first side I chose instead of after
step3.png
step3.png (150.72 KiB) Viewed 10529 times
as seen here:
step4.png
step4.png (143.7 KiB) Viewed 10529 times

jeffhostetler
Posts: 534
Joined: Tue Jun 05, 2007 11:37 am
Location: SourceGear
Contact:

Re: Request: Apply changes from both Left and Right

Post by jeffhostetler » Mon Jan 11, 2010 2:34 pm

Yeah, when DiffMerge re-diffs after the insert, it cuts the original conflict
region into smaller chunks. So yeah, that'll make a mess when you do the
second step.

FWIW, you might turn on the "Inter-Line Smoothing" on the "Detail Level" page of
the preferences dialog. It defaults to 0. Set it to 1 or 2 and see if that helps.
This treats adjacent changes separated by n or fewer 3-way-equal lines as one
larger/combined change. This may help on this particular case. But try it and see.

This option may cause some false positives; in that changes that are near each
other will get globbed together and reported as a conflict more often than not.
But sometimes that's a good thing.

jeff

Post Reply