开发者

Using Mercurial when I've done a complete rewrite

This is my repository:

https://bitbucket.org/sergiotapia/sharpdic

Basically, I've rewritten the entire library. It doesn't resemble the original at all. What command can I run to completely erase/neglect the existing code base and replace it with my newer code vers开发者_如何学Pythonion?

I've done an hg init on the folder on my local disc (it has the newer code), do I have to delete that before trying to upload?

Thanks.


Just go to revision 0 (hg up null), commit (creates a new branch), and then close the old branch. That's what I would do if not replacing the repo altogether.

I assume that your new files are currently not yet in the repo directory. Make a backup first!

hg up tip -C
hg commit -m 'Old code branch' --close-branch
hg up null -C

You'll now have an empty reporsitory directoy, starting at revision 0. Copy your new files into it (don't copy the .hg folder from the new file directory).

hg addremove
hg commit -m 'New code branch'

That should do the trick. Did I mention to backup the files and repo first? ;-)

Another option is to force a push of the new repo onto the remote repo, but you'll still need to close the old branch after doing this in order to have only one active head. Choose this option if you did commit already to the nbew repo (you only mentionned having done a init, so I assumed no commit yet).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜