aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/bug.py
Commit message (Collapse)AuthorAgeFilesLines
* Add most comments with ignore_missing_references=True.W. Trevor King2009-12-281-1/+1
|
* Fixed libbe.storage.util.upgradeW. Trevor King2009-12-271-2/+2
| | | | | | | | | | | | | Note that it only upgrades on-disk versions, so you can't use a non-VCS storage backend whose version isn't your command's current storage version. See #bea/110/bd1# for reasoning. To see the on-disk storage version, look at .be/version To see your command's supported storage version, look at be --full-version I added test_upgrade.sh to exercise the upgrade mechanism on BE's own repository.
* Fixed libbe.command.diff + ugly BugDir.duplicate_bugdir implementationW. Trevor King2009-12-151-11/+16
| | | | | | | | | | | | | | | | | | | | | 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.
* Transitioned merge to Command-formatW. Trevor King2009-12-141-2/+1
|
* Transitioned comment to Command formatW. Trevor King2009-12-141-7/+1
|
* Converted libbe.storage.vcs.base to new Storage format.W. Trevor King2009-12-131-2/+3
|
* 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-99/+69
|
* 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-2/+2
|
* Transitioned bugdir.py to new storage format.W. Trevor King2009-12-081-16/+32
|
* Transitioned bug.py to new storage format.W. Trevor King2009-12-081-61/+46
|
* Remove some more Bug.target references from libbe/bug.pyW. Trevor King2009-12-051-6/+2
|
* This addresses the following portion of 22b:7:W. Trevor King2009-12-051-4/+1
| | | | | | | | | | | | | * Targeting normal bugs With "be depend". I think we should remove the "target" field from bugs, and move target dependencies over into the "be depend" framework. * be target list Would become "be list --severity target". A target "severity" would keep target bugs distinct from other bug/issue types.
* Added libbe.TESTING (defaults to False).W. Trevor King2009-12-031-2/+5
| | | | | | | | | | | | | | | | | | | | 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
* Changed Bug and Comment.merge() kwargs.W. Trevor King2009-11-301-16/+42
| | | | | | | | The old allow_changes and allow_new_comments didn't have separate handling for extra_strings, like import_xml will need. It also didn't have a way to specify what to do if an illegal change occurs. Sometimes you'll want to raise an exception, but sometimes you'll want to ?silently? ignore the change.
* Moved comment.list_to_root() to Bug.add_comments() with some cleanups.W. Trevor King2009-11-291-17/+42
| | | | | | | | | | | | | | | | | | | This makes Bug.add_comment simpler. Also makes Bug.from_xml() more robust, since it no longer depends on the order in which the XML file lists the comments. The previous Bug.from_xml() would have choked on <be-xml> <bug> <comment> <uuid>B</uuid> <in-reply-to>A</in-reply-to> </comment> <comment> <uuid>A</uuid> </comment> </bug> </be-xml> because when B was being added, the referenced A hadn't yet been noticed.
* Added comment import to Bug.from_xml().W. Trevor King2009-11-281-9/+89
| | | | | | | | | | | This is a pretty critical feature, dunno how I missed it before. I also added a little check to both Bug and Comment.from_xml() so that xml_string can take an ElementTree Element as well as the usual raw string/unicode. This avoids repeated string <-> Element conversions. Added Bug.add_comment() which handles the addition of a Comment instance, matching .in_reply_to, checking .uuid uniqueness, etc.
* Added Bug.merge() and Comment.merge().W. Trevor King2009-11-281-9/+110
| | | | | | | | | Added *.explicit_attrs list creation to Bug and Comment.from_xml(). Added match_alt_id keyword argumennt to .comment_from_uuid(). Removed extra enline following '</extra-string>' tag in Bug and Comment.xml().
* Added Bug.from_xml() + some .from_xml() fixups.W. Trevor King2009-11-201-23/+89
| | | | | | | | | | | | | | | | | | | | | Moved comment.InvalidXML to utility.InvalidXML, so that bug and comment can share it. Added docstring explaining the __init__ arguments. Added indent and shortname options to Bug.xml() to match Comment.xml(). Added .extra_strings export to Comment.xml(). Converted Bug.xml() from string addition to list joining, which avoids a bunch of memory allocation/deallocation. Assorted " -> ' replacements. Elaborated doctests to check UTF-8, extra_strings, ... Added new comparison cmp_extra_strings for both bug. and comment.DEFAULT_CMP_FULL_CMP_LIST.
* Ran the new update_copyright.pyW. Trevor King2009-11-191-1/+1
|
* Don't attempt to convert unicode objects to strings in *._setting_attr_string()W. Trevor King2009-11-171-1/+3
|
* Added docstrings to libbe submodules.W. Trevor King2009-08-311-0/+5
| | | | Also a few minor tweaks to the module imports.
* RCS -> VCS, BUGDIR_DISK_VERSION -> v1.2W. Trevor King2009-08-311-12/+12
|
* Made get_path() definitions consistent between bugdirs, bugs, and comments.W. Trevor King2009-08-311-6/+6
|
* Added cmp functions to libbe.comment, and fleshed them out in libbe.bug.W. Trevor King2009-07-271-1/+6
| | | | | | | | | | Previous comment comparison had just been the default Tree.__cmp__. Fleshed out so A == B ensures no meaningful differences between A and B. Also added first line of comments to new comment output in libbe.diff, and added a comment/"settings" node and .comment_mod_string() (to mirror bugdir and bug).
* Added DiskAccessRequired errors to libbe.bug.Bug and .comment.Comment.W. Trevor King2009-07-261-24/+47
|
* Added libbe.bug.cmp_comments(), and added that to default bug comparison.W. Trevor King2009-07-231-1/+18
|
* Bug._extra_strings_check_fn() guts now utility.iterable_full_of_strings().W. Trevor King2009-07-211-9/+2
|
* Cleaned up saving/sync_with_disk.W. Trevor King2009-07-211-2/+14
| | | | | | | | | | | | | | | | | | | | | | 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-4/+3
| | | | | | | | 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.
* 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...
* Adjustments to new versioned_property behavior.W. Trevor King2009-07-111-8/+8
| | | | | Also adjusted libbe/comment.py to move to user-specified alt_ids, rather than uuids.
* Updated copyright blurbs and AUTHORS and included script for future updatesW. Trevor King2009-07-011-1/+3
|
* Remove blank line from bug.xml() output when bug has no comments.W. Trevor King2009-06-301-2/+2
|
* Added ability to handle non text/* MIME types.W. Trevor King2009-06-261-1/+1
| | | | | | | | | | | | | | | | The main problem was the encoding/decoding that was happening to _all_ input/output. Now many I/O activities have a `binary' option to disable any encoding/decoding. The `binary' flag is set whenever the comment content-type is not a text/* type. In order to print valid XML (and make life easy on xml/be-xml-to-mbox), non text/* types are printed out as base64-encoded MIME messages, so be list --xml | be-xml-to-mbox | catmutt works as you'd expect. With the standard (non-XML) output from `be show', we just print a message telling the user that we can't reasonably display the MIME type and that they should use the XML output if they want to see it.
* Added extra_strings functionality to libbe.bug.xml and be-xml-to-mbox.W. Trevor King2009-06-251-1/+2
|
* tag --remove now returns bug.settings["extra_strings"] to EMPTY.W. Trevor King2009-06-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | extra_strings returns to a defaulting property from a cached/generator property, with the help of the new, mutable defaults. Lots of deepcopies avoid mutable default uncertainty too ;). And copy.deepcopy([]) should be pretty cheap. tag --remove had previously left settings["extra_strings"] as [], which polluted the bug's values file. Now the improved defaulting_property notices a return to the default [], and sets the internally stored value to EMPTY. I struggled with creating a more intuitive way to notice changes to extra_strings than the tmp = bug.extra_strings <work on tmp> bug.extra_strings = tmp but didn't have any luck. The problem seems to be that if you only hand out copies of your default, you don't have any pointers to what you handed out to check for changes. On the other hand, if you hand out your original default, any external changes will _change_ your original default. I suppose you could only hand out copies, but keep a list of all copies handed out, but that sounds like a disaster. Reassigning is easy enough.
* Use generator instead of default for libbe.bug.Bug.extra_strings.W. Trevor King2009-06-231-1/+3
| | | | This avoids the problems associated with mutable defaults.
* Added Bug.extra_strings to support add-on functionality, e.g. `be tag`.W. Trevor King2009-06-231-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-16/+34
| | | | | | | | | | | 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.
* Only print RFC 2822 date in bug xml output.W. Trevor King2009-06-221-3/+1
|
* Escape XML strings.W. Trevor King2009-06-221-1/+2
| | | | | | Since <creator>John Doe <jdoe@example.com></creator> is not valid XML.
* Fixed libbe.settings_object.EMPTY output in bug/comment XML.W. Trevor King2009-06-221-1/+1
| | | | The xml() method hadn't been updated since the settings_object revamp.
* Merged Thomas Habets 2009-01-07 XML output for "be show".W. Trevor King2009-06-191-0/+36
|\ | | | | | | | | | | | | | | | | | | | | | | I rewrote a few of his routines, e.g. generalizing Comment.string_thread to run a caller-specified method avoided the need for some duplicate code in Comment.xml_thread. There was also a reasonable reorganization of libbe.settings_object.versioned_property because the <in_reply_to> field of the Comment.xml output was giving me `-1' (= old settings_object.EMPTY) instead of None, even after I had set comm.in_reply_to to None. The rewritten versioned_property avoids the ambiguity of UNPRIMED vs EMPTY, and avoids the stupididy of my using EMPTY=-1 ;).
| * XML output for "be show"Thomas Habets2009-01-071-0/+37
| |
* | Per-tree status levels working.W. Trevor King2008-12-041-9/+26
| |
* | bug severity verification now works with per-tree severities.W. Trevor King2008-12-041-5/+1
| | | | | | | | | | | | | | | | | | | | I adjusted the YAML format following http://pyyaml.org/ticket/11 Unicode support To remove '!!python/unicode' escapes and allow unicode in the output. We can always have unicode in the output because the output is encoded (as per the BugFile.encoding setting) before being sent to the outside world.
* | Per-tree settings now passed into bug module.W. Trevor King2008-12-041-6/+18
| | | | | | | | | | | | | | | | becommands/severity gets the configured settings appropriately. Todo: adjust setting-validation to compare against the current values. setup becommands/severity to --complete severities.