/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to mapping.py

mark remote git directories as not supporting working trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
185
185
 
186
186
    def _extract_git_svn_metadata(self, rev, message):
187
187
        lines = message.split("\n")
188
 
        if not (lines[-1] == "" and len(lines) >= 2 and lines[-2].startswith("git-svn-id:")):
 
188
        if not (lines[-1] == "" and lines[-2].startswith("git-svn-id:")):
189
189
            return message
190
190
        git_svn_id = lines[-2].split(": ", 1)[1]
191
191
        rev.properties['git-svn-id'] = git_svn_id
228
228
        return b
229
229
 
230
230
    def export_commit(self, rev, tree_sha, parent_lookup, roundtrip,
231
 
                      verifiers):
 
231
                      testament3_sha1):
232
232
        """Turn a Bazaar revision in to a Git commit
233
233
 
234
234
        :param tree_sha: Tree sha for the commit
235
235
        :param parent_lookup: Function for looking up the GIT sha equiv of a
236
236
            bzr revision
237
237
        :param roundtrip: Whether to store roundtripping information.
238
 
        :param verifiers: Verifiers info
 
238
        :param testament3_sha1: Testament SHA1
239
239
        :return dulwich.objects.Commit represent the revision:
240
240
        """
241
241
        from dulwich.objects import Commit
243
243
        commit.tree = tree_sha
244
244
        if roundtrip:
245
245
            metadata = BzrGitRevisionMetadata()
246
 
            metadata.verifiers = verifiers
 
246
            metadata.testament3_sha1 = testament3_sha1
247
247
        else:
248
248
            metadata = None
249
249
        parents = []
355
355
            if md.explicit_parent_ids:
356
356
                rev.parent_ids = md.explicit_parent_ids
357
357
            rev.properties.update(md.properties)
358
 
            verifiers = md.verifiers
 
358
            testament3_sha1 = md.testament3_sha1
359
359
        else:
360
360
            roundtrip_revid = None
361
 
            verifiers = {}
362
 
        return rev, roundtrip_revid, verifiers
 
361
            testament3_sha1 = None
 
362
        return rev, roundtrip_revid, testament3_sha1
363
363
 
364
364
    def get_fileid_map(self, lookup_object, tree_sha):
365
365
        """Obtain a fileid map for a particular tree.
407
407
        return ret
408
408
 
409
409
    def import_commit(self, commit, lookup_parent_revid):
410
 
        rev, roundtrip_revid, verifiers = super(BzrGitMappingExperimental, self).import_commit(commit, lookup_parent_revid)
 
410
        rev, roundtrip_revid, testament3_sha1 = super(BzrGitMappingExperimental, self).import_commit(commit, lookup_parent_revid)
411
411
        rev.properties['converted_revision'] = "git %s\n" % commit.id
412
 
        return rev, roundtrip_revid, verifiers
 
412
        return rev, roundtrip_revid, testament3_sha1
413
413
 
414
414
 
415
415
class GitMappingRegistry(VcsMappingRegistry):