aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
Commit message (Collapse)AuthorAgeFilesLines
* Fixed comment.cmp_attr unittest because "o" > "a" so cmp("o", "a") == 1.W. Trevor King2009-07-311-2/+2
|
* Fixed indent spacing in libbe.diff.report().W. Trevor King2009-07-311-20/+22
| | | | Only increment depth if data_part != None.
* Merged interactive email interfaceW. Trevor King2009-07-2914-341/+972
|\
| * Corrected some problems with revision_id() before an initial commit.W. Trevor King2009-07-293-2/+19
| |
| * Cleaned up be-handle-mail's subscriber notification emails (fewer attachments).W. Trevor King2009-07-271-20/+20
| | | | | | | | | | | | | | | | | | | | | | Previously, every node in the DiffTree created it's own attachment. Now they're consolidated into a single attachment per bug. higher level nodes are still one attachment per node. Also: * added send_pgp_mime.append_text() * pulled guess_encoding() out of send_pgp_mime.encodedMIMEText(). * renamed data_string -> data_part in libbe.diff, since it needn't be a string.
| * Tweaked the output text for modified bugs in libbe.diff and be-handle-mail.W. Trevor King2009-07-271-1/+3
| |
| * Removed debugging exception from libbe/comment.py.W. Trevor King2009-07-271-1/+0
| |
| * Comment.remove() now ignores .sync_with_disk when removing the root comment.W. Trevor King2009-07-271-1/+1
| |
| * Added default to settings_object.versioned_property's change_hook_property.W. Trevor King2009-07-272-13/+8
| | | | | | | | | | | | | | | | | | | | 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.
| * Added cmp functions to libbe.comment, and fleshed them out in libbe.bug.W. Trevor King2009-07-273-7/+78
| | | | | | | | | | | | | | | | | | | | 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).
| * Hack Comment.load_settings() to work around From->Author change.W. Trevor King2009-07-271-0/+3
| | | | | | | | | | | | "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.
| * Cache data strings in libbe.diff.DiffTree.W. Trevor King2009-07-271-0/+3
| | | | | | | | | | This makes repeated .report() generation from the same tree more efficient.
| * Major rewrite of libbe.diff introduces DiffTree and Diff classes.W. Trevor King2009-07-271-94/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * .sync_with_disk fixes for libbe.bugdir and .comment.W. Trevor King2009-07-272-4/+8
| | | | | | | | | | | | | | | | | | | | 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.
| * Added DiskAccessRequired errors to libbe.bug.Bug and .comment.Comment.W. Trevor King2009-07-262-98/+144
| |
| * BugDir._in_memory was a stupid idea. Took it back out.W. Trevor King2009-07-261-103/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was too confusing having three memory access levels: 1) syncronized 2) explicit 3) memory-only with .sync_with_disk selecting between 1 and 2/3 and ._in_memory selecting between 2/3. Now there are only two: 1) syncronized 2) memory-only excepting explicit BugDir.save() calls. I avoid the problem of non-syncronized loading of on-disk bugs in simple_bug_dir by restricting .list_uuids() to in-memory bugs when .sync_with_disk==True. Beyond that, I shifted the order of the BugDir methods around a bit so that they were better grouped according to general idea. Note that the DiskAccessRequired exceptions on filesystem access when .sync_with_disk==False should be propogated to the Bug and Comment methods, but I haven't done that yet.
| * Added in_memory to BugDir.__init__ to disable saving/loading completely.W. Trevor King2009-07-251-17/+77
| | | | | | | | | | | | | | The previous simple_bug_dir(on_disk==False) supprised me by loading my BE bugdir when called from the BE directory. This functionality could probably move out to Bug and Comment as well, but I have avoided that for now.
| * Added on_disk option to libbe.bugdir.simple_bug_dir().W. Trevor King2009-07-251-6/+14
| | | | | | | | Now you can easily generate simple_bug_dirs that live only in memory.
| * Renamed Comment.From and .time_string to .author and .date respectively.W. Trevor King2009-07-251-27/+23
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Added .revision_id() to all the VCSs.W. Trevor King2009-07-236-24/+114
| | | | | | | | | | This makes it easier to compare recent revisions without a human around to give you revision numbers.
| * Merged libbe.diff upgrades and libbe.tree.Tree.has_descendant from be.wtk-rr.W. Trevor King2009-07-233-28/+73
| |\ | | | | | | | | | Also pulls "show referenced text" fix to "be comment".
| * \ Merged assorted changes from be.wtk-rr for BugDir.extra_strings.W. Trevor King2009-07-217-85/+216
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | Other highlights: * be show --no-comments * Improved *.sync_with_disk. * Improved be-mbox-to-xml.
| * \ \ Merged "be commit --allow-empty from be.wtk-rr"W. Trevor King2009-07-197-47/+101
| |\ \ \
| * \ \ \ Merged becommands/commit.py addition from be.wtk-rr.W. Trevor King2009-07-193-4/+5
| |\ \ \ \
| * \ \ \ \ Merged some bugfixes from be.wtk-rrW. Trevor King2009-07-181-1/+1
| |\ \ \ \ \
| * | | | | | Allow external override of libbe.encoding.get_encoding().W. Trevor King2009-07-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous procmail encoding fix failed, because the becommand execution checks libbe.encoding.get_encoding() on it's own, and got the procmail encoding. This one works.
| * | | | | | Renamed test->manipulate_encodings in becommands.*.execute.W. Trevor King2009-07-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 clean messages on bug_from_shortname failure.W. Trevor King2009-07-292-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | So user's don't get confused.
* | | | | | | libbe.rcs.RCS.commit() now actually calls .pre/postcommit().W. Trevor King2009-07-232-16/+10
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It hadn't before, which defeats the Pu purpose of hook functions. This hand't caused any problems though, since only libbe.bzr defined a postcommit() and there were no precommit() definitions. Bzr's postcommit() had been to auto-merge from the default merge source. Yikes! Removed that ;).
* | | | | | Added bugdir setting comparision to libbe.diff.W. Trevor King2009-07-231-20/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Added libbe.bug.cmp_comments(), and added that to default bug comparison.W. Trevor King2009-07-231-1/+18
| | | | | |
* | | | | | Added libbe.tree.Tree.has_descendant().W. Trevor King2009-07-231-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tree equality is now based on instance id. It had previously used the default list "equal if all elements are equal", which meant that all the leaves matched each other.
* | | | | | libbe/tree.Tree.traverse(depthFirst)->depth_first & stripped trailing spaces.W. Trevor King2009-07-231-7/+7
| |_|_|_|/ |/| | | |
* | | | | I'll add Comment.extra_strings too, while I'm at it.W. Trevor King2009-07-211-0/+14
| | | | |
* | | | | Added BugDir.extra_strings.W. Trevor King2009-07-211-0/+14
| | | | |
* | | | | Bug._extra_strings_check_fn() guts now utility.iterable_full_of_strings().W. Trevor King2009-07-212-10/+22
| | | | |
* | | | | libbe.properties unittest changes due to "extra change-hook save" fix.W. Trevor King2009-07-211-4/+8
| | | | | | | | | | | | | | | | | | | | Missed these earlier.
* | | | | Fixed extra change-hook save in testChangeHookMutableProperty.W. Trevor King2009-07-212-23/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The actual fix was @@ -339,7 +355,10 @@ fset = funcs.get("fset") name = funcs.get("name", "<unknown>") def _fget(self, new_value=None, from_fset=False): # only used if mutable == True - value = fget(self) + if from_fset == True: + value = new_value # compare new value with cached + else: + value = fget(self) # compare current value with cached if _cmp_cached_mutable_property(self, "change hook property", name, value) != 0: # there has been a change, cache new value old_value = _get_cached_mutable_property(self, "change hook property", name) The reason for the double-save was: >>> print t.settings["List-type"]==EMPTY True (the cached value here is EMPTY) >>> t.list_type = [] (old fget compares cached EMPTY to current EMPTY, no change, so no cache. fset notices change and saves EMPTY->[]) >>> t.list_type.append(5) (now fget notices the change EMPTY->[], caches [], and calls extra save) The new way: >>> print t.settings["List-type"]==EMPTY True (the cached value here is EMPTY) >>> t.list_type = [] (fget compares cached EMPTY to new [] and saves EMPTY->[]) >>> t.list_type.append(5) (fget sees no change ([]->[]), which is correct) In addition to the fix and the related corrections to testChangeHookMutableProperty, I added details about mutables to all relevant docstrings and stripped trailing whitespace from both files.
* | | | | Cleaned up saving/sync_with_disk.W. Trevor King2009-07-214-37/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-204-11/+10
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | From back before commit wking@drexel.edu-20090619184215-nfx205yaj02sqrqx cleaned up the versioned_property implementation. Also a few style fixes and typos.
* | | | Added --allow-empty to "be commit"W. Trevor King2009-07-197-46/+100
| |_|/ |/| | | | | | | | | | | | | | | | | 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.
* | | Added becommands/commit.py and minor fixes.W. Trevor King2009-07-193-4/+5
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fixed broken path in libbe.rcs.RCS._rcs_get_file_contents(binary=True).W. Trevor King2009-07-181-1/+1
|/ | | | | | I'd forgotten to prefix the directory root, so calling be show --only-raw-body COMMIT-ID would fail if you weren't executing it in the repository root.
* Updated GPLv2 to current GPLv2.W. Trevor King2009-07-1421-233/+231
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fixed "be --dir --complete"W. Trevor King2009-07-131-0/+8
|
* Use CmdOptionParser in "be".W. Trevor King2009-07-131-9/+14
| | | | | | All the becommands have been using cmdutil CmdOptionParser for a long time, but "be" parsed its options by hand. Now it used CmdOptionParser, which makes adding new options much easier.
* Added "be comment --xml --ignore-missing-references ID COMMENT".W. Trevor King2009-07-122-4/+23
| | | | Now you don't have to edit them out by hand.
* Added timezone handling to libbe.utility.str_to_time.W. Trevor King2009-07-121-2/+20
|
* Minor fixes to get unittests working again.W. Trevor King2009-07-121-2/+1
|
* Added be-mbox-to-xml.W. Trevor King2009-07-122-7/+21
| | | | | | | | | | | | | | | | | | | | | | | 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 ;).