Mercurial:从所有变更集中删除文件 [英] Mercurial: Remove file from all changesets

查看:63
本文介绍了Mercurial:从所有变更集中删除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解如何从历史记录中删除整个变更集,但尚不清楚如何删除子集代替.

I understand how to remove an entire changeset from history but it's not clear how to remove a subset instead.

例如,如何在不保留源代码的情况下从现有变更集中删除所有DLL文件?

For example, how do I remove all DLL files from an existing changeset while leaving the source-code alone?

推荐答案

由于修订版ID(例如a8d7641f ...)基于更改集的哈希值,因此删除确实是不可能的历史记录中变更集的子集.

Because the revision ids (e.g. a8d7641f...) are based on a hash of the changeset, it's not really possible to remove a subset of a changeset from history.

但是,可以使用转换扩展名.您将使用文件映射通过添加exclude来排除不需要的文件,从而将Mercurial仓库转换为Mercurial仓库.这将创建一个新的,不相关的存储库,这意味着人们无法再从该存储库中提取任何克隆文件,而必须从此新存储库中重新克隆.

However, it is possible to create a new repo with a parallel history, except for a certain set of files, by using the Convert extension. You'll be converting a Mercurial repo to a Mercurial repo, using the filemap to exclude the files you don't want by adding excludes. This will create a new, unrelated repository, which means that any clones people have won't be able to pull from it any more, and will have to re-clone from this new repo.

这篇关于Mercurial:从所有变更集中删除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆