be.git
15 years agoFixed import_xml.py to live up to its longhelp description.
W. Trevor King [Mon, 30 Nov 2009 11:35:29 +0000 (06:35 -0500)]
Fixed import_xml.py to live up to its longhelp description.

Also added LonghelpTestCase to prove it.

15 years agoAvoid redundant Comment.alt_ids
W. Trevor King [Mon, 30 Nov 2009 11:26:49 +0000 (06:26 -0500)]
Avoid redundant Comment.alt_ids

15 years agoChanged Bug and Comment.merge() kwargs.
W. Trevor King [Mon, 30 Nov 2009 11:05:03 +0000 (06:05 -0500)]
Changed Bug and Comment.merge() kwargs.

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.

15 years agoMinor BugDir docstring typo correction.
W. Trevor King [Mon, 30 Nov 2009 10:05:49 +0000 (05:05 -0500)]
Minor BugDir docstring typo correction.

15 years agoMoved comment.list_to_root() to Bug.add_comments() with some cleanups.
W. Trevor King [Sun, 29 Nov 2009 08:19:30 +0000 (03:19 -0500)]
Moved comment.list_to_root() to Bug.add_comments() with some cleanups.

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.

15 years agoAdded comment import to Bug.from_xml().
W. Trevor King [Sun, 29 Nov 2009 03:07:16 +0000 (22:07 -0500)]
Added comment import to Bug.from_xml().

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.

15 years agotest.py now uses unittest.TestSuite 'suite' in becommands if present.
W. Trevor King [Sun, 29 Nov 2009 01:27:53 +0000 (20:27 -0500)]
test.py now uses unittest.TestSuite 'suite' in becommands if present.

Such 'suite' instances have been required for libbe submodules.  This
will allow becommands to test themselves more thoroughly than they
could with only doctests.

15 years agoBugDir.list_uuids() -> BugDir.uuids()
W. Trevor King [Sun, 29 Nov 2009 01:24:19 +0000 (20:24 -0500)]
BugDir.list_uuids() -> BugDir.uuids()

15 years agoAdded Bug.merge() and Comment.merge().
W. Trevor King [Sat, 28 Nov 2009 12:41:13 +0000 (07:41 -0500)]
Added Bug.merge() and Comment.merge().

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().

15 years agoAdded restrict_file_access to becommands' execute() args.
W. Trevor King [Sat, 21 Nov 2009 20:18:02 +0000 (15:18 -0500)]
Added restrict_file_access to becommands' execute() args.

+ associated adjustments in other files.

See cmdutil.restrict_file_access.__doc__ for an explanation of the
security hole this closes.

15 years agoMerged mostly completed `be email-bugs'.
W. Trevor King [Sat, 21 Nov 2009 20:06:10 +0000 (15:06 -0500)]
Merged mostly completed `be email-bugs'.

Highlights:
 * new be commands 'email-bugs' and 'import-xml'
 * standardized <be-xml> format for XML files.
 * new be-handle-mail interface '[be-bug:xml]'
 * restrict_file_access security patch
 * new subprocess handling submodule libbe.subproc
 * test.py adjusted to use an installed VCS for most tests.
 * assorted bugfixes

Altered interfaces to the following be commands:
 * comment --xml     tag gone, use import-xml.
 * show --xml        xml format updated to <be-xml> format.

Also adjusted be-mbox-to-xml and be-xml-to-mbox to handle new <be-xml>
format and provide better handling of *.extra_strings.

15 years agoFix libbe.vcs.VCS.get_file_contents(allow_no_vcs=True,binary=True).
W. Trevor King [Sat, 21 Nov 2009 19:54:11 +0000 (14:54 -0500)]
Fix libbe.vcs.VCS.get_file_contents(allow_no_vcs=True,binary=True).

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.

15 years agoUpdated interfaces/email/interactive/README for [be-bug:xml] interface
W. Trevor King [Sat, 21 Nov 2009 19:03:00 +0000 (14:03 -0500)]
Updated interfaces/email/interactive/README for [be-bug:xml] interface

15 years agoAdded [be-tag:xml] processing to be-handle-mail.
W. Trevor King [Sat, 21 Nov 2009 18:53:09 +0000 (13:53 -0500)]
Added [be-tag:xml] processing to be-handle-mail.

Now it will automatically apply and commit emails from
  be email-bugs ...

15 years agoAdjusted `be import-xml` to properly handle croot_bug==None.
W. Trevor King [Sat, 21 Nov 2009 18:49:32 +0000 (13:49 -0500)]
Adjusted `be import-xml` to properly handle croot_bug==None.

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.

15 years agoFixed bug in be-handle-mail.Message.parse_comment() for emails w/o Message-id.
W. Trevor King [Sat, 21 Nov 2009 18:18:54 +0000 (13:18 -0500)]
Fixed bug in be-handle-mail.Message.parse_comment() for emails w/o Message-id.

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,...]

15 years agoAdded interfaces/email/interactive/examples/email_bugs
W. Trevor King [Sat, 21 Nov 2009 18:08:05 +0000 (13:08 -0500)]
Added interfaces/email/interactive/examples/email_bugs

For testing the new [be-bug:xml] interface we're about to write.

15 years ago`be email-bugs` now uses `be show` internals to produce consistent XML.
W. Trevor King [Sat, 21 Nov 2009 17:52:37 +0000 (12:52 -0500)]
`be email-bugs` now uses `be show` internals to produce consistent XML.

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.

15 years agoUpgraded `be show --xml` to new <be-xml> format.
W. Trevor King [Sat, 21 Nov 2009 17:23:47 +0000 (12:23 -0500)]
Upgraded `be show --xml` to new <be-xml> format.

15 years agoBroke `be comment --xml` out and extended into `be import-xml`.
W. Trevor King [Sat, 21 Nov 2009 15:53:04 +0000 (10:53 -0500)]
Broke `be comment --xml` out and extended into `be import-xml`.

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.)

15 years agoAdded Bug.from_xml() + some .from_xml() fixups.
W. Trevor King [Fri, 20 Nov 2009 22:09:08 +0000 (17:09 -0500)]
Added Bug.from_xml() + some .from_xml() fixups.

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.

15 years agoImport os in libbe.subproc if _POSIX == True
W. Trevor King [Fri, 20 Nov 2009 22:07:57 +0000 (17:07 -0500)]
Import os in libbe.subproc if _POSIX == True

15 years agoFixed bug 529c290e-b1cf-4800-be7e-68f1ecb9565c (howto version BE).
W. Trevor King [Fri, 20 Nov 2009 21:48:07 +0000 (16:48 -0500)]
Fixed bug 529c290e-b1cf-4800-be7e-68f1ecb9565c (howto version BE).

Also appended some of the recent discussion about releases to the
comment list.

15 years agoFix typo in becommands.init's doctest
W. Trevor King [Fri, 20 Nov 2009 20:10:59 +0000 (15:10 -0500)]
Fix typo in becommands.init's doctest

15 years agoImport select in libbe.subproc if _POSIX == True
W. Trevor King [Fri, 20 Nov 2009 20:09:42 +0000 (15:09 -0500)]
Import select in libbe.subproc if _POSIX == True

15 years agoAdjusted test.py to use an installed vcs by default.
W. Trevor King [Fri, 20 Nov 2009 19:29:01 +0000 (14:29 -0500)]
Adjusted test.py to use an installed vcs by default.

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.

15 years agoAdded becommands/email_bugs.py
W. Trevor King [Fri, 20 Nov 2009 18:25:08 +0000 (13:25 -0500)]
Added becommands/email_bugs.py

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...

15 years agoBroke subprocess handling out into its own submodule libbe.subproc.
W. Trevor King [Fri, 20 Nov 2009 15:48:36 +0000 (10:48 -0500)]
Broke subprocess handling out into its own submodule libbe.subproc.

15 years agoRemoved superfluous 'import time' from becommands/commit.py doctest.
W. Trevor King [Fri, 20 Nov 2009 14:41:44 +0000 (09:41 -0500)]
Removed superfluous 'import time' from becommands/commit.py doctest.

15 years agoCreated bug 56506b73-36cc-4e32-a578-258a219edba8 describing problem
W. Trevor King [Fri, 20 Nov 2009 13:33:40 +0000 (08:33 -0500)]
Created bug 56506b73-36cc-4e32-a578-258a219edba8 describing problem

15 years agoHave release.py update copyrights as well.
W. Trevor King [Fri, 20 Nov 2009 12:57:17 +0000 (07:57 -0500)]
Have release.py update copyrights as well.

15 years agoAdded release.py script automating release process
W. Trevor King [Fri, 20 Nov 2009 12:28:20 +0000 (07:28 -0500)]
Added release.py script automating release process

15 years agoMerged updated READMEs and new update_copyright.py (and its results).
W. Trevor King [Thu, 19 Nov 2009 21:45:53 +0000 (16:45 -0500)]
Merged updated READMEs and new update_copyright.py (and its results).

15 years agoRan the new update_copyright.py
W. Trevor King [Thu, 19 Nov 2009 22:00:02 +0000 (17:00 -0500)]
Ran the new update_copyright.py

15 years agoTranslated update_copyright.sh to Python update_copyright.py
W. Trevor King [Thu, 19 Nov 2009 21:59:06 +0000 (16:59 -0500)]
Translated update_copyright.sh to Python update_copyright.py

15 years agoUpdated README and Bugs-Everywhere-Web/README.
W. Trevor King [Thu, 19 Nov 2009 05:39:31 +0000 (00:39 -0500)]
Updated README and Bugs-Everywhere-Web/README.

15 years agoUpdated NEWS file
W. Trevor King [Wed, 18 Nov 2009 00:55:42 +0000 (19:55 -0500)]
Updated NEWS file

15 years agoFixed bug with unicode handling reported by Nicolas Alvarez.
W. Trevor King [Tue, 17 Nov 2009 14:51:18 +0000 (09:51 -0500)]
Fixed bug with unicode handling reported by Nicolas Alvarez.

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
]

15 years agoUse unicode_output=False in some Darcs._u_invoke_client() calls.
W. Trevor King [Tue, 17 Nov 2009 14:47:44 +0000 (09:47 -0500)]
Use unicode_output=False in some Darcs._u_invoke_client() calls.

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.

15 years agoCleanup temp. dir. in libbe.vcs tests.
W. Trevor King [Tue, 17 Nov 2009 14:04:37 +0000 (09:04 -0500)]
Cleanup temp. dir. in libbe.vcs tests.

15 years ago"CommandStderr" -> "CommandError" in VCS._u_invoke()
W. Trevor King [Tue, 17 Nov 2009 13:48:14 +0000 (08:48 -0500)]
"CommandStderr" -> "CommandError" in VCS._u_invoke()

Corrects a mistake from using string replace to move output,error ->
stdout,stderr a few commits ago.

15 years agoDon't attempt to convert unicode objects to strings in *._setting_attr_string()
W. Trevor King [Tue, 17 Nov 2009 13:43:44 +0000 (08:43 -0500)]
Don't attempt to convert unicode objects to strings in *._setting_attr_string()

15 years agoSet binary=True for mapfile file handling
W. Trevor King [Tue, 17 Nov 2009 13:36:22 +0000 (08:36 -0500)]
Set binary=True for mapfile file handling

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.

15 years agoAdded unicode_output option to VCS._u_invoke()
W. Trevor King [Tue, 17 Nov 2009 13:25:15 +0000 (08:25 -0500)]
Added unicode_output option to VCS._u_invoke()

15 years agorename "output","error" -> "stdout","stderr" in VCS._u_invoke()
W. Trevor King [Tue, 17 Nov 2009 13:21:56 +0000 (08:21 -0500)]
rename "output","error" -> "stdout","stderr" in VCS._u_invoke()

15 years agoMerged Gianluca's nested directory fix.
W. Trevor King [Sat, 24 Oct 2009 11:21:07 +0000 (07:21 -0400)]
Merged Gianluca's nested directory fix.

15 years ago- Merged Trevor branch
Gianluca Montecchi [Thu, 22 Oct 2009 20:20:19 +0000 (22:20 +0200)]
- Merged Trevor branch
- Reapplied the fix for subdirs

15 years agoFixed a typo in the --export-dir-template options
Gianluca Montecchi [Wed, 21 Oct 2009 21:34:05 +0000 (23:34 +0200)]
Fixed a typo in the --export-dir-template options

15 years agoFixed a problem with the creation of nested directory
Gianluca Montecchi [Wed, 21 Oct 2009 21:30:35 +0000 (23:30 +0200)]
Fixed a problem with the creation of nested directory
(i.e.: be html -o dir1/dir2 failed to create dir2 if dir1 does not exists)

15 years agoMerged Gianluca's recent `be html` work.
W. Trevor King [Wed, 21 Oct 2009 15:03:50 +0000 (11:03 -0400)]
Merged Gianluca's recent `be html` work.

* 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.

15 years agotest for bzr merge
gian [Wed, 21 Oct 2009 12:51:06 +0000 (14:51 +0200)]
test for bzr merge

15 years agoFinished merge with Trevor branch
Gianluca Montecchi [Tue, 20 Oct 2009 23:18:40 +0000 (01:18 +0200)]
Finished merge with Trevor branch

15 years agoadded the --export-template and --export-dir_template
Gianluca Montecchi [Tue, 20 Oct 2009 23:14:10 +0000 (01:14 +0200)]
added the --export-template and --export-dir_template
to export the default template

15 years agoThe (ugly) colors are back
Gianluca Montecchi [Tue, 20 Oct 2009 22:37:18 +0000 (00:37 +0200)]
The (ugly) colors are back

15 years agoFixed the wrong index_header values
Gianluca Montecchi [Tue, 20 Oct 2009 21:15:27 +0000 (23:15 +0200)]
Fixed the wrong index_header values

15 years agomerged with Trevor branch
Gianluca Montecchi [Tue, 20 Oct 2009 21:08:57 +0000 (23:08 +0200)]
merged with Trevor branch

15 years agoMerged my cleanup of Gianluca's HTML branch.
W. Trevor King [Tue, 20 Oct 2009 13:38:17 +0000 (09:38 -0400)]
Merged my cleanup of Gianluca's HTML branch.

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...

15 years agoSave non-text/ comments as separate files. Inline images.
W. Trevor King [Tue, 20 Oct 2009 13:37:22 +0000 (09:37 -0400)]
Save non-text/ comments as separate files.  Inline images.

15 years agoPass content_type to Comment.new_reply() to fix error adding non-text/ comments
W. Trevor King [Tue, 20 Oct 2009 13:30:42 +0000 (09:30 -0400)]
Pass content_type to Comment.new_reply() to fix error adding non-text/ comments

15 years agoRestructured becommands/html to make templating more flexible + general cleanups.
W. Trevor King [Tue, 20 Oct 2009 12:28:35 +0000 (08:28 -0400)]
Restructured becommands/html to make templating more flexible + general cleanups.

15 years agoGeneral cleanup of becommands/html.py
W. Trevor King [Tue, 20 Oct 2009 01:36:25 +0000 (21:36 -0400)]
General cleanup of becommands/html.py

15 years agoMerged Gianluca's html becommand with templates.
W. Trevor King [Mon, 19 Oct 2009 23:52:14 +0000 (19:52 -0400)]
Merged Gianluca's html becommand with templates.

15 years agoNon-event merge with trunk, just to pull in that bit of history
W. Trevor King [Mon, 19 Oct 2009 19:51:34 +0000 (15:51 -0400)]
Non-event merge with trunk, just to pull in that bit of history

15 years agoReworked the html command template system
Gianluca Montecchi [Thu, 8 Oct 2009 20:18:50 +0000 (22:18 +0200)]
Reworked the html command template system

15 years agoPartially moved to a newer, better and simpler template system
Gianluca Montecchi [Wed, 7 Oct 2009 23:17:03 +0000 (01:17 +0200)]
Partially moved to a newer, better and simpler template system

15 years agoTemplate system v1 completed
Gianluca Montecchi [Wed, 7 Oct 2009 22:41:31 +0000 (00:41 +0200)]
Template system v1 completed

15 years agoUpdated to trunk
Gianluca Montecchi [Wed, 7 Oct 2009 18:41:49 +0000 (20:41 +0200)]
Updated to trunk

15 years agoFix darcs testsuite failure
Chris Ball [Tue, 6 Oct 2009 14:56:47 +0000 (10:56 -0400)]
Fix darcs testsuite failure

15 years agoOops, fixed return typo in libbe.darcs.Darcs._vcs_get_file_contents()
W. Trevor King [Tue, 6 Oct 2009 10:47:10 +0000 (06:47 -0400)]
Oops, fixed return typo in libbe.darcs.Darcs._vcs_get_file_contents()

For self.parsed_version[0] >= 2, was returning the entire output of
._u_invoke_client() (status, output, and error).  Now it just returns
the output, which is what we want.  This fixes Chris' failed test:

======================================================================
FAIL: Should get file contents as committed to specified revision.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "libbe/vcs.py", line 852, in test_revision_file_contents_as_committed
    self.test_contents['rev_1'], committed_contents)
AssertionError: 'Lorem ipsum' != (0, 'Lorem ipsum', '')
----------------------------------------------------------------------

15 years agoMoved VCS detection from _vcs_help() to _vcs_version().
W. Trevor King [Tue, 6 Oct 2009 10:37:21 +0000 (06:37 -0400)]
Moved VCS detection from _vcs_help() to _vcs_version().

The version string is useful information to have around, while the
help string is probably not.  For example, we use it in
darcs.Darcs._vcs_get_file_contents() to construct an incantation
appropriate to the version we're dealing with.

15 years agoSilence testsuite warnings, from W. Trevor King.
Chris Ball [Tue, 6 Oct 2009 03:16:33 +0000 (23:16 -0400)]
Silence testsuite warnings, from W. Trevor King.

15 years agoLarge merge from W. Trevor King, including Gianluca's HTML export.
Chris Ball [Tue, 6 Oct 2009 03:15:39 +0000 (23:15 -0400)]
Large merge from W. Trevor King, including Gianluca's HTML export.

15 years agoMoved from *.__del__() to exclusive use of *.cleanup().
W. Trevor King [Tue, 6 Oct 2009 01:00:34 +0000 (21:00 -0400)]
Moved from *.__del__() to exclusive use of *.cleanup().

*.__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()

15 years agoInitial implementation of a template system
Gianluca Montecchi [Mon, 5 Oct 2009 22:35:47 +0000 (00:35 +0200)]
Initial implementation of a template system

15 years agoAdded the verbose option
Gianluca Montecchi [Mon, 5 Oct 2009 22:08:11 +0000 (00:08 +0200)]
Added the verbose option

15 years agohelp
Gianluca Montecchi [Mon, 5 Oct 2009 21:51:13 +0000 (23:51 +0200)]
help

15 years agoAdded the initial support for css templates
Gianluca Montecchi [Fri, 2 Oct 2009 22:05:16 +0000 (00:05 +0200)]
Added the initial support for css templates

15 years agoMerged with Trevor's -rr branch
Gianluca Montecchi [Fri, 2 Oct 2009 21:46:24 +0000 (23:46 +0200)]
Merged with Trevor's -rr branch

15 years agoFixed the merge
Gianluca Montecchi [Thu, 1 Oct 2009 22:08:33 +0000 (00:08 +0200)]
Fixed the merge

15 years agoMerged with head branch
Gianluca Montecchi [Thu, 1 Oct 2009 21:39:28 +0000 (23:39 +0200)]
Merged with head branch

15 years agoSet self.ret if necessary in be-handle-mail.Command.response_msg().
W. Trevor King [Sat, 26 Sep 2009 17:49:26 +0000 (13:49 -0400)]
Set self.ret if necessary in be-handle-mail.Command.response_msg().

If an exception is raised during command exection, self.ret may be
left at None.

15 years agoAdded "Confirm" and "Subscribe" pseudoheaders to be-handle-mail.
W. Trevor King [Sat, 26 Sep 2009 17:02:18 +0000 (13:02 -0400)]
Added "Confirm" and "Subscribe" pseudoheaders to be-handle-mail.

Allowed values for both are "yes" or "no", case insensitive.

Setting Confirm:no disables the confirmation email letting you know
your new bug was successfully submitted.

Setting Subscribe:yes automatically subscribes you to the new bug
you're submitting immediately, without reqiring an extra control
email.

In the case where both Confirm:yes and Subscribe:yes, the submitter
will only recieve the subscription email (which shows the "be show"
view of the new bug) and not the submission email (which shows the
output of all the executed submission commands).

Both of these pseudoheaders were in response to a
  Would you like a direct response concerning your comments?
checkbox on the web frontend that generates emails for a BE repo.
When the checkbox is set, we set Confirm:yes Subscribe:yes, and the
submitter gets a nice pretty confirmation email and will be
automatically notified of any future action on their bug.  When the
checkbox is not set, they get no response or submission emails.

Also fixed up some bugs in in the subscriber_emails() parsing.  We now
use ordered_subscriptions to ensure that we parse the "DIR"
subscription first, since we don't want to include the same
information twice, and the user might be subscribed to DIR:all and a
particular bug (which would be wierd, but is easily avoidable).  This
also ensures that the more central DIR level changes appear first in
the email.

We also check that there is an entry for a particular bug in bug_index
before attempting to grab it, which could raise KeyErrors otherwise.

Finally, we check to make sure we don't double-include bugs for which
the user is subscribed to both that bug's new and DIR:new.

A final minor correction is the capitalization of the first word of
our log entries.  The logs are pretty cluttered, and the
capitalization helps the lines I care about stand out.  A better
solution would be to come up with a cleaner idea of what to write to
the logs...

15 years agoLoad bugs in be-handle-mail.Message.subscriber_emails().
W. Trevor King [Sat, 26 Sep 2009 16:48:42 +0000 (12:48 -0400)]
Load bugs in be-handle-mail.Message.subscriber_emails().

Because subscribe.get_bugdir_subscribers() only looks for subscribers
in bugs that are already in memory.

15 years agoFix agressive be-handle-mail.Message._strip_footer().
W. Trevor King [Sat, 26 Sep 2009 16:45:27 +0000 (12:45 -0400)]
Fix agressive be-handle-mail.Message._strip_footer().

It had been eating the last line of the message (which wasn't a
problem when I had a blank line before the footer, but was when I had
neither footer nor trailing blank line).

15 years agoPrefix cache attributes in be-handle-mail with underscore (_).
W. Trevor King [Sat, 26 Sep 2009 16:43:40 +0000 (12:43 -0400)]
Prefix cache attributes in be-handle-mail with underscore (_).

To conform with Python convention for "hiding" class attributes only
intended for internal use.

15 years agoFixed invalid TAG error in becommands.subscribe.get_subscribers()
W. Trevor King [Sat, 26 Sep 2009 16:39:37 +0000 (12:39 -0400)]
Fixed invalid TAG error in becommands.subscribe.get_subscribers()

Check that the string has the right tag before attempting to parse it
:p.

15 years agoAdded -a and -l options to be subscribe.
W. Trevor King [Sat, 26 Sep 2009 16:37:49 +0000 (12:37 -0400)]
Added -a and -l options to be subscribe.

It's useful to have some way to see the current subscription status
from the command line ;).

15 years agoAdded normalize_RFC_2822_date() to be-mbox-to-xml.
W. Trevor King [Wed, 23 Sep 2009 16:18:31 +0000 (12:18 -0400)]
Added normalize_RFC_2822_date() to be-mbox-to-xml.

The
  if new_fields[u'date'] != None:
bit avoids attemting to normalize missing dates (which fails).  You
get messages with missing dates when comment_message_to_xml() is
called recursively for multipart messages.

Also fixed some unicode keys (['X'] -> [u'X']) for consistency.

15 years agoAdded normalize_email_address() to be-mbox-to-xml
W. Trevor King [Wed, 23 Sep 2009 15:03:59 +0000 (11:03 -0400)]
Added normalize_email_address() to be-mbox-to-xml

15 years agoFixed mutliple in-reply-to splitting in be-mbox-to-xml
W. Trevor King [Wed, 23 Sep 2009 14:47:17 +0000 (10:47 -0400)]
Fixed mutliple in-reply-to splitting in be-mbox-to-xml

15 years agoFixed bugdir name collision in cmdutil.bug_from_shortname()
W. Trevor King [Wed, 23 Sep 2009 14:07:38 +0000 (10:07 -0400)]
Fixed bugdir name collision in cmdutil.bug_from_shortname()

15 years agoUse Bug.active to decide active status in becommands/html.py
W. Trevor King [Wed, 23 Sep 2009 13:13:46 +0000 (09:13 -0400)]
Use Bug.active to decide active status in becommands/html.py

15 years agoConvert incoming text/* email payloads to unicode in be-handle-mail.
W. Trevor King [Wed, 23 Sep 2009 10:30:31 +0000 (06:30 -0400)]
Convert incoming text/* email payloads to unicode in be-handle-mail.

Switched from cStringIO to StringIO in be-handle-mail because:
  (from http://docs.python.org/library/stringio.html)

  "Unlike the memory files implemented by the StringIO module, those
  provided by this [cStringIO] module are not able to accept Unicode
  strings that cannot be encoded as plain ASCII strings."

I'm not sure what all the fuss with sys.__stdin__ had been about in
Command.run(), but I took it out and everything still seems to work
;).

Also fix Makefail (again!) to install under $HOME by default.

15 years agoos.path.isdir() -> .exists() for check for "comments" file.
W. Trevor King [Mon, 21 Sep 2009 13:52:28 +0000 (09:52 -0400)]
os.path.isdir() -> .exists() for check for "comments" file.

"comments" should always be a directory if it exists, but if it is
something else, be should fail rather than return an empty comment
list.

This fix was inspired by some browsing around in response to Thomas
Habets' version of a fix for missing "bugs" directory.

15 years agoInclude stdout in CommandError.
W. Trevor King [Sat, 19 Sep 2009 21:58:09 +0000 (17:58 -0400)]
Include stdout in CommandError.

15 years agoFixed email.Parser typo in send_pgp_mime.py imports for Python 2.4.
W. Trevor King [Thu, 17 Sep 2009 19:31:01 +0000 (15:31 -0400)]
Fixed email.Parser typo in send_pgp_mime.py imports for Python 2.4.

15 years agoAdded `be --verbose-version' option to print full version information.
W. Trevor King [Tue, 15 Sep 2009 22:59:16 +0000 (18:59 -0400)]
Added `be --verbose-version' option to print full version information.

15 years agoAdded libbe.version, wrapping the auto-generated libbe._version.
W. Trevor King [Tue, 15 Sep 2009 13:32:40 +0000 (09:32 -0400)]
Added libbe.version, wrapping the auto-generated libbe._version.

Two major benefits:

1) Programatic access to the BE version.  Previously the
version-string logic was internal to the commandline interface ./be,
which left the other interfaces hanging.

2) Simple to override auto-generated revision id version with any
string you like (by setting libbe.version._VERSION, if that's the way
you want to run things or the way your packaging system requires.

Note that other modules should never read libbe.version._VERSION,
since it may not be defined.  Instead they should use the output of
libbe.version.version().

15 years agoFixed a few typos in be-handle-mail
W. Trevor King [Sun, 13 Sep 2009 10:42:38 +0000 (06:42 -0400)]
Fixed a few typos in be-handle-mail

15 years agoMention commit message in interactive email README subject explaination.
W. Trevor King [Sun, 13 Sep 2009 10:32:07 +0000 (06:32 -0400)]
Mention commit message in interactive email README subject explaination.