Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of 'git rebase --skip' for 'hg rebase'

Tags:

mercurial

I'm doing a Mercurial rebase (induced by hg histedit) and I reach a conflict where I realize, actually, I should have dropped this patch. In git, I would have just done git rebase --skip. Is there an equivalent in Mercurial?

like image 768
Edward Z. Yang Avatar asked Jan 31 '19 18:01

Edward Z. Yang


People also ask

What is git rebase -- skip?

@mittal: think of git rebase as copying commits from one branch onto another branch. So when you skip a commit, the original content of the commit is skipped and the patch is not applied (so all changes made to any file will not make it into your target branch).

What is rebase in HG?

move changeset (and descendants) to a different branch: hg rebase [-s REV | -b REV] [-d REV] [OPTION] Rebase uses repeated merging to graft changesets from one part of history (the source) onto another (the destination). This can be useful for linearizing local changes relative to a master development tree.

How do I skip a commit in rebase?

Sometimes during a Git rebase process, you may encounter some conflicting commits and wants to skip the specific commit for some reason. You can do that by passing the --skip flag in the git rebase command.


1 Answers

If you realize you should have dropped it, then the safe bet would be to do hg histedit --abort, then redo hg histedit and select drop for that changeset.

The only downside is losing progress on any other changeset conflicts already resolved in the same operation. To avoid that, there's hg histedit --edit-plan that allows changing the changeset to drop, and then use hg histedit --continue. But the current conflict still has to be resolved first, so for example hg resolve --all --mark could be done first. But I think this depends on the details of the current situation and gets much more complex and risky, and in most cases is probably not worth the trouble.

like image 162
Peter Avatar answered Oct 01 '22 21:10

Peter