<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools/git-repo.git/tests/test_subcmds_sync.py, branch v2.34</title>
<subtitle>Mirror of gerrit.googlesource.com/git-repo</subtitle>
<id>https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.34</id>
<link rel='self' href='https://git.enea.com/cgit/tools/git-repo.git/atom?h=v2.34'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/'/>
<updated>2023-03-22T17:46:28+00:00</updated>
<entry>
<title>Format codebase with black and check formatting in CQ</title>
<updated>2023-03-22T17:46:28+00:00</updated>
<author>
<name>Gavin Mak</name>
<email>gavinmak@google.com</email>
</author>
<published>2023-03-11T06:46:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=ea2e330e43c182dc16b0111ebc69ee5a71ee4ce1'/>
<id>urn:sha1:ea2e330e43c182dc16b0111ebc69ee5a71ee4ce1</id>
<content type='text'>
Apply rules set by https://gerrit-review.googlesource.com/c/git-repo/+/362954/ across the codebase and fix any lingering errors caught
by flake8. Also check black formatting in run_tests (and CQ).

Bug: b/267675342
Change-Id: I972d77649dac351150dcfeb1cd1ad0ea2efc1956
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/363474
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
Tested-by: Gavin Mak &lt;gavinmak@google.com&gt;
Commit-Queue: Gavin Mak &lt;gavinmak@google.com&gt;
</content>
</entry>
<entry>
<title>sync: fix manifest sync-j handling</title>
<updated>2022-12-08T15:06:24+00:00</updated>
<author>
<name>Mike Frysinger</name>
<email>vapier@google.com</email>
</author>
<published>2022-12-07T14:41:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=f159ce0f9ef5bce5a4866a677f0534e3b45a80e2'/>
<id>urn:sha1:f159ce0f9ef5bce5a4866a677f0534e3b45a80e2</id>
<content type='text'>
Since --jobs defaults to 0, not None, we never pull the value out
of the manifest.  Treat values of 0 and None the same to fix.

Bug: http://b/239712300
Bug: http://b/260908907
Change-Id: I9b1026682072366616825fd72f90bd90c10a252f
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/354254
Tested-by: Mike Frysinger &lt;vapier@google.com&gt;
Reviewed-by: Josip Sokcevic &lt;sokcevic@google.com&gt;
Reviewed-by: Sam Saccone &lt;samccone@google.com&gt;
</content>
</entry>
<entry>
<title>sync: clear preciousObjects when set in error.</title>
<updated>2022-11-03T23:01:16+00:00</updated>
<author>
<name>LaMont Jones</name>
<email>lamontjones@google.com</email>
</author>
<published>2022-11-02T22:01:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=fa8d939c8f6a3d25d9a203f28b16a71d891dcc1c'/>
<id>urn:sha1:fa8d939c8f6a3d25d9a203f28b16a71d891dcc1c</id>
<content type='text'>
If this is a project that is not using object sharing (there is only one
copy of the remote project) then clear preciousObjects.

To override this for a project, run:

  git config --replace-all repo.preservePreciousObjects true

Change-Id: If3ea061c631c5ecd44ead84f68576012e2c7405c
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/350235
Reviewed-by: Jonathan Nieder &lt;jrn@google.com&gt;
Tested-by: LaMont Jones &lt;lamontjones@google.com&gt;
</content>
</entry>
<entry>
<title>sync: refactor use of self.manifest</title>
<updated>2022-04-14T22:24:04+00:00</updated>
<author>
<name>LaMont Jones</name>
<email>lamontjones@google.com</email>
</author>
<published>2022-04-07T21:57:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=a46047a822ad13738af9b17a524a0bd483b98033'/>
<id>urn:sha1:a46047a822ad13738af9b17a524a0bd483b98033</id>
<content type='text'>
We need to iterate over multiple manifests, and generally use the
outer_client.manifest for multi-manifest support.  This refactors the
use of self.manifest into a chosen manifest.

Change-Id: I992f21d610c929675e99555ece9c38df4b635839
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334699
Tested-by: LaMont Jones &lt;lamontjones@google.com&gt;
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
<entry>
<title>sync: respect `sync-c` manifest option</title>
<updated>2022-04-08T21:06:37+00:00</updated>
<author>
<name>Daniel Andersson</name>
<email>daniel.r.andersson@volvocars.com</email>
</author>
<published>2022-04-01T10:55:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/tools/git-repo.git/commit/?id=d52ca421d52c75837d1614ec54549569f354b7ec'/>
<id>urn:sha1:d52ca421d52c75837d1614ec54549569f354b7ec</id>
<content type='text'>
The documentation states that a `sync-c` attribute in the manifest file
can set a default for whether only the current branch should be fetched
or all branches. This seems to have been broken for some time.

Commit 7356114 introduced the `--no-current-branch` CLI option and
relied on getting `None` via `optparse` if neither `--current-branch`
nor `--no-current-branch` was set to distinguish it from a boolean
value. If `None` was received, it would read the value from the manifest
option `sync-c`. The parsing went through the utility function
`_GetCurrentBranchOnly` which returned `True` if `--current-branch` had
been given on the command-line, or fell back on the "superproject"
setting, which would either return `True` or `None`. This would
incorrectly make `repo` fall back to the manifest setting even if the
user had given `--no-current-branch` if no superproject was requested --
the manifest became "too powerful":

Command-line         Using superproject  → `current_branch_only`
------------         ------------------  -----------------------
                     No                  From manifest
                     Yes                 True
--current-branch     No                  True
--current-branch     Yes                 True
--no-current-branch  No                  From manifest ← wrong
--no-current-branch  Yes                 True

In commit 0cb6e92 the superproject configuration value reading changed
from something that could return `None` to something that always
returned a boolean. If it returned `False`, this would then incorrectly
make `repo` ignore the manifest option even if neither
`--current-branch` nor `--no-current-branch` had been given. The
manifest default became useless:

Command-line         Using superproject  → `current_branch_only`
------------         ------------------  -----------------------
                     No                  False ← wrong
                     Yes                 True
--current-branch     No                  True
--current-branch     Yes                 True
--no-current-branch  No                  False
--no-current-branch  Yes                 True

By swapping the order in which the command-line option target and the
superproject setting is evaluated, things should work as documented:

Command-line         Using superproject  → `current_branch_only`
------------         ------------------  -----------------------
                     No                  From manifest
                     Yes                 True
--current-branch     No                  True
--current-branch     Yes                 True
--no-current-branch  No                  False
--no-current-branch  Yes                 True

Change-Id: I933c232d2fbecc6b9bdc364ebac181798bce9175
Tested-by: Daniel Andersson &lt;daniel.r.andersson@volvocars.com&gt;
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/334270
Reviewed-by: Mike Frysinger &lt;vapier@google.com&gt;
</content>
</entry>
</feed>
