Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions oca_port/migrate_addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,13 @@ def run(self):
def _checkout_base_branch(self):
# Ensure to not start to work from a working branch
if self.app.to_branch.name in self.app.repo.heads:
self.app.repo.heads[self.app.to_branch.name].checkout()
self.app.repo.heads[self.app.to_branch.name].checkout(
"--recurse-submodules",
)
else:
self.app.repo.git.checkout(
"--no-track",
"--recurse-submodules",
"-b",
self.app.to_branch.name,
self.app.to_branch.ref(),
Expand All @@ -205,7 +208,11 @@ def _create_mig_branch(self):
f"from {self.app.to_branch.ref()}..."
)
self.app.repo.git.checkout(
"--no-track", "-b", self.mig_branch.name, self.app.to_branch.ref()
"--no-track",
"--recurse-submodules",
"-b",
self.mig_branch.name,
self.app.to_branch.ref(),
)
return create_branch

Expand Down
15 changes: 12 additions & 3 deletions oca_port/port_addon_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,28 @@ def _port_pull_requests(self, branches_diff):
if self.app.repo.active_branch.name == dest_branch_name:
# We cannot delete an active branch, checkout the underlying
# commit instead
self.app.repo.git.checkout(dest_commit)
self.app.repo.git.checkout(
"--recurse-submodules",
dest_commit,
)
self.app.repo.delete_head(dest_branch_name, "-f")
dest_branch_exists = False
# Clear any ongoing work from the session
session = self._init_session()
session.clear()
if not dest_branch_exists:
self.app.repo.git.checkout(
"--no-track", "-b", dest_branch_name, base_ref.ref()
"--no-track",
"--recurse-submodules",
"-b",
dest_branch_name,
base_ref.ref(),
)
# Checkout the destination branch before porting PRs
dest_branch = g.Branch(self.app.repo, dest_branch_name)
self.app.repo.heads[dest_branch.name].checkout()
self.app.repo.heads[dest_branch.name].checkout(
"--recurse-submodules",
)
last_pr = (
list(branches_diff.commits_diff["addon"].keys())[-1]
if branches_diff.commits_diff["addon"]
Expand Down