aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/arch.py
Commit message (Collapse)AuthorAgeFilesLines
* Added libbe.TESTING (defaults to False).W. Trevor King2009-12-031-6/+8
| | | | | | | | | | | | | | | | | | | | 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
* Adjusted test.py to use an installed vcs by default.W. Trevor King2009-11-201-1/+1
| | | | | | | | | 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.
* Ran the new update_copyright.pyW. Trevor King2009-11-191-1/+2
|
* Use unicode_output=False in some Darcs._u_invoke_client() calls.W. Trevor King2009-11-171-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Moved VCS detection from _vcs_help() to _vcs_version().W. Trevor King2009-10-061-2/+2
| | | | | | | 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-051-2/+2
| | | | | | | | | *.__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()
* Added docstrings to libbe submodules.W. Trevor King2009-08-311-5/+10
| | | | Also a few minor tweaks to the module imports.
* RCS -> VCS, BUGDIR_DISK_VERSION -> v1.2W. Trevor King2009-08-311-23/+23
|
* Improved unittest cleanup by adding BugDir.cleanup().W. Trevor King2009-07-311-1/+5
| | | | | | | | 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...
* Added .revision_id() to all the VCSs.W. Trevor King2009-07-231-2/+10
| | | | | This makes it easier to compare recent revisions without a human around to give you revision numbers.
* Added --allow-empty to "be commit"W. Trevor King2009-07-191-9/+10
| | | | | | | 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.
* Updated GPLv2 to current GPLv2.W. Trevor King2009-07-141-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Removed <abentley@panoramicfeedback.com> from copyright blurbs.W. Trevor King2009-07-111-1/+0
| | | | | | | | | | | These didn't work with my update_copyright.sh. I went with Aaron Bentley and Panometrics, Inc. instead of Aaron Bentley <abentley@panoramicfeedback.com> and Panometrics, Inc. just because of line length, but I'm open to convincing if people prefer the latter...
* Updated copyright blurbs and AUTHORS and included script for future updatesW. Trevor King2009-07-011-1/+4
|
* Added ability to handle non text/* MIME types.W. Trevor King2009-06-261-2/+2
| | | | | | | | | | | | | | | | 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.
* Merge from Ben Finney's RCS unittest patchW. Trevor King2009-06-211-5/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This involved an `upgrade' of BE's bzr repo Previous version (via `bzr info path/to/repo`): pack-0.92 Current version: rich-root-pack The whole rich-root thing is a bzr features-vs-backwards-compatability thing they've been wrestling with [1,2,3,4,...]. It seems that BE was in some sort of unstable equilibrium [5], so I'll follow Ben's lead and make the official switch. Note that you'll need to use bzr>=1.5 to make the shift [6]. For the sake of completeness, the whole rich-root thing was introduced here [7], but I don't understand enough of bzr to make sense of the diff. It just versions the repo's root directory the same way it versions other directories [3]. The bzr people seem to be planning to phase out non-rich-root formats in favor of brisbane-core, aka 2.0beta [8], by bzr 2.0 [8], which is apparently on the horizon [9,10,11]. What a headache. Citations are all titles/X-List-Received-Date from https://lists.ubuntu.com/archives/bazaar/ with the exception of the URL [11]. [1] [RFC] rich root pack as default in 1.8 ? Sat, 06 Sep 2008 03:33:46 -0000 (conclusion: none) [2] Re: 1.9rc1 countdown Thu, 30 Oct 2008 08:44:53 -0000 (conclusion: "primary" format should be rich-root next time we make a new format) [3] So many repo formats Fri, 14 Nov 2008 08:41:33 -0000 Mon, 17 Nov 2008 07:37:47 -0000 (explains rich-root format) Mon, 17 Nov 2008 22:37:39 -0000 (explains no-return policy) Mon, 17 Nov 2008 20:57:08 -0000 (explicitly lists non-svn reasons for rich-root) [4] Branch fails from 'pack-0.92' repo to 'rich-root-pack' repo. Wed, 27 Aug 2008 11:31:11 -0000 (we're not sure again) [5] Branch fails from 'pack-0.92' repo to 'rich-root-pack' repo. Sun, 20 Apr 2008 12:58:09 -0000 [6] Branch fails from 'pack-0.92' repo to 'rich-root-pack' repo. Fri, 29 Aug 2008 13:23:52 -0000 [7] [RFC] Knit format 2 Fri, 25 Aug 2006 22:55:36 -0000 [8] bazaar 2.0beta format for launchpad release Fri, 29 May 2009 06:00:03 -0000 [9] Upgrading loggerhead to 1.9-rich-root Mon, 11 May 2009 22:35:28 -0000 (mentions eventual switch to rich-root in 2.0) [10] bzr 1.16rc1 released! Fri, 12 Jun 2009 08:00:08 -0000 (confirms eventual switch to rich-root in 2.0) [11] https://launchpad.net/bzr/+announcement/2733 (current outstanding releases: 1.17, 2.0)
| * Make RCS testcase subclasses dynamically.John Doe2009-06-141-5/+9
| |
* | Allow defaults for config.get_val() in case of missing user-config file.W. Trevor King2009-06-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes bug introduced by James Rowe's previous patch: $ be list Traceback (most recent call last): ... File ".../libbe/rcs.py", line 34, in _get_matching_rcs import arch File ".../libbe/arch.py", line 29, in <module> client = config.get_val("arch_client") File ".../libbe/config.py", line 70, in get_val File "/usr/lib/python2.5/codecs.py", line 817, in open file = __builtin__.open(filename, mode, buffering) IOError: [Errno 2] No such file or directory: '/home/wking/.bugs_everywhere'
* | Merged James Rowe's arch-shouldn't-create-userwide-config-file patch.James Rowe2009-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From his email to the be-devel list: From: James Rowe <jnrowe@ukfsn.org> Date: Tue, 3 May 2009 11:44:41 +0000 Subject: [PATCH] Don't create config file unless we're using arch. Hi, I find the current behaviour of creating a config file simply to set a default for a revision control system I'm never going to use to be a little annoying, the attached patch changes this behaviour to only set the default in the config file if you're actually using arch. Thanks, James
* | Added libbe/encoding.py to wrap input/output/file access appropriately.W. Trevor King2008-11-251-8/+18
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Added archive/project init code for `./test_usage.sh arch`.W. Trevor King2008-11-231-7/+0
| | | | Also some minor cleanups.
* Explicit rcs.cleanup() in bugdir test.W. Trevor King2008-11-221-13/+6
| | | | | | | | | | | | | Don't use del(rcs), because if there was an error, there is still a reference to rcs in the traceback, so it is never cleaned up. This can leave the external archive cluttering up your Arch install if you're using the Arch backend. See the __del__ documentation http://python.active-venture.com/ref/customization.html#l2h-175 for details. Also fixed some out-of-date method names in libbe.diff
* Created and fixed bug 496edad5-1484-413a-bc68-4b01274a65eb.W. Trevor King2008-11-221-5/+24
| | | | | | | | I figured out why Arch was complaining. For non-Arch users, file system access has been tweaked a bit see the BugDir doc string for details. Also, you should now set BugDir.rcs instead of .rcs_name. .rcs_name automatically tracks changes in .rcs (the reverse of the previous situation), so read from whichever you like.
* Another major rewrite. Now BugDir, Bug, and Comment are more distinct.W. Trevor King2008-11-211-10/+60
| | | | | | | | | | | | | | | I pushed a lot of the little helper functions into the main classes, which makes it easier for me to keep track of what's going on. I'm now at the point where I can run through `python test.py` with each of the backends (by changing the search order in rcs.py _get_matching_rcs) without any unexpected errors for each backend (except Arch). I can also run `test_usage.sh` without non-Arch errors either. However, don't consider this a stable commit yet. The bzr backend is *really*slow*, and the other's aren't blazingly fast either. I think I'm rewriting the entire database every time I save it :p. Still, it passes the checks. and I don't like it when zounds of changes build up.
* Major rewrite of RCS backends. RCS now represented as a class.W. Trevor King2008-11-181-166/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lots of changes and just one commit. This started with bug dac91856-cb6a-4f69-8c03-38ff0b29aab2, when I noticed that new bugs were not being added appropriately with the Git backend. I'd been working with Git trouble before with bug 0cad2ac6-76ef-4a88-abdf-b2e02de76f5c, and decided things would be better off if I just scrapped the current RCS architecture and went to a more object oriented setup. So I did. It's not clear how to add support for an RCS backend: * Create a new module that - defines an inheritor of rsc.RCS, overriding the _rcs_*() methods - provide a new() function for instantizating the new class - defines an inheritor of rcs.RCStestCase, overiding the Class attribute - defines 'suite' a unittest.TestSuite testing the module * Add your new module to the rest in rcs._get_matching_rcs() * Add your new module to the rest in libbe/tests.py Although I'm not sure libbe/tests.py is still usefull. The new framework clears out a bunch of hackery that used to be involved with supporting becommands/diff.py. There's still room for progress though. While implementing the new verision, I moved the testing framework over from doctest to a doctest/unittest combination. Longer tests that don't demonstrate a function's usage should be moved to unittests at the end of the module, since unittest has better support for setup/teardown, etc. The new framework also revealed some underimplented backends, most notably arch. These backends have now been fixed. I also tweaked the test_usage.sh script to run through all the backends if it is called with no arguments. The fix for the dac bug turned out to be an unflushed file write :p.
* Replaced libbe.arch.invoke() with general rcs.invoke()W. Trevor King2008-11-141-14/+3
|
* * use python2.4/2.5 compatible import of ElementTreeW. Trevor King2008-11-131-1/+5
| | | | | * catch Popen() calls to missing VCS binaries * test.py should only test installed backends
* Ensure that Arch tests have a user id setAaron Bentley2007-07-161-0/+20
|
* Added compatibility functions for commit to arch, no_rcsAaron Bentley2006-02-031-0/+9
|
* Fixed subprocess invocation for bzrAaron Bentley2005-12-231-0/+1
|
* Various Windows-related bugfixesAaron Bentley2005-12-221-8/+11
|
* Distinguished between 'paranoid' and non-paranoid add-idAaron Bentley2005-05-191-8/+8
| | | | | The paranoid adds are only used for the .be root. Paranoia is a big time-suck on Arch trees, because they require a full inventory.
* Normalized paths before use in rel_filenameAaron Bentley2005-05-181-0/+2
|
* Ensured .be is source for Arch (closes 381)Aaron Bentley2005-05-181-1/+86
| | | | | | | Modified bug reports: 381: Ensure .be is source in Arch status: open -> closed
* Added appropriate copyright notices, GPLed.Aaron Bentley2005-05-161-0/+16
|
* Added preliminary tree-diffing supportAaron Bentley2005-04-141-6/+17
|
* Added RCS configuration.Aaron Bentley2005-03-191-0/+32
|
* Made arch_client configurableAaron Bentley2005-03-111-3/+14
|
* Added RCS integrationAaron Bentley2005-03-091-0/+15