简体   繁体   English

Mercurial:删除单个非标题变更集

[英]Mercurial: Removing a single, non-head, changeset

How do I remove a single changeset (which is not a head) from a repository? 如何从存储库中删除单个变更集(不是头部)?

  • hg strip doesn't work because I don't wanna remove the descendants. hg strip不起作用,因为我不想删除后代。
  • hg rebase on a head and then hg strip would work, but I can't rebase on a descendent. hg rebase在头上重新建立hg strip ,然后hg strip 可以工作,但是我无法在后代上重新建立基准。 (that yields an error) (产生错误)

My changeset is not related to anything else (it's just a bunch of file adds I shouldn't have made), so it should be easy to remove without problems. 我的变更集与其他任何内容都不相关(它只是我不应该添加的一堆文件),因此应该很容易删除而不会出现问题。 Also, my repository in fact has a linear history (each changeset only has one child and in particular, there's only one head). 此外,我的存储库实际上具有线性历史记录(每个变更集只有一个孩子,尤其是只有一个孩子)。

Background 背景

I'm using hgsubversion and either it or my SVN server crash when I try to push a commit that touches any file that has umlauts in its name. 我正在使用hgsubversion,当我尝试推送涉及其名称中有变音符号的任何文件的提交时,它或SVN服务器崩溃。 I accidentally added such a file and then did some other work on top of it. 我不小心添加了这样的文件,然后在它上面做了其他工作。 Now the offending commit needs to be removed. 现在,需要删除有问题的提交。

As ngoldbaum implied in a comment , strip removes descendants , not ancestors. 正如ngoldbaum所暗示的那样 ,strip删除了后代 ,而不是祖先。 If there are no descendants you're OK. 如果没有子孙,您就可以了。 (Watch out, though: descendants in another branch will be stripped!) (但是请注意:另一个分支的后代被剥夺!)

If your issue is that the commit has descendants, you can still use hg histedit to remove it while keeping its descendants. 如果您的问题是提交包含后代,则仍可以使用hg histedit将其删除,同时保留其后代。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Mercurial中,有没有办法(除了“Cherry pick”之外)推动变更集而不推动与不同头部相关的变更集? - In Mercurial, is there any way (aside from “Cherry picking”) to push a changeset without also pushing changesets associated with a different head? 如何在Mercurial中拥有本地唯一变更集? - How to have a local only changeset in Mercurial? 将已提交的变更集转换为Mercurial中未提交的变更 - Converting committed changeset to uncommitted changes in Mercurial Mercurial Hg的“不是修订版!” - “Not a head revision!” in Mercurial Hg Mercurial Repo:hg 验证问题:“第一个损坏的变更集似乎是 3270” - Mercurial Repo : hg verify issue : “first damaged changeset appears to be 3270” 如何在Mercurial中提取变更集的所有已更改文件? - How can I extract all changed files of a changeset in Mercurial? 我可以将多个连续的变更集合并到Mercurial中的变更集中 - Can I merge multiple consecutive changesets into a changeset in Mercurial 使用Mercurial签入单个文件? - Check in single file with Mercurial? 将文件与最后的Mercurial变更集进行比较,是否应该有所不同? - Diffing a file against last Mercurial changeset, should it be different? 为什么这些命令会产生新的头绪? - Why these commands in mercurial create a new head?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM