diff options
author | Raman Tenneti <rtenneti@google.com> | 2021-08-13 11:47:24 -0700 |
---|---|---|
committer | Raman Tenneti <rtenneti@google.com> | 2021-08-13 20:07:40 +0000 |
commit | b55769a5c9422e0aac532e901a4d7b5af834b34d (patch) | |
tree | 3c19999b962d6f4e0de02e4585ae99c949d82117 /tests | |
parent | 5637afcc60fdbd38fc0790ea84d5dcb901ec5959 (diff) | |
download | git-repo-b55769a5c9422e0aac532e901a4d7b5af834b34d.tar.gz |
superproject: print messages if the manifest has superproject tag.v2.16.5
1) If the manifest has superproject tag (git_master, etc), then
display error/warning messages (as it is doing today)
2) If the manifest doesn't have superproject tag (nest, chromeos
manifests), then don't display any error/warning messages about
superrproject (behave as though user has specified
--no-use-superproject).
3) Print error/warning messages if --use-superproject passed as
argument to repo sync.
4) No change in behavior for the repo init command.
git_superproject.py:
+ Fixed typo in _WriteManifestFile method name
+ Superproject accepts print_message as an argument and it defaults
to True. All messages that are printed to stderr are controlled by
this flag. If it is True, then messages get printed.
+ Added PrintMessages function which return true if either
--use-superproject is specified on the command line or if the
manifest has a superproject tag.
sync.py:
+ Displays the warning message if PrintMessgages are enabled and
passes that as argument to superproject object.
+ Added 'hassuperprojecttag' trace2 log entry for analysis. We can
find users/branches that are using superproject, but the manifest is
missing the superproject tag.
Tested:
$ ./run_tests
+ Verified printing of messages with and without superproject tag, with
with --use-superproject option.
+ aosp-master
$ repo_dev init --use-superproject -u https://android.googlesource.com/platform/manifest
$ repo_dev sync
+ A manifest without superproject tag.
$ repo_dev init -m $(pwd)/manifest_7482982.xml
$ repo_dev sync -n -c -j32 -m $(pwd)/manifest_7482982.xml
Bug: [google internal] b/196411099
Change-Id: I92166dcad15a4129fab82edcf869e7c8db3efd4b
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/314982
Reviewed-by: Xin Li <delphij@google.com>
Tested-by: Raman Tenneti <rtenneti@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fixtures/test.gitconfig | 4 | ||||
-rw-r--r-- | tests/test_git_superproject.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/fixtures/test.gitconfig b/tests/fixtures/test.gitconfig index d69e162c..90afff04 100644 --- a/tests/fixtures/test.gitconfig +++ b/tests/fixtures/test.gitconfig | |||
@@ -12,10 +12,10 @@ | |||
12 | intm = 10m | 12 | intm = 10m |
13 | intg = 10g | 13 | intg = 10g |
14 | [repo "syncstate.main"] | 14 | [repo "syncstate.main"] |
15 | synctime = 2021-08-11T17:54:14.530286Z | 15 | synctime = 2021-08-13T18:37:43.928600Z |
16 | version = 1 | 16 | version = 1 |
17 | [repo "syncstate.sys"] | 17 | [repo "syncstate.sys"] |
18 | argv = ['/usr/bin/pytest-3', '-v'] | 18 | argv = ['/usr/bin/pytest-3'] |
19 | [repo "syncstate.superproject"] | 19 | [repo "syncstate.superproject"] |
20 | test = false | 20 | test = false |
21 | [repo "syncstate.options"] | 21 | [repo "syncstate.options"] |
diff --git a/tests/test_git_superproject.py b/tests/test_git_superproject.py index 6ff81843..e9b824d6 100644 --- a/tests/test_git_superproject.py +++ b/tests/test_git_superproject.py | |||
@@ -203,7 +203,7 @@ class SuperprojectTestCase(unittest.TestCase): | |||
203 | project.SetRevisionId('ABCDEF') | 203 | project.SetRevisionId('ABCDEF') |
204 | # Create temporary directory so that it can write the file. | 204 | # Create temporary directory so that it can write the file. |
205 | os.mkdir(self._superproject._superproject_path) | 205 | os.mkdir(self._superproject._superproject_path) |
206 | manifest_path = self._superproject._WriteManfiestFile() | 206 | manifest_path = self._superproject._WriteManifestFile() |
207 | self.assertIsNotNone(manifest_path) | 207 | self.assertIsNotNone(manifest_path) |
208 | with open(manifest_path, 'r') as fp: | 208 | with open(manifest_path, 'r') as fp: |
209 | manifest_xml_data = fp.read() | 209 | manifest_xml_data = fp.read() |