Next: , Previous: Subprojects, Up: Starting Up


4.1.5 Submodules

Related to the notion of subproject is that of “submodule” (or “subrepo”) as some RCSes would put it. A submodule is a standalone project that appears under another project (so it looks like a subproject, only it isn't).

Normally, there is nothing special about submodules, in the sense that if you want to handle them from Patcher, you would define them as regular projects. However, there are ways to detect submodules automatically, which can be very convenient if you have plenty of them (this happens for XEmacs packages for instance).

Patcher currently knows how to detect submodules of Mercurial and Git projects. The effect is to define new projects that inherit from the umbrella project automatically, with their own name and directory, so that you don't need to define them by hand.

Automatic detection of submodules is controlled via the :submodule-detection-function project option. Its value is a symbol naming a function, or nil if you don't want autodetection. The built-in Git and Mercurial themes set this option to patcher-hg-detect-submodules and patcher-git-detect-submodules respectively.

Submodules are detected automatically by scanning the value of patcher-projects the first time you use Patcher in an XEmacs session. If you further modify this variable, it may be needed to recompute the list of known submodules. You can do this by calling patcher-detect-submodules interactively.