Skip to content

[IMP] code: save the repository given on the command line - #8

Merged
brinkflew merged 1 commit into
betafrom
avs-link-repository
Aug 27, 2026
Merged

[IMP] code: save the repository given on the command line#8
brinkflew merged 1 commit into
betafrom
avs-link-repository

Conversation

@brinkflew

Copy link
Copy Markdown
Contributor

Description

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. That
invocation 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 entry
point odev database --set-repo uses, so it is normalized and stored once — repository names, HTTPS
and SSH URLs and paths to local clones all end up as organization/repository — and every command
relying on the link picks it up. Editor.__init__ still receives the same argument and behaves
identically.

Note for reviewers

Merge odoo-odev/odev#107 first. It adds LocalDatabase.link_repository, and nothing here
enforces that: the plugin declares no dependency and pins no core version, so on an older odev this
would raise AttributeError the 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 is
covered on the core side, where link_repository is tested against names, HTTPS and SSH URLs and
against a database that has no row in the data store.

Linked Issues

Compliance

  • I have read the contribution guide
  • I made sure the documentation is up-to-date both in doctrings and the docs directory
  • I have added or modified unit tests where necessary — this repository has no test suite
  • I have added new libraries to the requirements.txt file, if any
  • I have incremented the version number according the versioning guide
  • The PR contains my changes only and no other external commit

🤖 Generated with Claude Code

https://claude.ai/code/session_01K8csZBrrBYp8oqH5paxTAm

`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
@brinkflew
brinkflew merged commit 56abe14 into beta Aug 27, 2026
@brinkflew
brinkflew deleted the avs-link-repository branch August 27, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants