aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage
Commit message (Collapse)AuthorAgeFilesLines
* Add VersionedStorageTestCases in make_versioned_storage_testcase_subclassesW. Trevor King2010-01-181-2/+5
|
* Added libbe.storage.base.VersionedStorage.changed() and a test.W. Trevor King2010-01-151-5/+59
| | | | | Also converted libbe.storage.base.VersionedStorage revision ids from integers to strings.
* Fixed update_copyright.py's subproc import and updated copyrightsW. Trevor King2010-01-011-1/+1
|
* Fixed commit handling in commands.serve and storage.httpW. Trevor King2010-01-011-2/+2
|
* Use more kwargs in libbe.command.serveW. Trevor King2010-01-011-1/+1
| | | | | | | | kwargs make things easier to maintain. Also make sure the .handle_*() methods return two items (content,ctype) even when both are None.
* Fixed some stupid typos in libbe/storage/http.pyW. Trevor King2010-01-011-2/+2
|
* Added libbe.command.serve and libbe.storage.http for HTTP backend.W. Trevor King2010-01-012-4/+275
| | | | | | | | | | Now the following works: some-BE-dir$ ./be serve $ ./be --repo http://localhost:8000 list I haven't come up with a clean idea for testing this yet, so other commands may be broken, but once we get the testing working, it shouldn't be too hard to get everything working over HTTP :).
* Hand nonexistent paths in VCS._u_search_parent_directories().W. Trevor King2010-01-011-1/+5
| | | | | search_parent_directries raises an AssertionError if the original path doesn't exist.
* Return a meaningful Storage.version()W. Trevor King2010-01-011-1/+2
|
* Updated copyright informationW. Trevor King2010-01-0114-15/+57
|
* Track connection status to allow multiple Storage.disconnect() calls.W. Trevor King2009-12-312-5/+18
| | | | This makes cleaning up UIs easier: just call disconnect() :p.
* Correct for possible directory changes in mercurial.dispatch.dispatch()W. Trevor King2009-12-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | I ran across this when the hg unittests broke the vcs.base unittests: $ python test.py libbe.storage.vcs.base libbe.storage.vcs.hg ... OK $ python test.py libbe.storage.vcs.hg libbe.storage.vcs.base ... File ".../libbe/storage/vcs/base.py", line 914, in libbe.storage.vcs.base.VCSTestCase.Class._u_rel_path Failed example: vcs._u_rel_path("./a", ".") Exception raised: Traceback (most recent call last): File "/usr/lib/python2.5/doctest.py", line 1228, in __run compileflags, 1) in test.globs File "<doctest libbe.storage.vcs.base.VCSTestCase.Class._u_rel_path[4]>", line 1, in <module> vcs._u_rel_path("./a", ".") File ".../libbe/storage/vcs/base.py", line 921, in _u_rel_path path = os.path.abspath(path) File "/usr/lib/python2.5/posixpath.py", line 403, in abspath path = join(os.getcwd(), path) OSError: [Errno 2] No such file or directory ... FAILED (failures=1)
* Disable mercurial.demandimport, since it breaks BzrW. Trevor King2009-12-291-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running python test.py libbe.storage.vcs.hg libbe.storage.vcs.bzr with the old setup produced lots of Traceback (most recent call last): File ".../libbe/storage/vcs/base.py", line 1010, in setUp self.s.init() File ".../libbe/storage/base.py", line 170, in init return self._init() File ".../libbe/storage/vcs/base.py", line 664, in _init self._vcs_init(self.repo) File ".../libbe/storage/vcs/bzr.py", line 88, in _vcs_init cmd.run(location=path) File ".../python2.5/site-packages/bzrlib/builtins.py", line 1685, in run format = bzrdir.format_registry.make_bzrdir('default') File ".../python2.5/site-packages/bzrlib/bzrdir.py", line 3452, in make_bzrdir return self.get(key)() File ".../python2.5/site-packages/bzrlib/bzrdir.py", line 3398, in helper bd.set_branch_format(_load(branch_format)) File ".../python2.5/site-packages/bzrlib/bzrdir.py", line 3385, in _load [factory_name]) File "/var/lib/python-support/python2.5/mercurial/demandimport.py", line 108, in _demandimport setattr(mod, x, _demandmod(x, mod.__dict__, locals)) File ".../python2.5/site-packages/bzrlib/lazy_import.py", line 106, in __getattribute__ obj = _replace() File ".../python2.5/site-packages/bzrlib/lazy_import.py", line 88, in _replace extra=e) IllegalUseOfScopeReplacer: ScopeReplacer object 'branch' was used incorrectly: Object already cleaned up, did you assign it to another variable?: _factory
* Use ._vcs_is_versioned() in VCS._children()W. Trevor King2009-12-291-0/+3
| | | | Otherwise Arch will return '.arch-ids' in its list, etc.
* Fixed make_*_testcase_subclasses() to avoid duplication.W. Trevor King2009-12-292-14/+17
| | | | | | Also removed final check for 'parent' existence in Storage_add_remove_TestCase.test_remove_nonrooted() because some VCSs (e.g. Git) don't keep track of blank directories.
* We don't do much with Mercurial's ui, so _dispatch -> dispatchW. Trevor King2009-12-291-2/+1
|
* Updated Darcs backend towards supporting .children(revision).W. Trevor King2009-12-291-40/+114
| | | | | | | | | | | | | | | | | | | ._vcs_isdir() and ._vcs_listdir() will need to parse the output of darcs show files [options] --patch REVISION PATH but both the --patch option and the PATH argument are new, and I can't get a recent enough version of Darcs to compile on my system. Theoretically they will work, but they remain untested for now. I don't think it's worth rolling my own darcs show files --patch REVISION to support earlier versions of Darcs, since the only solution I can think of now would be to check out the given revision and use os.walk() or some such, and that would be really ugly... Also added .version_cmp() for easy version comparison. Reindented ._vcs_get_file_contents() to remove trailing elses since the if clauses all contain returns.
* Added an additional VCS._u_rel_path() unittest.W. Trevor King2009-12-291-2/+3
| | | | | Also re-enabled the unitsuite in libbe.storage.vcs.base, which I'd disabled while testing the VCS unittests.
* Added root directory handling to VCS._u_rel_path().W. Trevor King2009-12-291-3/+8
| | | | | Now it returns '.' when you ask for the relative path from root to itself. It used to raise AssertionError or InvalidPath.
* Adjust Git._vcs_isdir() to Python-2.5-compatible syntaxW. Trevor King2009-12-291-1/+2
|
* Updated Hg backend to support .children(revision).W. Trevor King2009-12-292-5/+37
|
* Hg storage now based off mercurial module, not 'hg' executible.W. Trevor King2009-12-292-22/+40
| | | | | | | | | | | | | | | | | | | | | | | | This should make repeated calls to Hg storage instances _much_ faster, since we avoid repeatedly loading and tearing down a python subprocess. For example, the testsuite runs ~6x faster on my box. Here's a run with the old Hg implementation: $ python test.py libbe.storage.vcs.hg ... ================================= ERROR: test_get_previous_children --------------------------------- Traceback (most recent call last): ... NotImplementedError --------------------------------- Ran 49 tests in 133.285s FAILED (errors=1) A run with the new implementation gives the same results, except for: Ran 49 tests in 22.328s
* Updated Git backend to support .children(revision).W. Trevor King2009-12-283-4/+26
| | | | | | | + some minor fixes to vcs/base.py and vcs/bzr.py Also removed .be/id-cache, which should never have been versioned in the first place.
* Fixed VCS.children() and Bzr.children() for non-None revisions.W. Trevor King2009-12-283-12/+102
| | | | | | | | Now they both pass VersionedStorage_commit_TestCase.test_commit_revision_ids() The .children() implementation for previous revisions lacks the working directory's id<->path cache, so it's fairly slow...
* Added VersionedStorage_commit_TestCase.test_commit_revision_ids()W. Trevor King2009-12-281-0/+23
|
* Bzr storage now based off bzrlib module, not 'bzr' executible.W. Trevor King2009-12-281-38/+76
| | | | | This should make repeated calls to Bzr storage instances _much_ faster, since we avoid repeatedly loading and tearing down a python subprocess.
* VersionedStorage_commit_TestCase now allows for versioned files created by ↵W. Trevor King2009-12-281-4/+17
| | | | self.s.init()
* libbe.storage.vcs.base.VCS._init() now creates the '.be/version' file.W. Trevor King2009-12-282-17/+34
| | | | | | And python test.py libbe.storage.vcs.base passes again.
* Moved InvalidStorageVersion from libbe.command to libbe.storageW. Trevor King2009-12-273-7/+24
| | | | | | Also added ConnectionError pretty-print to ui.command_line, storage version checking to BugDir.duplicate_bugdir(), and optional revision argument to Storage.storage_version().
* Added storage.Storage.storage_version() and command.InvalidStorageVersion.W. Trevor King2009-12-274-24/+33
| | | | Now commands automatically check for storage version compatibility.
* Fixed libbe.storage.util.upgradeW. Trevor King2009-12-272-72/+164
| | | | | | | | | | | | | Note that it only upgrades on-disk versions, so you can't use a non-VCS storage backend whose version isn't your command's current storage version. See #bea/110/bd1# for reasoning. To see the on-disk storage version, look at .be/version To see your command's supported storage version, look at be --full-version I added test_upgrade.sh to exercise the upgrade mechanism on BE's own repository.
* Fixed libbe.command.diff + ugly BugDir.duplicate_bugdir implementationW. Trevor King2009-12-1511-55/+73
| | | | | | | | | | | | | | | | | | | | | duplicate_bugdir() works, but for the vcs backends, it could require shelling out for _every_ file read. This could, and probably will, be horribly slow. Still it works ;). I'm not sure what a better implementation would be. The old implementation checked out the entire earlier state into a temporary directory pros: single shell out, simple upgrade implementation cons: wouldn't work well for HTTP backens I think a good solution would run along the lines of the currently commented out code in duplicate_bugdir(), where a VersionedStorage.changed_since(revision) call would give you a list of changed files. diff could work off of that directly, without the need to generate a whole duplicate bugdir. I'm stuck on how to handle upgrades though... Also removed trailing whitespace from all python files.
* Transitioned comment to Command formatW. Trevor King2009-12-142-7/+8
|
* Transitioned init to Command formatW. Trevor King2009-12-141-4/+6
|
* The VCS storage backends are all mostly working now.W. Trevor King2009-12-132-3/+1
| | | | | | | | | | | | | Running python test.py libbe.storage.vcs yields some EmptyCommit problems, an issue with bzr revision ids, and some trouble with git's remove(), but nothing too critical. On the bright side, now ./be list Detects and uses the bzr backend :). Onwards to moving over the remaining commands...
* Moved Arch over to Storage formatW. Trevor King2009-12-132-83/+135
|
* Move Darcs over to Storage format.W. Trevor King2009-12-132-74/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have to work around the same issue as mercurial (hg) issue 618. I can't find a Darcs bug report for this, but it's been fixed somewhere between 1.0.9 and 2.3.1. Example scripts demonstrating the bug: $ darcs=/usr/bin/darcs $ mkdir x; cd x; $darcs init; echo a > b; $darcs add b; \ $darcs record --all --author 'x <a@b.com>' --logfile b; \ echo z>b; $darcs record --all --author 'x <a@b.com>' --logfile b; \ echo g>b; $darcs record --all --author 'x <a@b.com>' --logfile b; \ cd ..; rm -rf x > /dev/null; $darcs --version Finished recording patch 'a' No changes! No changes! 1.0.9 (release) And showing it's been fixed: $ darcs=~/.cabal/bin/darcs $ mkdir x; cd x; $darcs init; echo a > b; $darcs add b; \ $darcs record --all --author 'x <a@b.com>' --logfile b; \ echo z>b; $darcs record --all --author 'x <a@b.com>' --logfile b; \ echo g>b; $darcs record --all --author 'x <a@b.com>' --logfile b; \ cd ..; rm -rf x > /dev/null; $darcs --version Finished recording patch 'a' Finished recording patch 'z' Finished recording patch 'g' 2.3.1 (release)
* Check for repo existence before initializing VCSW. Trevor King2009-12-131-2/+4
|
* Adjust Bzr._vcs_revision_id for 1-indexed revision ids.W. Trevor King2009-12-131-1/+1
|
* Adjust Hg._vcs_revision_id for 1-indexed revision ids.W. Trevor King2009-12-131-0/+2
|
* Don't require new revisions on empty commits.W. Trevor King2009-12-131-4/+7
| | | | | | | | | | | | | | | | | | | For example, hg can't: $ mkdir x; cd x; x$ hg init; x$ echo a> b; hg add b; x$ hg commit -m 'r1'; x$ hg commit -m 'r2'; nothing changed x$ hg log; changeset: 0:e30558c36fca tag: tip user: W. Trevor King <wking@drexel.edu> date: Sun Dec 13 19:48:47 2009 -0500 summary: hi x$ cd ..; rm -rf x We shouldn't need this functionality anyway ;).
* Work around mercurial (hg) issue 618.W. Trevor King2009-12-131-1/+13
|
* Don't regexp out the short-revid in Git._vcs_commit()W. Trevor King2009-12-131-8/+2
| | | | | | | | | | | The output version strings change: Version 1.5.4.3: Created initial commit 217efa7: MESSAGE Created commit acb3066: MESSAGE Version 1.6.4.4: [master (root-commit) c5b48cf] MESSAGE [master 66a48c1] MESSAGE Instead, get the full revid, and look for its beginning in the output.
* Fix Git._vcs_revision_id() offset bug.W. Trevor King2009-12-133-6/+13
|
* Handle non-int args to VCS.revision_id at the VCS level.W. Trevor King2009-12-132-4/+5
|
* Adjust Hg._vcs_revision_id to bail cleanly on non-int revidsW. Trevor King2009-12-132-0/+5
|
* Use detect rather than catching errors in _vcs_root().W. Trevor King2009-12-132-56/+11
|
* .bzr transition.W. Trevor King2009-12-133-37/+58
|
* More fixes for libbe.storage.vcs.hg + .git transition.W. Trevor King2009-12-133-58/+72
|
* Fixes to get libbe.storage.vcs.hg passing tests.W. Trevor King2009-12-131-2/+3
|