Jump to content
Misieq

Merge-To in CommandLine

Recommended Posts

Hi

 

I am trying to use command line version of Merge-To feature.

It looks that when --destination|--to option is used than --mergetype is ignored...

What I am trying to do is performing Merge-To operation but allow only changes from source.

 

For now it looks that even if I use --mergetype=onlysrc Plastic is also automaticaly merging also destination changes (if it is possible of course, in case of conflicts it stops).

I also cannot find any way to provide check-in comment for newly created changeset.

 

This is pretty problematic for me. I am trying to switch to working branch. Run some tests and if they pass perform mergeto main branch.

Workaround could be switching to main branch and running regular merge from - however it leads  to a lot of unecessery switchworkspace operations (with changes download from server each time).

 

Additionally in help it is stated that more information about MergeTo I shall find in 'documentation. Could you please tell me where I can find it?

 

Thank you in advance.

 

PS. Just noticed that there is dedicated sub-forum for "Branching and merging". Can you please move this topic there? I guess it will be more appropriate place for this discussion. Thanks in advance.

Share this post


Link to post
Share on other sites

Hello Misieq,

 

I'm sorry but the "--mergetype=" or "--keepsource/--keepdestination" parameters are not supported for the merge-to operation.

 

You are kindly invited to add the suggestion in our user voice system: plasticscm.uservoice.com/forums/15467-general

You'll have my 3 votes since I find it very interesting to have.

Share this post


Link to post
Share on other sites

Done.

 

I also added remark about -c.

For now I see that all check-ins which are result of MergeTo do not have comments provided (however from GUI it asks for comment so it looks that somehow it can be done).

 

BTW: I understand that currently there is no possibility to perform MergeTo if unresolvable conflicts occure because there is no workarea. Maybe it would be good to download files to temporary location, run GUI to resolve conflicts and upload back to server?

 

 

And additional observation:

It looks that even for regular merge option --mergetype works always per item level. Not per changeset level.

Would it be possible to add also mergetypes like:

--onlysrcallowed

--onlydstallowed

And if anything was changed in destination branch raise an error?

Share this post


Link to post
Share on other sites

Hi Misieq,

 

thanks for adding the idea!

 

I forgot to tell you that you can also specify a comment during the merge op. It's done like this:

cm merge br:/main/scm003 --to=br:/main --merge -c="Merging scm003"

BTW: I understand that currently there is no possibility to perform MergeTo if unresolvable conflicts occure because there is no workarea. Maybe it would be good to download files to temporary location, run GUI to resolve conflicts and upload back to server?

 

Yes, you are right, it's not possible. It would be possible but it will require a few changes, not trivial.

 

 

And additional observation:

It looks that even for regular merge option --mergetype works always per item level. Not per changeset level.

Would it be possible to add also mergetypes like:

--onlysrcallowed

--onlydstallowed

And if anything was changed in destination branch raise an error?

 

Yes, the preference is sent to the mergetool, or it's highly related with the mergetool so it's a "per item" preference.

 

I'm afraid what you are asking is a different operation, the "--mergetype" only decides when the mergetool should appear. BTW, I'm attaching here an example if anybody want to see the difference between "try" and "forced".

 

What you want is something like "only allow the merge if src/dst changes it" right?

 

 

 

 

base.txt

dst.txt

src.txt

Share this post


Link to post
Share on other sites

Hi

 

Yeap, I have discovered -c. I propose to include it in help :)

 

What you want is something like "only allow the merge if src/dst changes it" right?

Exactly :)

For now I use following command to detect if my current workspace branch contains all latests changes from /development.

cm merge br:/development | grep -q 'No merges detected'
But this approach is not very clean (especially that it's never known if message text is not changed in the future :) ).

Share this post


Link to post
Share on other sites

I see, well don't worry about the message it's been the no merges detected message for the last years, no plans about change it.

 

If you don't mind you can add this as a feature request in the user voice page :P we'll evaluate it too.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...