Skip to content
Snippets Groups Projects
Commit f716863d authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

upgrade-reference: add an explicit test about updating format

This test will come handy as we modify the script more.
parent 5b587afd
No related branches found
No related tags found
No related merge requests found
......@@ -154,3 +154,43 @@
$ tar tf my-source-repo-*-partial-same.tar --wildcards '*/.hg/requires'
my-source-repo-39241d24-partial-same/.hg/requires
Check that missing format entry get updated
-------------------------------------------
remove a format entry from the file
$ benchrepofile=`tar tf my-source-repo-*-reference.tar | grep '.benchrepo$'`
$ tar xf my-source-repo-*-reference.tar $benchrepofile
$ grep -v "fncache: true" $benchrepofile > tmp
$ mv tmp $benchrepofile
$ tar --delete --file my-source-repo-*-reference.tar $benchrepofile
$ tar --append --file my-source-repo-*-reference.tar $benchrepofile
The upgrade script should add the missing entry again
$ tar xf my-source-repo-*-reference.tar --to-stdout $benchrepofile | grep fnache
[1]
$ upgrade-reference my-source-repo-*-reference.tar ../p-config.yaml
Extracting the tar.
Reading the original benchrepo file.
Gathering the new benchrepo data.
Archiving the new benchrepo file.
Writing the new reference tar as my-source-repo-*-reference.tar (glob)
Skipping copy of my-source-repo-*-partial-missing-last-10.tar, not present in reference archive directory (glob)
Skipping copy of my-source-repo-*-partial-same.tar, it already has the right file name (glob)
Directory name inside my-source-repo-*-partial-same.tar is correct (glob)
Removing the temporary directory.
$ tar xf my-source-repo-*-reference.tar --to-stdout $benchrepofile
reference-repo:
format-info:
compression: zlib
compression-level: default
dotencode: true
fncache: true
generaldelta: true
plain-cl-delta: true
sparserevlog: true
id: my-source-repo
repo-prefix: my-source-repo-* (glob)
source: some-dir/my-source-repo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment