Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial hg merge default

I am running a rebase on a set of changes in Hg. Occasionally it comes up with a message that says something like local changed somefile.cs which remote deleted. use (c)hanged version or (d)elete?

I assume that when I am rebasing I want to follow what the remote is doing, so I have been deleting. If this is incorrect, someone stop me.

However, here is the big thing? I've noticed that if I just press Enter it seems to move on. However I have no idea what it is defaulting to. Does anyone know?

like image 205
jocull Avatar asked May 11 '11 16:05

jocull


People also ask

How do I merge Mercurials?

To merge two branches, you pull their heads into the same repository, update to one of them and merge the other, and then commit the result once you're happy with the merge. The resulting changeset has two parents.

What is hg graft?

hg graft allows "cherry-picking," as you noted in your question. For example, you can run hg graft -D "2085::2093 and not 2091" to copy only some changes from another revision. By comparison, hg rebase (with or without --keep ) will grab whatever changeset you specify and all of its decendant changes.

How do I revert a commit in Mercurial?

If you want to revert just the latest commit use: hg strip --keep -r . Using strip will revert the state of your files to the specified commit but you will have them as pending changes, so you can apply them together with your file to a new commit.


1 Answers

The default is to use the (c)hanged version. Rebase uses the merge logic for this operation.

There is no documentation of this default choice, but it is decided here:

   216                 if repo.ui.promptchoice(
   217                     _(" local changed %s which remote deleted\n"
   218                       "use (c)hanged version or (d)elete?") % f,
   219                     (_("&Changed"), _("&Delete")), 0):
   220                     act("prompt delete", "r", f)
   221                 else:
   222                     act("prompt keep", "a", f)

There does not appear to be a way to automatically decide which option is selected.

like image 137
Tim Henigan Avatar answered Oct 04 '22 00:10

Tim Henigan