summaryrefslogtreecommitdiffstats
path: root/docs/manifest-format.md
diff options
context:
space:
mode:
authorPeter Kjellerstedt <pkj@axis.com>2025-11-08 00:06:16 +0100
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2025-11-26 02:07:35 -0800
commit412367bfafd9de014cfeb37475e0f97b1f6a2509 (patch)
tree100e674dea649546145dbb81532a8f432cc09f52 /docs/manifest-format.md
parent47c24b5c4092ce397c94c05d8686c8bcac64fbb2 (diff)
downloadgit-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/manifest-format.md')
-rw-r--r--docs/manifest-format.md13
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
454Parent directories of "dest" will be automatically created if missing. 454Parent directories of "dest" will be automatically created if missing.
455 455
456The files are copied in the order they are specified in the manifests.
457If multiple elements specify the same source and destination, they will
458only be applied as one, based on the first occurence. Files are copied
459before any links specified via linkfile elements are created.
460
456### Element linkfile 461### Element linkfile
457 462
458It's just like copyfile and runs at the same time as copyfile but 463It's just like copyfile, but instead of copying it creates a symlink.
459instead of copying it creates a symlink.
460 464
461The symlink is created at "dest" (relative to the top of the tree) and 465The symlink is created at "dest" (relative to the top of the tree) and
462points to the path specified by "src" which is a path in the project. 466points 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.
466The symlink target may be a file or directory, but it may not point outside 470The symlink target may be a file or directory, but it may not point outside
467of the repo client. 471of the repo client.
468 472
473The links are created in the order they are specified in the manifests.
474If multiple elements specify the same source and destination, they will
475only be applied as one, based on the first occurence. Links are created
476after any files specified via copyfile elements are copied.
477
469### Element remove-project 478### Element remove-project
470 479
471Deletes a project from the internal manifest table, possibly 480Deletes a project from the internal manifest table, possibly