bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
0.193.1
by Robert Collins
Create plugin. |
1 |
# Copyright (C) 2008 Canonical Ltd
|
2 |
#
|
|
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; version 2 of the License.
|
|
6 |
#
|
|
7 |
# This program is distributed in the hope that it will be useful,
|
|
8 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
9 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
10 |
# GNU General Public License for more details.
|
|
11 |
#
|
|
12 |
# You should have received a copy of the GNU General Public License
|
|
13 |
# along with this program; if not, write to the Free Software
|
|
14 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
15 |
||
16 |
||
17 |
"""CVS working tree support for bzr.
|
|
18 |
||
|
6652.2.9
by Jelmer Vernooij
Refresh docstring. |
19 |
Currently limited to referencing tools for migration.
|
|
0.193.1
by Robert Collins
Create plugin. |
20 |
"""
|
21 |
||
|
6652.2.2
by Jelmer Vernooij
Bundle mtn plugin. |
22 |
from __future__ import absolute_import |
23 |
||
|
7143.11.1
by Jelmer Vernooij
Remove some unused imports. |
24 |
from ... import version_info # noqa: F401 |
|
6778
by Jelmer Vernooij
Merge lp:~jelmer/brz/warn-mtn-cvs. |
25 |
|
|
6652.2.6
by Jelmer Vernooij
Fix test references. |
26 |
from ... import ( |
|
6778
by Jelmer Vernooij
Merge lp:~jelmer/brz/warn-mtn-cvs. |
27 |
controldir, |
|
6652.2.6
by Jelmer Vernooij
Fix test references. |
28 |
errors, |
|
6778
by Jelmer Vernooij
Merge lp:~jelmer/brz/warn-mtn-cvs. |
29 |
)
|
|
7413.5.1
by Jelmer Vernooij
CVS pserver URLs indicate that the pserver protocol is not supported. |
30 |
from ...transport import register_transport_proto |
|
6652.2.1
by Jelmer Vernooij
Bundle the cvs plugin. |
31 |
|
32 |
||
33 |
class CVSUnsupportedError(errors.UnsupportedFormatError): |
|
|
0.193.5
by Jelmer Vernooij
Update for new Prober.known_formats() interface. |
34 |
|
35 |
_fmt = ("CVS working trees are not supported. To convert CVS projects to " |
|
36 |
"bzr, please see http://bazaar-vcs.org/BzrMigration and/or "
|
|
37 |
"https://launchpad.net/launchpad-bazaar/+faq/26.") |
|
38 |
||
|
6778
by Jelmer Vernooij
Merge lp:~jelmer/brz/warn-mtn-cvs. |
39 |
|
40 |
class CVSDirFormat(controldir.ControlDirFormat): |
|
|
0.193.1
by Robert Collins
Create plugin. |
41 |
"""The CVS directory control format.""" |
42 |
||
43 |
def get_converter(self): |
|
44 |
raise NotImplementedError(self.get_converter) |
|
45 |
||
46 |
def get_format_description(self): |
|
47 |
return "CVS control directory." |
|
48 |
||
49 |
def initialize_on_transport(self, transport): |
|
|
6652.2.6
by Jelmer Vernooij
Fix test references. |
50 |
raise errors.UninitializableFormat(self) |
|
0.193.1
by Robert Collins
Create plugin. |
51 |
|
|
0.195.1
by Jelmer Vernooij
Implement CVSDirFormat.check_status. |
52 |
def is_supported(self): |
53 |
return False |
|
|
0.193.1
by Robert Collins
Create plugin. |
54 |
|
|
6778
by Jelmer Vernooij
Merge lp:~jelmer/brz/warn-mtn-cvs. |
55 |
def supports_transport(self, transport): |
56 |
return False |
|
57 |
||
|
0.195.2
by Jelmer Vernooij
Rename check_status -> check_support_status. |
58 |
def check_support_status(self, allow_unsupported, recommend_upgrade=True, |
|
7143.15.2
by Jelmer Vernooij
Run autopep8. |
59 |
basedir=None): |
|
0.193.5
by Jelmer Vernooij
Update for new Prober.known_formats() interface. |
60 |
raise CVSUnsupportedError(self) |
|
0.193.1
by Robert Collins
Create plugin. |
61 |
|
|
6778
by Jelmer Vernooij
Merge lp:~jelmer/brz/warn-mtn-cvs. |
62 |
def open(self, transport): |
63 |
# Raise NotBranchError if there is nothing there
|
|
64 |
CVSProber().probe_transport(transport) |
|
65 |
raise NotImplementedError(self.open) |
|
66 |
||
67 |
||
68 |
class CVSProber(controldir.Prober): |
|
|
0.194.1
by Jelmer Vernooij
Support the new control dir API. |
69 |
|
70 |
@classmethod
|
|
|
7413.6.1
by Jelmer Vernooij
Add an optional priority field for probers. |
71 |
def priority(klass, transport): |
72 |
return 100 |
|
73 |
||
74 |
@classmethod
|
|
|
0.194.1
by Jelmer Vernooij
Support the new control dir API. |
75 |
def probe_transport(klass, transport): |
|
0.193.1
by Robert Collins
Create plugin. |
76 |
# little ugly, but works
|
77 |
# try a manual probe first, its a little faster perhaps ?
|
|
|
6778
by Jelmer Vernooij
Merge lp:~jelmer/brz/warn-mtn-cvs. |
78 |
if transport.has('CVS') and transport.has('CVS/Repository'): |
79 |
return CVSDirFormat() |
|
80 |
raise errors.NotBranchError(path=transport.base) |
|
|
0.194.1
by Jelmer Vernooij
Support the new control dir API. |
81 |
|
|
0.193.5
by Jelmer Vernooij
Update for new Prober.known_formats() interface. |
82 |
@classmethod
|
83 |
def known_formats(cls): |
|
|
6973.12.9
by Jelmer Vernooij
More fixes. |
84 |
return [CVSDirFormat()] |
|
0.193.5
by Jelmer Vernooij
Update for new Prober.known_formats() interface. |
85 |
|
|
6778
by Jelmer Vernooij
Merge lp:~jelmer/brz/warn-mtn-cvs. |
86 |
|
87 |
controldir.ControlDirFormat.register_prober(CVSProber) |
|
|
7413.5.1
by Jelmer Vernooij
CVS pserver URLs indicate that the pserver protocol is not supported. |
88 |
|
89 |
register_transport_proto( |
|
90 |
'cvs+pserver://', help="The pserver access protocol for CVS.") |