No API to create a branch reference without opening it
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
The code to create a branch reference on disk is in bzrlib.
For testing, it is sometimes desirable to create a branch reference that cannot be opened (e.g. pointing to http://
Currently, bzrlib does not provide a way to create a branch reference on disk without opening it. The two options I can see are: 1. reimplementing branch reference creation in the test code 2. subclassing BranchReference
Both solutions are hackish.
Extracting the branch reference creation code into BranchReference
Changed in bzr: | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
tags: | added: tech-debt |
Changed in bzr: | |
status: | Triaged → Confirmed |
tags: | added: check-for-breezy |
> Currently, bzrlib does not provide a way to create a branch reference on Format and overriding open() to be a no-op, so
> disk without opening it. The two options I can see are: 1.
> reimplementing branch reference creation in the test code 2. subclassing
> BranchReference
> initialize() do not actually open the reference.
>
> Both solutions are hackish.
Another temporary solution would be to call the current code, and
expect that it will fail after creating the reference but before
opening the refererent. I haven't checked that works, but it's
probably cleaner than the alternatives.
> Extracting the branch reference creation code into Format. initialize_ without_ opening would solve this
> BranchReference
> problem.
That sounds good to me; patch welcome.
--
Martin