diff options
| author | Jonathan Nieder <jrn@google.com> | 2018-10-10 05:54:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-10-10 05:54:59 +0000 |
| commit | b3133a31642ea88f0e4fe9c382411d43278dc9e4 (patch) | |
| tree | c72601d46a490856451082620a74e38b136a8f45 | |
| parent | 3b24e7b5577fc6d812e1d002ada9fdf85256fcd3 (diff) | |
| parent | b8f7bb04d003f8dbcf3ef2b201fc2678308995af (diff) | |
| download | git-repo-b3133a31642ea88f0e4fe9c382411d43278dc9e4.tar.gz | |
Merge "update markdown/help header format"
| -rw-r--r-- | docs/manifest-format.md | 42 | ||||
| -rw-r--r-- | subcmds/branches.py | 3 | ||||
| -rw-r--r-- | subcmds/forall.py | 6 | ||||
| -rw-r--r-- | subcmds/grep.py | 6 | ||||
| -rw-r--r-- | subcmds/help.py | 17 | ||||
| -rw-r--r-- | subcmds/init.py | 3 | ||||
| -rw-r--r-- | subcmds/status.py | 3 | ||||
| -rw-r--r-- | subcmds/sync.py | 6 | ||||
| -rw-r--r-- | subcmds/upload.py | 6 |
9 files changed, 27 insertions, 65 deletions
diff --git a/docs/manifest-format.md b/docs/manifest-format.md index cf48698d..c85726bc 100644 --- a/docs/manifest-format.md +++ b/docs/manifest-format.md | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | repo Manifest Format | 1 | # repo Manifest Format |
| 2 | ==================== | ||
| 3 | 2 | ||
| 4 | A repo manifest describes the structure of a repo client; that is | 3 | A repo manifest describes the structure of a repo client; that is |
| 5 | the directories that are visible and where they should be obtained | 4 | the directories that are visible and where they should be obtained |
| @@ -15,8 +14,7 @@ obtained by clients during `repo sync`. | |||
| 15 | [TOC] | 14 | [TOC] |
| 16 | 15 | ||
| 17 | 16 | ||
| 18 | XML File Format | 17 | ## XML File Format |
| 19 | --------------- | ||
| 20 | 18 | ||
| 21 | A manifest XML file (e.g. `default.xml`) roughly conforms to the | 19 | A manifest XML file (e.g. `default.xml`) roughly conforms to the |
| 22 | following DTD: | 20 | following DTD: |
| @@ -107,14 +105,12 @@ following DTD: | |||
| 107 | A description of the elements and their attributes follows. | 105 | A description of the elements and their attributes follows. |
| 108 | 106 | ||
| 109 | 107 | ||
| 110 | Element manifest | 108 | ### Element manifest |
| 111 | ---------------- | ||
| 112 | 109 | ||
| 113 | The root element of the file. | 110 | The root element of the file. |
| 114 | 111 | ||
| 115 | 112 | ||
| 116 | Element remote | 113 | ### Element remote |
| 117 | -------------- | ||
| 118 | 114 | ||
| 119 | One or more remote elements may be specified. Each remote element | 115 | One or more remote elements may be specified. Each remote element |
| 120 | specifies a Git URL shared by one or more projects and (optionally) | 116 | specifies a Git URL shared by one or more projects and (optionally) |
| @@ -149,8 +145,7 @@ Attribute `revision`: Name of a Git branch (e.g. `master` or | |||
| 149 | `refs/heads/master`). Remotes with their own revision will override | 145 | `refs/heads/master`). Remotes with their own revision will override |
| 150 | the default revision. | 146 | the default revision. |
| 151 | 147 | ||
| 152 | Element default | 148 | ### Element default |
| 153 | --------------- | ||
| 154 | 149 | ||
| 155 | At most one default element may be specified. Its remote and | 150 | At most one default element may be specified. Its remote and |
| 156 | revision attributes are used when a project element does not | 151 | revision attributes are used when a project element does not |
| @@ -188,8 +183,7 @@ branch (specified in the `revision` attribute) rather than | |||
| 188 | the other ref tags. | 183 | the other ref tags. |
| 189 | 184 | ||
| 190 | 185 | ||
| 191 | Element manifest-server | 186 | ### Element manifest-server |
| 192 | ----------------------- | ||
| 193 | 187 | ||
| 194 | At most one manifest-server may be specified. The url attribute | 188 | At most one manifest-server may be specified. The url attribute |
| 195 | is used to specify the URL of a manifest server, which is an | 189 | is used to specify the URL of a manifest server, which is an |
| @@ -217,8 +211,7 @@ the specified tag. This is used by repo sync when the --smart-tag option | |||
| 217 | is given. | 211 | is given. |
| 218 | 212 | ||
| 219 | 213 | ||
| 220 | Element project | 214 | ### Element project |
| 221 | --------------- | ||
| 222 | 215 | ||
| 223 | One or more project elements may be specified. Each element | 216 | One or more project elements may be specified. Each element |
| 224 | describes a single Git repository to be cloned into the repo | 217 | describes a single Git repository to be cloned into the repo |
| @@ -295,8 +288,7 @@ rather than the `name` attribute. This attribute only applies to the | |||
| 295 | local mirrors syncing, it will be ignored when syncing the projects in a | 288 | local mirrors syncing, it will be ignored when syncing the projects in a |
| 296 | client working directory. | 289 | client working directory. |
| 297 | 290 | ||
| 298 | Element extend-project | 291 | ### Element extend-project |
| 299 | ---------------------- | ||
| 300 | 292 | ||
| 301 | Modify the attributes of the named project. | 293 | Modify the attributes of the named project. |
| 302 | 294 | ||
| @@ -314,8 +306,7 @@ belongs. Same syntax as the corresponding element of `project`. | |||
| 314 | Attribute `revision`: If specified, overrides the revision of the original | 306 | Attribute `revision`: If specified, overrides the revision of the original |
| 315 | project. Same syntax as the corresponding element of `project`. | 307 | project. Same syntax as the corresponding element of `project`. |
| 316 | 308 | ||
| 317 | Element annotation | 309 | ### Element annotation |
| 318 | ------------------ | ||
| 319 | 310 | ||
| 320 | Zero or more annotation elements may be specified as children of a | 311 | Zero or more annotation elements may be specified as children of a |
| 321 | project element. Each element describes a name-value pair that will be | 312 | project element. Each element describes a name-value pair that will be |
| @@ -325,8 +316,7 @@ prefixed with REPO__. In addition, there is an optional attribute | |||
| 325 | "false". This attribute determines whether or not the annotation will | 316 | "false". This attribute determines whether or not the annotation will |
| 326 | be kept when exported with the manifest subcommand. | 317 | be kept when exported with the manifest subcommand. |
| 327 | 318 | ||
| 328 | Element copyfile | 319 | ### Element copyfile |
| 329 | ---------------- | ||
| 330 | 320 | ||
| 331 | Zero or more copyfile elements may be specified as children of a | 321 | Zero or more copyfile elements may be specified as children of a |
| 332 | project element. Each element describes a src-dest pair of files; | 322 | project element. Each element describes a src-dest pair of files; |
| @@ -334,14 +324,12 @@ the "src" file will be copied to the "dest" place during `repo sync` | |||
| 334 | command. | 324 | command. |
| 335 | "src" is project relative, "dest" is relative to the top of the tree. | 325 | "src" is project relative, "dest" is relative to the top of the tree. |
| 336 | 326 | ||
| 337 | Element linkfile | 327 | ### Element linkfile |
| 338 | ---------------- | ||
| 339 | 328 | ||
| 340 | It's just like copyfile and runs at the same time as copyfile but | 329 | It's just like copyfile and runs at the same time as copyfile but |
| 341 | instead of copying it creates a symlink. | 330 | instead of copying it creates a symlink. |
| 342 | 331 | ||
| 343 | Element remove-project | 332 | ### Element remove-project |
| 344 | ---------------------- | ||
| 345 | 333 | ||
| 346 | Deletes the named project from the internal manifest table, possibly | 334 | Deletes the named project from the internal manifest table, possibly |
| 347 | allowing a subsequent project element in the same manifest file to | 335 | allowing a subsequent project element in the same manifest file to |
| @@ -351,8 +339,7 @@ This element is mostly useful in a local manifest file, where | |||
| 351 | the user can remove a project, and possibly replace it with their | 339 | the user can remove a project, and possibly replace it with their |
| 352 | own definition. | 340 | own definition. |
| 353 | 341 | ||
| 354 | Element include | 342 | ### Element include |
| 355 | --------------- | ||
| 356 | 343 | ||
| 357 | This element provides the capability of including another manifest | 344 | This element provides the capability of including another manifest |
| 358 | file into the originating manifest. Normal rules apply for the | 345 | file into the originating manifest. Normal rules apply for the |
| @@ -362,8 +349,7 @@ Attribute `name`: the manifest to include, specified relative to | |||
| 362 | the manifest repository's root. | 349 | the manifest repository's root. |
| 363 | 350 | ||
| 364 | 351 | ||
| 365 | Local Manifests | 352 | ## Local Manifests |
| 366 | =============== | ||
| 367 | 353 | ||
| 368 | Additional remotes and projects may be added through local manifest | 354 | Additional remotes and projects may be added through local manifest |
| 369 | files stored in `$TOP_DIR/.repo/local_manifests/*.xml`. | 355 | files stored in `$TOP_DIR/.repo/local_manifests/*.xml`. |
diff --git a/subcmds/branches.py b/subcmds/branches.py index 2902684a..fa1dff67 100644 --- a/subcmds/branches.py +++ b/subcmds/branches.py | |||
| @@ -67,8 +67,7 @@ class Branches(Command): | |||
| 67 | 67 | ||
| 68 | Summarizes the currently available topic branches. | 68 | Summarizes the currently available topic branches. |
| 69 | 69 | ||
| 70 | Branch Display | 70 | # Branch Display |
| 71 | -------------- | ||
| 72 | 71 | ||
| 73 | The branch display output by this command is organized into four | 72 | The branch display output by this command is organized into four |
| 74 | columns of information; for example: | 73 | columns of information; for example: |
diff --git a/subcmds/forall.py b/subcmds/forall.py index 693949e2..6fb16f16 100644 --- a/subcmds/forall.py +++ b/subcmds/forall.py | |||
| @@ -53,8 +53,7 @@ Executes the same shell command in each project. | |||
| 53 | The -r option allows running the command only on projects matching | 53 | The -r option allows running the command only on projects matching |
| 54 | regex or wildcard expression. | 54 | regex or wildcard expression. |
| 55 | 55 | ||
| 56 | Output Formatting | 56 | # Output Formatting |
| 57 | ----------------- | ||
| 58 | 57 | ||
| 59 | The -p option causes '%prog' to bind pipes to the command's stdin, | 58 | The -p option causes '%prog' to bind pipes to the command's stdin, |
| 60 | stdout and stderr streams, and pipe all output into a continuous | 59 | stdout and stderr streams, and pipe all output into a continuous |
| @@ -71,8 +70,7 @@ command produces output only on stderr. Normally the -p option | |||
| 71 | causes command output to be suppressed until the command produces | 70 | causes command output to be suppressed until the command produces |
| 72 | at least one byte of output on stdout. | 71 | at least one byte of output on stdout. |
| 73 | 72 | ||
| 74 | Environment | 73 | # Environment |
| 75 | ----------- | ||
| 76 | 74 | ||
| 77 | pwd is the project's working directory. If the current client is | 75 | pwd is the project's working directory. If the current client is |
| 78 | a mirror client, then pwd is the Git repository. | 76 | a mirror client, then pwd is the Git repository. |
diff --git a/subcmds/grep.py b/subcmds/grep.py index dd391cfa..1157355d 100644 --- a/subcmds/grep.py +++ b/subcmds/grep.py | |||
| @@ -33,8 +33,7 @@ class Grep(PagedCommand): | |||
| 33 | helpDescription = """ | 33 | helpDescription = """ |
| 34 | Search for the specified patterns in all project files. | 34 | Search for the specified patterns in all project files. |
| 35 | 35 | ||
| 36 | Boolean Options | 36 | # Boolean Options |
| 37 | --------------- | ||
| 38 | 37 | ||
| 39 | The following options can appear as often as necessary to express | 38 | The following options can appear as often as necessary to express |
| 40 | the pattern to locate: | 39 | the pattern to locate: |
| @@ -47,8 +46,7 @@ in order to scan multiple trees. If the same file matches in more | |||
| 47 | than one tree, only the first result is reported, prefixed by the | 46 | than one tree, only the first result is reported, prefixed by the |
| 48 | revision name it was found under. | 47 | revision name it was found under. |
| 49 | 48 | ||
| 50 | Examples | 49 | # Examples |
| 51 | ------- | ||
| 52 | 50 | ||
| 53 | Look for a line that has '#define' and either 'MAX_PATH or 'PATH_MAX': | 51 | Look for a line that has '#define' and either 'MAX_PATH or 'PATH_MAX': |
| 54 | 52 | ||
diff --git a/subcmds/help.py b/subcmds/help.py index 9bb4c8c7..67a225e5 100644 --- a/subcmds/help.py +++ b/subcmds/help.py | |||
| @@ -107,15 +107,13 @@ Displays detailed usage information about a command. | |||
| 107 | 107 | ||
| 108 | self.heading('%s', heading) | 108 | self.heading('%s', heading) |
| 109 | self.nl() | 109 | self.nl() |
| 110 | |||
| 111 | self.heading('%s', ''.ljust(len(heading), '-')) | ||
| 112 | self.nl() | 110 | self.nl() |
| 113 | 111 | ||
| 114 | me = 'repo %s' % cmd.NAME | 112 | me = 'repo %s' % cmd.NAME |
| 115 | body = body.strip() | 113 | body = body.strip() |
| 116 | body = body.replace('%prog', me) | 114 | body = body.replace('%prog', me) |
| 117 | 115 | ||
| 118 | asciidoc_hdr = re.compile(r'^\n?([^\n]{1,})\n([=~-]{2,})$') | 116 | asciidoc_hdr = re.compile(r'^\n?#+ (.+)$') |
| 119 | for para in body.split("\n\n"): | 117 | for para in body.split("\n\n"): |
| 120 | if para.startswith(' '): | 118 | if para.startswith(' '): |
| 121 | self.write('%s', para) | 119 | self.write('%s', para) |
| @@ -125,19 +123,8 @@ Displays detailed usage information about a command. | |||
| 125 | 123 | ||
| 126 | m = asciidoc_hdr.match(para) | 124 | m = asciidoc_hdr.match(para) |
| 127 | if m: | 125 | if m: |
| 128 | title = m.group(1) | 126 | self.heading(m.group(1)) |
| 129 | section_type = m.group(2) | ||
| 130 | if section_type[0] in ('=', '-'): | ||
| 131 | p = self.heading | ||
| 132 | else: | ||
| 133 | def _p(fmt, *args): | ||
| 134 | self.write(' ') | ||
| 135 | self.heading(fmt, *args) | ||
| 136 | p = _p | ||
| 137 | |||
| 138 | p('%s', title) | ||
| 139 | self.nl() | 127 | self.nl() |
| 140 | p('%s', ''.ljust(len(title), section_type[0])) | ||
| 141 | self.nl() | 128 | self.nl() |
| 142 | continue | 129 | continue |
| 143 | 130 | ||
diff --git a/subcmds/init.py b/subcmds/init.py index 47a1c9fa..4e51dfe8 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
| @@ -67,8 +67,7 @@ resumeable bundle file on a content delivery network. This | |||
| 67 | may be necessary if there are problems with the local Python | 67 | may be necessary if there are problems with the local Python |
| 68 | HTTP client or proxy configuration, but the Git binary works. | 68 | HTTP client or proxy configuration, but the Git binary works. |
| 69 | 69 | ||
| 70 | Switching Manifest Branches | 70 | # Switching Manifest Branches |
| 71 | --------------------------- | ||
| 72 | 71 | ||
| 73 | To switch to another manifest branch, `repo init -b otherbranch` | 72 | To switch to another manifest branch, `repo init -b otherbranch` |
| 74 | may be used in an existing client. However, as this only updates the | 73 | may be used in an existing client. However, as this only updates the |
diff --git a/subcmds/status.py b/subcmds/status.py index 60e26ff4..b47c8736 100644 --- a/subcmds/status.py +++ b/subcmds/status.py | |||
| @@ -49,8 +49,7 @@ includes deeper items. For example, if dir/subdir/proj1 and | |||
| 49 | dir/subdir/proj2 are repo projects, dir/subdir/proj3 will be shown | 49 | dir/subdir/proj2 are repo projects, dir/subdir/proj3 will be shown |
| 50 | if it is not known to repo. | 50 | if it is not known to repo. |
| 51 | 51 | ||
| 52 | Status Display | 52 | # Status Display |
| 53 | -------------- | ||
| 54 | 53 | ||
| 55 | The status display is organized into three columns of information, | 54 | The status display is organized into three columns of information, |
| 56 | for example if the file 'subcmds/status.py' is modified in the | 55 | for example if the file 'subcmds/status.py' is modified in the |
diff --git a/subcmds/sync.py b/subcmds/sync.py index cda47fdd..943a0264 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -155,8 +155,7 @@ exist locally. | |||
| 155 | The --prune option can be used to remove any refs that no longer | 155 | The --prune option can be used to remove any refs that no longer |
| 156 | exist on the remote. | 156 | exist on the remote. |
| 157 | 157 | ||
| 158 | SSH Connections | 158 | # SSH Connections |
| 159 | --------------- | ||
| 160 | 159 | ||
| 161 | If at least one project remote URL uses an SSH connection (ssh://, | 160 | If at least one project remote URL uses an SSH connection (ssh://, |
| 162 | git+ssh://, or user@host:path syntax) repo will automatically | 161 | git+ssh://, or user@host:path syntax) repo will automatically |
| @@ -170,8 +169,7 @@ environment variable to 'ssh'. For example: | |||
| 170 | export GIT_SSH=ssh | 169 | export GIT_SSH=ssh |
| 171 | %prog | 170 | %prog |
| 172 | 171 | ||
| 173 | Compatibility | 172 | # Compatibility |
| 174 | ~~~~~~~~~~~~~ | ||
| 175 | 173 | ||
| 176 | This feature is automatically disabled on Windows, due to the lack | 174 | This feature is automatically disabled on Windows, due to the lack |
| 177 | of UNIX domain socket support. | 175 | of UNIX domain socket support. |
diff --git a/subcmds/upload.py b/subcmds/upload.py index d12efd1a..02b43b40 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
| @@ -78,8 +78,7 @@ added to the respective list of users, and emails are sent to any | |||
| 78 | new users. Users passed as --reviewers must already be registered | 78 | new users. Users passed as --reviewers must already be registered |
| 79 | with the code review system, or the upload will fail. | 79 | with the code review system, or the upload will fail. |
| 80 | 80 | ||
| 81 | Configuration | 81 | # Configuration |
| 82 | ------------- | ||
| 83 | 82 | ||
| 84 | review.URL.autoupload: | 83 | review.URL.autoupload: |
| 85 | 84 | ||
| @@ -126,8 +125,7 @@ is set to "true" then repo will assume you always want the equivalent | |||
| 126 | of the -t option to the repo command. If unset or set to "false" then | 125 | of the -t option to the repo command. If unset or set to "false" then |
| 127 | repo will make use of only the command line option. | 126 | repo will make use of only the command line option. |
| 128 | 127 | ||
| 129 | References | 128 | # References |
| 130 | ---------- | ||
| 131 | 129 | ||
| 132 | Gerrit Code Review: https://www.gerritcodereview.com/ | 130 | Gerrit Code Review: https://www.gerritcodereview.com/ |
| 133 | 131 | ||
