aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/storage
Commit message (Collapse)AuthorAgeFilesLines
* Add VCS._exists(), VCS.path(). Fix default handling in VCS._get().W. Trevor King2010-01-221-25/+37
| | | | | | | | | | VCS.path() consolidates a bunch of distributed code. The VCS backend cannot distinguish between _EMPTY and '' entry values, so it assumes len(contents) == 0 means _EMPTY. However, it had been returing None then, not default like its supposed to.
* Added _EMPTY and Storage.exists() to libbe.storage.base.W. Trevor King2010-01-221-12/+43
| | | | | | | There seem to be problems distinguishing between "added but unset" IDs and "added and set to ''" IDs. Now _EMPTY lets us mark "added but unset", and Storage.exists() handles "already added?" more clearly than the old hack "does .get() succeed?".
* Reworked settings_object module, but command.init tests still fail:W. Trevor King2010-01-221-119/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ python test.py libbe.command.init Doctest: libbe.command.init.Init ... FAIL ... ----------------------- File ".../libbe/command/init.py", line 47, in libbe.command.init.Init Failed example: ui.run(cmd) Exception raised: Traceback (most recent call last): ... File "/tmp/be.wtk/libbe/command/init.py", line 97, in _run bd = libbe.bugdir.BugDir(storage, from_storage=False) File "/tmp/be.wtk/libbe/bugdir.py", line 185, in __init__ self.save() File "/tmp/be.wtk/libbe/bugdir.py", line 228, in save self.save_settings() File "/tmp/be.wtk/libbe/bugdir.py", line 204, in save_settings mf = mapfile.generate(self._get_saved_settings()) File "/tmp/be.wtk/libbe/storage/util/settings_object.py", line 230, in _get_saved_settings self, self._setting_name_to_attr_name(k)) File "/tmp/be.wtk/libbe/storage/util/properties.py", line 194, in _fget value = fget(self) File "/tmp/be.wtk/libbe/storage/util/properties.py", line 329, in _fget primer(self) File "/tmp/be.wtk/libbe/storage/util/settings_object.py", line 69, in prop_load_settings self.load_settings() File "/tmp/be.wtk/libbe/bugdir.py", line 194, in load_settings self.settings = mapfile.parse(settings_mapfile) File "/tmp/be.wtk/libbe/storage/util/mapfile.py", line 123, in parse c = yaml.load(contents) ... File "/usr/lib/python2.6/site-packages/yaml/reader.py", line 213, in update_raw data = self.stream.read(size) AttributeError: 'NoneType' object has no attribute 'read' ...
* Added unprimableVal option to primed_property.W. Trevor King2010-01-221-5/+14
| | | | For clearer handling of the "Tried to load but failed" case.
* Update libbe.storage.util.settings_object tests for new ._get_saved_settingsW. Trevor King2010-01-211-1/+2
|
* Fix version import for mercurial <= 1.1.2W. Trevor King2010-01-211-1/+1
|
* Fix not-yet-loaded bug in SavedSettingsObject._get_saved_settings()W. Trevor King2010-01-201-6/+19
| | | | | | The earlier implementation only copied in the currently loaded properties and the required ones. The new implementation copies in _all_ the non-default properties.
* Adjust to modern mercurial version definition.W. Trevor King2010-01-201-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hg-stable$ hg log --patch mercurial/util.py ... changeset: 7640:9626819b2e3d user: Matt Mackall <mpm@selenic.com> date: Sat Jan 10 18:02:38 2009 -0600 summary: refactor version code diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -142,6 +142,14 @@ """Find the length in characters of a local string""" return len(s.decode(_encoding, "replace")) +def version(): + """Return version information if available.""" + try: + import __version__ + return __version__.version + except ImportError: + return 'unknown' + # used by parsedate ... hg-stable$ hg tags ... 1.2 7823:11efa41037e2 1.1.2 7497:11a4eb81fb4f ...
* Fix _u_rel_path problems in VCS._childrenW. Trevor King2010-01-202-3/+4
|
* Use relative paths *._vcs_* methods.W. Trevor King2010-01-191-3/+6
|
* Better error messages in VCS._getW. Trevor King2010-01-191-3/+5
|
* Work around the extra output of `tla file-find` to get path.W. Trevor King2010-01-191-1/+2
| | | | | | | | Example output: * build pristine tree for ...--patch-1 * from import revision: ...--base-0 * patching for revision: ...--patch-1 ./{arch}/++pristine-trees/...--patch-1/./.be/unlikely id
* Work around Mercurial issue618 in Arch backend.W. Trevor King2010-01-191-4/+20
| | | | Also add some NotImplementedErrors for clearer diagnostics.
* Added changed() support for DarcsW. Trevor King2010-01-181-17/+110
|
* Add .changed support to HTTP storage backend.W. Trevor King2010-01-181-0/+9
| | | | Also work around urlparse.parse_qs location in Python <= 2.5.
* Add ancestors support to HTTP storageW. Trevor King2010-01-181-0/+7
|
* Add .changed() support to HgW. Trevor King2010-01-181-0/+71
|
* Fix VCS doctest for +revision InvalidID error messageW. Trevor King2010-01-181-1/+1
|
* Add class name to StorageTestCase failure reportingW. Trevor King2010-01-181-0/+17
|
* Added VCS._u_find_id_from_manifest for faster id->path calculationW. Trevor King2010-01-184-26/+44
|
* Adjust VCSTestCase method docstrings for unittest.W. Trevor King2010-01-181-6/+3
|
* Added VCS._ancestorsW. Trevor King2010-01-181-0/+21
|
* Added Storage.ancestorsW. Trevor King2010-01-181-47/+77
|
* Ignore paths with _u_path_to_id errors in VCS.changedW. Trevor King2010-01-181-5/+12
|
* Add .changed() support to BzrW. Trevor King2010-01-181-1/+83
|
* Add .changed() support to GitW. Trevor King2010-01-181-0/+81
|
* Add .changed() support to VCSW. Trevor King2010-01-181-0/+15
|
* Too much trouble to handle Git's lack of dir versioning in ↵W. Trevor King2010-01-181-1/+1
| | | | test_get_previous_children
* 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