开发者

Mercurial: aborting during a branch-update merge

开发者 https://www.devze.com 2023-03-24 10:52 出处:网络
I had a working directory with uncommitted changes and updated to a different branch. Part way through the process of merging all the changed files, I realized that this was not what I wanted to do. I

I had a working directory with uncommitted changes and updated to a different branch. Part way through the process of merging all the changed files, I realized that this was not what I wanted to do. Is there a way to recover from this? Is there a way to prevent it from happening again?

Mercurial version 1.8.4

The command executed was hg update default.

开发者_如何学JAVA

The branch I was in was a child of the default branch. No changes had been made to the default branch since the last merge from default to child.


This is the danger of keeping uncommitted changes in your working copy. Mercurial keeps no record of your working copy changes. You are forced to rely on the files themselves.

It may be possible to recover if you:

  1. Backup the repo (including the uncommitted changes) so you can try again if needed
  2. hg update <branch you want to be on>
  3. Carefully review your working copy

This will attempt to merge your working copy changes back into their original branch. However, there is no guarantee that the result will be what you want.

To prevent this in the future, you should use hg update --check. The --check option will abort the update if there are uncommitted local changes.

0

精彩评论

暂无评论...
验证码 换一张
取 消