[IMP] code: save the repository given on the command line - #8
Merged
Conversation
`odev code <database> <repository>` opened the project for that repository but did not record it, so the next `odev code <database>` had lost the link and had to be given the repository again. The repository is now linked to the database through `LocalDatabase.link_repository`, the same entry point `odev database --set-repo` uses, so it is normalized and saved once and every command relying on the link picks it up. Requires odev 4.30.0 for `LocalDatabase.link_repository`. Closes odoo-odev/odev#101
6 tasks
sea-odoo
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
odev code <database> <repository>opened the project for that repository but did not record it, sothe next
odev code <database>had lost the link and had to be given the repository again. Thatinvocation is what odoo-odev/odev#101 reports; the error the issue was filed for is already gone,
removed by abd6288, and what is left is the missing persistence.
The repository is now linked to the database through
LocalDatabase.link_repository, the same entrypoint
odev database --set-repouses, so it is normalized and stored once — repository names, HTTPSand SSH URLs and paths to local clones all end up as
organization/repository— and every commandrelying on the link picks it up.
Editor.__init__still receives the same argument and behavesidentically.
Note for reviewers
Merge odoo-odev/odev#107 first. It adds
LocalDatabase.link_repository, and nothing hereenforces that: the plugin declares no dependency and pins no core version, so on an older odev this
would raise
AttributeErrorthe first time a repository is passed. Requires odev 4.30.0.No test is added because this repository has no test suite yet —
tests/is empty. The behaviour iscovered on the core side, where
link_repositoryis tested against names, HTTPS and SSH URLs andagainst a database that has no row in the data store.
Linked Issues
Compliance
docsdirectoryrequirements.txtfile, if any🤖 Generated with Claude Code
https://claude.ai/code/session_01K8csZBrrBYp8oqH5paxTAm