From 79154201c1c012063aa3fe1881ff06a3f239fdc5 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 8 Dec 2009 09:01:26 -0500 Subject: Moved properties.py and settings_object.py to libbe/storage/util/ --- libbe/storage/__init__.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 libbe/storage/__init__.py (limited to 'libbe/storage/__init__.py') diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py new file mode 100644 index 0000000..9c954ee --- /dev/null +++ b/libbe/storage/__init__.py @@ -0,0 +1,13 @@ +# Copyright + +import base + +ConnectionError = base.ConnectionError +InvalidID = base.InvalidID +InvalidRevision = base.InvalidRevision +NotWriteable = base.NotWriteable +NotReadable = base.NotReadable +EmptyCommit = base.EmptyCommit + +__all__ = [ConnectionError, InvalidID, InvalidRevision, + NotWriteable, NotReadable, EmptyCommit] -- cgit From 4d057dab603f42ec40b911dbee6792dcf107bd14 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 13 Dec 2009 06:19:23 -0500 Subject: Converted libbe.storage.vcs.base to new Storage format. --- libbe/storage/__init__.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libbe/storage/__init__.py') diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py index 9c954ee..5d5b918 100644 --- a/libbe/storage/__init__.py +++ b/libbe/storage/__init__.py @@ -5,9 +5,21 @@ import base ConnectionError = base.ConnectionError InvalidID = base.InvalidID InvalidRevision = base.InvalidRevision +InvalidDirectory = base.InvalidDirectory NotWriteable = base.NotWriteable NotReadable = base.NotReadable EmptyCommit = base.EmptyCommit +def get_storage(location): + """ + Return a Storage instance from a repo location string. + """ + import vcs + #s = vcs.detect_vcs(location) + s = vcs.vcs_by_name('None') + s.repo = location + return s + __all__ = [ConnectionError, InvalidID, InvalidRevision, - NotWriteable, NotReadable, EmptyCommit] + InvalidDirectory, NotWriteable, NotReadable, + EmptyCommit, get_storage] -- cgit From 7addcc4aff8d391765b22d8f095afba739489511 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 13 Dec 2009 23:25:07 -0500 Subject: The VCS storage backends are all mostly working now. 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... --- libbe/storage/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libbe/storage/__init__.py') diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py index 5d5b918..c58ec34 100644 --- a/libbe/storage/__init__.py +++ b/libbe/storage/__init__.py @@ -15,8 +15,7 @@ def get_storage(location): Return a Storage instance from a repo location string. """ import vcs - #s = vcs.detect_vcs(location) - s = vcs.vcs_by_name('None') + s = vcs.detect_vcs(location) s.repo = location return s -- cgit From dff704764d77bffbf6cc94c5ba4bb03309da45f8 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 27 Dec 2009 16:30:54 -0500 Subject: Added storage.Storage.storage_version() and command.InvalidStorageVersion. Now commands automatically check for storage version compatibility. --- libbe/storage/__init__.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libbe/storage/__init__.py') diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py index c58ec34..104b1e1 100644 --- a/libbe/storage/__init__.py +++ b/libbe/storage/__init__.py @@ -10,6 +10,17 @@ NotWriteable = base.NotWriteable NotReadable = base.NotReadable EmptyCommit = base.EmptyCommit +# a list of all past versions +STORAGE_VERSIONS = ['Bugs Everywhere Tree 1 0', + 'Bugs Everywhere Directory v1.1', + 'Bugs Everywhere Directory v1.2', + 'Bugs Everywhere Directory v1.3', + 'Bugs Everywhere Directory v1.4', + ] + +# the current version +STORAGE_VERSION = STORAGE_VERSIONS[-1] + def get_storage(location): """ Return a Storage instance from a repo location string. @@ -21,4 +32,5 @@ def get_storage(location): __all__ = [ConnectionError, InvalidID, InvalidRevision, InvalidDirectory, NotWriteable, NotReadable, - EmptyCommit, get_storage] + EmptyCommit, STORAGE_VERSIONS, STORAGE_VERSION, + get_storage] -- cgit From cfebc238cbda9b6338ec57d5c215c4cbf0246f8b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 27 Dec 2009 16:50:36 -0500 Subject: Moved InvalidStorageVersion from libbe.command to libbe.storage Also added ConnectionError pretty-print to ui.command_line, storage version checking to BugDir.duplicate_bugdir(), and optional revision argument to Storage.storage_version(). --- libbe/storage/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libbe/storage/__init__.py') diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py index 104b1e1..e99f799 100644 --- a/libbe/storage/__init__.py +++ b/libbe/storage/__init__.py @@ -3,6 +3,7 @@ import base ConnectionError = base.ConnectionError +InvalidStorageVersion = base.InvalidStorageVersion InvalidID = base.InvalidID InvalidRevision = base.InvalidRevision InvalidDirectory = base.InvalidDirectory @@ -30,7 +31,7 @@ def get_storage(location): s.repo = location return s -__all__ = [ConnectionError, InvalidID, InvalidRevision, - InvalidDirectory, NotWriteable, NotReadable, +__all__ = [ConnectionError, InvalidStorageVersion, InvalidID, + InvalidRevision, InvalidDirectory, NotWriteable, NotReadable, EmptyCommit, STORAGE_VERSIONS, STORAGE_VERSION, get_storage] -- cgit From 4d4283ecd654f1efb058cd7f7dba6be88b70ee92 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 1 Jan 2010 08:11:08 -0500 Subject: Updated copyright information --- libbe/storage/__init__.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'libbe/storage/__init__.py') diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py index e99f799..7abe791 100644 --- a/libbe/storage/__init__.py +++ b/libbe/storage/__init__.py @@ -1,4 +1,18 @@ -# Copyright +# Copyright (C) 2009-2010 W. Trevor King +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. import base -- cgit From 5f26c407789a2f8fc51d89b6d0c590253b50c754 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 1 Jan 2010 14:43:03 -0500 Subject: Added libbe.command.serve and libbe.storage.http for HTTP backend. 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 :). --- libbe/storage/__init__.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'libbe/storage/__init__.py') diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py index 7abe791..b6b0ac1 100644 --- a/libbe/storage/__init__.py +++ b/libbe/storage/__init__.py @@ -36,15 +36,24 @@ STORAGE_VERSIONS = ['Bugs Everywhere Tree 1 0', # the current version STORAGE_VERSION = STORAGE_VERSIONS[-1] -def get_storage(location): - """ - Return a Storage instance from a repo location string. - """ +def get_http_storage(location): + import http + return http.HTTP(location) + +def get_vcs_storage(location): import vcs s = vcs.detect_vcs(location) s.repo = location return s +def get_storage(location): + """ + Return a Storage instance from a repo location string. + """ + if location.startswith('http://'): + return get_http_storage(location) + return get_vcs_storage(location) + __all__ = [ConnectionError, InvalidStorageVersion, InvalidID, InvalidRevision, InvalidDirectory, NotWriteable, NotReadable, EmptyCommit, STORAGE_VERSIONS, STORAGE_VERSION, -- cgit From e0d0e0825add948a89c8ad305a3b259b743ec91d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 27 Jan 2010 08:07:31 -0500 Subject: Streamlined libbe.command.serve, adding --auth option, #/bea/c1b#, and testing. --- libbe/storage/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libbe/storage/__init__.py') diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py index b6b0ac1..c3bda4b 100644 --- a/libbe/storage/__init__.py +++ b/libbe/storage/__init__.py @@ -50,7 +50,7 @@ def get_storage(location): """ Return a Storage instance from a repo location string. """ - if location.startswith('http://'): + if location.startswith('http://') or location.startswith('https://'): return get_http_storage(location) return get_vcs_storage(location) -- cgit From 977eff5af10b50ba6e6edb6abc4f40804c418b12 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 7 Feb 2010 17:53:53 -0500 Subject: Fixed docstrings so only Sphinx errors are "autosummary" and "missing attribute" --- libbe/storage/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libbe/storage/__init__.py') diff --git a/libbe/storage/__init__.py b/libbe/storage/__init__.py index c3bda4b..6bceac9 100644 --- a/libbe/storage/__init__.py +++ b/libbe/storage/__init__.py @@ -14,6 +14,20 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +"""Define the :class:`~libbe.storage.base.Storage` and +:class:`~libbe.storage.base.VersionedStorage` classes for storing BE +data. + +Also define assorted implementations for the Storage classes: + +* :mod:`libbe.storage.vcs` +* :mod:`libbe.storage.http` + +Also define an assortment of storage-related tools and utilities: + +* :mod:`libbe.storage.util` +""" + import base ConnectionError = base.ConnectionError -- cgit