aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
Commit message (Collapse)AuthorAgeFilesLines
* Pass content_type to Comment.new_reply() to fix error adding non-text/ commentsW. Trevor King2009-10-201-1/+3
|
* Oops, fixed return typo in libbe.darcs.Darcs._vcs_get_file_contents()W. Trevor King2009-10-061-8/+8
| | | | | | | | | | | | | | | 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', '') ----------------------------------------------------------------------
* Moved VCS detection from _vcs_help() to _vcs_version().W. Trevor King2009-10-066-22/+29
| | | | | | | 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.
* Moved from *.__del__() to exclusive use of *.cleanup().W. Trevor King2009-10-054-14/+9
| | | | | | | | | *.__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()
* Fixed bugdir name collision in cmdutil.bug_from_shortname()W. Trevor King2009-09-231-2/+2
|
* os.path.isdir() -> .exists() for check for "comments" file.W. Trevor King2009-09-211-1/+1
| | | | | | | | | "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.
* Include stdout in CommandError.W. Trevor King2009-09-193-8/+9
|
* Added libbe.version, wrapping the auto-generated libbe._version.W. Trevor King2009-09-151-0/+50
| | | | | | | | | | | | | | | | 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().
* Added docstrings to libbe submodules.W. Trevor King2009-08-3119-29/+123
| | | | Also a few minor tweaks to the module imports.
* BugDir.duplicate_bugdir() fix for when parent bugdir's sync_with_disk == False.W. Trevor King2009-08-311-2/+8
|
* RCS -> VCS, BUGDIR_DISK_VERSION -> v1.2W. Trevor King2009-08-3112-461/+477
|
* Use 'v#.#' for major/minor version in upgrade.BUGDIR_DISK_VERSIONSW. Trevor King2009-08-311-1/+1
|
* Upgrade duplicate bugdirs if necessary (e.g. for `be diff').W. Trevor King2009-08-313-20/+49
| | | | | Also moved pre-YAML mapfile handling in mapfile.parse() into upgrade.Upgrade_1_0_to_2._upgrade_mapfile().
* Added libbe/upgrade.py to handle upgrading on-disk bugdirs.W. Trevor King2009-08-313-16/+144
|
* Made get_path() definitions consistent between bugdirs, bugs, and comments.W. Trevor King2009-08-313-15/+15
|
* Handle BugDir.list_uuids() in the case of missing ".be/bugs/".W. Trevor King2009-08-111-4/+5
| | | | | | | | | | Previously: $ be init $ be list ... File ".../libbe/bugdir.py", line 537, in list_uuids for uuid in os.listdir(self.get_path("bugs")): OSError: [Errno 2] No such file or directory: '.../.be/bugs'
* Now libbe.git.Git handles missing name/email and guesses instead.W. Trevor King2009-08-041-4/+12
|
* Ssupport for UTF-8 in "be comment" calls to EDITOR/VISUAL.W. Trevor King2009-08-031-1/+2
|
* Improved unittest cleanup by adding BugDir.cleanup().W. Trevor King2009-07-313-36/+54
| | | | | | | | Also simple_bug_dir -> SimpleBugDir class, which allows me to add utility.Dir cleanup to SimpleBugDir.cleanup(). Still having a bit of trouble with the becommand.new tests due to bugdir loading though...
* Return to original directory after libbe.bugdir.SimpleBugDirTestCase().W. Trevor King2009-07-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was causing strange "RCS not found" errors in the bzr and hg unittests. For example, the bzr tests all passed: wking@thor:be.wtk-rr$ python test.py bzr ... Ran 12 tests in 24.143s OK Except when run after the bugdir tests: wking@thor:be.wtk-rr$ python test.py bugdir bzr ... Ran 19 tests in 1.862s FAILED (errors=12) Where the failures were all AssertionError: bzr RCS not found Fixed by returning to intial directory after SimpleBugDirTestCase execution. Problem is due to Python issues with unlinked directories though, so bzr/hg will _still_ not work from unlinked directories. This is for Python 2.5.4 on Ubuntu 8.04.3, but probably effects other pythons too. Details: Isolated problem to unlinked directories: mkdir /tmp/a cd /tmp/a rmdir /tmp/a python /home/wking/src/fun/be/be.wtk-rr/test.py bzr which fails with the same "RCS not found" errors because bzr fails: wking@thor:/$ mkdir /tmp/a; cd /tmp/a; rmdir /tmp/a; bzr --help; cd /; rmdir: removing directory, /tmp/a 'import site' failed; use -v for traceback bzr: ERROR: Couldn't import bzrlib and dependencies. Please check bzrlib is on your PYTHONPATH. Traceback (most recent call last): File "/usr/bin/bzr", line 64, in <module> import bzrlib ImportError: No module named bzrlib which fails becase 'import site' fails: wking@thor:/$ mkdir /tmp/a; cd /tmp/a; rmdir /tmp/a; python -c 'import site'; cd /; rmdir: removing directory, /tmp/a 'import site' failed; use -v for traceback Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/wking/lib/python/site.py", line 73, in <module> __boot() File "/home/wking/lib/python/site.py", line 33, in __boot imp.load_module('site',stream,path,descr) File "/usr/lib/python2.5/site.py", line 408, in <module> main() File "/usr/lib/python2.5/site.py", line 392, in main paths_in_sys = removeduppaths() File "/usr/lib/python2.5/site.py", line 96, in removeduppaths dir, dircase = makepath(dir) File "/usr/lib/python2.5/site.py", line 72, in makepath dir = os.path.abspath(os.path.join(*paths)) File "/usr/lib/python2.5/posixpath.py", line 403, in abspath path = join(os.getcwd(), path) OSError: [Errno 2] No such file or directory which fails because our cwd doesn't exist. That makes sense ;). Still I think Python should be able to handle it, so I reported it http://bugs.python.org/issue6612
* Removed libbe.bzr.Bzr's automerge on post-commit.W. Trevor King2009-07-311-14/+0
| | | | | | I'd done this already in wking@drexel.edu-20090723154304-swmkxpfagdzff9ai but for some reason the merge with the email branch brought it back.
* Fixed libbe.bugdir.BugDirTestCase.testComments(sync_with_disk=False).W. Trevor King2009-07-311-1/+1
|
* 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.