Skip to content

Commit c635ce0

Browse files
committed
Duplicate VCS content
- Break VCS sections into files for inclusion - Add VCS kind content to package and project - Add VCS location content to package and project - Add VCS branch content to package and project - Add VCS kind content to package and project - Add VCS subdir content to package and project - Put "is required" first for CVS field - Move VCS out of the "Cabal Reference" - Rename include files to vcs/* - Revert "Move VCS out of the "Cabal Reference""
1 parent 1103d01 commit c635ce0

9 files changed

+114
-71
lines changed

doc/cabal-package-description-file.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,33 +2747,42 @@ The :ref:`VCS fields<vcs-fields>` of ``source-repository`` are:
27472747

27482748
This field is required.
27492749

2750+
.. include:: vcs/kind.rst
2751+
27502752
.. pkg-field:: location: VCS location
27512753

27522754
This field is required.
27532755

2754-
.. pkg-field:: module: token
2756+
.. include:: vcs/location.rst
27552757

2756-
CVS requires a named module, as each CVS server can host multiple
2757-
named repositories.
2758+
.. pkg-field:: module: token
27582759

27592760
This field is required for the CVS repository type and should not be
27602761
used otherwise.
27612762

2763+
CVS requires a named module, as each CVS server can host multiple
2764+
named repositories.
2765+
27622766
.. pkg-field:: branch: VCS branch
27632767

27642768
This field is optional.
27652769

2770+
.. include:: vcs/branch.rst
2771+
27662772
.. pkg-field:: tag: VCS tag
27672773

27682774
This field is required for the ``this`` repository kind.
27692775

27702776
This might be used to indicate what sources to get if someone needs to fix a
27712777
bug in an older branch that is no longer an active head branch.
27722778

2779+
.. include:: vcs/tag.rst
2780+
27732781
.. pkg-field:: subdir: VCS subdirectory
27742782

27752783
This field is optional but, if given, specifies a single subdirectory.
27762784

2785+
.. include:: vcs/subdir.rst
27772786

27782787
.. _setup-hooks:
27792788

doc/cabal-project-description-file.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,23 +269,33 @@ The :ref:`VCS fields<vcs-fields>` of ``source-repository-package`` are:
269269

270270
This field is required.
271271

272+
.. include:: vcs/kind.rst
273+
272274
.. cfg-field:: location: VCS location
273275

274276
This field is required.
275277

278+
.. include:: vcs/location.rst
279+
276280
.. cfg-field:: branch: VCS branch
277281

278282
This field is optional.
279283

284+
.. include:: vcs/branch.rst
285+
280286
.. cfg-field:: tag: VCS tag
281287

282288
This field is optional.
283289

290+
.. include:: vcs/tag.rst
291+
284292
.. cfg-field:: subdir: VCS subdirectory list
285293

286294
Look in one or more subdirectories of the repository for cabal files, rather
287295
than the root. This field is optional.
288296

297+
.. include:: vcs/subdir.rst
298+
289299
.. cfg-field:: post-checkout-command: command
290300

291301
Run command in the checked out repository, prior sdisting.

doc/vcs/branch.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
..
2+
VCS branch
3+
4+
Many source control systems support the notion of a branch, as a distinct
5+
concept from having repositories in separate locations. For example CVS, SVN and
6+
git use branches while darcs uses different locations for different branches. If
7+
you need to specify a branch to identify a your repository then specify it in
8+
this field.

doc/vcs/fields.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
..
2+
VCS common fields
3+
4+
Most of the version control system (VCS) fields types are common to both
5+
``source-repository`` and ``source-repository-package`` stanzas.
6+
7+
.. list-table::
8+
:header-rows: 1
9+
:widths: 30 30 40
10+
11+
* - Field Name
12+
- source-repository (head|this)
13+
- source-repository-package
14+
* - type
15+
- [x]
16+
- [x]
17+
* - location
18+
- [x]
19+
- [x]
20+
* - branch
21+
- [x]
22+
- [x]
23+
* - tag
24+
- [x]
25+
- [x]
26+
* - subdir
27+
- [x] (0 or 1)
28+
- [x] (0 or 1 for each dependency)
29+
* - module (CVS only)
30+
- [x]
31+
- [_]
32+
* - post-checkout-command
33+
- [_]
34+
- [x]

doc/vcs/kind.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
..
2+
VCS kind
3+
4+
Cabal supports specifying different information for various common source
5+
control systems. This is the name of the source control system used for a
6+
repository. The currently recognised types are:
7+
8+
- ``darcs``
9+
- ``git``
10+
- ``svn``
11+
- ``cvs``
12+
- ``mercurial`` (or alias ``hg``)
13+
- ``bazaar`` (or alias ``bzr``)
14+
- ``arch``
15+
- ``monotone``
16+
- ``pijul``
17+
18+
The VCS kind will determine what other fields are appropriate to specify for a
19+
particular version control system.

doc/vcs/location.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
..
2+
VCS location
3+
4+
The location of the repository, usually a URL but the exact form of this field
5+
depends on the repository type. For example:
6+
7+
- for Darcs: ``http://code.haskell.org/foo/``
8+
- for Git: ``https://github.com/foo/bar.git``
9+
- for CVS: ``anoncvs@cvs.foo.org:/cvs``

doc/vcs/subdir.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
..
2+
VCS subdirectory
3+
4+
A field of this type is always optional because it defaults to empty, which
5+
corresponds to the root directory of the repository and is the same as
6+
specifying ``.`` explicitly.
7+
8+
Some projects put the sources for multiple packages inside a single VCS
9+
repository. This field lets you specify the relative path from the root of the
10+
repository to the top directory for the package, i.e. the directory containing
11+
the package's ``.cabal`` file.

doc/vcs/tag.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
..
2+
VCS tag
3+
4+
A tag identifies a particular state of a source repository. The exact form of
5+
the tag depends on the repository type.

doc/version-control-fields.rst

Lines changed: 6 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,93 +3,31 @@ Version Control System Fields
33

44
.. _vcs-fields:
55

6-
Most of the version control system (VCS) fields types are common to both
7-
``source-repository`` and ``source-repository-package`` stanzas.
8-
9-
.. list-table::
10-
:header-rows: 1
11-
:widths: 30 30 40
12-
13-
* - Field Name
14-
- source-repository (head|this)
15-
- source-repository-package
16-
* - type
17-
- [x]
18-
- [x]
19-
* - location
20-
- [x]
21-
- [x]
22-
* - branch
23-
- [x]
24-
- [x]
25-
* - tag
26-
- [x]
27-
- [x]
28-
* - subdir
29-
- [x] (0 or 1)
30-
- [x] (0 or 1 for each dependency)
31-
* - module (CVS only)
32-
- [x]
33-
- [_]
34-
* - post-checkout-command
35-
- [_]
36-
- [x]
6+
.. include:: vcs/fields.rst
377

388
.. _vcs-kind:
399

4010
VCS kind
4111
^^^^^^^^
4212

43-
Cabal supports specifying different information for various common source
44-
control systems. This is the name of the source control system used for a
45-
repository. The currently recognised types are:
46-
47-
- ``darcs``
48-
- ``git``
49-
- ``svn``
50-
- ``cvs``
51-
- ``mercurial`` (or alias ``hg``)
52-
- ``bazaar`` (or alias ``bzr``)
53-
- ``arch``
54-
- ``monotone``
55-
- ``pijul``
56-
57-
The VCS kind will determine what other fields are appropriate to specify for a
58-
particular version control system.
13+
.. include:: vcs/kind.rst
5914

6015
VCS location
6116
^^^^^^^^^^^^
6217

63-
The location of the repository, usually a URL but the exact form of this field
64-
depends on the repository type. For example:
65-
66-
- for Darcs: ``http://code.haskell.org/foo/``
67-
- for Git: ``https://github.com/foo/bar.git``
68-
- for CVS: ``anoncvs@cvs.foo.org:/cvs``
18+
.. include:: vcs/location.rst
6919

7020
VCS branch
7121
^^^^^^^^^^
7222

73-
Many source control systems support the notion of a branch, as a distinct
74-
concept from having repositories in separate locations. For example CVS, SVN and
75-
git use branches while darcs uses different locations for different branches. If
76-
you need to specify a branch to identify a your repository then specify it in
77-
this field.
23+
.. include:: vcs/branch.rst
7824

7925
VCS tag
8026
^^^^^^^
8127

82-
A tag identifies a particular state of a source repository. The exact form of
83-
the tag depends on the repository type.
28+
.. include:: vcs/tag.rst
8429

8530
VCS subdirectory
8631
^^^^^^^^^^^^^^^^
8732

88-
A field of this type is always optional because it defaults to empty, which
89-
corresponds to the root directory of the repository and is the same as
90-
specifying ``.`` explicitly.
91-
92-
Some projects put the sources for multiple packages inside a single VCS
93-
repository. This field lets you specify the relative path from the root of the
94-
repository to the top directory for the package, i.e. the directory containing
95-
the package's ``.cabal`` file.
33+
.. include:: vcs/subdir.rst

0 commit comments

Comments
 (0)