aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fixed import_xml.py to live up to its longhelp description.W. Trevor King2009-11-301-27/+188
| | | | Also added LonghelpTestCase to prove it.
* Avoid redundant Comment.alt_idsW. Trevor King2009-11-301-1/+3
|
* Changed Bug and Comment.merge() kwargs.W. Trevor King2009-11-302-25/+69
| | | | | | | | 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.
* Minor BugDir docstring typo correction.W. Trevor King2009-11-301-1/+1
|
* Moved comment.list_to_root() to Bug.add_comments() with some cleanups.W. Trevor King2009-11-292-65/+45
| | | | | | | | | | | | | | | | | | | 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-282-10/+93
| | | | | | | | | | | 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.
* test.py now uses unittest.TestSuite 'suite' in becommands if present.W. Trevor King2009-11-281-1/+4
| | | | | | Such 'suite' instances have been required for libbe submodules. This will allow becommands to test themselves more thoroughly than they could with only doctests.
* BugDir.list_uuids() -> BugDir.uuids()W. Trevor King2009-11-284-9/+9
|
* Added Bug.merge() and Comment.merge().W. Trevor King2009-11-282-16/+185
| | | | | | | | | 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 restrict_file_access to becommands' execute() args.W. Trevor King2009-11-2126-27/+57
| | | | | | | + associated adjustments in other files. See cmdutil.restrict_file_access.__doc__ for an explanation of the security hole this closes.
* Fix libbe.vcs.VCS.get_file_contents(allow_no_vcs=True,binary=True).W. Trevor King2009-11-211-1/+8
| | | | | | | | In it's previous form it had ignored the binary option if self._use_vcs() returned False. Also added a few more details to the docstring, explaining the arguments.
* Updated interfaces/email/interactive/README for [be-bug:xml] interfaceW. Trevor King2009-11-211-2/+13
|
* Added [be-tag:xml] processing to be-handle-mail.W. Trevor King2009-11-211-4/+25
| | | | | Now it will automatically apply and commit emails from be email-bugs ...
* Adjusted `be import-xml` to properly handle croot_bug==None.W. Trevor King2009-11-211-26/+31
| | | | | | If there aren't any root comments, then the user needn't specify --comment-root, in which case croot_bug will be None and we want to skip all the croot processing.
* Fixed bug in be-handle-mail.Message.parse_comment() for emails w/o Message-id.W. Trevor King2009-11-211-2/+4
| | | | | | | | | | | | | | | | | | You used to get: Uncaught exception: 'NoneType' object has no attribute 'decode' File "./be-handle-mail", line 857, in main m.run() File "./be-handle-mail", line 591, in run command.run() File "./be-handle-mail", line 244, in run manipulate_encodings=False) File "/tmp/be.email-bugs/interfaces/email/interactive/libbe/cmdutil.py", line 82, in execute ret = cmd.execute([a.decode(enc) for a in args], A `print args' in Message.parse_comment() revealed [..., u'--alt-id', None,...]
* Added interfaces/email/interactive/examples/email_bugsW. Trevor King2009-11-211-0/+37
| | | | For testing the new [be-bug:xml] interface we're about to write.
* `be email-bugs` now uses `be show` internals to produce consistent XML.W. Trevor King2009-11-213-66/+78
| | | | | | | | Broke the bulk of show.py out into new function show.output(), which is used by both show.py and email_bugs.py to reduce duplication of effort and increase consistency of the XML. Also a few relevant help string updates.
* Upgraded `be show --xml` to new <be-xml> format.W. Trevor King2009-11-213-55/+128
|
* Broke `be comment --xml` out and extended into `be import-xml`.W. Trevor King2009-11-2118-126/+373
| | | | | | | | | | | | | | | | | | | | | | | It should currently do everything that `be comment --xml` did, but it still has a way to go before it lives up to it's longhelp string, mostly figuring out bug/comment merging. The allowed XML format also changed a bit, becoming a bit more structured. cmdutil.bug_from_shortname() renamed to cmdutil.bug_from_id(). New functions cmdutil.parse_id() and cmdutil.bug_comment_from_id(). Additional doctests in libbe.comment.Comment.comment_shortnames() to show example output if bug_shortname==None. Brought be-xml-to-mbox and be-mbox-to-xml up to speed on the current <be-xml>-rooted format. * Added <extra-string> handling to their comment handling. * Moved extra strings from email bodies to X-Extra-String headers (some comment bodies are not text, and we should keep the estr location consistent between bugs and comments.)
* Added Bug.from_xml() + some .from_xml() fixups.W. Trevor King2009-11-203-72/+152
| | | | | | | | | | | | | | | | | | | | | 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.
* Import os in libbe.subproc if _POSIX == TrueW. Trevor King2009-11-201-0/+1
|
* Fix typo in becommands.init's doctestW. Trevor King2009-11-201-0/+1
|
* Import select in libbe.subproc if _POSIX == TrueW. Trevor King2009-11-201-0/+3
|
* Adjusted test.py to use an installed vcs by default.W. Trevor King2009-11-205-19/+30
| | | | | | | | | 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.
* Added becommands/email_bugs.pyW. Trevor King2009-11-201-0/+231
| | | | | | This send a list of bugs in a single email off to be processed by be-handle-mail. Of course, be-handle-mail doesn't yet handle the [be-bug:xml] format that email_bugs.py creates. On to that now...
* Broke subprocess handling out into its own submodule libbe.subproc.W. Trevor King2009-11-206-186/+233
|
* Removed superfluous 'import time' from becommands/commit.py doctest.W. Trevor King2009-11-201-1/+1
|
* Created bug 56506b73-36cc-4e32-a578-258a219edba8 describing problemW. Trevor King2009-11-203-0/+43
|
* Have release.py update copyrights as well.W. Trevor King2009-11-202-15/+18
|
* Added release.py script automating release processW. Trevor King2009-11-201-0/+159
|
* Merged updated READMEs and new update_copyright.py (and its results).W. Trevor King2009-11-1947-204/+536
|\
| * Ran the new update_copyright.pyW. Trevor King2009-11-1943-26/+60
| |
| * Translated update_copyright.sh to Python update_copyright.pyW. Trevor King2009-11-192-158/+454
| |
| * Updated README and Bugs-Everywhere-Web/README.W. Trevor King2009-11-192-20/+22
| |
* | Updated NEWS fileW. Trevor King2009-11-171-0/+30
|/
* Fixed bug with unicode handling reported by Nicolas Alvarez.W. Trevor King2009-11-179-34/+48
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Date: Mon, 16 Nov 2009 20:34:50 -0300 From: Nicolas Alvarez <nicolas.alvarez@gmail.com> Subject: [Be-devel] Mercurial + BE + Unicode doesn't work My username in ~/.hgrc contains a Unicode character. When I run "be new" on a Mercurial repository, I get an unhandled Python exception: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128) The following shell script should reproduce the error: #!/bin/sh repo=/tmp/`mktemp -d bug-repro.XXXX` hg init $repo cd $repo /usr/bin/printf "[ui]\nusername = Nicol\u00e1s\n" > $repo/.hg/hgrc be set-root $repo be new "Testing" rm -rf /tmp/$repo [WTK: Note that the be set-root usage is out of date, it is now be init ]
| * Use unicode_output=False in some Darcs._u_invoke_client() calls.W. Trevor King2009-11-176-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids the following error: ====================================================================== ERROR: Should get file contents as committed to specified revision. ---------------------------------------------------------------------- Traceback (most recent call last): File ".../libbe/vcs.py", line 860, in test_revision_file_contents_as_committed full_path, revision) File ".../libbe/vcs.py", line 339, in get_file_contents contents = self._vcs_get_file_contents(relpath,revision,binary=binary) File ".../libbe/darcs.py", line 122, in _vcs_get_file_contents status,output,error = self._u_invoke(args, stdin=major_patch) File ".../libbe/vcs.py", line 488, in _u_invoke raise CommandError(args, status, stdout, stderr) CommandError: Command failed (2): patch: **** Only garbage was found in the patch input. while executing ['patch', '--reverse', 'a/text'] After adding the unicode_output=False lines, I adjusted the VCS._u_invoke_client() definition to pass all it's kwargs automatically through to VCS._u_invoke(). To make this simpler and more consistent, I renamed the "directory" option to "cwd", and adjusted *._u_invoke() calls appropriately in several VCS backends.
| * Cleanup temp. dir. in libbe.vcs tests.W. Trevor King2009-11-171-1/+2
| |
| * "CommandStderr" -> "CommandError" in VCS._u_invoke()W. Trevor King2009-11-171-1/+1
| | | | | | | | | | Corrects a mistake from using string replace to move output,error -> stdout,stderr a few commits ago.
| * Don't attempt to convert unicode objects to strings in *._setting_attr_string()W. Trevor King2009-11-172-2/+6
| |
| * Set binary=True for mapfile file handlingW. Trevor King2009-11-171-4/+9
| | | | | | | | | | | | | | | | The YAML library produces Python string encodings of unicode objects. There's no reason to try and convert them back into Python unicode objects just to save them with binary=False, because the files are only read in to be passed into the YAML parser, which can handle the unicode characters correctly.
| * Added unicode_output option to VCS._u_invoke()W. Trevor King2009-11-171-2/+8
| |
| * rename "output","error" -> "stdout","stderr" in VCS._u_invoke()W. Trevor King2009-11-171-4/+4
|/
* Merged Gianluca's nested directory fix.W. Trevor King2009-10-241-1/+1
|\
| * - Merged Trevor branchGianluca Montecchi2009-10-221-83/+93
| |\ | |/ |/| | | - Reapplied the fix for subdirs
* | Merged Gianluca's recent `be html` work.W. Trevor King2009-10-211-49/+97
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added --export-template and --export-template-dir * Fixed index page row colors. * Fixed --index-header Also a bit of tightening on my own: * Inspired by ._write_file, wrote ._read_file and .make_dir. * Wrapped some lines to stay under 80 characters, * Stripped trailing whitespace.
| | * Fixed a typo in the --export-dir-template optionsGianluca Montecchi2009-10-211-1/+1
| | |
| | * Fixed a problem with the creation of nested directoryGianluca Montecchi2009-10-211-1/+1
| |/ | | | | | | (i.e.: be html -o dir1/dir2 failed to create dir2 if dir1 does not exists)
| * test for bzr mergegian2009-10-21288-6842/+4855
| |\ | |/ |/|
* | Merged my cleanup of Gianluca's HTML branch.W. Trevor King2009-10-206-517/+497
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug in binary comments (non-"text/" content-types), where the content-type wasn't being set until _after_ the save was attempted. This led to errors for non-ascii bodies (e.g. images with null characters). Note that text/html comments are included as is, so make sure they are formatted appropriately to fit into your tempate without creating invalid code. This issue could be a real pain in the neck, especially when including text/html email bodies, which might contain <body> tags, etc.. Stupid email clients that don't send a text/plain alternative...