Skip to content

Commit

Permalink
Fix using qisrc checkout after qisrc init --no-review (#29790)
Browse files Browse the repository at this point in the history
Change-Id: I3f056b5af49b8077b58d96e348e6d2d58ccbf7f5
Reviewed-on: http://gerrit.aldebaran.lan/60414
Tested-by: gerrit
Reviewed-by: dmerejkowsky <dmerejkowsky@aldebaran-robotics.com>
  • Loading branch information
dmerejkowsky committed Aug 27, 2015
1 parent d28e438 commit 3787768
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/source/changes/3.10.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ qisrc
(Previously you could run ``qisrc push --all``, but that was
deemed to dangerous)
* ``qisrc push`` displays reviewers before notifying them.
* Fix using ``qisrc checkout`` after ``qisrc init --no-review``

qitoolchain
-----------
Expand Down
8 changes: 7 additions & 1 deletion python/qisrc/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,16 @@ def dump_manifest(self):
qisys.qixml.write(xml, self.manifest_xml)

def configure_manifest(self, url, branch="master", groups=None,
ref=None, review=True, force=False):
ref=None, review=None, force=False):
""" Add a manifest to the list. Will be stored in
.qi/manifests/<name>
"""
if review is None:
# not set explicitely by the user,
# (i.e not from qisrc init --no-review)
# read it from the config
review = self.manifest.review
self.old_repos = self.get_old_repos()
self.manifest.url = url
self.manifest.groups = groups
Expand All @@ -145,6 +150,7 @@ def configure_manifest(self, url, branch="master", groups=None,
self.manifest.review = review
res = self.sync_repos(force=force)
self.configure_projects()
self.dump_manifest()
return res

def read_remote_manifest(self, manifest_xml=None):
Expand Down
9 changes: 9 additions & 0 deletions python/qisrc/test/test_qisrc_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,12 @@ def test_relative_path(qisrc_action, tmpdir):
git.commit("-m", "Initial commit")
qisrc_action("init", os.path.relpath(tmpdir.strpath))
assert os.path.isfile(os.path.join(".qi", "manifests", "default", "manifest.xml"))

def test_using_checkout_after_no_review(qisrc_action, git_server):
git_server.create_repo("foo", review=True)
qisrc_action("init", git_server.manifest_url, "--no-review")
git_server.switch_manifest_branch("devel")
qisrc_action("checkout", "devel")
git_worktree = TestGitWorkTree()
foo = git_worktree.get_git_project("foo")
assert not foo.review
2 changes: 1 addition & 1 deletion python/qisrc/worktree.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, worktree):
self._syncer = qisrc.sync.WorkTreeSyncer(self)

def configure_manifest(self, manifest_url, groups=None,
branch="master", ref=None, review=True, force=False):
branch="master", ref=None, review=None, force=False):
""" Add a new manifest to this worktree """
return self._syncer.configure_manifest(manifest_url, groups=groups,
branch=branch, ref=ref, review=review,
Expand Down

0 comments on commit 3787768

Please sign in to comment.