Hg:如何恢复已撤销的更改?

发布于 2024-10-04 11:05:46 字数 416 浏览 0 评论 0原文

我对我的分支进行了更改并提交了更改。

其他人错误地将这些更改合并并提交到默认分支。

为了修复他们的错误,他们默认使用了hg backout

然后人们对默认值进行了一系列其他更改。

我没有意识到发生了撤销,并且想要最新的更改。所以我将默认值合并并提交到我的分支中。

现在,我的分支的当前状态不包含我的更改。

恢复之前的更改并保留我想要保留的默认情况下不相关的更改的正确方法是什么?

到目前为止,我已经尝试将之前的更改合并到我的工作副本中,但它不喜欢与祖先合并,并且我尝试将更改导出为补丁并再次导入它们,但在导入时出现错误。

很有趣,我喜欢从 Subversion 切换到 Mercurial,但每次我认为我可能已经掌握了它的窍门时,就会出现一些像这样的新问题:-P

I made and committed changes to my branch.

Someone else mistakenly merged and committed those changes to the default branch.

To fix their mistake, they used hg backout on default.

Then people committed a bunch of other changes to default.

I didn't realise the backout had happened, and wanted the latest changes. So I merged and committed default into my branch.

Now, the current state of my branch doesn't contain my changes.

What's the right way to get my earlier changes back and preserve the unrelated changes from default that I want to keep?

So far, I've tried merging my earlier changing into my working copy, but it doesn't like merging with an ancestor, and I've tried exporting the changes as a patch and importing them again, but get errors on the import.

It's funny, I'm liking switching to Mercurial from Subversion, but every time I think I might be getting the hang of it, some new bump like this crops up :-P

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尬尬 2024-10-11 11:05:46

退还退还。这只是一个普通的提交,更改已更改的内容,因此它应该可以正常工作,将已更改的内容更改回来。

Backout the backout. It's just an ordinary commit changing what was changed back, so it should work fine, changing what was changed back back.

π浅易 2024-10-11 11:05:46

也许获取版本号然后克隆它:

hg log --style Compact

hg clone -r REV your-current-repo new-repo

Maybe get the rev number then clone it :

hg log --style compact

hg clone -r REV your-current-repo new-repo

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文