/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 branch.py

Fix git -> git fetching.

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
        if stop_revision is None:
146
146
            stop_revision = source.last_revision()
147
147
        # FIXME: Check for diverged branches
148
 
        refs = { "refs/heads/master": stop_revision }
 
148
        refs = { "HEAD": stop_revision }
149
149
        for name, revid in source.tags.get_tag_dict().iteritems():
150
150
            if source.repository.has_revision(revid):
151
151
                refs["refs/tags/%s" % name] = revid
163
163
    def _set_head(self, head):
164
164
        self.head = head
165
165
        self.repository._git.set_ref(self.name, self.head)
 
166
        self._clear_cached_state()
166
167
 
167
168
    def lock_write(self):
168
169
        self.control_files.lock_write()
393
394
            self.target.repository)
394
395
        result.old_revid = self.target.last_revision()
395
396
        if stop_revision is None:
396
 
            stop_revision = self.source.last_revision()
397
 
        interrepo.fetch(revision_id=stop_revision)
 
397
            refs = interrepo.fetch_refs(branches=["HEAD"])
 
398
            stop_revision = self.target.mapping.revision_id_foreign_to_bzr(refs["HEAD"])
 
399
        else:
 
400
            refs = interrepo.fetch_refs(revision_id=stop_revision)
398
401
        self.target.generate_revision_history(stop_revision, result.old_revid)
399
402
        result.new_revid = self.target.last_revision()
400
403
        return result