/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 tests/test_branch.py

Cope with tuples in refs dictionary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
    )
46
46
 
47
47
from bzrlib.plugins.git import (
 
48
    LocalGitControlDirFormat,
48
49
    branch,
49
50
    tests,
50
51
    )
51
 
from bzrlib.plugins.git.dir import (
52
 
    LocalGitControlDirFormat,
53
 
    )
54
52
from bzrlib.plugins.git.mapping import (
55
53
    default_mapping,
56
54
    )
68
66
        GitRepo.init('.')
69
67
        d = BzrDir.open('.')
70
68
        thebranch = d.create_branch()
71
 
        self.assertEquals(
72
 
            "<LocalGitBranch('file://%s/', 'master')>" % self.test_dir, repr(thebranch))
 
69
        self.assertEquals("<LocalGitBranch('file://%s/', 'HEAD')>" % self.test_dir, repr(thebranch))
73
70
 
74
71
    def test_last_revision_is_null(self):
75
72
        GitRepo.init('.')
239
236
        inter_branch.pull(stop_revision=revid1)
240
237
        self.assertEquals(revid1, newbranch.last_revision())
241
238
 
242
 
    def test_interbranch_pull_with_tags(self):
 
239
    def test_interbranch_limited_pull(self):
243
240
        path, (gitsha1, gitsha2) = self.make_tworev_branch()
244
 
        gitrepo = GitRepo(path)
245
 
        gitrepo.refs["refs/tags/sometag"] = gitsha2
246
241
        oldrepo = Repository.open(path)
247
242
        revid1 = oldrepo.get_mapping().revision_id_foreign_to_bzr(gitsha1)
248
243
        revid2 = oldrepo.get_mapping().revision_id_foreign_to_bzr(gitsha2)
249
244
        newbranch = self.make_branch('g')
250
 
        source_branch = Branch.open(path)
251
 
        source_branch.get_config().set_user_option("branch.fetch_tags", True)
252
 
        inter_branch = InterBranch.get(source_branch, newbranch)
253
 
        inter_branch.pull(stop_revision=revid1)
 
245
        inter_branch = InterBranch.get(Branch.open(path), newbranch)
 
246
        inter_branch.pull(limit=1)
254
247
        self.assertEquals(revid1, newbranch.last_revision())
255
 
        self.assertTrue(newbranch.repository.has_revision(revid2))
 
248
        inter_branch.pull(limit=1)
 
249
        self.assertEquals(revid2, newbranch.last_revision())
256
250
 
257
251
 
258
252
class ForeignTestsBranchFactory(object):