Merged Anton Batenev's report of Nicolas Alvarez' unicode-in-be-new bug
[be.git] / .be / bea86499-824e-4e77-b085-2d581fa9ccab / bugs / 496edad5-1484-413a-bc68-4b01274a65eb / comments / 8d927822-eff9-42c4-9541-8b784b3f7db2 / body
1 I was having problems with `python test.py bugdir` with the Arch
2 backend.  Commits were failing with `archive not registered'.
3
4 Adding some trace information to arch.Arch._rcs_init() and
5 ._rcs_cleanup() (the traceback module is great :p), I found
6 that the problem was coming from bugdir.BugDir.guess_rcs().
7
8 The Arch backend deletes any auto-created archives when it is cleaned
9 up (RCS.__del__ -> RCS.cleanup -> Arch._rcs_cleanup).  This means that
10 whatever instance is used to init the archive in guess_rcs() must be
11 kept around.  I had been doing:
12   * installed_rcs() -> Arch-instance-A
13   * Arch-instance-A.init()
14   * store Arch-instnance-A.name as bugdir.rcs_name
15   * future calls to bugdir.rcs get new instance Arch-instance-B
16   * eventually Arch-instance-A cleaned up
17   * archive dissapears & tests crash
18
19 I switched things around so .rcs is the `master attribute' and
20 .rcs_name follows it.  Now just save whichever rcs you used to init
21 your archive as .rcs.
22
23 In order to implement the fix, I had to tweak the memory/file-system
24 interaction a bit.  Instead of saving the settings *every*time* a
25 setting_property changed, we now save only if the .be file exists.
26 This file serves as a 'file-system-bugdir-active' flag.  Before it is
27 created (e.g., by a .save()), the BugDir lives purely in memory, and
28 can freely go about configuring .rcs, .rcs_name, etc until it get's
29 to the point where it's ready to go to disk.