aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
Commit message (Collapse)AuthorAgeFilesLines
* BugDir.list_uuids() -> BugDir.uuids()W. Trevor King2009-11-282-7/+7
|
* 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-211-2/+19
| | | | | | | + 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.
* Broke `be comment --xml` out and extended into `be import-xml`.W. Trevor King2009-11-212-3/+62
| | | | | | | | | | | | | | | | | | | | | | | 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
|
* 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-203-8/+19
| | | | | | | | | 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.
* Broke subprocess handling out into its own submodule libbe.subproc.W. Trevor King2009-11-204-43/+227
|
* Ran the new update_copyright.pyW. Trevor King2009-11-1921-14/+33
|
* 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
|
* 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).