bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
0.358.2
by Jelmer Vernooij
Refresh copyright headers, add my email. |
1 |
# Copyright (C) 2008-2018 Jelmer Vernooij <jelmer@jelmer.uk>
|
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
2 |
# Copyright (C) 2007 Canonical Ltd
|
3 |
#
|
|
4 |
# This program is free software; you can redistribute it and/or modify
|
|
5 |
# it under the terms of the GNU General Public License as published by
|
|
6 |
# the Free Software Foundation; either version 2 of the License, or
|
|
7 |
# (at your option) any later version.
|
|
8 |
#
|
|
9 |
# This program is distributed in the hope that it will be useful,
|
|
10 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 |
# GNU General Public License for more details.
|
|
13 |
#
|
|
14 |
# You should have received a copy of the GNU General Public License
|
|
15 |
# along with this program; if not, write to the Free Software
|
|
|
0.358.1
by Jelmer Vernooij
Fix FSF address. |
16 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
17 |
|
18 |
"""An adapter between a Git Repository and a Bazaar Branch"""
|
|
19 |
||
|
0.200.1594
by Jelmer Vernooij
Use absolute_import everywhere. |
20 |
from __future__ import absolute_import |
21 |
||
|
0.200.1641
by Jelmer Vernooij
Use relative imports where possible. |
22 |
from ... import ( |
|
0.200.1244
by Jelmer Vernooij
Implement GitRepository.check. |
23 |
check, |
|
0.200.43
by David Allouche
Ultra-experimental support for "bzr pull". No test. No sanity. |
24 |
errors, |
|
0.200.1281
by Jelmer Vernooij
Provide Repository.get_known_graph_ancestry. |
25 |
graph as _mod_graph, |
|
0.200.1670
by Jelmer Vernooij
Fix compatibility with newer versions of bzr. |
26 |
lock, |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
27 |
repository, |
|
0.285.5
by Jelmer Vernooij
Fix import. |
28 |
revision as _mod_revision, |
|
0.425.1
by Jelmer Vernooij
Add really basic check implementation. |
29 |
trace, |
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
30 |
transactions, |
|
0.200.1601
by Jelmer Vernooij
remove compatibility code for bzr < 2.5. |
31 |
ui, |
|
0.200.1646
by Jelmer Vernooij
Rename bzrlib to breezy. |
32 |
version_info as breezy_version, |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
33 |
)
|
|
0.200.1641
by Jelmer Vernooij
Use relative imports where possible. |
34 |
from ...decorators import only_raises |
35 |
from ...foreign import ( |
|
|
0.200.292
by Jelmer Vernooij
Fix formatting. |
36 |
ForeignRepository, |
37 |
)
|
|
|
7018.3.2
by Jelmer Vernooij
Fix some git tests. |
38 |
from ...sixish import viewvalues |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
39 |
|
|
0.200.1641
by Jelmer Vernooij
Use relative imports where possible. |
40 |
from .commit import ( |
|
0.200.387
by Jelmer Vernooij
Initial work on supporting commit in git trees. |
41 |
GitCommitBuilder, |
42 |
)
|
|
|
0.200.1641
by Jelmer Vernooij
Use relative imports where possible. |
43 |
from .filegraph import ( |
|
0.200.1283
by Jelmer Vernooij
Provide Repository.get_file_graph() and Tree.get_file_revision(). |
44 |
GitFileLastChangeScanner, |
45 |
GitFileParentProvider, |
|
46 |
)
|
|
|
0.200.1641
by Jelmer Vernooij
Use relative imports where possible. |
47 |
from .mapping import ( |
|
0.200.256
by Jelmer Vernooij
Add tests for import_revision_gist. |
48 |
default_mapping, |
|
0.200.1263
by Jelmer Vernooij
Fix foreign_vcs_git. |
49 |
foreign_vcs_git, |
|
0.200.256
by Jelmer Vernooij
Add tests for import_revision_gist. |
50 |
mapping_registry, |
51 |
)
|
|
|
0.200.1641
by Jelmer Vernooij
Use relative imports where possible. |
52 |
from .tree import ( |
|
0.200.617
by Jelmer Vernooij
Add custom InterTree for use between git revision trees. |
53 |
GitRevisionTree, |
54 |
)
|
|
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
55 |
|
56 |
||
|
0.200.1636
by Jelmer Vernooij
Some formatting fixes. |
57 |
from dulwich.errors import ( |
58 |
NotCommitError, |
|
59 |
)
|
|
|
0.252.21
by Jelmer Vernooij
Fix GitRepository.all_revision_ids() to find all revisions. |
60 |
from dulwich.objects import ( |
61 |
Commit, |
|
|
0.200.1153
by Jelmer Vernooij
Import ZERO_SHA from dulwich.objects. |
62 |
ZERO_SHA, |
|
0.252.21
by Jelmer Vernooij
Fix GitRepository.all_revision_ids() to find all revisions. |
63 |
)
|
|
0.200.1233
by Jelmer Vernooij
Implement Repository.iter_files_bytes. |
64 |
from dulwich.object_store import ( |
65 |
tree_lookup_path, |
|
66 |
)
|
|
|
0.252.21
by Jelmer Vernooij
Fix GitRepository.all_revision_ids() to find all revisions. |
67 |
|
68 |
||
|
0.200.1246
by Jelmer Vernooij
Provide GitRepository.reconcile. |
69 |
class RepoReconciler(object): |
70 |
"""Reconciler that reconciles a repository. |
|
71 |
||
72 |
"""
|
|
73 |
||
74 |
def __init__(self, repo, other=None, thorough=False): |
|
75 |
"""Construct a RepoReconciler. |
|
76 |
||
77 |
:param thorough: perform a thorough check which may take longer but
|
|
78 |
will correct non-data loss issues such as incorrect
|
|
79 |
cached data.
|
|
80 |
"""
|
|
81 |
self.repo = repo |
|
82 |
||
83 |
def reconcile(self): |
|
84 |
"""Perform reconciliation. |
|
85 |
||
86 |
After reconciliation the following attributes document found issues:
|
|
87 |
inconsistent_parents: The number of revisions in the repository whose
|
|
88 |
ancestry was being reported incorrectly.
|
|
89 |
garbage_inventories: The number of inventory objects without revisions
|
|
90 |
that were garbage collected.
|
|
91 |
"""
|
|
92 |
||
93 |
||
|
0.200.1244
by Jelmer Vernooij
Implement GitRepository.check. |
94 |
class GitCheck(check.Check): |
95 |
||
96 |
def __init__(self, repository, check_repo=True): |
|
97 |
self.repository = repository |
|
|
0.425.1
by Jelmer Vernooij
Add really basic check implementation. |
98 |
self.check_repo = check_repo |
|
0.200.1244
by Jelmer Vernooij
Implement GitRepository.check. |
99 |
self.checked_rev_cnt = 0 |
|
0.425.1
by Jelmer Vernooij
Add really basic check implementation. |
100 |
self.object_count = None |
101 |
self.problems = [] |
|
|
0.200.1244
by Jelmer Vernooij
Implement GitRepository.check. |
102 |
|
103 |
def check(self, callback_refs=None, check_repo=True): |
|
104 |
if callback_refs is None: |
|
105 |
callback_refs = {} |
|
|
0.425.1
by Jelmer Vernooij
Add really basic check implementation. |
106 |
with self.repository.lock_read(), ui.ui_factory.nested_progress_bar() as self.progress: |
107 |
shas = set(self.repository._git.object_store) |
|
108 |
self.object_count = len(shas) |
|
109 |
# TODO(jelmer): Check more things
|
|
110 |
for i, sha in enumerate(shas): |
|
111 |
self.progress.update('checking objects', i, self.object_count) |
|
112 |
o = self.repository._git.object_store[sha] |
|
113 |
try: |
|
114 |
o.check() |
|
115 |
except Exception as e: |
|
116 |
self.problems.append((sha, e)) |
|
117 |
||
118 |
def _report_repo_results(self, verbose): |
|
119 |
trace.note('checked repository {0} format {1}'.format( |
|
120 |
self.repository.user_url, |
|
121 |
self.repository._format)) |
|
122 |
trace.note('%6d objects', self.object_count) |
|
123 |
for sha, problem in self.problems: |
|
124 |
trace.note('%s: %s', sha, problem) |
|
|
0.200.1244
by Jelmer Vernooij
Implement GitRepository.check. |
125 |
|
126 |
def report_results(self, verbose): |
|
|
0.425.1
by Jelmer Vernooij
Add really basic check implementation. |
127 |
if self.check_repo: |
128 |
self._report_repo_results(verbose) |
|
|
0.200.1244
by Jelmer Vernooij
Implement GitRepository.check. |
129 |
|
130 |
||
|
0.200.1447
by Jelmer Vernooij
Load optimisers at most once. |
131 |
_optimisers_loaded = False |
132 |
||
133 |
def lazy_load_optimisers(): |
|
134 |
global _optimisers_loaded |
|
135 |
if _optimisers_loaded: |
|
136 |
return
|
|
|
0.401.2
by Jelmer Vernooij
Move all InterRepository implementations into interrepo. |
137 |
from . import interrepo |
138 |
for optimiser in [interrepo.InterRemoteGitNonGitRepository, |
|
139 |
interrepo.InterLocalGitNonGitRepository, |
|
140 |
interrepo.InterLocalGitLocalGitRepository, |
|
141 |
interrepo.InterRemoteGitLocalGitRepository, |
|
142 |
interrepo.InterToLocalGitRepository, |
|
|
0.401.3
by Jelmer Vernooij
Formatting fixes. |
143 |
interrepo.InterToRemoteGitRepository, |
144 |
]:
|
|
|
0.200.1447
by Jelmer Vernooij
Load optimisers at most once. |
145 |
repository.InterRepository.register_optimiser(optimiser) |
146 |
_optimisers_loaded = True |
|
147 |
||
148 |
||
|
0.200.115
by Jelmer Vernooij
Pass mapping object. |
149 |
class GitRepository(ForeignRepository): |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
150 |
"""An adapter to git repositories for bzr.""" |
151 |
||
|
0.200.41
by David Allouche
Define _serializer = None in GitRepository. |
152 |
_serializer = None |
|
0.200.1263
by Jelmer Vernooij
Fix foreign_vcs_git. |
153 |
vcs = foreign_vcs_git |
|
0.200.1086
by Jelmer Vernooij
Provide chk_bytes attribute. |
154 |
chk_bytes = None |
|
0.200.41
by David Allouche
Define _serializer = None in GitRepository. |
155 |
|
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
156 |
def __init__(self, gitdir): |
|
0.200.1447
by Jelmer Vernooij
Load optimisers at most once. |
157 |
self._transport = gitdir.root_transport |
|
0.200.1307
by Jelmer Vernooij
Formatting fixes, specify path to a couple more functions. |
158 |
super(GitRepository, self).__init__(GitRepositoryFormat(), |
|
0.200.1601
by Jelmer Vernooij
remove compatibility code for bzr < 2.5. |
159 |
gitdir, control_files=None) |
|
0.200.1449
by Jelmer Vernooij
Fix compatibility with bzr < 2.5 when used with remote repositories. |
160 |
self.base = gitdir.root_transport.base |
|
0.200.1447
by Jelmer Vernooij
Load optimisers at most once. |
161 |
lazy_load_optimisers() |
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
162 |
self._lock_mode = None |
163 |
self._lock_count = 0 |
|
|
0.200.139
by Jelmer Vernooij
Share more code between local and remote classes, support opening remote branches. |
164 |
|
|
0.200.1231
by Jelmer Vernooij
Implement GitRepository.add_fallback_repository. |
165 |
def add_fallback_repository(self, basis_url): |
|
0.200.1307
by Jelmer Vernooij
Formatting fixes, specify path to a couple more functions. |
166 |
raise errors.UnstackableRepositoryFormat(self._format, |
167 |
self.control_transport.base) |
|
|
0.200.1231
by Jelmer Vernooij
Implement GitRepository.add_fallback_repository. |
168 |
|
|
0.200.139
by Jelmer Vernooij
Share more code between local and remote classes, support opening remote branches. |
169 |
def is_shared(self): |
|
0.200.886
by Jelmer Vernooij
Git repositories are not shared. |
170 |
return False |
|
0.200.139
by Jelmer Vernooij
Share more code between local and remote classes, support opening remote branches. |
171 |
|
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
172 |
def get_physical_lock_status(self): |
173 |
return False |
|
174 |
||
175 |
def lock_write(self): |
|
176 |
"""See Branch.lock_write().""" |
|
177 |
if self._lock_mode: |
|
|
0.361.1
by Jelmer Vernooij
Don't use assert. |
178 |
if self._lock_mode != 'w': |
179 |
raise errors.ReadOnlyError(self) |
|
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
180 |
self._lock_count += 1 |
181 |
else: |
|
182 |
self._lock_mode = 'w' |
|
183 |
self._lock_count = 1 |
|
|
0.334.1
by Jelmer Vernooij
Improve transaction and write group handling. |
184 |
self._transaction = transactions.WriteTransaction() |
|
0.200.1680
by Jelmer Vernooij
Fix repo locks. |
185 |
return repository.RepositoryWriteLockResult(self.unlock, None) |
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
186 |
|
|
0.200.1454
by Jelmer Vernooij
Provide Repository.break_lock. |
187 |
def break_lock(self): |
188 |
raise NotImplementedError(self.break_lock) |
|
189 |
||
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
190 |
def dont_leave_lock_in_place(self): |
191 |
raise NotImplementedError(self.dont_leave_lock_in_place) |
|
192 |
||
193 |
def leave_lock_in_place(self): |
|
194 |
raise NotImplementedError(self.leave_lock_in_place) |
|
195 |
||
196 |
def lock_read(self): |
|
197 |
if self._lock_mode: |
|
|
0.361.1
by Jelmer Vernooij
Don't use assert. |
198 |
if self._lock_mode not in ('r', 'w'): |
199 |
raise AssertionError |
|
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
200 |
self._lock_count += 1 |
201 |
else: |
|
202 |
self._lock_mode = 'r' |
|
203 |
self._lock_count = 1 |
|
|
0.334.1
by Jelmer Vernooij
Improve transaction and write group handling. |
204 |
self._transaction = transactions.ReadOnlyTransaction() |
|
0.200.1670
by Jelmer Vernooij
Fix compatibility with newer versions of bzr. |
205 |
return lock.LogicalLockResult(self.unlock) |
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
206 |
|
207 |
@only_raises(errors.LockNotHeld, errors.LockBroken) |
|
208 |
def unlock(self): |
|
209 |
if self._lock_count == 0: |
|
210 |
raise errors.LockNotHeld(self) |
|
211 |
if self._lock_count == 1 and self._lock_mode == 'w': |
|
212 |
if self._write_group is not None: |
|
213 |
self.abort_write_group() |
|
214 |
self._lock_count -= 1 |
|
215 |
self._lock_mode = None |
|
216 |
raise errors.BzrError( |
|
217 |
'Must end write groups before releasing write locks.') |
|
218 |
self._lock_count -= 1 |
|
219 |
if self._lock_count == 0: |
|
220 |
self._lock_mode = None |
|
|
0.334.1
by Jelmer Vernooij
Improve transaction and write group handling. |
221 |
transaction = self._transaction |
222 |
self._transaction = None |
|
223 |
transaction.finish() |
|
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
224 |
|
225 |
def is_write_locked(self): |
|
226 |
return (self._lock_mode == 'w') |
|
227 |
||
228 |
def is_locked(self): |
|
229 |
return (self._lock_mode is not None) |
|
230 |
||
231 |
def get_transaction(self): |
|
232 |
"""See Repository.get_transaction().""" |
|
|
0.334.1
by Jelmer Vernooij
Improve transaction and write group handling. |
233 |
if self._transaction is None: |
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
234 |
return transactions.PassThroughTransaction() |
235 |
else: |
|
|
0.334.1
by Jelmer Vernooij
Improve transaction and write group handling. |
236 |
return self._transaction |
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
237 |
|
|
0.200.1246
by Jelmer Vernooij
Provide GitRepository.reconcile. |
238 |
def reconcile(self, other=None, thorough=False): |
239 |
"""Reconcile this repository.""" |
|
240 |
reconciler = RepoReconciler(self, thorough=thorough) |
|
241 |
reconciler.reconcile() |
|
242 |
return reconciler |
|
243 |
||
|
0.200.139
by Jelmer Vernooij
Share more code between local and remote classes, support opening remote branches. |
244 |
def supports_rich_root(self): |
245 |
return True |
|
246 |
||
247 |
def get_mapping(self): |
|
248 |
return default_mapping |
|
249 |
||
|
0.200.147
by Jelmer Vernooij
Merge new dulwich; fetching objects from local repository works now; they aren't converted yet though. |
250 |
def make_working_trees(self): |
|
0.200.1546
by Jelmer Vernooij
Provide get_config. |
251 |
return not self._git.get_config().get_boolean(("core", ), "bare") |
|
0.200.139
by Jelmer Vernooij
Share more code between local and remote classes, support opening remote branches. |
252 |
|
|
0.200.557
by Jelmer Vernooij
Implement GitRepository.revision_graph_can_have_wrong_parents(). |
253 |
def revision_graph_can_have_wrong_parents(self): |
254 |
return False |
|
255 |
||
|
0.200.1158
by Jelmer Vernooij
Implement stub Repositor.add_signature_text. |
256 |
def add_signature_text(self, revid, signature): |
257 |
raise errors.UnsupportedOperation(self.add_signature_text, self) |
|
258 |
||
|
0.200.1467
by Jelmer Vernooij
Implement GitRepository.sign_revision. |
259 |
def sign_revision(self, revision_id, gpg_strategy): |
260 |
raise errors.UnsupportedOperation(self.add_signature_text, self) |
|
261 |
||
|
0.200.139
by Jelmer Vernooij
Share more code between local and remote classes, support opening remote branches. |
262 |
|
263 |
class LocalGitRepository(GitRepository): |
|
|
0.200.276
by Jelmer Vernooij
Improve formatting. |
264 |
"""Git repository on the file system.""" |
|
0.200.139
by Jelmer Vernooij
Share more code between local and remote classes, support opening remote branches. |
265 |
|
|
0.200.1411
by Jelmer Vernooij
Fix control files. |
266 |
def __init__(self, gitdir): |
267 |
GitRepository.__init__(self, gitdir) |
|
|
0.200.90
by Jelmer Vernooij
Basic support for opening working trees. |
268 |
self._git = gitdir._git |
|
0.200.1283
by Jelmer Vernooij
Provide Repository.get_file_graph() and Tree.get_file_revision(). |
269 |
self._file_change_scanner = GitFileLastChangeScanner(self) |
|
0.334.1
by Jelmer Vernooij
Improve transaction and write group handling. |
270 |
self._transaction = None |
|
0.200.45
by David Allouche
More performance hacking, introduce sqlite cache, escape characters in commits that break serializers. |
271 |
|
|
0.200.1224
by Jelmer Vernooij
provide explicit GitRepository.get_commit_builder. |
272 |
def get_commit_builder(self, branch, parents, config, timestamp=None, |
273 |
timezone=None, committer=None, revprops=None, |
|
274 |
revision_id=None, lossy=False): |
|
275 |
"""Obtain a CommitBuilder for this repository. |
|
276 |
||
277 |
:param branch: Branch to commit to.
|
|
278 |
:param parents: Revision ids of the parents of the new revision.
|
|
279 |
:param config: Configuration to use.
|
|
280 |
:param timestamp: Optional timestamp recorded for commit.
|
|
281 |
:param timezone: Optional timezone for timestamp.
|
|
282 |
:param committer: Optional committer to set for commit.
|
|
283 |
:param revprops: Optional dictionary of revision properties.
|
|
284 |
:param revision_id: Optional revision id.
|
|
285 |
:param lossy: Whether to discard data that can not be natively
|
|
286 |
represented, when pushing to a foreign VCS
|
|
287 |
"""
|
|
|
0.294.1
by Jelmer Vernooij
Fix write group handling when creating commit builder fails. |
288 |
builder = GitCommitBuilder(self, parents, config, |
289 |
timestamp, timezone, committer, revprops, revision_id, |
|
290 |
lossy) |
|
|
0.200.1229
by Jelmer Vernooij
Provide CommitBuilder.any_changes. |
291 |
self.start_write_group() |
|
0.294.1
by Jelmer Vernooij
Fix write group handling when creating commit builder fails. |
292 |
return builder |
|
0.200.1224
by Jelmer Vernooij
provide explicit GitRepository.get_commit_builder. |
293 |
|
|
0.200.1283
by Jelmer Vernooij
Provide Repository.get_file_graph() and Tree.get_file_revision(). |
294 |
def get_file_graph(self): |
|
0.200.1307
by Jelmer Vernooij
Formatting fixes, specify path to a couple more functions. |
295 |
return _mod_graph.Graph(GitFileParentProvider( |
296 |
self._file_change_scanner)) |
|
|
0.200.1283
by Jelmer Vernooij
Provide Repository.get_file_graph() and Tree.get_file_revision(). |
297 |
|
|
0.200.1233
by Jelmer Vernooij
Implement Repository.iter_files_bytes. |
298 |
def iter_files_bytes(self, desired_files): |
299 |
"""Iterate through file versions. |
|
300 |
||
301 |
Files will not necessarily be returned in the order they occur in
|
|
302 |
desired_files. No specific order is guaranteed.
|
|
303 |
||
304 |
Yields pairs of identifier, bytes_iterator. identifier is an opaque
|
|
305 |
value supplied by the caller as part of desired_files. It should
|
|
306 |
uniquely identify the file version in the caller's context. (Examples:
|
|
307 |
an index number or a TreeTransform trans_id.)
|
|
308 |
||
309 |
bytes_iterator is an iterable of bytestrings for the file. The
|
|
310 |
kind of iterable and length of the bytestrings are unspecified, but for
|
|
311 |
this implementation, it is a list of bytes produced by
|
|
312 |
VersionedFile.get_record_stream().
|
|
313 |
||
314 |
:param desired_files: a list of (file_id, revision_id, identifier)
|
|
315 |
triples
|
|
316 |
"""
|
|
317 |
per_revision = {} |
|
318 |
for (file_id, revision_id, identifier) in desired_files: |
|
|
0.200.1307
by Jelmer Vernooij
Formatting fixes, specify path to a couple more functions. |
319 |
per_revision.setdefault(revision_id, []).append( |
320 |
(file_id, identifier)) |
|
|
0.200.1233
by Jelmer Vernooij
Implement Repository.iter_files_bytes. |
321 |
for revid, files in per_revision.iteritems(): |
|
0.200.1745
by Jelmer Vernooij
Fix iter_files_bytes. |
322 |
try: |
323 |
(commit_id, mapping) = self.lookup_bzr_revision_id(revid) |
|
324 |
except errors.NoSuchRevision: |
|
325 |
raise errors.RevisionNotPresent(revid, self) |
|
|
0.200.1233
by Jelmer Vernooij
Implement Repository.iter_files_bytes. |
326 |
try: |
327 |
commit = self._git.object_store[commit_id] |
|
328 |
except KeyError: |
|
329 |
raise errors.RevisionNotPresent(revid, self) |
|
330 |
root_tree = commit.tree |
|
331 |
for fileid, identifier in files: |
|
|
0.200.1715
by Jelmer Vernooij
Fix some more tests. |
332 |
try: |
333 |
path = mapping.parse_file_id(fileid) |
|
334 |
except ValueError: |
|
335 |
raise errors.RevisionNotPresent((fileid, revid), self) |
|
|
0.200.1233
by Jelmer Vernooij
Implement Repository.iter_files_bytes. |
336 |
try: |
337 |
obj = tree_lookup_path( |
|
338 |
self._git.object_store.__getitem__, root_tree, path) |
|
339 |
if isinstance(obj, tuple): |
|
340 |
(mode, item_id) = obj |
|
341 |
obj = self._git.object_store[item_id] |
|
342 |
except KeyError: |
|
343 |
raise errors.RevisionNotPresent((fileid, revid), self) |
|
344 |
else: |
|
345 |
if obj.type_name == "tree": |
|
346 |
yield (identifier, []) |
|
347 |
elif obj.type_name == "blob": |
|
348 |
yield (identifier, obj.chunked) |
|
349 |
else: |
|
350 |
raise AssertionError("file text resolved to %r" % obj) |
|
351 |
||
|
0.200.1533
by Jelmer Vernooij
Improve gather_stats. |
352 |
def gather_stats(self, revid=None, committers=None): |
353 |
"""See Repository.gather_stats().""" |
|
354 |
result = super(LocalGitRepository, self).gather_stats(revid, committers) |
|
355 |
revs = [] |
|
356 |
for sha in self._git.object_store: |
|
357 |
o = self._git.object_store[sha] |
|
358 |
if o.type_name == "commit": |
|
359 |
revs.append(o.id) |
|
360 |
result['revisions'] = len(revs) |
|
361 |
return result |
|
362 |
||
|
0.252.46
by Jelmer Vernooij
Generate refs/bzr/* if not set yet. |
363 |
def _iter_revision_ids(self): |
|
0.200.1021
by Jelmer Vernooij
Put testament sha1 in revisions. |
364 |
mapping = self.get_mapping() |
|
0.252.21
by Jelmer Vernooij
Fix GitRepository.all_revision_ids() to find all revisions. |
365 |
for sha in self._git.object_store: |
366 |
o = self._git.object_store[sha] |
|
367 |
if not isinstance(o, Commit): |
|
368 |
continue
|
|
|
0.200.1029
by Jelmer Vernooij
Use dictionary with verifiers rather than requiring testament3-sha1 everywhere. |
369 |
rev, roundtrip_revid, verifiers = mapping.import_commit(o, |
|
0.261.6
by Jelmer Vernooij
Use mapping.revision_id_foreign_to_bzr to find parents everywhere. |
370 |
mapping.revision_id_foreign_to_bzr) |
|
0.200.1021
by Jelmer Vernooij
Put testament sha1 in revisions. |
371 |
yield o.id, rev.revision_id, roundtrip_revid |
|
0.252.46
by Jelmer Vernooij
Generate refs/bzr/* if not set yet. |
372 |
|
373 |
def all_revision_ids(self): |
|
|
0.200.1727
by Jelmer Vernooij
Change all_revision_ids type to list. |
374 |
ret = set() |
|
0.200.1021
by Jelmer Vernooij
Put testament sha1 in revisions. |
375 |
for git_sha, revid, roundtrip_revid in self._iter_revision_ids(): |
376 |
if roundtrip_revid: |
|
377 |
ret.add(roundtrip_revid) |
|
|
0.200.1325
by Jelmer Vernooij
More test fixes. |
378 |
else: |
379 |
ret.add(revid) |
|
|
0.200.1727
by Jelmer Vernooij
Change all_revision_ids type to list. |
380 |
return list(ret) |
|
0.200.74
by Jelmer Vernooij
Implement Repository.all_revision_ids(). |
381 |
|
|
0.200.1552
by Jelmer Vernooij
Claim to support nested trees. |
382 |
def _get_parents(self, revid, no_alternates=False): |
|
0.200.1756
by Jelmer Vernooij
Initial work on annotate support. |
383 |
if type(revid) != bytes: |
|
0.200.1328
by Jelmer Vernooij
More test fixes. |
384 |
raise ValueError |
385 |
try: |
|
|
0.200.1343
by Jelmer Vernooij
Update docstrings. |
386 |
(hexsha, mapping) = self.lookup_bzr_revision_id(revid) |
|
0.200.1328
by Jelmer Vernooij
More test fixes. |
387 |
except errors.NoSuchRevision: |
388 |
return None |
|
|
0.200.1552
by Jelmer Vernooij
Claim to support nested trees. |
389 |
# FIXME: Honor no_alternates setting
|
|
0.200.1328
by Jelmer Vernooij
More test fixes. |
390 |
try: |
|
0.200.1553
by Jelmer Vernooij
Avoid using nonexistant method. |
391 |
commit = self._git.object_store[hexsha] |
|
0.200.1328
by Jelmer Vernooij
More test fixes. |
392 |
except KeyError: |
393 |
return None |
|
|
6965.1.1
by Jelmer Vernooij
Add basic support for horizoned history. |
394 |
ret = [] |
395 |
for p in commit.parents: |
|
396 |
try: |
|
397 |
ret.append(self.lookup_foreign_revision_id(p, mapping)) |
|
398 |
except KeyError: |
|
399 |
ret.append(mapping.revision_id_foreign_to_bzr(p)) |
|
400 |
return ret |
|
|
0.200.1328
by Jelmer Vernooij
More test fixes. |
401 |
|
|
0.200.1552
by Jelmer Vernooij
Claim to support nested trees. |
402 |
def _get_parent_map_no_fallbacks(self, revids): |
403 |
return self.get_parent_map(revids, no_alternates=True) |
|
404 |
||
405 |
def get_parent_map(self, revids, no_alternates=False): |
|
|
0.200.131
by Jelmer Vernooij
Fix all tests but two, use rich roots by default. |
406 |
parent_map = {} |
407 |
for revision_id in revids: |
|
|
0.200.1552
by Jelmer Vernooij
Claim to support nested trees. |
408 |
parents = self._get_parents(revision_id, no_alternates=no_alternates) |
|
0.285.5
by Jelmer Vernooij
Fix import. |
409 |
if revision_id == _mod_revision.NULL_REVISION: |
|
0.200.1329
by Jelmer Vernooij
Fix more tests. |
410 |
parent_map[revision_id] = () |
411 |
continue
|
|
|
0.200.1328
by Jelmer Vernooij
More test fixes. |
412 |
if parents is None: |
413 |
continue
|
|
|
0.200.1324
by Jelmer Vernooij
More work on roundtripping support. |
414 |
if len(parents) == 0: |
|
0.285.5
by Jelmer Vernooij
Fix import. |
415 |
parents = [_mod_revision.NULL_REVISION] |
|
0.200.1094
by Jelmer Vernooij
Fix test_get_no_parents. |
416 |
parent_map[revision_id] = tuple(parents) |
|
0.200.131
by Jelmer Vernooij
Fix all tests but two, use rich roots by default. |
417 |
return parent_map |
418 |
||
|
0.200.1281
by Jelmer Vernooij
Provide Repository.get_known_graph_ancestry. |
419 |
def get_known_graph_ancestry(self, revision_ids): |
420 |
"""Return the known graph for a set of revision ids and their ancestors. |
|
421 |
"""
|
|
422 |
pending = set(revision_ids) |
|
423 |
parent_map = {} |
|
424 |
while pending: |
|
|
0.200.1328
by Jelmer Vernooij
More test fixes. |
425 |
this_parent_map = {} |
426 |
for revid in pending: |
|
|
0.285.5
by Jelmer Vernooij
Fix import. |
427 |
if revid == _mod_revision.NULL_REVISION: |
|
0.200.1328
by Jelmer Vernooij
More test fixes. |
428 |
continue
|
429 |
parents = self._get_parents(revid) |
|
430 |
if parents is not None: |
|
431 |
this_parent_map[revid] = parents |
|
|
0.200.1281
by Jelmer Vernooij
Provide Repository.get_known_graph_ancestry. |
432 |
parent_map.update(this_parent_map) |
433 |
pending = set() |
|
|
7018.3.2
by Jelmer Vernooij
Fix some git tests. |
434 |
map(pending.update, viewvalues(this_parent_map)) |
|
0.200.1281
by Jelmer Vernooij
Provide Repository.get_known_graph_ancestry. |
435 |
pending = pending.difference(parent_map) |
436 |
return _mod_graph.KnownGraph(parent_map) |
|
437 |
||
|
0.200.43
by David Allouche
Ultra-experimental support for "bzr pull". No test. No sanity. |
438 |
def get_signature_text(self, revision_id): |
|
0.386.1
by Jelmer Vernooij
Support signing commits. |
439 |
git_commit_id, mapping = self.lookup_bzr_revision_id(revision_id) |
440 |
try: |
|
441 |
commit = self._git.object_store[git_commit_id] |
|
442 |
except KeyError: |
|
443 |
raise errors.NoSuchRevision(self, revision_id) |
|
444 |
if commit.gpgsig is None: |
|
445 |
raise errors.NoSuchRevision(self, revision_id) |
|
446 |
return commit.gpgsig |
|
|
0.200.43
by David Allouche
Ultra-experimental support for "bzr pull". No test. No sanity. |
447 |
|
|
0.200.1244
by Jelmer Vernooij
Implement GitRepository.check. |
448 |
def check(self, revision_ids=None, callback_refs=None, check_repo=True): |
449 |
result = GitCheck(self, check_repo=check_repo) |
|
450 |
result.check(callback_refs) |
|
451 |
return result |
|
452 |
||
|
0.257.1
by Jelmer Vernooij
use transport repo objects even for local access. |
453 |
def pack(self, hint=None, clean_obsolete_packs=False): |
454 |
self._git.object_store.pack_loose_objects() |
|
455 |
||
|
0.200.650
by Jelmer Vernooij
Use standard names for lookup functions. |
456 |
def lookup_foreign_revision_id(self, foreign_revid, mapping=None): |
|
0.200.124
by Jelmer Vernooij
Add lookup_revision_id stub. |
457 |
"""Lookup a revision id. |
|
0.200.676
by Jelmer Vernooij
Avoid iterating over all keys in the tdb database. |
458 |
|
|
0.200.1508
by Jelmer Vernooij
Add docstring, use peel_sha. |
459 |
:param foreign_revid: Foreign revision id to look up
|
460 |
:param mapping: Mapping to use (use default mapping if not specified)
|
|
461 |
:raise KeyError: If foreign revision was not found
|
|
462 |
:return: bzr revision id
|
|
|
0.200.124
by Jelmer Vernooij
Add lookup_revision_id stub. |
463 |
"""
|
|
7018.3.2
by Jelmer Vernooij
Fix some git tests. |
464 |
if not isinstance(foreign_revid, bytes): |
|
0.361.1
by Jelmer Vernooij
Don't use assert. |
465 |
raise TypeError(foreign_revid) |
|
0.200.649
by Jelmer Vernooij
Make GitRevisions VF implementation behave as the interface expects. |
466 |
if mapping is None: |
467 |
mapping = self.get_mapping() |
|
|
0.200.914
by Jelmer Vernooij
Fix tests. |
468 |
if foreign_revid == ZERO_SHA: |
|
0.285.5
by Jelmer Vernooij
Fix import. |
469 |
return _mod_revision.NULL_REVISION |
|
0.200.1508
by Jelmer Vernooij
Add docstring, use peel_sha. |
470 |
commit = self._git.object_store.peel_sha(foreign_revid) |
|
0.200.1403
by Jelmer Vernooij
Cope with tags pointing at tree objects when cloning local git repositories. |
471 |
if not isinstance(commit, Commit): |
472 |
raise NotCommitError(commit.id) |
|
|
0.200.1029
by Jelmer Vernooij
Use dictionary with verifiers rather than requiring testament3-sha1 everywhere. |
473 |
rev, roundtrip_revid, verifiers = mapping.import_commit(commit, |
|
0.261.6
by Jelmer Vernooij
Use mapping.revision_id_foreign_to_bzr to find parents everywhere. |
474 |
mapping.revision_id_foreign_to_bzr) |
|
0.200.1021
by Jelmer Vernooij
Put testament sha1 in revisions. |
475 |
# FIXME: check testament before doing this?
|
476 |
if roundtrip_revid: |
|
477 |
return roundtrip_revid |
|
478 |
else: |
|
479 |
return rev.revision_id |
|
|
0.200.124
by Jelmer Vernooij
Add lookup_revision_id stub. |
480 |
|
|
0.200.60
by Jelmer Vernooij
Support signature functions. |
481 |
def has_signature_for_revision_id(self, revision_id): |
|
0.200.1343
by Jelmer Vernooij
Update docstrings. |
482 |
"""Check whether a GPG signature is present for this revision. |
483 |
||
484 |
This is never the case for Git repositories.
|
|
485 |
"""
|
|
|
0.386.2
by Jelmer Vernooij
Support verifying signatures. |
486 |
try: |
487 |
self.get_signature_text(revision_id) |
|
488 |
except errors.NoSuchRevision: |
|
489 |
return False |
|
490 |
else: |
|
491 |
return True |
|
492 |
||
493 |
def verify_revision_signature(self, revision_id, gpg_strategy): |
|
494 |
"""Verify the signature on a revision. |
|
495 |
||
496 |
:param revision_id: the revision to verify
|
|
497 |
:gpg_strategy: the GPGStrategy object to used
|
|
498 |
||
499 |
:return: gpg.SIGNATURE_VALID or a failed SIGNATURE_ value
|
|
500 |
"""
|
|
501 |
from breezy import gpg |
|
502 |
with self.lock_read(): |
|
503 |
git_commit_id, mapping = self.lookup_bzr_revision_id(revision_id) |
|
504 |
try: |
|
505 |
commit = self._git.object_store[git_commit_id] |
|
506 |
except KeyError: |
|
507 |
raise errors.NoSuchRevision(self, revision_id) |
|
508 |
||
509 |
if commit.gpgsig is None: |
|
510 |
return gpg.SIGNATURE_NOT_SIGNED, None |
|
511 |
||
512 |
without_sig = Commit.from_string(commit.as_raw_string()) |
|
513 |
without_sig.gpgsig = None |
|
514 |
||
|
0.386.3
by Jelmer Vernooij
use new API. |
515 |
(result, key, plain_text) = gpg_strategy.verify(without_sig.as_raw_string(), commit.gpgsig) |
516 |
return (result, key) |
|
|
0.200.60
by Jelmer Vernooij
Support signature functions. |
517 |
|
|
0.200.913
by Jelmer Vernooij
Fix tests. |
518 |
def lookup_bzr_revision_id(self, bzr_revid, mapping=None): |
|
0.200.1343
by Jelmer Vernooij
Update docstrings. |
519 |
"""Lookup a bzr revision id in a Git repository. |
520 |
||
521 |
:param bzr_revid: Bazaar revision id
|
|
522 |
:param mapping: Optional mapping to use
|
|
523 |
:return: Tuple with git commit id, mapping that was used and supplement
|
|
524 |
details
|
|
525 |
"""
|
|
|
0.200.105
by Jelmer Vernooij
Add common function for finding git commit by bzr revid. |
526 |
try: |
|
0.200.1343
by Jelmer Vernooij
Update docstrings. |
527 |
(git_sha, mapping) = mapping_registry.revision_id_bzr_to_foreign(bzr_revid) |
|
0.200.105
by Jelmer Vernooij
Add common function for finding git commit by bzr revid. |
528 |
except errors.InvalidRevisionId: |
|
0.200.913
by Jelmer Vernooij
Fix tests. |
529 |
if mapping is None: |
530 |
mapping = self.get_mapping() |
|
|
0.252.6
by Jelmer Vernooij
Roundtripping support for revision ids works. |
531 |
try: |
|
0.200.1307
by Jelmer Vernooij
Formatting fixes, specify path to a couple more functions. |
532 |
return (self._git.refs[mapping.revid_as_refname(bzr_revid)], |
533 |
mapping) |
|
|
0.252.6
by Jelmer Vernooij
Roundtripping support for revision ids works. |
534 |
except KeyError: |
|
0.252.46
by Jelmer Vernooij
Generate refs/bzr/* if not set yet. |
535 |
# Update refs from Git commit objects
|
536 |
# FIXME: Hitting this a lot will be very inefficient...
|
|
|
0.200.1601
by Jelmer Vernooij
remove compatibility code for bzr < 2.5. |
537 |
pb = ui.ui_factory.nested_progress_bar() |
538 |
try: |
|
539 |
for i, (git_sha, revid, roundtrip_revid) in enumerate(self._iter_revision_ids()): |
|
540 |
if not roundtrip_revid: |
|
541 |
continue
|
|
542 |
pb.update("resolving revision id", i) |
|
543 |
refname = mapping.revid_as_refname(roundtrip_revid) |
|
544 |
self._git.refs[refname] = git_sha |
|
545 |
if roundtrip_revid == bzr_revid: |
|
546 |
return git_sha, mapping |
|
547 |
finally: |
|
548 |
pb.finished() |
|
|
0.200.913
by Jelmer Vernooij
Fix tests. |
549 |
raise errors.NoSuchRevision(self, bzr_revid) |
|
0.200.1343
by Jelmer Vernooij
Update docstrings. |
550 |
else: |
551 |
return (git_sha, mapping) |
|
|
0.200.105
by Jelmer Vernooij
Add common function for finding git commit by bzr revid. |
552 |
|
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
553 |
def get_revision(self, revision_id): |
|
7018.3.7
by Jelmer Vernooij
Fix remaining git tests. |
554 |
if not isinstance(revision_id, bytes): |
|
0.200.1101
by Jelmer Vernooij
Raise InvalidRevisionId on invalid type being specified to Repository.get_revision. |
555 |
raise errors.InvalidRevisionId(revision_id, self) |
|
0.200.650
by Jelmer Vernooij
Use standard names for lookup functions. |
556 |
git_commit_id, mapping = self.lookup_bzr_revision_id(revision_id) |
|
0.200.147
by Jelmer Vernooij
Merge new dulwich; fetching objects from local repository works now; they aren't converted yet though. |
557 |
try: |
|
0.200.1552
by Jelmer Vernooij
Claim to support nested trees. |
558 |
commit = self._git.object_store[git_commit_id] |
|
0.200.147
by Jelmer Vernooij
Merge new dulwich; fetching objects from local repository works now; they aren't converted yet though. |
559 |
except KeyError: |
560 |
raise errors.NoSuchRevision(self, revision_id) |
|
|
0.200.1029
by Jelmer Vernooij
Use dictionary with verifiers rather than requiring testament3-sha1 everywhere. |
561 |
revision, roundtrip_revid, verifiers = mapping.import_commit( |
|
0.200.1021
by Jelmer Vernooij
Put testament sha1 in revisions. |
562 |
commit, self.lookup_foreign_revision_id) |
|
0.361.1
by Jelmer Vernooij
Don't use assert. |
563 |
if revision is None: |
564 |
raise AssertionError |
|
|
0.200.1029
by Jelmer Vernooij
Use dictionary with verifiers rather than requiring testament3-sha1 everywhere. |
565 |
# FIXME: check verifiers ?
|
|
0.200.1021
by Jelmer Vernooij
Put testament sha1 in revisions. |
566 |
if roundtrip_revid: |
567 |
revision.revision_id = roundtrip_revid |
|
|
0.200.43
by David Allouche
Ultra-experimental support for "bzr pull". No test. No sanity. |
568 |
return revision |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
569 |
|
570 |
def has_revision(self, revision_id): |
|
|
0.200.1119
by Jelmer Vernooij
Refactor repository initialization. |
571 |
"""See Repository.has_revision.""" |
|
0.285.5
by Jelmer Vernooij
Fix import. |
572 |
if revision_id == _mod_revision.NULL_REVISION: |
|
0.200.1122
by Jelmer Vernooij
has_revision(null:) should always return True. |
573 |
return True |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
574 |
try: |
|
0.200.902
by Jelmer Vernooij
Fix Repository.has_revision{s,}. |
575 |
git_commit_id, mapping = self.lookup_bzr_revision_id(revision_id) |
|
0.200.130
by Jelmer Vernooij
Make most tree inspection tests succeed. |
576 |
except errors.NoSuchRevision: |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
577 |
return False |
|
0.200.902
by Jelmer Vernooij
Fix Repository.has_revision{s,}. |
578 |
return (git_commit_id in self._git) |
579 |
||
580 |
def has_revisions(self, revision_ids): |
|
|
0.200.1119
by Jelmer Vernooij
Refactor repository initialization. |
581 |
"""See Repository.has_revisions.""" |
|
0.200.913
by Jelmer Vernooij
Fix tests. |
582 |
return set(filter(self.has_revision, revision_ids)) |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
583 |
|
|
0.200.1657
by Jelmer Vernooij
Implement iter_revisions. |
584 |
def iter_revisions(self, revision_ids): |
|
0.200.1119
by Jelmer Vernooij
Refactor repository initialization. |
585 |
"""See Repository.get_revisions.""" |
|
0.200.1657
by Jelmer Vernooij
Implement iter_revisions. |
586 |
for revid in revision_ids: |
587 |
try: |
|
588 |
rev = self.get_revision(revid) |
|
589 |
except errors.NoSuchRevision: |
|
590 |
rev = None |
|
591 |
yield (revid, rev) |
|
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
592 |
|
593 |
def revision_trees(self, revids): |
|
|
0.200.1119
by Jelmer Vernooij
Refactor repository initialization. |
594 |
"""See Repository.revision_trees.""" |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
595 |
for revid in revids: |
596 |
yield self.revision_tree(revid) |
|
597 |
||
598 |
def revision_tree(self, revision_id): |
|
|
0.200.1119
by Jelmer Vernooij
Refactor repository initialization. |
599 |
"""See Repository.revision_tree.""" |
|
0.287.6
by Jelmer Vernooij
Fix some more tests. |
600 |
if revision_id is None: |
601 |
raise ValueError('invalid revision id %s' % revision_id) |
|
|
0.200.195
by Jelmer Vernooij
Return mapping in revision_id_bzr_to_foreign() as required by the interface. |
602 |
return GitRevisionTree(self, revision_id) |
|
0.200.18
by John Arbash Meinel
Start splitting up the Git{Branch,Dir,Repository} into separate modules, etc. |
603 |
|
|
0.285.4
by Jelmer Vernooij
Add get_deltas_for_revisoins implementation. |
604 |
def get_deltas_for_revisions(self, revisions, specific_fileids=None): |
605 |
"""Produce a generator of revision deltas. |
|
606 |
||
607 |
Note that the input is a sequence of REVISIONS, not revision_ids.
|
|
608 |
Trees will be held in memory until the generator exits.
|
|
609 |
Each delta is relative to the revision's lefthand predecessor.
|
|
610 |
||
611 |
:param specific_fileids: if not None, the result is filtered
|
|
612 |
so that only those file-ids, their parents and their
|
|
613 |
children are included.
|
|
614 |
"""
|
|
615 |
# Get the revision-ids of interest
|
|
616 |
required_trees = set() |
|
617 |
for revision in revisions: |
|
618 |
required_trees.add(revision.revision_id) |
|
619 |
required_trees.update(revision.parent_ids[:1]) |
|
620 |
||
|
0.200.1743
by Jelmer Vernooij
Fix some revision delta filtering. |
621 |
trees = dict((t.get_revision_id(), t) for |
622 |
t in self.revision_trees(required_trees)) |
|
|
0.285.4
by Jelmer Vernooij
Add get_deltas_for_revisoins implementation. |
623 |
|
624 |
# Calculate the deltas
|
|
625 |
for revision in revisions: |
|
626 |
if not revision.parent_ids: |
|
627 |
old_tree = self.revision_tree(_mod_revision.NULL_REVISION) |
|
628 |
else: |
|
629 |
old_tree = trees[revision.parent_ids[0]] |
|
|
0.200.1743
by Jelmer Vernooij
Fix some revision delta filtering. |
630 |
new_tree = trees[revision.revision_id] |
631 |
if specific_fileids is not None: |
|
632 |
specific_files = [new_tree.id2path(fid) for fid in specific_fileids] |
|
633 |
else: |
|
634 |
specific_files = None |
|
635 |
yield new_tree.changes_from(old_tree, specific_files=specific_files) |
|
|
0.285.4
by Jelmer Vernooij
Add get_deltas_for_revisoins implementation. |
636 |
|
|
0.200.108
by Jelmer Vernooij
Support bzr init --git. |
637 |
def set_make_working_trees(self, trees): |
|
0.287.6
by Jelmer Vernooij
Fix some more tests. |
638 |
raise errors.UnsupportedOperation(self.set_make_working_trees, self) |
|
0.200.108
by Jelmer Vernooij
Support bzr init --git. |
639 |
|
|
0.200.276
by Jelmer Vernooij
Improve formatting. |
640 |
def fetch_objects(self, determine_wants, graph_walker, resolve_ext_ref, |
|
0.286.6
by Jelmer Vernooij
Pass through limit argument. |
641 |
progress=None, limit=None): |
642 |
return self._git.fetch_objects(determine_wants, graph_walker, progress, |
|
643 |
limit=limit) |
|
|
0.200.138
by Jelmer Vernooij
Add initial infrastructure for accessing remote git repositories. |
644 |
|
|
0.200.43
by David Allouche
Ultra-experimental support for "bzr pull". No test. No sanity. |
645 |
|
|
0.200.289
by Jelmer Vernooij
Cope with new member variables in RepositoryFormat. |
646 |
class GitRepositoryFormat(repository.RepositoryFormat): |
|
0.200.429
by Jelmer Vernooij
get remote dpush to a point where we now what to send. |
647 |
"""Git repository format.""" |
|
0.203.1
by Aaron Bentley
Make checkouts work |
648 |
|
|
0.200.1294
by Jelmer Vernooij
Mark as not supporting versioned directories. |
649 |
supports_versioned_directories = False |
|
0.429.2
by Jelmer Vernooij
Some more work on submodule support. |
650 |
supports_tree_reference = True |
|
0.200.133
by Jelmer Vernooij
Unmark as deprecated. |
651 |
rich_root_data = True |
|
0.200.1105
by Jelmer Vernooij
Don't claim to support leaving locks. |
652 |
supports_leaving_lock = False |
|
0.200.1106
by Jelmer Vernooij
Claim to support fast deltas. |
653 |
fast_deltas = True |
|
0.200.1123
by Jelmer Vernooij
Set more repository format flags. |
654 |
supports_funky_characters = True |
|
0.200.1560
by Jelmer Vernooij
stacking is not supported. |
655 |
supports_external_lookups = False |
|
0.200.1135
by Jelmer Vernooij
Set supports_full_versioned_files=False. |
656 |
supports_full_versioned_files = False |
|
0.200.1162
by Jelmer Vernooij
Set RepositoryFormat.supports_revision_signatures. |
657 |
supports_revision_signatures = False |
|
0.200.1383
by Jelmer Vernooij
Claim to not support nested repositories. |
658 |
supports_nesting_repositories = False |
|
0.200.1166
by Jelmer Vernooij
Set GitRepositoryFormat.revision_graph_can_have_wrong_parents. |
659 |
revision_graph_can_have_wrong_parents = False |
|
0.200.1493
by Jelmer Vernooij
Test fixes. |
660 |
supports_unreferenced_revisions = True |
|
0.200.1665
by Jelmer Vernooij
Rename _matchingbzrdir to _matchingcnotroldir. |
661 |
supports_setting_revision_ids = False |
|
0.200.1698
by Jelmer Vernooij
Update xfail. |
662 |
supports_storing_branch_nick = False |
663 |
supports_overriding_transport = False |
|
|
0.200.1746
by Jelmer Vernooij
Mark as not supporting custom revision properties. |
664 |
supports_custom_revision_properties = False |
|
0.396.1
by Jelmer Vernooij
Mark as not support per file revision recording. |
665 |
records_per_file_revision = False |
|
0.200.71
by Jelmer Vernooij
Implement GitRepositoryFormat.get_format_description. |
666 |
|
|
0.200.1083
by Jelmer Vernooij
Register repository format. |
667 |
@property
|
|
0.200.1665
by Jelmer Vernooij
Rename _matchingbzrdir to _matchingcnotroldir. |
668 |
def _matchingcontroldir(self): |
|
0.200.1641
by Jelmer Vernooij
Use relative imports where possible. |
669 |
from .dir import LocalGitControlDirFormat |
|
0.200.1083
by Jelmer Vernooij
Register repository format. |
670 |
return LocalGitControlDirFormat() |
671 |
||
|
0.200.71
by Jelmer Vernooij
Implement GitRepositoryFormat.get_format_description. |
672 |
def get_format_description(self): |
673 |
return "Git Repository" |
|
|
0.200.133
by Jelmer Vernooij
Unmark as deprecated. |
674 |
|
|
0.200.1084
by Jelmer Vernooij
Support 'initializing' repositories in control directories. |
675 |
def initialize(self, controldir, shared=False, _internal=False): |
|
0.200.1641
by Jelmer Vernooij
Use relative imports where possible. |
676 |
from .dir import GitDir |
|
0.200.1084
by Jelmer Vernooij
Support 'initializing' repositories in control directories. |
677 |
if not isinstance(controldir, GitDir): |
678 |
raise errors.UninitializableFormat(self) |
|
679 |
return controldir.open_repository() |
|
|
0.200.133
by Jelmer Vernooij
Unmark as deprecated. |
680 |
|
681 |
def check_conversion_target(self, target_repo_format): |
|
682 |
return target_repo_format.rich_root_data |
|
|
0.200.536
by Jelmer Vernooij
Implement network name. |
683 |
|
|
0.200.658
by Jelmer Vernooij
Provide right infrastructure for foreign repository tests from bzrlib. |
684 |
def get_foreign_tests_repository_factory(self): |
|
0.200.1654
by Jelmer Vernooij
Fix test import. |
685 |
from .tests.test_repository import ( |
|
0.200.713
by Jelmer Vernooij
Improve formatting. |
686 |
ForeignTestsRepositoryFactory, |
687 |
)
|
|
|
0.200.658
by Jelmer Vernooij
Provide right infrastructure for foreign repository tests from bzrlib. |
688 |
return ForeignTestsRepositoryFactory() |
689 |
||
|
0.200.536
by Jelmer Vernooij
Implement network name. |
690 |
def network_name(self): |
|
6973.7.8
by Jelmer Vernooij
Fix more tests. |
691 |
return b"git" |
|
6989.2.6
by Jelmer Vernooij
Run tests against brz-git interrepositories. |
692 |
|
693 |
||
694 |
def get_extra_interrepo_test_combinations(): |
|
695 |
from ...bzr.groupcompress_repo import RepositoryFormat2a |
|
696 |
from . import interrepo |
|
697 |
return [ |
|
698 |
(interrepo.InterLocalGitNonGitRepository, GitRepositoryFormat(), RepositoryFormat2a()), |
|
699 |
(interrepo.InterLocalGitLocalGitRepository, GitRepositoryFormat(), GitRepositoryFormat()), |
|
700 |
(interrepo.InterToLocalGitRepository, RepositoryFormat2a(), GitRepositoryFormat()), |
|
701 |
]
|