(Mercurial) 有什么方法可以返回并标记分支的开始吗?
我愚蠢地未能在 default
主干上启动一个分支来进行一些实验性工作,现在意识到我所做的并不是那么好。由于此代码实际上已被其他人使用(并且在野外),因此我想将修订版 394
(本实验中未进行的最后一个更改)标记为正确的头,并基本上删除我想要的任何内容。已经完成了)。最好的方法是什么?
@ 397 my change, bad (tip)
|
|
o 396 my change, bad
|
|
o 395 my change, bad
|
|
o 394 good change
|
|
...
这应该变成
@ 394 good change (tip)
|
|
|- 397 bad change (closed)
||
||
|o 396 bad change
||
||
|o 395 bad change
|/
|
...
我是否需要根据 394 进行虚拟签入(这会自动创建一个新头)?这似乎是最简单的解决方案,但不是“最干净的”。
I foolishly failed to start a branch off the default
trunk to do some experimental work, and now realize that what I've done isn't really all that great. Since this code is actually used by others (and out in the wild), I want to mark revision 394
(the last change not made in this experiment) as the proper head, and basically strip off anything I've done). What would be the best way to do that?
@ 397 my change, bad (tip)
|
|
o 396 my change, bad
|
|
o 395 my change, bad
|
|
o 394 good change
|
|
...
This should become
@ 394 good change (tip)
|
|
|- 397 bad change (closed)
||
||
|o 396 bad change
||
||
|o 395 bad change
|/
|
...
Do I need to make a dummy check-in based off of 394 (which would create a new head automatically)? That seems the simplest solution, but not the "cleanest".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不需要虚拟签到,但你需要确保你的下一次签到是从 rev 394 开始完成的。
新的头部将是小费。
或者,如果您没有将存储库推送到任何地方[1],并且您只想永久删除这些修订,则可以使用 mq 扩展,并
strip
更改集或qimport 将它们放入补丁队列并
qdel
补丁。这很危险,一定要确保正确。
[1] 如果您已经将变更集发送到任何地方,但为时已晚,则秘密将被泄露。你只需要从 rev 394 分支出来。
You don't need a dummy check-in, but you do need to make sure your next check-in is done from rev 394.
The new head will be the tip.
Alternatively, if you haven't pushed the repo anywhere[1], and you just want to delete those revisions forever you can use the mq extension, and either
strip
the changesets orqimport
them into a patch queue andqdel
the patches.This is dangerous, make sure you get it right.
[1] If you've already sent the changesets anywhere, too late, the cat's out of the bag. You'll just have to branch off rev 394.