Mercurial 工作流程是否可以通过未提交的更改进行更新?
因此,我的网站从 CVS 切换到 Mercurial。
我遇到的最大问题是,如果我正在处理一些我不想提交的文件,我只需保存它们..然后我还有其他文件想要推送到服务器,但是如果其他人已经制作了对存储库进行更改,然后我将它们拉下来。它要求我合并或变基。这些选项中的任何一个都会导致我丢失尚未提交的本地更改。
我读过,我应该在本地主机上克隆每个项目的存储库,并在准备好时将其合并到实时中。这不仅看起来很乏味,而且还需要很长时间,因为它是一个很大的存储库。
对此有更好的解决方案吗?
我希望 Mercurial 能够看到我没有提交更改(即使我已经更改了服务器上的文件),因此它只会忽略该文件。
对此的任何意见将不胜感激。谢谢你!
另外,我正在使用 hg eclipse 插件来处理我的文件并从服务器推送/拉取。
So i've made the switch from CVS to mercurial for my website.
The biggest issue I am having is that if i'm working on some files that I don't want to commit, I just save them.. I then have other files I want to push to the server, however if someone else has made changes to the repository, and I pull them down.. It asks me to merge or rebase.. either of these options will cause me to lose my local changes that I have not committed.
I've read that I should clone the repository for each project on my local host and merge it into the live when it's ready to do so. This not only seems tedious, but also takes a long time as it's a large repository.
Are there better solutions to this?
I would have hoped that Mercurial would see that I haven't committed my changes (even though I have changed the file from what's on the server) so it'd just overlook the file.
Any input on this would be greatly appreciated. Thank you!
Also, i'm using the hg eclipse plugin to work on my files and push/pull from the server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想
hg shelve
是你的朋友。它来自
概述中的搁置扩展(可能 - 见下文):
或者可能是阁楼扩展
它似乎与搁置扩展具有相同的语法,所以我不确定我使用的是哪一个
hg shelve
is your friend here I think.which comes from the shelve extention (maybe - see below)
from the overview:
or maybe its the attic extension
it seems to have the same syntax as the shelve extension, so I'm not certain which one I've used
我赞同@Sam 的回答。但是,如果您更喜欢使用标准 Mercurial,一个简单的工作流程是将
例如:
I second @Sam's answer. However, if you prefer to use standard Mercurial, a simple workflow is to
For instance:
首先,您是通过命令行工作,还是使用 Tortoise 之类的工具?
如果您从命令行工作,并且已经完成了拉取,则 Mercurial 不会要求您执行任何操作,因为它只会更新您的本地存储库。
如果您随后进行 hg 更新并进行本地更改,它应该执行您在 CVS 中习惯的操作。它将更新到当前分支的尖端,并尝试合并您未完成的更改。对此有一些注意事项,因此请参阅官方文档 http://www.selenic.com/mercurial/hg.1.html#update。
另外,为了临时存储更改,我建议使用 MQ 而不是 shelve。 Shelve只提供一个存储区域,而MQ可以提供任意数量的存储区域。 MQ 需要一些时间来适应,但值得投资。
First, are you working from the commandline, or using something like Tortoise?
If you're working from the commandline, and you've done a pull, mercurial will not ask you to do anything, as it merely updates your local repository.
If you then do an hg update and have local changes, it should do what you're used to from CVS. It will update to the tip of the current branch, and attempt to merge your outstanding changes in. There are some caveats to that, so refer to the official docs at http://www.selenic.com/mercurial/hg.1.html#update.
Also, for temporarily storing changes, I would recommend MQ over shelve. Shelve only provides one storage area, whereas MQ provides as many as you need. MQ takes some getting used to, but worth the investment.