aboutsummaryrefslogtreecommitdiffstats
path: root/becommands
Commit message (Collapse)AuthorAgeFilesLines
* Added default to settings_object.versioned_property's change_hook_property.W. Trevor King2009-07-271-6/+0
| | | | | | | | | | Now change_hook properties handle defaults, which allows them to avoid an initial None -> default save hook trigger. Removed the now-redundant read-only mode business in becommands/diff.py.
* Put bd into read-only mode in becommands/diff.py.W. Trevor King2009-07-271-0/+6
| | | | | | | | Otherwise comment comparison reads were triggering notice of the None -> EMPTY transition in comment.extra_strings, which was causing a write to disk. This trigger is probably occuring in Bug and BugDir too. Perhaps I should just remove the trigger...
* Major rewrite of libbe.diff introduces DiffTree and Diff classes.W. Trevor King2009-07-271-16/+27
| | | | | | | | | | | | | To make the interface proposed by becommands/subscribers.py easier to implement, I've moved the libbe.diff functionality into classes. Now it should be easy two tweak the output as desired by subclassing these classes. The basic idea is that Diff.report_tree() generates a diff_tree tree of changes between two bugdirs, where diff_tree is some subclass of DiffTree. Each type of change has a default .*_string() method producing a string summary of the change. DiffTree.report() moves through and generates a report by joining all those summary strings to a single root, and DiffTree.report_string() serialized the report to produce e.g. the output of becommands/diff.py.
* Renamed Comment.From and .time_string to .author and .date respectively.W. Trevor King2009-07-251-2/+2
| | | | | | | | | | | | Now they conform to the libbe.settings_object.setting_name_to_attr_name() standard. I fixed the references I found in becommands/comment.py interfaces/xml/be-mbox-to-xml interfaces/xml/be-xml-to-mbox but there may have been some references or files that slipped through.
* "be diff" now compares agains the last commit (for versioning VCSs).W. Trevor King2009-07-231-0/+2
| | | | This is the default behaviour of most of the VCSs own diff commands.
* Added Tree types and get_bugdir_subscribers to becommands/subscribe.py.W. Trevor King2009-07-231-83/+214
| | | | | | | | | | | | | | The Tree subclass SubscriptionType may be a few more lines to setup, but they should be really easy to extend and will automatically keep the longhelp and type handling in sync. An example extension for bugdir types would be all -> assigned -> <user> to subscribe only to bugs being assigned to the specified user. You'd have to loosen the currently strict InvalidType checking to make that work, but the current type-tree handling would be up to the task. Also a bit of reorganizing to hide the private functions.
* Merged libbe.diff upgrades and libbe.tree.Tree.has_descendant from be.wtk-rr.W. Trevor King2009-07-232-9/+16
|\ | | | | | | Also pulls "show referenced text" fix to "be comment".
| * Added bugdir setting comparision to libbe.diff.W. Trevor King2009-07-231-3/+4
| | | | | | | | | | | | | | | | | | | | | | Renamed libbe.diff.diff -> bug_diffs, since it doesn't compare bugdirs. Load comments before bug comparision so cmp_comments will see them. Use .settings_properties rather than static lists to create attribute lists for change_lines(). Removed trailing endline from becommands/diff.py output.
| * Fixed unrecognized "Test" typo in becommands/comment.py.W. Trevor King2009-07-231-1/+1
| |
| * Show text of comment's reference in notes when spawning EDITOR.W. Trevor King2009-07-221-2/+17
| |
* | Added becommands/subscribe.py to manage subscription list.W. Trevor King2009-07-221-0/+237
| |
* | Merged assorted changes from be.wtk-rr for BugDir.extra_strings.W. Trevor King2009-07-2113-29/+28
|\| | | | | | | | | | | | | Other highlights: * be show --no-comments * Improved *.sync_with_disk. * Improved be-mbox-to-xml.
| * Added "--no-comments" to "be show".W. Trevor King2009-07-211-9/+16
| | | | | | | | | | | | | | | | | | Also moved the XML-header line to the top of the argument loop, since there should only be one. We're still missing global tags wrapping the whole thing though... Also set options.XML default to False. It had been defaulting to None, which was breaking the non-XML newline-adding check.
| * "be comment --xml" now saves the comments (again).W. Trevor King2009-07-211-0/+1
| | | | | | | | | | | | | | | | | | They are generated in memory (from_disk defaults to False) 133: new = comment.Comment(bug) With the leaner saving since I started trusting sync_with_disk, they were no longer making it to disk. Easily fixed with an explicit save once you've got them all set up.
| * Touched up becommands/diff.py's help message.W. Trevor King2009-07-211-3/+4
| |
| * Cleaned up saving/sync_with_disk.W. Trevor King2009-07-2112-17/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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...
* | Merged "be commit --allow-empty from be.wtk-rr"W. Trevor King2009-07-191-3/+12
|\|
| * Added --allow-empty to "be commit"W. Trevor King2009-07-191-3/+12
| | | | | | | | | | | | | | Previously many backends would silently add an empty commit. Not very useful. When the new --allow-empty flag and related allow_empty options are false, every versioning backend is guaranteed to raise the EmptyCommit exception in the case of an attempted empty commit.
* | Merged becommands/commit.py addition from be.wtk-rr.W. Trevor King2009-07-191-0/+68
|\|
| * Added becommands/commit.py and minor fixes.W. Trevor King2009-07-191-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we can commit changes from the command line with a unified interface. The interface is much less flexible than using your particular version control system's commit command directly, so this command is mostly intended for user-interfaces and other tools that don't want to be bothered with the extra flexibility. Normalized spacing in rcs.RCS.commit to produce: summary <BLANKLINE> body <TRAILING-ENDLINE> messages regardless of the input string format. Also fixed a "--complete" handline bug in cmdutil, and some minor docstring typos in libbe.rcs and .editor.
* | Merged some bugfixes from be.wtk-rrW. Trevor King2009-07-181-0/+1
|\|
| * Import sys in becommands/new.py.W. Trevor King2009-07-181-0/+1
| | | | | | | | Required for reading the bug summary string from stdin.
* | Renamed test->manipulate_encodings in becommands.*.execute.W. Trevor King2009-07-1618-90/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reminder from my initial libbe/encoding.py commit: Because of the stdout replacement, the doctests executes now need an optional 'test' argument to turn off replacement during the doctests, otherwise doctest flips out (since it had set up stdout to catch output, and then we clobbered it's setup). I'm also trying to catch stdout/stderr from be-handle-mail, and I ran into the same problem. It took me a bit to remember exactly what "test" was supposed to do, so I thought I'd make the argument name more specific. If you need other changes when running in "test" mode, you'll have to add other kwargs.
* | Added --author and --alt-id to "be comment".W. Trevor King2009-07-141-0/+8
|/ | | | | You could already add this info via the --xml input, now you can do it from the command line too.
* Updated GPLv2 to current GPLv2.W. Trevor King2009-07-1418-199/+198
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Added "be comment --xml --ignore-missing-references ID COMMENT".W. Trevor King2009-07-121-1/+8
| | | | Now you don't have to edit them out by hand.
* Altered be-xml-to-mbox to work with non-ASCII input.W. Trevor King2009-07-121-1/+2
| | | | | | Now it runs off xml.etree instead of xml.sax. Removed "No matching bugs found" from "be list --xml" output.
* Not escaping whitespace (e.g. endlines) outside the XML document root.W. Trevor King2009-07-121-1/+1
| | | | | | ElementTree.XML was choking on them. I should unescape all whitespace (e.g. tabs, etc.), but I'm lazy and don't have any XML that's strange enough to need it ;).
* Added be-mbox-to-xml.W. Trevor King2009-07-122-2/+5
| | | | | | | | | | | | | | | | | | | | | | | Reworked to allow "be comment" to handle unicode strings (see bug e4ed63f6-9000-4d0b-98c3-487269140141). The solution was to escape all the unicode to produce and ASCII string before calling ElementTree.XML, and then converting back to unicode afterwards. Added a unicode-containing comment to the end of bug f7ccd916-b5c7-4890-a2e3-8c8ace17ae3a so that there's a handy unicode comment for testing. XML headers (e.g. '<?xml version="1.0" encoding="UTF-8" ?>') are now added to all xml output from be. Switched non-text/* encoding library to base64 instead of email.encoders, which makes that code in libbe/comment.py simpler. Changed libbe/mapfile.py error encoding from string_escape to unicode_escape so it can handle unicode. Everything's still untested, and be-xml-to-mbox doesn't handle unicode yet, but I felt this commit was getting a bit unwieldy ;).
* Went through "closed" bugs looking for miss-categorized bugs.W. Trevor King2009-07-111-3/+3
| | | | | | Found a few that were actually "fixed" and one that I reopened. Perhaps we should add a "merged" status to the default, so that the merged bugs don't clutter up the closed bugs category...
* Updating "be set --help" and "be status --help".W. Trevor King2009-07-112-20/+57
| | | | | | | | | 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-1114-14/+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...
* "be comment --xml" now translates comment uuids to alt_ids.W. Trevor King2009-07-111-5/+11
|
* Adjustments to new versioned_property behavior.W. Trevor King2009-07-115-12/+12
| | | | | Also adjusted libbe/comment.py to move to user-specified alt_ids, rather than uuids.
* seems to work ;)W. Trevor King2009-07-101-5/+38
|
* Save whole bugdir in becommands/tag.py.W. Trevor King2009-07-101-1/+1
| | | | | | | It doesn't matter now, but at some point Bugdir might implement some sort of repo-wide caching which would need to be saved. The BugDir.save() method should be intelligent enough to not save things that have not changed, so efficiency should not be effected either.
* Added new-bug-from-stdin to mirror comments-from-stdin.W. Trevor King2009-07-071-3/+8
|
* Added "be show --only-raw-body COMMENT-ID".W. Trevor King2009-07-061-1/+7
|
* Added ability to show individual comments with "be show".W. Trevor King2009-07-061-10/+30
|
* "be init [ROOTDIR]" -> "be init [--root ROOTDIR]"W. Trevor King2009-07-011-15/+16
| | | | Following Ben's Wed, 01 Jul 2009 11:31:51 +1000 suggestion.
* Updated copyright blurbs and AUTHORS and included script for future updatesW. Trevor King2009-07-0116-16/+51
|
* "be set-root" changed to "be init"W. Trevor King2009-06-301-2/+2
| | | | | | | | | On the advice of Martin F Krafft <madduck@debian.org> as posted in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477125 on Fri, 12 Jun 2009 17:03:02 +0200
* "be comment" now handles the default options.content_type.W. Trevor King2009-06-301-1/+2
| | | | | Previously it choked when options.content_type == None. I'm not sure how that made it past test_usage.sh...
* Add "--show-status" flag to "be depend"W. Trevor King2009-06-301-1/+13
|
* Added ability to handle non text/* MIME types.W. Trevor King2009-06-261-3/+7
| | | | | | | | | | | | | | | | 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.
* Updated help strings, man page, and completionsW. Trevor King2009-06-252-2/+2
|
* Remove blank line from tag's output if no tags existW. Trevor King2009-06-251-1/+2
|
* Added regexp matching to `be list --extra-strings'W. Trevor King2009-06-251-4/+8
|
* Merged extra-strings branch, adding be tag/depend.W. Trevor King2009-06-253-4/+227
|\
| * Added `be depend'.W. Trevor King2009-06-252-20/+97
| | | | | | | | | | | | | | | | This closes bug 7ec2c071-9630-42b0-b08a-9854616f9144. BE is now bug free ;). At least until the next commit :p. Writing depend.py turned up a few style points in tag.py which I also fixed.