-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] add option rename-to to allow rename addon #64
base: main
Are you sure you want to change the base?
Conversation
dc1f63f
to
f5d3ad4
Compare
or ( | ||
self.app.rename_to | ||
and MIG_BRANCH_NAME.format( | ||
branch=self.app.target_version, addon=self.app.rename_to | ||
) | ||
) | ||
or MIG_BRANCH_NAME.format( | ||
branch=self.app.target_version, addon=self.app.addon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could do:
or ( | |
self.app.rename_to | |
and MIG_BRANCH_NAME.format( | |
branch=self.app.target_version, addon=self.app.rename_to | |
) | |
) | |
or MIG_BRANCH_NAME.format( | |
branch=self.app.target_version, addon=self.app.addon | |
or MIG_BRANCH_NAME.format( | |
branch=self.app.target_version, addon=(self.app.rename_to or self.app.addon) |
addons_tree /= str(self.app.addons_rootdir) | ||
branch_addons = [t.path for t in addons_tree.trees] | ||
|
||
if str(self.app.rename_to) in branch_addons: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could remove the call to str
no? Here rename_to
is defined, it should be a string.
if str(self.app.rename_to) in branch_addons: | |
if self.app.rename_to in branch_addons: |
@@ -66,6 +66,26 @@ | |||
f"\t\t=> {bc.BOLD}" "{new_pr_url}" f"{bc.END}", | |||
] | |||
) | |||
RENAME_TIPS = "\n".join( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored the way tips are printed so it's more extendable and maintainable: #65
This RENAME_TIPS
can be replaced by a MIG_RENAMED_TIPS
with required steps once it's merged.
def _rename_module(self): | ||
if self.app.rename_to: | ||
try: | ||
import git_filter_repo as fr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember a command that was in the OCA documentation in the past to rework history to rename a module, I can't find it anymore...
I tend to reduce the dependencies if possible, especially if a git command can do the job.
Keep this lib for now, I still didn't test your PR :)
And for such feature (renaming a module), we can consider it as required, so such dependency should be in the pyproject.toml
(and try/except
block can be removed).
Thanks for this work 🙏 I wanted to start working on it yesterday and saw your PR 🎉 I'll test it soon |
This change