在克隆中进行更改时,使Mercurial子存储库保持最新状态的工作流程? [英] Workflow to keep Mercurial subrepositories up to date when changes are made in clones?

查看:59
本文介绍了在克隆中进行更改时,使Mercurial子存储库保持最新状态的工作流程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了关于Mercurial子存储库的所有问题,我仍然可以并且仍然不确定它是如何工作的.我们在IIS上使用hgweb.cgi,因此我们拥有所有存储库的http://路径.

I have read every question on Mercurial subrepositories that I could and still not sure how it works. We are using hgweb.cgi on IIS so we have http:// paths to all of our repos.

这是基本布局:

/Libraries - http://server/Libraries
/Project1 - http://server/Project1
/Project1/LibrariesSubrepo - http://server/Project1/LibrariesSubrepo (clone of libraries)
/Project2 - http://server/Project1
/Project2/LibrariesSubrepo - http://server/Project2/LibrariesSubrepo (clone of libraries)

在.hgsub文件中,我将路径设置为:

In the .hgsub files, I have the path setup as:

LibrariesSubrepo = LibrariesSubrepo

如果要处理这些项目,可以将它们从服务器克隆到我的工作站,这样我就可以复制Project1和Project2,并且它也会自动提取子存储库.

If I want to work on the projects, I clone them from the server to my workstation so I have a clone of Project1 and Project2 and it automatically pulls the subrepos as well.

在本地工作站上的project1中,我对/Project1/LibrariesSubrepo中的文件进行了一些更改.如何确保这些更改将其返回到服务器上库的源回购中?我必须手动将更改从子存储库推送到子存储库的源存储库吗?

In project1 on my local workstation, I make some changes to files in the /Project1/LibrariesSubrepo. How do I ensure that those changes make it back to the source repo for Libraries on the server? Do I have to manually push the changes from the subrepo to the source repo of the subrepo ?

我希望能够在本地的Project1存储库中进行更改,然后提交/推送这些更改,然后在Project2中,我应该能够从服务器中提取更改,该服务器应将Project2/LibrariesSubrepo更新为最新版本版本.

I would like to be able to make changes in the Project1 repo locally, then commit/push those changes, then in Project2, I should be able to pull the changes from the server which should update the Project2/LibrariesSubrepo to the latest version.

推荐答案

您绝对可以从Project1中的LibrariesSubrepo手动推送到服务器上的Libraries存储库,然后从Libraries手动拉入LibrariesSubrepo在Project2克隆中.

You can definitely push manually from your LibrariesSubrepo in Project1 to the Libraries repository on the server and then manually pull from Libraries into LibrariesSubrepo in a Project2 clone.

但是,您也可以在服务器上链接子仓库:

However, you can also link the subrepos on the server:

  1. 通过共享扩展名,您可以创建两个或多个共享文件夹.在服务器上执行此操作,以使服务器上子仓库的三个实例共享.hg文件夹.

  1. The share extension lets you create two or more repositories that share a .hg folder. Do this on the server so that the three instances of the subrepo on the server share the .hg folders.

.hg文件夹进行符号链接-更多的oldschol,仅当您在可以创建符号链接的服务器上(Unix服务器或Windows Vista以及具有适当权限的更高版本)时,它才起作用.

Symlink the .hg folders -- more oldschol and it only works if you're on a server where you can create symlink (Unix servers or Windows Vista and later with the right priviledge).

在服务器上仅保留一个子存储库,但在hgweb配置中将其公开三次.像这样:

Keep just one subrepo on the server but expose it three times in the hgweb configuration. Like this:

[paths]
Project1                  = /repos/Project1
Project1/LibrariesSubrepo = /repos/Libraries
Project2                  = /repos/Project2
Project2/LibrariesSubrepo = /repos/Libraries

在所有情况下,服务器上实际上只有三个存储库:Project1Project2Libraries.

In all cases, there are actually only three repositories on the server: Project1, Project2, and Libraries.

这篇关于在克隆中进行更改时,使Mercurial子存储库保持最新状态的工作流程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆