28
28
def test_git_to_bzr(self):
29
29
m = branch_mapper.BranchMapper()
35
'refs/remotes/origin/master',
36
'refs/remotes/origin/foo',
38
git_to_bzr_map = m.git_to_bzr(git_refs)
39
self.assertEqual(git_to_bzr_map, {
40
31
'refs/heads/master': 'trunk',
41
32
'refs/heads/foo': 'foo',
42
33
'refs/tags/master': 'trunk.tag',
43
34
'refs/tags/foo': 'foo.tag',
44
35
'refs/remotes/origin/master': 'trunk.remote',
45
36
'refs/remotes/origin/foo': 'foo.remote',
38
self.assertEqual(m.git_to_bzr(git), bzr)
48
40
def test_git_to_bzr_with_slashes(self):
49
41
m = branch_mapper.BranchMapper()
51
'refs/heads/master/slave',
53
'refs/tags/master/slave',
55
'refs/remotes/origin/master/slave',
56
'refs/remotes/origin/foo/bar',
58
git_to_bzr_map = m.git_to_bzr(git_refs)
59
self.assertEqual(git_to_bzr_map, {
60
43
'refs/heads/master/slave': 'master/slave',
61
44
'refs/heads/foo/bar': 'foo/bar',
62
45
'refs/tags/master/slave': 'master/slave.tag',
63
46
'refs/tags/foo/bar': 'foo/bar.tag',
64
47
'refs/remotes/origin/master/slave': 'master/slave.remote',
65
48
'refs/remotes/origin/foo/bar': 'foo/bar.remote',
50
self.assertEqual(m.git_to_bzr(git), bzr)
68
52
def test_git_to_bzr_for_trunk(self):
69
53
# As 'master' in git is mapped to trunk in bzr, we need to handle
70
54
# 'trunk' in git in a sensible way.
71
55
m = branch_mapper.BranchMapper()
75
'refs/remotes/origin/trunk',
76
'refs/heads/git-trunk',
77
'refs/tags/git-trunk',
78
'refs/remotes/origin/git-trunk',
80
git_to_bzr_map = m.git_to_bzr(git_refs)
81
self.assertEqual(git_to_bzr_map, {
82
57
'refs/heads/trunk': 'git-trunk',
83
58
'refs/tags/trunk': 'git-trunk.tag',
84
59
'refs/remotes/origin/trunk': 'git-trunk.remote',
85
60
'refs/heads/git-trunk': 'git-git-trunk',
86
61
'refs/tags/git-trunk': 'git-git-trunk.tag',
87
62
'refs/remotes/origin/git-trunk':'git-git-trunk.remote',
64
self.assertEqual(m.git_to_bzr(git), bzr)