Mercurial:从未版本控制的副本中提取更改
我目前正在维护我正在从事的项目的 Mercurial 存储库。
然而,团队的其他成员却不这么认为。
我可以通过 SSH 访问代码库的“良好”(未版本控制)副本。我想做的是能够在更新时从该好的副本中执行类似 hg pull
到我的主存储库中的操作。
据我所知,没有明显的方法可以做到这一点,因为 hg pull
要求您有一个源 hg 存储库。
我想我可以使用像 rsync 这样的实用程序来更新我的存储库,然后提交,但我想知道:
是否有一种更简单/不那么做作的方法来做到这一点?
I am currently maintaining a Mercurial repository of the project I am working on.
The rest of the team, however, doesn't.
There is a "good" (unversioned) copy of the code base that I can access by SSH. What I would like to do is be able to do something like an hg pull
from that good copy into my master repository whenever it gets updated.
As far as I can tell, there's no obvious way to do this, as hg pull
requires you have a source hg repository.
I suppose I could use a utility like rsync
to update my repository, then commit, but I was wondering:
Is there was an easier/less contrived way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简而言之:据我所知没有。
不过,如果我处于您的位置,我会将“中心”代码保留在一个分支中,在另一个分支中进行开发,然后编写可以适当推/拉的脚本。
例如,拉取脚本将:
hg cocentral
(确保在工作副本有未提交的更改时中止)rsync ssh://central/repo
hg ci -m "snapshot ofcentral on $(date)"
推送脚本将类似于:
./pull
hg cocentral
hg合并<您的工作分支>
rsync 。 ssh://central/repo
最后,我会自由地使用线索棒,直到团队的其他成员都加入进来:)(尽管你可能已经知道了)。
In short: not that I know of.
If I were in your position, though, I'd keep the "central" code in one branch, do my dev in another branch, then have scripts which would push/pull as appropriate.
For example, the pull script would:
hg co central
(making sure to abort if the working copy had uncommitted changes)rsync ssh://central/repo
hg ci -m "snapshot of central on $(date)"
The push script would then be something like:
./pull
hg co central
hg merge <your working branch>
rsync . ssh://central/repo
Finally, I would apply clue stick liberally until the rest of the team is on board :) (although you probably knew that already).