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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With