74
72
# get extra revision from b
76
bzr('commit -m merge')
74
bzr('commit', '-m', 'merge')
78
76
# compare again, but now we have the 'merge' commit extra
79
lines = bzr('missing ../b', retcode=1).splitlines()
77
lines = bzr('missing', '../b', retcode=1).splitlines()
80
78
self.assertEqual("You have 1 extra revision(s):", lines[0])
81
79
self.assertEqual(8, len(lines))
82
lines2 = bzr('missing ../b --mine-only', retcode=1)
80
lines2 = bzr('missing', '../b', '--mine-only', retcode=1)
83
81
lines2 = lines2.splitlines()
84
82
self.assertEqual(lines, lines2)
85
lines3 = bzr('missing ../b --theirs-only', retcode=1)
83
lines3 = bzr('missing', '../b', '--theirs-only', retcode=1)
86
84
lines3 = lines3.splitlines()
87
85
self.assertEqual(0, len(lines3))
89
87
# relative to a, missing the 'merge' commit
91
lines = bzr('missing ../a', retcode=1).splitlines()
89
lines = bzr('missing', '../a', retcode=1).splitlines()
92
90
self.assertEqual(missing, lines[0])
93
91
self.assertEqual(8, len(lines))
94
lines2 = bzr('missing ../a --theirs-only', retcode=1)
92
lines2 = bzr('missing', '../a', '--theirs-only', retcode=1)
95
93
lines2 = lines2.splitlines()
96
94
self.assertEqual(lines, lines2)
97
lines3 = bzr('missing ../a --mine-only', retcode=1)
95
lines3 = bzr('missing', '../a', '--mine-only', retcode=1)
98
96
lines3 = lines3.splitlines()
99
97
self.assertEqual(0, len(lines3))
100
lines4 = bzr('missing ../a --short', retcode=1)
98
lines4 = bzr('missing', '../a', '--short', retcode=1)
101
99
lines4 = lines4.splitlines()
102
100
self.assertEqual(4, len(lines4))
103
lines5 = bzr('missing ../a --line', retcode=1)
101
lines5 = bzr('missing', '../a', '--line', retcode=1)
104
102
lines5 = lines5.splitlines()
105
103
self.assertEqual(2, len(lines5))
106
lines6 = bzr('missing ../a --reverse', retcode=1)
104
lines6 = bzr('missing', '../a', '--reverse', retcode=1)
107
105
lines6 = lines6.splitlines()
108
106
self.assertEqual(lines6, lines)
109
lines7 = bzr('missing ../a --show-ids', retcode=1)
107
lines7 = bzr('missing', '../a', '--show-ids', retcode=1)
110
108
lines7 = lines7.splitlines()
111
109
self.assertEqual(11, len(lines7))
112
lines8 = bzr('missing ../a --verbose', retcode=1)
110
lines8 = bzr('missing', '../a', '--verbose', retcode=1)
113
111
lines8 = lines8.splitlines()
114
112
self.assertEqual("modified:", lines8[-2])
115
113
self.assertEqual(" a", lines8[-1])
117
116
# after a pull we're back on track
119
self.assertEqual("Branches are up to date.\n", bzr('missing ../a'))
121
def test_missing_check_last_location(self):
122
# check that last location shown as filepath not file URL
124
# create a source branch
127
wt = self.make_branch_and_tree('.')
129
self.build_tree(['foo'])
133
location = osutils.getcwd() + '/'
136
b.bzrdir.sprout('../b')
138
# check last location
139
lines, err = self.run_bzr('missing', working_dir='../b')
140
self.assertEquals('Using last location: %s\n'
141
'Branches are up to date.\n' % location,
143
self.assertEquals('', err)
118
self.assertEqual("Branches are up to date.\n",
119
bzr('missing', '../a'))