aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/bugdir.py
Commit message (Collapse)AuthorAgeFilesLines
* Bumped to version 1.0.01.0.0Chris Ball2011-01-081-1/+1
|
* Ran update_copyright.pyW. Trevor King2010-06-221-12/+13
|
* Fixed docstrings so only Sphinx errors are "autosummary" and "missing attribute"W. Trevor King2010-02-071-31/+16
|
* Use numpydoc and generate-libbe-txt.py to autogenerate API documentationW. Trevor King2010-02-061-1/+1
|
* Added bugdir and comment modules to Sphinx docsW. Trevor King2010-02-061-5/+7
|
* Always load settings when initializing BugDir from storage.W. Trevor King2010-01-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoids problems like: $ be html Traceback (most recent call last): File "be", line 21, in <module> sys.exit(libbe.ui.command_line.main()) File ".../libbe/ui/command_line.py", line 327, in main ret = dispatch(ui, command, args) File ".../libbe/ui/command_line.py", line 267, in dispatch ret = ui.run(command, options, args) File ".../libbe/command/base.py", line 504, in run return command.run(options, args) File ".../libbe/command/base.py", line 233, in run self.status = self._run(**params) File ".../libbe/command/html.py", line 111, in _run html_gen.run(params['output']) File ".../libbe/command/html.py", line 154, in run bugs.sort() File ".../libbe/bug.py", line 261, in __cmp__ return cmp_full(self, other) File ".../libbe/bug.py", line 818, in __call__ val = comparison(bug_1, bug_2) File ".../libbe/bug.py", line 750, in cmp_status return cmp(status_index[bug_1.status], status_index[bug_2.status]) File ".../libbe/storage/util/properties.py", line 223, in _fget raise ValueCheckError(name, value, value_allowed_fn) libbe.storage.util.properties.ValueCheckError: open-feature not allowed by <function <lambda> at 0x84b610c> for status
* Move BugDir, Bug, and Comment to new _setup_saved_settingsW. Trevor King2010-01-221-2/+2
|
* Minor cleanups + remove debuging line in Init doctestW. Trevor King2010-01-221-1/+0
|
* Reworked settings_object module, but command.init tests still fail:W. Trevor King2010-01-221-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ python test.py libbe.command.init Doctest: libbe.command.init.Init ... FAIL ... ----------------------- File ".../libbe/command/init.py", line 47, in libbe.command.init.Init Failed example: ui.run(cmd) Exception raised: Traceback (most recent call last): ... File "/tmp/be.wtk/libbe/command/init.py", line 97, in _run bd = libbe.bugdir.BugDir(storage, from_storage=False) File "/tmp/be.wtk/libbe/bugdir.py", line 185, in __init__ self.save() File "/tmp/be.wtk/libbe/bugdir.py", line 228, in save self.save_settings() File "/tmp/be.wtk/libbe/bugdir.py", line 204, in save_settings mf = mapfile.generate(self._get_saved_settings()) File "/tmp/be.wtk/libbe/storage/util/settings_object.py", line 230, in _get_saved_settings self, self._setting_name_to_attr_name(k)) File "/tmp/be.wtk/libbe/storage/util/properties.py", line 194, in _fget value = fget(self) File "/tmp/be.wtk/libbe/storage/util/properties.py", line 329, in _fget primer(self) File "/tmp/be.wtk/libbe/storage/util/settings_object.py", line 69, in prop_load_settings self.load_settings() File "/tmp/be.wtk/libbe/bugdir.py", line 194, in load_settings self.settings = mapfile.parse(settings_mapfile) File "/tmp/be.wtk/libbe/storage/util/mapfile.py", line 123, in parse c = yaml.load(contents) ... File "/usr/lib/python2.6/site-packages/yaml/reader.py", line 213, in update_raw data = self.stream.read(size) AttributeError: 'NoneType' object has no attribute 'read' ...
* Fix _uuids_cache reset in BugDir._clear_bugsW. Trevor King2010-01-211-1/+2
|
* Add _uuids_cache management to BugDir._clear_bugsW. Trevor King2010-01-211-0/+1
|
* Fix BugDir._uuid_cache management for new_bug()/remove_bug().W. Trevor King2010-01-201-0/+4
| | | | | Initial implementation in wking@drexel.edu-20100120192451-j206hn1s78u9a3ys missed them.
* Optimized BugDir.uuids, caching on-disk bug uuids.W. Trevor King2010-01-201-13/+10
| | | | | | | | | | | | | | Output of python -m cProfile -o profile be list python -c "import pstats; p=pstats.Stats('profile'); p.sort_stats('cumulative').print_stats()" on my slow netbook before optimization: ncalls tottime percall cumtime percall filename:lineno(function) 10290 0.417 0.000 10.832 0.001 libbe/bugdir.py:237(uuids) after optimization: 105 0.063 0.001 0.250 0.002 libbe/bugdir.py:237(uuids) The old generator produced many more calls than the new implementation, but the number of calls was not the source of the slowdown (data not shown ;).
* Optimized libbe.diff.Diff._changed when old bugdir is a RevisionedBugDirW. Trevor King2010-01-181-47/+11
|
* Moved BugDir.duplicate_bugdir to RevisionedBugDir classW. Trevor King2010-01-181-11/+18
|
* Updated copyright informationW. Trevor King2010-01-011-1/+1
|
* Fixed up the completion helpers in libbe.command.utilW. Trevor King2009-12-291-7/+11
| | | | | | | | | | This entailed a fairly thorough cleanup of libbe.util.id. Remaining unimplemented completion helpers: * complete_assigned() * complete_extra_strings() Since these would require scanning all (active?) bugs to compile lists, and I was feeling lazy...
* Adapted BugDir.duplicate_bugdir() to use revision-dependend Storage.children()W. Trevor King2009-12-291-3/+9
|
* Moved InvalidStorageVersion from libbe.command to libbe.storageW. Trevor King2009-12-271-0/+3
| | | | | | Also added ConnectionError pretty-print to ui.command_line, storage version checking to BugDir.duplicate_bugdir(), and optional revision argument to Storage.storage_version().
* Fixed libbe.command.diff + ugly BugDir.duplicate_bugdir implementationW. Trevor King2009-12-151-52/+73
| | | | | | | | | | | | | | | | | | | | | duplicate_bugdir() works, but for the vcs backends, it could require shelling out for _every_ file read. This could, and probably will, be horribly slow. Still it works ;). I'm not sure what a better implementation would be. The old implementation checked out the entire earlier state into a temporary directory pros: single shell out, simple upgrade implementation cons: wouldn't work well for HTTP backens I think a good solution would run along the lines of the currently commented out code in duplicate_bugdir(), where a VersionedStorage.changed_since(revision) call would give you a list of changed files. diff could work off of that directly, without the need to generate a whole duplicate bugdir. I'm stuck on how to handle upgrades though... Also removed trailing whitespace from all python files.
* Fixed up libbe.diffW. Trevor King2009-12-151-2/+2
|
* Transitioned remove to Command-formatW. Trevor King2009-12-141-2/+2
|
* Transitioned merge to Command-formatW. Trevor King2009-12-141-1/+1
|
* Transitioned init to Command formatW. Trevor King2009-12-141-3/+0
|
* Transitioned assign to Command formatW. Trevor King2009-12-141-17/+23
|
* Converted libbe.storage.vcs.base to new Storage format.W. Trevor King2009-12-131-6/+6
|
* Moved be to libbe.ui.command_line and transitioned to Command format.W. Trevor King2009-12-121-1/+1
|
* Moved bugdir, bug, and comment over to new id implementation.W. Trevor King2009-12-101-59/+25
|
* Reworked test.py to handle deeper directory structureW. Trevor King2009-12-081-1/+1
|
* Moved properties.py and settings_object.py to libbe/storage/util/W. Trevor King2009-12-081-4/+4
|
* Transitioned bugdir.py to new storage format.W. Trevor King2009-12-081-574/+329
|
* Don't necessarily initialize a new VCS in BugDir.load_settings().W. Trevor King2009-12-031-2/+3
| | | | | | | | | | We may already have the right type, in which case, don't mess with it. This speeds up bugdir loading a bit more: $ time be list > /dev/null real 0m1.245s user 0m1.116s sys 0m0.124s
* Added libbe.TESTING (defaults to False).W. Trevor King2009-12-031-143/+156
| | | | | | | | | | | | | | | | | | | | This flag allows us to skip unittest and testsuite declaration if we woln't need them. It speeds up simple be calls a suprising amount. With Testing=True (the old behavior): wking@thor:be.wtk$ time ./be > /dev/null real 0m0.393s user 0m0.340s sys 0m0.048s With TESTING=False (the new behavior): be.wtk$ time ./be > /dev/null real 0m0.216s user 0m0.152s sys 0m0.064s This adjustment was inspired by Jakub Wilk's Debian bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559295
* Minor BugDir docstring typo correction.W. Trevor King2009-11-301-1/+1
|
* BugDir.list_uuids() -> BugDir.uuids()W. Trevor King2009-11-281-5/+5
|
* Adjusted test.py to use an installed vcs by default.W. Trevor King2009-11-201-1/+1
| | | | | | | | | Protects agaist the off chance that the user doesn't have Arch (tla) installed ;). Changed Arch.name from "Arch" to "arch" so that each VCSs .name matches the module name. This allows us to use vcs.VCS_ORDER (a list of module names) to set up the allowed values of BugDir.vcs_name.
* Ran the new update_copyright.pyW. Trevor King2009-11-191-0/+1
|
* Moved from *.__del__() to exclusive use of *.cleanup().W. Trevor King2009-10-051-4/+4
| | | | | | | | | *.__del__() is run some unspecified time after the refcount for an object is reduced to zero. Sometimes that means that the rest of the world has already been deallocated, which makes life difficult, especially when Python won't attempt to construct stack traces inside *.__del__(). We were always (hopefully ;) calling del(*) anyway, so we just replace those calls with *.cleanup()
* Added docstrings to libbe submodules.W. Trevor King2009-08-311-0/+6
| | | | Also a few minor tweaks to the module imports.
* BugDir.duplicate_bugdir() fix for when parent bugdir's sync_with_disk == False.W. Trevor King2009-08-311-2/+8
|
* RCS -> VCS, BUGDIR_DISK_VERSION -> v1.2W. Trevor King2009-08-311-77/+77
|
* Upgrade duplicate bugdirs if necessary (e.g. for `be diff').W. Trevor King2009-08-311-2/+13
| | | | | Also moved pre-YAML mapfile handling in mapfile.parse() into upgrade.Upgrade_1_0_to_2._upgrade_mapfile().
* Added libbe/upgrade.py to handle upgrading on-disk bugdirs.W. Trevor King2009-08-311-13/+9
|
* Made get_path() definitions consistent between bugdirs, bugs, and comments.W. Trevor King2009-08-311-3/+3
|
* Handle BugDir.list_uuids() in the case of missing ".be/bugs/".W. Trevor King2009-08-111-4/+5
| | | | | | | | | | Previously: $ be init $ be list ... File ".../libbe/bugdir.py", line 537, in list_uuids for uuid in os.listdir(self.get_path("bugs")): OSError: [Errno 2] No such file or directory: '.../.be/bugs'
* Improved unittest cleanup by adding BugDir.cleanup().W. Trevor King2009-07-311-34/+47
| | | | | | | | Also simple_bug_dir -> SimpleBugDir class, which allows me to add utility.Dir cleanup to SimpleBugDir.cleanup(). Still having a bit of trouble with the becommand.new tests due to bugdir loading though...
* Return to original directory after libbe.bugdir.SimpleBugDirTestCase().W. Trevor King2009-07-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was causing strange "RCS not found" errors in the bzr and hg unittests. For example, the bzr tests all passed: wking@thor:be.wtk-rr$ python test.py bzr ... Ran 12 tests in 24.143s OK Except when run after the bugdir tests: wking@thor:be.wtk-rr$ python test.py bugdir bzr ... Ran 19 tests in 1.862s FAILED (errors=12) Where the failures were all AssertionError: bzr RCS not found Fixed by returning to intial directory after SimpleBugDirTestCase execution. Problem is due to Python issues with unlinked directories though, so bzr/hg will _still_ not work from unlinked directories. This is for Python 2.5.4 on Ubuntu 8.04.3, but probably effects other pythons too. Details: Isolated problem to unlinked directories: mkdir /tmp/a cd /tmp/a rmdir /tmp/a python /home/wking/src/fun/be/be.wtk-rr/test.py bzr which fails with the same "RCS not found" errors because bzr fails: wking@thor:/$ mkdir /tmp/a; cd /tmp/a; rmdir /tmp/a; bzr --help; cd /; rmdir: removing directory, /tmp/a 'import site' failed; use -v for traceback bzr: ERROR: Couldn't import bzrlib and dependencies. Please check bzrlib is on your PYTHONPATH. Traceback (most recent call last): File "/usr/bin/bzr", line 64, in <module> import bzrlib ImportError: No module named bzrlib which fails becase 'import site' fails: wking@thor:/$ mkdir /tmp/a; cd /tmp/a; rmdir /tmp/a; python -c 'import site'; cd /; rmdir: removing directory, /tmp/a 'import site' failed; use -v for traceback Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/wking/lib/python/site.py", line 73, in <module> __boot() File "/home/wking/lib/python/site.py", line 33, in __boot imp.load_module('site',stream,path,descr) File "/usr/lib/python2.5/site.py", line 408, in <module> main() File "/usr/lib/python2.5/site.py", line 392, in main paths_in_sys = removeduppaths() File "/usr/lib/python2.5/site.py", line 96, in removeduppaths dir, dircase = makepath(dir) File "/usr/lib/python2.5/site.py", line 72, in makepath dir = os.path.abspath(os.path.join(*paths)) File "/usr/lib/python2.5/posixpath.py", line 403, in abspath path = join(os.getcwd(), path) OSError: [Errno 2] No such file or directory which fails because our cwd doesn't exist. That makes sense ;). Still I think Python should be able to handle it, so I reported it http://bugs.python.org/issue6612
* Fixed libbe.bugdir.BugDirTestCase.testComments(sync_with_disk=False).W. Trevor King2009-07-311-1/+1
|
* Merged interactive email interfaceW. Trevor King2009-07-291-84/+199
|\
| * .sync_with_disk fixes for libbe.bugdir and .comment.W. Trevor King2009-07-271-3/+6
| | | | | | | | | | | | | | | | | | | | In BugDir, only call bug.remove if bug.sync_with_disk==True. If it's just in memory, automatic garbage collection is sufficient cleanup. Comment.set_sync_with_disk() had been setting .sync_with_disk=True regardless of the value passed in. Fixed now. Also some minor textual adjustments.