47
47
from bzrlib.plugins.git import (
48
LocalGitControlDirFormat,
51
from bzrlib.plugins.git.dir import (
52
LocalGitControlDirFormat,
52
54
from bzrlib.plugins.git.mapping import (
236
238
inter_branch.pull(stop_revision=revid1)
237
239
self.assertEquals(revid1, newbranch.last_revision())
239
def test_interbranch_limited_pull(self):
241
def test_interbranch_pull_with_tags(self):
240
242
path, (gitsha1, gitsha2) = self.make_tworev_branch()
243
gitrepo = GitRepo(path)
244
gitrepo.refs["refs/tags/sometag"] = gitsha2
241
245
oldrepo = Repository.open(path)
242
246
revid1 = oldrepo.get_mapping().revision_id_foreign_to_bzr(gitsha1)
243
247
revid2 = oldrepo.get_mapping().revision_id_foreign_to_bzr(gitsha2)
244
248
newbranch = self.make_branch('g')
245
inter_branch = InterBranch.get(Branch.open(path), newbranch)
246
inter_branch.pull(limit=1)
249
source_branch = Branch.open(path)
250
source_branch.get_config().set_user_option("branch.fetch_tags", True)
251
inter_branch = InterBranch.get(source_branch, newbranch)
252
inter_branch.pull(stop_revision=revid1)
247
253
self.assertEquals(revid1, newbranch.last_revision())
248
inter_branch.pull(limit=1)
249
self.assertEquals(revid2, newbranch.last_revision())
254
self.assertTrue(newbranch.repository.has_revision(revid2))
252
257
class ForeignTestsBranchFactory(object):