| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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 *.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().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
"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.
|
|
|
|
| |
Also a few minor tweaks to the module imports.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
| |
"Author" -> comment.author obeys settings_object.setting_name_to_attr_name(),
but all the current on-disk mapfiles talk about "From". Add a hack to accept
both forms of on-disk comment files.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
|
| |
From back before commit
wking@drexel.edu-20090619184215-nfx205yaj02sqrqx
cleaned up the versioned_property implementation.
Also a few style fixes and typos.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Now you don't have to edit them out by hand.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 ;).
|
| |
|
|
|
|
|
| |
Also adjusted libbe/comment.py to move to user-specified alt_ids,
rather than uuids.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
Since
<creator>John Doe <jdoe@example.com></creator>
is not valid XML.
|
|
|
|
| |
The xml() method hadn't been updated since the settings_object revamp.
|
|
|
|
|
| |
Renamed "name" -> "short-name" and "in_reply_to" -> "in-reply-to".
Reordered uuid before short-name.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 ;).
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If bug_A had no comments (and so, no comment directory), changing
comment settings before saving raised missing directory errors.
save_settings had previously assumed the
.be/bugs/XYZ/comments/
directory existed, which wasn't true for comment-less bugs. Now it
checks, and creates the directory if necessary.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
settings_object.SavedSettingsObject encapsulates some of the common
settings functionality in the BE BugDir, Bug, and Comment classes.
It's a bit awkward due to the nature of scoping in python subclasses,
but it's better than reproducing this code in each of the above classes.
Now I need to move Bug and Comment over to *this* system ;).
|
| |
| |
| |
| |
| | |
Also some typo corrections and some reworking of bug/bugdir to better
support the lazier loading.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I borrowed most of the code for this.
get_encoding() is from Trac
http://trac.edgewall.org/browser/trunk/trac/util/datefmt.py
format_datetime()
Trac has a BSD license
http://trac.edgewall.org/wiki/TracLicense
I don't know if such a small snippet requires us to "reproduce the
above copyright" or where we need to reproduce it if it is needed.
The stdout/stdin replacement code follows
http://wiki.python.org/moin/ShellRedirectionFails
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).
References:
http://wiki.python.org/moin/Unicode
http://www.amk.ca/python/howto/unicode
http://www.python.org/dev/peps/pep-0100/
I also split libbe/editor.py off from libbe.utility.py and started
explaining the motivation for the BugDir init flags in it's docstring.
|