1 # Copyright (C) 2009-2010 W. Trevor King <wking@drexel.edu>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License along
14 # with this program; if not, write to the Free Software Foundation, Inc.,
15 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 ConnectionError = base.ConnectionError
20 InvalidStorageVersion = base.InvalidStorageVersion
21 InvalidID = base.InvalidID
22 InvalidRevision = base.InvalidRevision
23 InvalidDirectory = base.InvalidDirectory
24 NotWriteable = base.NotWriteable
25 NotReadable = base.NotReadable
26 EmptyCommit = base.EmptyCommit
28 # a list of all past versions
29 STORAGE_VERSIONS = ['Bugs Everywhere Tree 1 0',
30 'Bugs Everywhere Directory v1.1',
31 'Bugs Everywhere Directory v1.2',
32 'Bugs Everywhere Directory v1.3',
33 'Bugs Everywhere Directory v1.4',
37 STORAGE_VERSION = STORAGE_VERSIONS[-1]
39 def get_http_storage(location):
41 return http.HTTP(location)
43 def get_vcs_storage(location):
45 s = vcs.detect_vcs(location)
49 def get_storage(location):
51 Return a Storage instance from a repo location string.
53 if location.startswith('http://') or location.startswith('https://'):
54 return get_http_storage(location)
55 return get_vcs_storage(location)
57 __all__ = [ConnectionError, InvalidStorageVersion, InvalidID,
58 InvalidRevision, InvalidDirectory, NotWriteable, NotReadable,
59 EmptyCommit, STORAGE_VERSIONS, STORAGE_VERSION,