Mercurial > hg
annotate mercurial/help/subrepos.txt @ 16543:715a9fb8ef22 stable
i18n-ja: synchronized with 4bce649a2b0f
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 29 Apr 2012 00:48:22 +0900 |
parents | c27a769d9703 |
children | 979b107eaea2 |
rev | line source |
---|---|
12828 | 1 Subrepositories let you nest external repositories or projects into a |
2 parent Mercurial repository, and make commands operate on them as a | |
15213
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
3 group. |
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
4 |
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
5 Mercurial currently supports Mercurial, Git, and Subversion |
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
6 subrepositories. |
12828 | 7 |
8 Subrepositories are made of three components: | |
9 | |
10 1. Nested repository checkouts. They can appear anywhere in the | |
15213
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
11 parent working directory. |
12828 | 12 |
16503
c27a769d9703
doc: add description about location of management files for subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
15474
diff
changeset
|
13 2. Nested repository references. They are defined in ``.hgsub``, which |
c27a769d9703
doc: add description about location of management files for subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
15474
diff
changeset
|
14 should be placed in the root of working directory, and |
12828 | 15 tell where the subrepository checkouts come from. Mercurial |
16 subrepositories are referenced like: | |
17 | |
18 path/to/nested = https://example.com/nested/repo/path | |
19 | |
15213
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
20 Git and Subversion subrepos are also supported: |
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
21 |
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
22 path/to/nested = [git]git://example.com/nested/repo/path |
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
23 path/to/nested = [svn]https://example.com/nested/trunk/path |
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
24 |
12828 | 25 where ``path/to/nested`` is the checkout location relatively to the |
26 parent Mercurial root, and ``https://example.com/nested/repo/path`` | |
27 is the source repository path. The source can also reference a | |
15213
15f15f3b405d
subrepo: add git to the help topic
Matt Mackall <mpm@selenic.com>
parents:
13411
diff
changeset
|
28 filesystem path. |
12828 | 29 |
30 Note that ``.hgsub`` does not exist by default in Mercurial | |
31 repositories, you have to create and add it to the parent | |
32 repository before using subrepositories. | |
33 | |
16503
c27a769d9703
doc: add description about location of management files for subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
15474
diff
changeset
|
34 3. Nested repository states. They are defined in ``.hgsubstate``, which |
c27a769d9703
doc: add description about location of management files for subrepo
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
15474
diff
changeset
|
35 is placed in the root of working directory, and |
12828 | 36 capture whatever information is required to restore the |
37 subrepositories to the state they were committed in a parent | |
38 repository changeset. Mercurial automatically record the nested | |
39 repositories states when committing in the parent repository. | |
40 | |
41 .. note:: | |
42 The ``.hgsubstate`` file should not be edited manually. | |
43 | |
44 | |
45 Adding a Subrepository | |
46 ---------------------- | |
47 | |
48 If ``.hgsub`` does not exist, create it and add it to the parent | |
49 repository. Clone or checkout the external projects where you want it | |
50 to live in the parent repository. Edit ``.hgsub`` and add the | |
51 subrepository entry as described above. At this point, the | |
52 subrepository is tracked and the next commit will record its state in | |
53 ``.hgsubstate`` and bind it to the committed changeset. | |
54 | |
55 Synchronizing a Subrepository | |
56 ----------------------------- | |
57 | |
58 Subrepos do not automatically track the latest changeset of their | |
59 sources. Instead, they are updated to the changeset that corresponds | |
60 with the changeset checked out in the top-level changeset. This is so | |
61 developers always get a consistent set of compatible code and | |
62 libraries when they update. | |
63 | |
64 Thus, updating subrepos is a manual process. Simply check out target | |
65 subrepo at the desired revision, test in the top-level repo, then | |
66 commit in the parent repository to record the new combination. | |
67 | |
68 Deleting a Subrepository | |
69 ------------------------ | |
70 | |
12860
db2ff771204d
help: correct tip about deleting a subrepository
Wagner Bruna <wbruna@softwareexpress.com.br>
parents:
12828
diff
changeset
|
71 To remove a subrepository from the parent repository, delete its |
db2ff771204d
help: correct tip about deleting a subrepository
Wagner Bruna <wbruna@softwareexpress.com.br>
parents:
12828
diff
changeset
|
72 reference from ``.hgsub``, then remove its files. |
12828 | 73 |
74 Interaction with Mercurial Commands | |
75 ----------------------------------- | |
76 | |
77 :add: add does not recurse in subrepos unless -S/--subrepos is | |
15410
9e99d2bbb1b1
add: support adding explicit files in subrepos
David M. Carr <david@carrclan.us>
parents:
15213
diff
changeset
|
78 specified. However, if you specify the full path of a file in a |
9e99d2bbb1b1
add: support adding explicit files in subrepos
David M. Carr <david@carrclan.us>
parents:
15213
diff
changeset
|
79 subrepo, it will be added even without -S/--subrepos specified. |
15432 | 80 Git and Subversion subrepositories are currently silently |
12828 | 81 ignored. |
82 | |
83 :archive: archive does not recurse in subrepositories unless | |
84 -S/--subrepos is specified. | |
85 | |
86 :commit: commit creates a consistent snapshot of the state of the | |
15427
2a3ab9e81a3e
subrepo: update help for commit to reflect new default behavior
David M. Carr <david@carrclan.us>
parents:
15213
diff
changeset
|
87 entire project and its subrepositories. If any subrepositories |
2a3ab9e81a3e
subrepo: update help for commit to reflect new default behavior
David M. Carr <david@carrclan.us>
parents:
15213
diff
changeset
|
88 have been modified, Mercurial will abort. Mercurial can be made |
2a3ab9e81a3e
subrepo: update help for commit to reflect new default behavior
David M. Carr <david@carrclan.us>
parents:
15213
diff
changeset
|
89 to instead commit all modified subrepositories by specifying |
2a3ab9e81a3e
subrepo: update help for commit to reflect new default behavior
David M. Carr <david@carrclan.us>
parents:
15213
diff
changeset
|
90 -S/--subrepos, or setting "ui.commitsubrepos=True" in a |
2a3ab9e81a3e
subrepo: update help for commit to reflect new default behavior
David M. Carr <david@carrclan.us>
parents:
15213
diff
changeset
|
91 configuration file (see :hg:`help config`). After there are no |
2a3ab9e81a3e
subrepo: update help for commit to reflect new default behavior
David M. Carr <david@carrclan.us>
parents:
15213
diff
changeset
|
92 longer any modified subrepositories, it records their state and |
2a3ab9e81a3e
subrepo: update help for commit to reflect new default behavior
David M. Carr <david@carrclan.us>
parents:
15213
diff
changeset
|
93 finally commits it in the parent repository. |
12828 | 94 |
95 :diff: diff does not recurse in subrepos unless -S/--subrepos is | |
96 specified. Changes are displayed as usual, on the subrepositories | |
15428
da81da6caa6b
subrepo: improve help for git subrepo support
David M. Carr <david@carrclan.us>
parents:
15427
diff
changeset
|
97 elements. Git and Subversion subrepositories are currently |
da81da6caa6b
subrepo: improve help for git subrepo support
David M. Carr <david@carrclan.us>
parents:
15427
diff
changeset
|
98 silently ignored. |
12828 | 99 |
15474
95174c381525
forget: support forgetting explicit paths in subrepos
David M. Carr <david@carrclan.us>
parents:
15432
diff
changeset
|
100 :forget: forget currently only handles exact file matches in subrepos. |
95174c381525
forget: support forgetting explicit paths in subrepos
David M. Carr <david@carrclan.us>
parents:
15432
diff
changeset
|
101 Git and Subversion subrepositories are currently silently ignored. |
95174c381525
forget: support forgetting explicit paths in subrepos
David M. Carr <david@carrclan.us>
parents:
15432
diff
changeset
|
102 |
12828 | 103 :incoming: incoming does not recurse in subrepos unless -S/--subrepos |
15428
da81da6caa6b
subrepo: improve help for git subrepo support
David M. Carr <david@carrclan.us>
parents:
15427
diff
changeset
|
104 is specified. Git and Subversion subrepositories are currently |
da81da6caa6b
subrepo: improve help for git subrepo support
David M. Carr <david@carrclan.us>
parents:
15427
diff
changeset
|
105 silently ignored. |
12828 | 106 |
107 :outgoing: outgoing does not recurse in subrepos unless -S/--subrepos | |
15428
da81da6caa6b
subrepo: improve help for git subrepo support
David M. Carr <david@carrclan.us>
parents:
15427
diff
changeset
|
108 is specified. Git and Subversion subrepositories are currently |
da81da6caa6b
subrepo: improve help for git subrepo support
David M. Carr <david@carrclan.us>
parents:
15427
diff
changeset
|
109 silently ignored. |
12828 | 110 |
111 :pull: pull is not recursive since it is not clear what to pull prior | |
112 to running :hg:`update`. Listing and retrieving all | |
113 subrepositories changes referenced by the parent repository pulled | |
114 changesets is expensive at best, impossible in the Subversion | |
115 case. | |
116 | |
117 :push: Mercurial will automatically push all subrepositories first | |
118 when the parent repository is being pushed. This ensures new | |
119 subrepository changes are available when referenced by top-level | |
15429
e48f0913f018
subrepo: improve help for svn subrepo support
David M. Carr <david@carrclan.us>
parents:
15428
diff
changeset
|
120 repositories. Push is a no-op for Subversion subrepositories. |
12828 | 121 |
122 :status: status does not recurse into subrepositories unless | |
123 -S/--subrepos is specified. Subrepository changes are displayed as | |
124 regular Mercurial changes on the subrepository | |
125 elements. Subversion subrepositories are currently silently | |
126 ignored. | |
127 | |
128 :update: update restores the subrepos in the state they were | |
129 originally committed in target changeset. If the recorded | |
130 changeset is not available in the current subrepository, Mercurial | |
131 will pull it in first before updating. This means that updating | |
132 can require network access when using subrepositories. | |
133 | |
134 Remapping Subrepositories Sources | |
135 --------------------------------- | |
136 | |
137 A subrepository source location may change during a project life, | |
138 invalidating references stored in the parent repository history. To | |
139 fix this, rewriting rules can be defined in parent repository ``hgrc`` | |
140 file or in Mercurial configuration. See the ``[subpaths]`` section in | |
141 hgrc(5) for more details. | |
142 |