diff options
| author | Peter Kjellerstedt <pkj@axis.com> | 2025-11-08 00:06:16 +0100 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2025-11-26 02:07:35 -0800 |
| commit | 412367bfafd9de014cfeb37475e0f97b1f6a2509 (patch) | |
| tree | 100e674dea649546145dbb81532a8f432cc09f52 /docs | |
| parent | 47c24b5c4092ce397c94c05d8686c8bcac64fbb2 (diff) | |
| download | git-repo-412367bfafd9de014cfeb37475e0f97b1f6a2509.tar.gz | |
project: Use dicts to keep track of copyfiles and linkfiles
This avoids copying/linking the same file/link multiple times if a
copyfile/linkfile element with the same values has been specifed
multiple times. This can happen when including a common manifest that
uses an extend-project element that has a copyfile/linkfile element.
This uses dicts rather than sets to store the copyfiles and linkfiles to
make sure the order they are specified in the manifest is maintained.
For Python 3.7+, maintaining the order that keys are added to dicts is
guaranteed, and for Python 3.6 it happened to be true.
The _CopyFile class and the _LinkFile class are changed to inherit from
NamedTuple to be able to store them in dicts.
Change-Id: I9f5a80298b875251a81c5fe7d353e262d104fae4
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/525322
Reviewed-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/manifest-format.md | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/docs/manifest-format.md b/docs/manifest-format.md index d1a11cc9..42e1ab18 100644 --- a/docs/manifest-format.md +++ b/docs/manifest-format.md | |||
| @@ -453,10 +453,14 @@ Intermediate paths must not be symlinks either. | |||
| 453 | 453 | ||
| 454 | Parent directories of "dest" will be automatically created if missing. | 454 | Parent directories of "dest" will be automatically created if missing. |
| 455 | 455 | ||
| 456 | The files are copied in the order they are specified in the manifests. | ||
| 457 | If multiple elements specify the same source and destination, they will | ||
| 458 | only be applied as one, based on the first occurence. Files are copied | ||
| 459 | before any links specified via linkfile elements are created. | ||
| 460 | |||
| 456 | ### Element linkfile | 461 | ### Element linkfile |
| 457 | 462 | ||
| 458 | It's just like copyfile and runs at the same time as copyfile but | 463 | It's just like copyfile, but instead of copying it creates a symlink. |
| 459 | instead of copying it creates a symlink. | ||
| 460 | 464 | ||
| 461 | The symlink is created at "dest" (relative to the top of the tree) and | 465 | The symlink is created at "dest" (relative to the top of the tree) and |
| 462 | points to the path specified by "src" which is a path in the project. | 466 | points to the path specified by "src" which is a path in the project. |
| @@ -466,6 +470,11 @@ Parent directories of "dest" will be automatically created if missing. | |||
| 466 | The symlink target may be a file or directory, but it may not point outside | 470 | The symlink target may be a file or directory, but it may not point outside |
| 467 | of the repo client. | 471 | of the repo client. |
| 468 | 472 | ||
| 473 | The links are created in the order they are specified in the manifests. | ||
| 474 | If multiple elements specify the same source and destination, they will | ||
| 475 | only be applied as one, based on the first occurence. Links are created | ||
| 476 | after any files specified via copyfile elements are copied. | ||
| 477 | |||
| 469 | ### Element remove-project | 478 | ### Element remove-project |
| 470 | 479 | ||
| 471 | Deletes a project from the internal manifest table, possibly | 480 | Deletes a project from the internal manifest table, possibly |
