bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
0.200.235
by Jelmer Vernooij
Depend on newer dulwich. |
1 |
# Copyright (C) 2006-2009 Canonical Ltd
|
|
0.200.201
by Jelmer Vernooij
Try to import nothing other than __init__ when not opening git repositories. |
2 |
|
|
0.200.1
by Robert Collins
Commit initial content. |
3 |
# Authors: Robert Collins <robert.collins@canonical.com>
|
|
0.200.184
by Jelmer Vernooij
Update authors: line. |
4 |
# Jelmer Vernooij <jelmer@samba.org>
|
5 |
# John Carr <john.carr@unrouted.co.uk>
|
|
|
0.200.1
by Robert Collins
Commit initial content. |
6 |
#
|
7 |
# This program is free software; you can redistribute it and/or modify
|
|
8 |
# it under the terms of the GNU General Public License as published by
|
|
9 |
# the Free Software Foundation; either version 2 of the License, or
|
|
10 |
# (at your option) any later version.
|
|
11 |
#
|
|
12 |
# This program is distributed in the hope that it will be useful,
|
|
13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 |
# GNU General Public License for more details.
|
|
16 |
#
|
|
17 |
# You should have received a copy of the GNU General Public License
|
|
18 |
# along with this program; if not, write to the Free Software
|
|
19 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
20 |
||
21 |
||
22 |
"""A GIT branch and repository format implementation for bzr."""
|
|
23 |
||
|
0.224.1
by Alexander Belchenko
bzr.exe support: allow import of dulwich from _lib subdirectory |
24 |
import os |
25 |
import sys |
|
26 |
||
|
0.200.199
by Jelmer Vernooij
Check for bzrlib API version. |
27 |
import bzrlib |
28 |
import bzrlib.api |
|
|
0.200.519
by Jelmer Vernooij
Move imports down, might not be available in older bzr-git versions. |
29 |
|
|
0.200.587
by Jelmer Vernooij
Put plugin info in separate file. |
30 |
from info import ( |
|
0.200.583
by Jelmer Vernooij
Add plugin api info. |
31 |
bzr_compatible_versions, |
32 |
bzr_plugin_version as version_info, |
|
33 |
dulwich_minimum_version, |
|
34 |
)
|
|
|
0.200.519
by Jelmer Vernooij
Move imports down, might not be available in older bzr-git versions. |
35 |
|
36 |
if version_info[3] == 'final': |
|
37 |
version_string = '%d.%d.%d' % version_info[:3] |
|
38 |
else: |
|
39 |
version_string = '%d.%d.%d%s%d' % version_info |
|
40 |
__version__ = version_string |
|
41 |
||
|
0.200.583
by Jelmer Vernooij
Add plugin api info. |
42 |
bzrlib.api.require_any_api(bzrlib, bzr_compatible_versions) |
|
0.200.519
by Jelmer Vernooij
Move imports down, might not be available in older bzr-git versions. |
43 |
|
44 |
||
|
0.200.292
by Jelmer Vernooij
Fix formatting. |
45 |
from bzrlib import ( |
46 |
errors as bzr_errors, |
|
47 |
)
|
|
|
0.200.1111
by Jelmer Vernooij
Drop support for Bazaar < 2.3. |
48 |
|
49 |
from bzrlib.controldir import ( |
|
50 |
ControlDirFormat, |
|
51 |
Prober, |
|
52 |
format_registry, |
|
|
0.200.1137
by Jelmer Vernooij
Support BzrProber.known_formats(). |
53 |
network_format_registry as controldir_network_format_registry, |
|
0.200.1111
by Jelmer Vernooij
Drop support for Bazaar < 2.3. |
54 |
)
|
|
0.200.1012
by Jelmer Vernooij
Rename BzrDir to ControlDir. |
55 |
|
|
0.200.292
by Jelmer Vernooij
Fix formatting. |
56 |
from bzrlib.foreign import ( |
57 |
foreign_vcs_registry, |
|
58 |
)
|
|
|
0.200.1011
by Jelmer Vernooij
Add some basic documentation in 'bzr help git'. |
59 |
from bzrlib.help_topics import ( |
60 |
topic_registry, |
|
61 |
)
|
|
|
0.200.292
by Jelmer Vernooij
Fix formatting. |
62 |
from bzrlib.transport import ( |
63 |
register_lazy_transport, |
|
|
0.200.308
by Jelmer Vernooij
Register git protocols. |
64 |
register_transport_proto, |
|
0.200.292
by Jelmer Vernooij
Fix formatting. |
65 |
)
|
66 |
from bzrlib.commands import ( |
|
67 |
plugin_cmds, |
|
68 |
)
|
|
|
0.238.1
by Lukas Lalinsky, Jelmer Vernooij
Import initial work on 'bzr send --format=git' based on luks' patch for bzr-svn. |
69 |
from bzrlib.send import ( |
70 |
format_registry as send_format_registry, |
|
|
0.200.292
by Jelmer Vernooij
Fix formatting. |
71 |
)
|
|
0.200.341
by Jelmer Vernooij
Add stanza with git commit info in 'bzr version-info' |
72 |
|
|
0.200.192
by Jelmer Vernooij
use system-provided dulwich, remove own copy. |
73 |
|
|
0.224.1
by Alexander Belchenko
bzr.exe support: allow import of dulwich from _lib subdirectory |
74 |
if getattr(sys, "frozen", None): |
75 |
# allow import additional libs from ./_lib for bzr.exe only
|
|
|
0.200.926
by Jelmer Vernooij
Fix formatting, drop support for Bazaar < 2.0. |
76 |
sys.path.append(os.path.normpath( |
77 |
os.path.join(os.path.dirname(__file__), '_lib'))) |
|
|
0.224.1
by Alexander Belchenko
bzr.exe support: allow import of dulwich from _lib subdirectory |
78 |
|
|
0.200.987
by Jelmer Vernooij
Add DulwichFeature. |
79 |
|
80 |
def import_dulwich(): |
|
|
0.200.200
by Jelmer Vernooij
Register lazily where possible. |
81 |
try: |
82 |
from dulwich import __version__ as dulwich_version |
|
83 |
except ImportError: |
|
|
0.200.695
by Jelmer Vernooij
Clean up trailing whitespace. |
84 |
raise bzr_errors.DependencyNotPresent("dulwich", |
85 |
"bzr-git: Please install dulwich, https://launchpad.net/dulwich") |
|
|
0.200.200
by Jelmer Vernooij
Register lazily where possible. |
86 |
else: |
|
0.200.583
by Jelmer Vernooij
Add plugin api info. |
87 |
if dulwich_version < dulwich_minimum_version: |
|
0.200.926
by Jelmer Vernooij
Fix formatting, drop support for Bazaar < 2.0. |
88 |
raise bzr_errors.DependencyNotPresent("dulwich", |
89 |
"bzr-git: Dulwich is too old; at least %d.%d.%d is required" % |
|
90 |
dulwich_minimum_version) |
|
|
0.200.199
by Jelmer Vernooij
Check for bzrlib API version. |
91 |
|
|
0.200.987
by Jelmer Vernooij
Add DulwichFeature. |
92 |
|
93 |
_versions_checked = False |
|
94 |
def lazy_check_versions(): |
|
95 |
global _versions_checked |
|
96 |
if _versions_checked: |
|
97 |
return
|
|
98 |
import_dulwich() |
|
99 |
_versions_checked = True |
|
100 |
||
|
0.200.1012
by Jelmer Vernooij
Rename BzrDir to ControlDir. |
101 |
format_registry.register_lazy('git', |
|
0.200.1141
by Jelmer Vernooij
Use transports in git-import. |
102 |
"bzrlib.plugins.git.dir", "LocalGitControlDirFormat", |
|
0.200.1018
by Jelmer Vernooij
Fix use with new control dir API. |
103 |
help='GIT repository.', native=False, experimental=False, |
|
0.200.200
by Jelmer Vernooij
Register lazily where possible. |
104 |
)
|
|
0.200.204
by Jelmer Vernooij
Support bzr 1.11. |
105 |
|
|
0.200.1032
by Jelmer Vernooij
Support bare repositories. |
106 |
format_registry.register_lazy('git-bare', |
|
0.200.1141
by Jelmer Vernooij
Use transports in git-import. |
107 |
"bzrlib.plugins.git.dir", "BareLocalGitControlDirFormat", |
|
0.200.1032
by Jelmer Vernooij
Support bare repositories. |
108 |
help='Bare GIT repository (no working tree).', native=False, |
109 |
experimental=False, |
|
110 |
)
|
|
111 |
||
|
0.200.292
by Jelmer Vernooij
Fix formatting. |
112 |
from bzrlib.revisionspec import revspec_registry |
|
0.200.674
by Jelmer Vernooij
Fix formatting. |
113 |
revspec_registry.register_lazy("git:", "bzrlib.plugins.git.revspec", |
|
0.200.292
by Jelmer Vernooij
Fix formatting. |
114 |
"RevisionSpec_git") |
|
0.200.200
by Jelmer Vernooij
Register lazily where possible. |
115 |
|
|
0.200.1111
by Jelmer Vernooij
Drop support for Bazaar < 2.3. |
116 |
from bzrlib.revisionspec import dwim_revspecs, RevisionSpec_dwim |
117 |
if getattr(RevisionSpec_dwim, "append_possible_lazy_revspec", None): |
|
118 |
RevisionSpec_dwim.append_possible_lazy_revspec( |
|
119 |
"bzrlib.plugins.git.revspec", "RevisionSpec_git") |
|
120 |
else: # bzr < 2.4 |
|
121 |
from bzrlib.plugins.git.revspec import RevisionSpec_git |
|
122 |
dwim_revspecs.append(RevisionSpec_git) |
|
|
0.200.645
by Jelmer Vernooij
Support DWIM git: revspecs. |
123 |
|
|
0.200.328
by Jelmer Vernooij
Support stacking, depend on bzr 1.15. |
124 |
|
|
0.200.1014
by Jelmer Vernooij
Fix tests. |
125 |
class LocalGitProber(Prober): |
126 |
||
127 |
def probe_transport(self, transport): |
|
|
0.200.720
by Jelmer Vernooij
Avoid loading bzr-git/dulwich when not necessary. |
128 |
try: |
|
0.200.1237
by Jelmer Vernooij
Support control directories with a 'branches' subdirectory. |
129 |
if not transport.has_any(['info/refs', '.git/HEAD', 'HEAD', 'objects', '.git/objects']): |
|
0.200.720
by Jelmer Vernooij
Avoid loading bzr-git/dulwich when not necessary. |
130 |
raise bzr_errors.NotBranchError(path=transport.base) |
131 |
except bzr_errors.NoSuchFile: |
|
132 |
raise bzr_errors.NotBranchError(path=transport.base) |
|
|
0.200.730
by Jelmer Vernooij
Don't claim control directories can be accessed directly, always open the |
133 |
from bzrlib import urlutils |
134 |
if urlutils.split(transport.base)[1] == ".git": |
|
135 |
raise bzr_errors.NotBranchError(path=transport.base) |
|
|
0.239.13
by Jelmer Vernooij
Don't break "bzr info -v" when Dulwich is not installed. |
136 |
lazy_check_versions() |
|
0.200.580
by Jelmer Vernooij
Remove 'as git' imports. |
137 |
import dulwich |
|
0.200.1032
by Jelmer Vernooij
Support bare repositories. |
138 |
from bzrlib.plugins.git.transportgit import TransportRepo |
|
0.200.201
by Jelmer Vernooij
Try to import nothing other than __init__ when not opening git repositories. |
139 |
try: |
|
0.200.1032
by Jelmer Vernooij
Support bare repositories. |
140 |
gitrepo = TransportRepo(transport) |
|
0.200.580
by Jelmer Vernooij
Remove 'as git' imports. |
141 |
except dulwich.errors.NotGitRepository, e: |
|
0.200.203
by Jelmer Vernooij
Fix imports. |
142 |
raise bzr_errors.NotBranchError(path=transport.base) |
|
0.200.1032
by Jelmer Vernooij
Support bare repositories. |
143 |
else: |
|
0.200.1137
by Jelmer Vernooij
Support BzrProber.known_formats(). |
144 |
from bzrlib.plugins.git.dir import ( |
145 |
BareLocalGitControlDirFormat, |
|
146 |
LocalGitControlDirFormat, |
|
147 |
)
|
|
|
0.200.1032
by Jelmer Vernooij
Support bare repositories. |
148 |
if gitrepo.bare: |
149 |
return BareLocalGitControlDirFormat() |
|
150 |
else: |
|
151 |
return LocalGitControlDirFormat() |
|
|
0.200.201
by Jelmer Vernooij
Try to import nothing other than __init__ when not opening git repositories. |
152 |
|
|
0.200.1139
by Jelmer Vernooij
Prober.known_formats is a class method. |
153 |
@classmethod
|
154 |
def known_formats(cls): |
|
|
0.200.1137
by Jelmer Vernooij
Support BzrProber.known_formats(). |
155 |
from bzrlib.plugins.git.dir import ( |
156 |
BareLocalGitControlDirFormat, |
|
157 |
LocalGitControlDirFormat, |
|
158 |
)
|
|
159 |
return set([BareLocalGitControlDirFormat(), LocalGitControlDirFormat()]) |
|
|
0.200.1032
by Jelmer Vernooij
Support bare repositories. |
160 |
|
161 |
||
|
0.200.1014
by Jelmer Vernooij
Fix tests. |
162 |
class RemoteGitProber(Prober): |
163 |
||
164 |
def probe_transport(self, transport): |
|
165 |
url = transport.base |
|
166 |
if url.startswith('readonly+'): |
|
167 |
url = url[len('readonly+'):] |
|
168 |
if (not url.startswith("git://") and not url.startswith("git+")): |
|
169 |
raise bzr_errors.NotBranchError(transport.base) |
|
170 |
# little ugly, but works
|
|
|
0.200.1137
by Jelmer Vernooij
Support BzrProber.known_formats(). |
171 |
from bzrlib.plugins.git.remote import ( |
172 |
GitSmartTransport, |
|
173 |
RemoteGitControlDirFormat, |
|
174 |
)
|
|
|
0.200.1014
by Jelmer Vernooij
Fix tests. |
175 |
if not isinstance(transport, GitSmartTransport): |
176 |
raise bzr_errors.NotBranchError(transport.base) |
|
|
0.200.1034
by Jelmer Vernooij
Mark bare repositories as not supporting working trees for the purpose of the testsuite. |
177 |
return RemoteGitControlDirFormat() |
|
0.200.1014
by Jelmer Vernooij
Fix tests. |
178 |
|
|
0.200.201
by Jelmer Vernooij
Try to import nothing other than __init__ when not opening git repositories. |
179 |
@classmethod
|
|
0.200.1139
by Jelmer Vernooij
Prober.known_formats is a class method. |
180 |
def known_formats(cls): |
|
0.200.1137
by Jelmer Vernooij
Support BzrProber.known_formats(). |
181 |
from bzrlib.plugins.git.remote import RemoteGitControlDirFormat |
|
0.200.1012
by Jelmer Vernooij
Rename BzrDir to ControlDir. |
182 |
return set([RemoteGitControlDirFormat()]) |
|
0.200.201
by Jelmer Vernooij
Try to import nothing other than __init__ when not opening git repositories. |
183 |
|
|
0.200.1137
by Jelmer Vernooij
Support BzrProber.known_formats(). |
184 |
|
|
0.200.1138
by Jelmer Vernooij
Support new Prober.known_formats() API. |
185 |
if not getattr(Prober, "known_formats", None): # bzr < 2.4 |
|
0.200.1137
by Jelmer Vernooij
Support BzrProber.known_formats(). |
186 |
from bzrlib.plugins.git.dir import ( |
187 |
LocalGitControlDirFormat, BareLocalGitControlDirFormat, |
|
188 |
)
|
|
189 |
from bzrlib.plugins.git.remote import RemoteGitControlDirFormat |
|
190 |
ControlDirFormat.register_format(LocalGitControlDirFormat()) |
|
191 |
ControlDirFormat.register_format(BareLocalGitControlDirFormat()) |
|
192 |
ControlDirFormat.register_format(RemoteGitControlDirFormat()) |
|
|
0.200.1194
by Jelmer Vernooij
Use get_file_revision. |
193 |
# Provide RevisionTree.get_file_revision, so various parts of bzr-svn
|
194 |
# can avoid inventories.
|
|
195 |
from bzrlib.revisiontree import RevisionTree |
|
196 |
def get_file_revision(tree, file_id, path=None): |
|
197 |
return tree.inventory[file_id].revision |
|
198 |
RevisionTree.get_file_revision = get_file_revision |
|
199 |
||
|
0.200.1111
by Jelmer Vernooij
Drop support for Bazaar < 2.3. |
200 |
ControlDirFormat.register_prober(LocalGitProber) |
201 |
ControlDirFormat.register_prober(RemoteGitProber) |
|
|
0.200.138
by Jelmer Vernooij
Add initial infrastructure for accessing remote git repositories. |
202 |
|
|
0.200.674
by Jelmer Vernooij
Fix formatting. |
203 |
register_transport_proto('git://', |
|
0.200.308
by Jelmer Vernooij
Register git protocols. |
204 |
help="Access using the Git smart server protocol.") |
|
0.200.674
by Jelmer Vernooij
Fix formatting. |
205 |
register_transport_proto('git+ssh://', |
|
0.200.308
by Jelmer Vernooij
Register git protocols. |
206 |
help="Access using the Git smart server protocol over SSH.") |
207 |
||
|
0.200.138
by Jelmer Vernooij
Add initial infrastructure for accessing remote git repositories. |
208 |
register_lazy_transport("git://", 'bzrlib.plugins.git.remote', |
|
0.200.307
by Jelmer Vernooij
Support git+ssh. |
209 |
'TCPGitSmartTransport') |
210 |
register_lazy_transport("git+ssh://", 'bzrlib.plugins.git.remote', |
|
211 |
'SSHGitSmartTransport') |
|
|
0.200.19
by John Arbash Meinel
More refactoring. Add some direct tests for GitModel. |
212 |
|
|
0.200.674
by Jelmer Vernooij
Fix formatting. |
213 |
foreign_vcs_registry.register_lazy("git", |
|
0.200.1263
by Jelmer Vernooij
Fix foreign_vcs_git. |
214 |
"bzrlib.plugins.git.mapping", "foreign_vcs_git", "Stupid content tracker") |
|
0.208.5
by Jelmer Vernooij
Add log show function for git. |
215 |
|
|
0.200.206
by Jelmer Vernooij
Move commands to a separate python module and register them lazily. |
216 |
plugin_cmds.register_lazy("cmd_git_import", [], "bzrlib.plugins.git.commands") |
|
0.200.674
by Jelmer Vernooij
Fix formatting. |
217 |
plugin_cmds.register_lazy("cmd_git_object", ["git-objects", "git-cat"], |
|
0.200.422
by Jelmer Vernooij
'bzr git-object' without arguments now prints the available git objects. |
218 |
"bzrlib.plugins.git.commands") |
|
0.200.873
by Jelmer Vernooij
Add convenience command for accessing virtual git refs. |
219 |
plugin_cmds.register_lazy("cmd_git_refs", [], "bzrlib.plugins.git.commands") |
|
0.200.895
by Jelmer Vernooij
Add initial work on git-apply. |
220 |
plugin_cmds.register_lazy("cmd_git_apply", [], "bzrlib.plugins.git.commands") |
|
0.200.177
by Jelmer Vernooij
Add git-import command. |
221 |
|
|
0.200.1262
by Jelmer Vernooij
Add extract git foreign revid. |
222 |
def extract_git_foreign_revid(rev): |
223 |
try: |
|
224 |
foreign_revid = rev.foreign_revid |
|
225 |
except AttributeError: |
|
226 |
from bzrlib.plugins.git.mapping import mapping_registry |
|
227 |
foreign_revid, mapping = \ |
|
228 |
mapping_registry.parse_revision_id(rev.revision_id) |
|
229 |
return foreign_revid |
|
230 |
else: |
|
231 |
from bzrlib.plugins.git.mapping import foreign_vcs_git |
|
232 |
if rev.mapping.vcs == foreign_vcs_git: |
|
233 |
return foreign_revid |
|
234 |
else: |
|
235 |
raise bzr_errors.InvalidRevisionId(rev.revision_id, None) |
|
236 |
||
237 |
||
|
0.200.341
by Jelmer Vernooij
Add stanza with git commit info in 'bzr version-info' |
238 |
def update_stanza(rev, stanza): |
239 |
mapping = getattr(rev, "mapping", None) |
|
|
0.200.1262
by Jelmer Vernooij
Add extract git foreign revid. |
240 |
try: |
241 |
git_commit = extract_git_foreign_revid(rev) |
|
242 |
except bzr_errors.InvalidRevisionId: |
|
243 |
pass
|
|
244 |
else: |
|
245 |
stanza.add("git-commit", git_commit) |
|
|
0.200.341
by Jelmer Vernooij
Add stanza with git commit info in 'bzr version-info' |
246 |
|
|
0.200.1088
by Jelmer Vernooij
When possible, lazily load hook points from version_info_format.format_rio. |
247 |
try: |
248 |
from bzrlib.hooks import install_lazy_named_hook |
|
249 |
except ImportError: # Compatibility with bzr < 2.4 |
|
250 |
from bzrlib.version_info_formats.format_rio import ( |
|
251 |
RioVersionInfoBuilder, |
|
252 |
)
|
|
|
0.200.1137
by Jelmer Vernooij
Support BzrProber.known_formats(). |
253 |
RioVersionInfoBuilder.hooks.install_named_hook('revision', update_stanza, |
|
0.200.1088
by Jelmer Vernooij
When possible, lazily load hook points from version_info_format.format_rio. |
254 |
"git commits") |
255 |
else: |
|
256 |
install_lazy_named_hook("bzrlib.version_info_formats.format_rio", |
|
257 |
"RioVersionInfoBuilder.hooks", "revision", update_stanza, |
|
258 |
"git commits") |
|
|
0.200.341
by Jelmer Vernooij
Add stanza with git commit info in 'bzr version-info' |
259 |
|
|
0.200.531
by Jelmer Vernooij
Support 'bzr serve --git'. |
260 |
|
|
0.239.6
by Jelmer Vernooij
Remove pre-1.15 incompatible code. |
261 |
from bzrlib.transport import transport_server_registry |
262 |
transport_server_registry.register_lazy('git', |
|
|
0.200.674
by Jelmer Vernooij
Fix formatting. |
263 |
'bzrlib.plugins.git.server', |
|
0.239.6
by Jelmer Vernooij
Remove pre-1.15 incompatible code. |
264 |
'serve_git', |
265 |
'Git Smart server protocol over TCP. (default port: 9418)') |
|
|
0.200.531
by Jelmer Vernooij
Support 'bzr serve --git'. |
266 |
|
267 |
||
|
0.200.926
by Jelmer Vernooij
Fix formatting, drop support for Bazaar < 2.0. |
268 |
from bzrlib.repository import ( |
|
0.200.1083
by Jelmer Vernooij
Register repository format. |
269 |
format_registry as repository_format_registry, |
|
0.200.926
by Jelmer Vernooij
Fix formatting, drop support for Bazaar < 2.0. |
270 |
network_format_registry as repository_network_format_registry, |
271 |
)
|
|
|
0.200.674
by Jelmer Vernooij
Fix formatting. |
272 |
repository_network_format_registry.register_lazy('git', |
|
0.200.536
by Jelmer Vernooij
Implement network name. |
273 |
'bzrlib.plugins.git.repository', 'GitRepositoryFormat') |
274 |
||
|
0.200.1024
by Jelmer Vernooij
Cope with network_format_registry moving. |
275 |
try: |
|
0.200.1083
by Jelmer Vernooij
Register repository format. |
276 |
register_extra_lazy_repository_format = getattr(repository_format_registry, |
277 |
"register_extra_lazy") |
|
|
0.200.1111
by Jelmer Vernooij
Drop support for Bazaar < 2.3. |
278 |
except AttributeError: # bzr < 2.4 |
|
0.200.1083
by Jelmer Vernooij
Register repository format. |
279 |
pass
|
280 |
else: |
|
281 |
register_extra_lazy_repository_format('bzrlib.plugins.git.repository', |
|
282 |
'GitRepositoryFormat') |
|
283 |
||
|
0.200.1127
by Jelmer Vernooij
Register branch format network name. |
284 |
from bzrlib.branch import ( |
285 |
network_format_registry as branch_network_format_registry, |
|
286 |
)
|
|
287 |
branch_network_format_registry.register_lazy('git', |
|
288 |
'bzrlib.plugins.git.branch', 'GitBranchFormat') |
|
289 |
||
|
0.200.1083
by Jelmer Vernooij
Register repository format. |
290 |
try: |
|
0.200.1090
by Jelmer Vernooij
Register branch format for testing. |
291 |
from bzrlib.branch import ( |
292 |
format_registry as branch_format_registry, |
|
293 |
)
|
|
|
0.200.1111
by Jelmer Vernooij
Drop support for Bazaar < 2.3. |
294 |
except ImportError: # bzr < 2.4 |
|
0.200.1090
by Jelmer Vernooij
Register branch format for testing. |
295 |
pass
|
296 |
else: |
|
297 |
branch_format_registry.register_extra_lazy( |
|
298 |
'bzrlib.plugins.git.branch', |
|
299 |
'GitBranchFormat', |
|
300 |
)
|
|
301 |
||
302 |
try: |
|
|
0.200.1093
by Jelmer Vernooij
Register working tree format for testing. |
303 |
from bzrlib.workingtree import ( |
304 |
format_registry as workingtree_format_registry, |
|
305 |
)
|
|
|
0.200.1111
by Jelmer Vernooij
Drop support for Bazaar < 2.3. |
306 |
except ImportError: # bzr < 2.4 |
|
0.200.1093
by Jelmer Vernooij
Register working tree format for testing. |
307 |
pass
|
308 |
else: |
|
309 |
workingtree_format_registry.register_extra_lazy( |
|
310 |
'bzrlib.plugins.git.workingtree', |
|
311 |
'GitWorkingTreeFormat', |
|
312 |
)
|
|
313 |
||
|
0.200.1137
by Jelmer Vernooij
Support BzrProber.known_formats(). |
314 |
controldir_network_format_registry.register_lazy('git', |
315 |
"bzrlib.plugins.git.dir", "GitControlDirFormat") |
|
|
0.200.536
by Jelmer Vernooij
Implement network name. |
316 |
|
|
0.238.1
by Lukas Lalinsky, Jelmer Vernooij
Import initial work on 'bzr send --format=git' based on luks' patch for bzr-svn. |
317 |
send_format_registry.register_lazy('git', 'bzrlib.plugins.git.send', |
318 |
'send_git', 'Git am-style diff format') |
|
319 |
||
|
0.200.1137
by Jelmer Vernooij
Support BzrProber.known_formats(). |
320 |
topic_registry.register_lazy('git', 'bzrlib.plugins.git.help', 'help_git', |
321 |
'Using Bazaar with Git') |
|
|
0.200.1011
by Jelmer Vernooij
Add some basic documentation in 'bzr help git'. |
322 |
|
|
0.200.1111
by Jelmer Vernooij
Drop support for Bazaar < 2.3. |
323 |
from bzrlib.diff import format_registry as diff_format_registry |
324 |
diff_format_registry.register_lazy('git', 'bzrlib.plugins.git.send', |
|
325 |
'GitDiffTree', 'Git am-style diff format') |
|
|
0.200.870
by Jelmer Vernooij
Support git-specific bzr diff option. |
326 |
|
|
0.200.1291
by Jelmer Vernooij
add hook for updating to local git cache. |
327 |
|
328 |
def update_git_cache(repository, revid): |
|
329 |
"""Update the git cache after a local commit.""" |
|
330 |
if getattr(repository, "_git", None) is not None: |
|
331 |
return # No need to update cache for git repositories |
|
332 |
||
333 |
from bzrlib.plugins.git.object_store import BazaarObjectStore |
|
334 |
if not repository.control_transport.has("git"): |
|
335 |
return # No existing cache, don't bother updating |
|
336 |
store = BazaarObjectStore(repository) |
|
337 |
store.lock_write() |
|
338 |
try: |
|
339 |
store._update_sha_map_revision(revid) |
|
340 |
finally: |
|
341 |
store.unlock() |
|
342 |
||
343 |
||
344 |
def post_commit_update_cache(local_branch, master_branch, old_revno, old_revid, |
|
345 |
new_revno, new_revid): |
|
346 |
if local_branch is not None: |
|
347 |
update_git_cache(local_branch.repository, new_revid) |
|
348 |
update_git_cache(master_branch.repository, new_revid) |
|
349 |
||
350 |
||
351 |
try: |
|
352 |
from bzrlib.hooks import install_lazy_named_hook |
|
353 |
except ImportError: # Compatibility with bzr < 2.4 |
|
354 |
pass
|
|
355 |
else: |
|
356 |
install_lazy_named_hook("bzrlib.branch", |
|
357 |
"Branch.hooks", "post_commit", post_commit_update_cache, |
|
358 |
"git cache") |
|
359 |
||
360 |
||
|
0.201.1
by Jelmer Vernooij
Add very small initial testsuite. |
361 |
def test_suite(): |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
362 |
from bzrlib.plugins.git import tests |
363 |
return tests.test_suite() |