aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/bugdir.py
Commit message (Collapse)AuthorAgeFilesLines
* 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.
| * BugDir._in_memory was a stupid idea. Took it back out.W. Trevor King2009-07-261-103/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was too confusing having three memory access levels: 1) syncronized 2) explicit 3) memory-only with .sync_with_disk selecting between 1 and 2/3 and ._in_memory selecting between 2/3. Now there are only two: 1) syncronized 2) memory-only excepting explicit BugDir.save() calls. I avoid the problem of non-syncronized loading of on-disk bugs in simple_bug_dir by restricting .list_uuids() to in-memory bugs when .sync_with_disk==True. Beyond that, I shifted the order of the BugDir methods around a bit so that they were better grouped according to general idea. Note that the DiskAccessRequired exceptions on filesystem access when .sync_with_disk==False should be propogated to the Bug and Comment methods, but I haven't done that yet.
| * Added in_memory to BugDir.__init__ to disable saving/loading completely.W. Trevor King2009-07-251-17/+77
| | | | | | | | | | | | | | The previous simple_bug_dir(on_disk==False) supprised me by loading my BE bugdir when called from the BE directory. This functionality could probably move out to Bug and Comment as well, but I have avoided that for now.
| * Added on_disk option to libbe.bugdir.simple_bug_dir().W. Trevor King2009-07-251-6/+14
| | | | | | | | Now you can easily generate simple_bug_dirs that live only in memory.
* | Added clean messages on bug_from_shortname failure.W. Trevor King2009-07-291-1/+7
|/ | | | So user's don't get confused.
* Added BugDir.extra_strings.W. Trevor King2009-07-211-0/+14
|
* Cleaned up saving/sync_with_disk.W. Trevor King2009-07-211-29/+63
| | | | | | | | | | | | | | | | | | | | | | Got rid of a whole bunch of redundant .save() calls when sync_with_disk==True. Fixed up the "File-system access" portion of the BugDir docstring so we can all remember how things are supposed to work ;). Note that some .save() calls are still required. For example in becommands/merge.py, the copied comments have their .bug changed, but that is not a versioned property, so it doesn't trigger an automatic save, and we have to force the .save() by hand. libbe.rcs.RCS.mkdir() is now recursive by default, but you can set check_parents==False if you want it to fail in the case of missing parents. Because of the recursion, we removed the .update() call on preexisting directories, since there will be at least one of these occurrences for every .mkdir(check_parents=True) call, and I don't know of any VCS that actually needs them... Also stripped trailing whitespace from some files...
* Cleaned up some outdated libbe.settings_object.EMPTY cruft.W. Trevor King2009-07-201-3/+4
| | | | | | | | From back before commit wking@drexel.edu-20090619184215-nfx205yaj02sqrqx cleaned up the versioned_property implementation. Also a few style fixes and typos.
* Updated GPLv2 to current GPLv2.W. Trevor King2009-07-141-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | Fixes Ben's bug 00f26f04-9202-4288-8744-b29abc2342d6. I also tweaked update_copyright.sh to make possible future copyright-blurb revision easier. The new algorithm is greedier, overwriting _all_ consecutive comments after a '^# Copyright' line, so do # Copyright # GPL ... GPL ... GPL # Your comment here... not # Copyright # GPL ... GPL ... GPL # # Your comment here... Without the blank line, your comment would get overwritten by the next run of update_copyright.sh. Note that catmutt is ignored by update_copyright.sh because Moritz Barsnick has only licensed his grepm code under the GPLv2 (not GPLv>=2). See the initial catmutt commit for details.
* Updating "be set --help" and "be status --help".W. Trevor King2009-07-111-1/+1
| | | | | | | | | I don't really like the "defaults to None" for the settings that have funky initialization procedures (most of them :p), but I'm not sure how to handle that cleanly yet. Perhaps be set --current I also need to find a method of adding complicated settings like the nested lists for severities, etc from the "be set" commandline.
* Removed <abentley@panoramicfeedback.com> from copyright blurbs.W. Trevor King2009-07-111-1/+0
| | | | | | | | | | | These didn't work with my update_copyright.sh. I went with Aaron Bentley and Panometrics, Inc. instead of Aaron Bentley <abentley@panoramicfeedback.com> and Panometrics, Inc. just because of line length, but I'm open to convincing if people prefer the latter...
* Updated copyright blurbs and AUTHORS and included script for future updatesW. Trevor King2009-07-011-1/+5
|
* Added darcs support.W. Trevor King2009-06-301-1/+1
| | | | | | | | | | | | I don't know much darcs, so I make no claims about the beauty of my implementation. It seems to get the job done though, until a darcs guru comes along. I also tweaked the libbe.git.Git._rcs_get_user_id to handle the case where user.name or user.email are not set. I also added the option to pass a stdin string into the libbe.rcs.RCS._u_invoke* functions.
* Added Bug.extra_strings to support add-on functionality, e.g. `be tag`.W. Trevor King2009-06-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Versioned properties whose data is a mutable type are tricky, since the simple comparisons we'd been using in libbe.properties.change_hook_property don't work for mutables. For now, we avoid that problem by assuming a change happened whenever a mutable property is set. change_hook_property is a bit untidy at the moment while I work out how to deal with mutables. As an example of using Bug.extra_strings to patch on some useful functionality, I've written becommands/tag.py. I'd suggest future add-ons (e.g. becommands/depend.py?) use the "<LABEL>:<value>" string format to keep it easy to sort out which strings belong to which add-ons. tag.py is still missing command line tag-removal and tag-searching for `be list'. Perhaps something like be list --extra-strings TAG:<your-tag>,TAG:<another-tag>,DEPEND:<bug-id> would be good, although it would requre escaping commas from the tags, or refusing to allow commas in the tags... libbe.properties.ValueCheckError also got a minor update so the printed error message makes sense when raised with allowed being an iterable (i.e. check_property) or a function (e.g. fn_checked_property). All of this digging around turned up a really buggy libbe.bugdir.MultipleBugMatches. Obviously I had never actually called it before :p. Should be fixed now. libbe.comment._set_comment_body has also been normalized to match the suggested change_hook interface: change_hook(self, old, new). Although, I'm not sure why it hadn't been causing obvious problems before, so maybe I'm misunderstanding something about that.
* Added `be list --sort *` for user-selectable sorting.W. Trevor King2009-06-221-7/+0
| | | | | | | | | | | Also added libbe.bug.cmp_last_modified, which handles part of 9ce2f015-8ea0-43a5-a03d-fc36f6d202fe. To do better we could extend the RCS framework. I also transcribed a few emails from the be-devel list onto their relavent bugs and closed a few bugs. Finally, I removed some left over InvalidValue cruft.
* Fixed lack of user_id caching in bugdir.BugDirW. Trevor King2008-12-041-5/+9
|
* Added per-tree default assignee option.W. Trevor King2008-12-041-1/+6
| | | | | The new setting is currently only used when creating new bugs with becommand/new.
* Per-tree status levels working.W. Trevor King2008-12-041-1/+23
|