Mercurial:从未版本控制的副本中提取更改

发布于 2024-09-04 09:47:07 字数 311 浏览 2 评论 0原文

我目前正在维护我正在从事的项目的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

美男兮 2024-09-11 09:47:07

简而言之:据我所知没有。

不过,如果我处于您的位置,我会将“中心”代码保留在一个分支中,在另一个分支中进行开发,然后编写可以适当推/拉的脚本。

例如,拉取脚本将:

  1. hg cocentral(确保在工作副本有未提交的更改时中止)
  2. rsync ssh://central/repo
  3. hg ci -m "snapshot ofcentral on $(date)"

推送脚本将类似于:

  1. ./pull
  2. hg cocentral
  3. hg合并<您的工作分支>
  4. ...测试,修复任何冲突...
  5. 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:

  1. hg co central (making sure to abort if the working copy had uncommitted changes)
  2. rsync ssh://central/repo
  3. hg ci -m "snapshot of central on $(date)"

The push script would then be something like:

  1. ./pull
  2. hg co central
  3. hg merge <your working branch>
  4. ... test, fix any conflicts ...
  5. 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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文