~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_missing.py

  • Committer: Andrew Bennetts
  • Date: 2010-06-25 06:47:40 UTC
  • mto: (5050.3.16 2.2)
  • mto: This revision was merged to the branch mainline in revision 5365.
  • Revision ID: andrew.bennetts@canonical.com-20100625064740-k93ngat248kdcqdm
Remove merge_into_helper for now, as it currently has no callers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Black-box tests for bzr missing."""
18
18
 
63
63
        b_tree.commit(message='more')
64
64
 
65
65
        # run missing in a against b
66
 
        # this should not require missing to take out a write lock on a 
 
66
        # this should not require missing to take out a write lock on a
67
67
        # or b. So we take a write lock on both to test that at the same
68
68
        # time. This may let the test pass while the default branch is an
69
69
        # os-locking branch, but it will trigger failures with lockdir based
100
100
        lines3 = self.run_bzr('missing ../b --theirs-only', retcode=0)[0]
101
101
        self.assertEqualDiff('Other branch is up to date.\n', lines3)
102
102
 
103
 
        # relative to a, missing the 'merge' commit 
 
103
        # relative to a, missing the 'merge' commit
104
104
        os.chdir('../b')
105
105
        lines = self.run_bzr('missing ../a', retcode=1)[0].splitlines()
106
106
        self.assertEqual(missing, lines[0])
200
200
                          'Branches are up to date.\n' % location,
201
201
                          lines)
202
202
        self.assertEquals('', err)
 
203
 
 
204
    def test_missing_directory(self):
 
205
        """Test --directory option"""
 
206
 
 
207
        # create a source branch
 
208
        a_tree = self.make_branch_and_tree('a')
 
209
        self.build_tree_contents([('a/a', 'initial\n')])
 
210
        a_tree.add('a')
 
211
        a_tree.commit(message='initial')
 
212
 
 
213
        # clone and add a differing revision
 
214
        b_tree = a_tree.bzrdir.sprout('b').open_workingtree()
 
215
        self.build_tree_contents([('b/a', 'initial\nmore\n')])
 
216
        b_tree.commit(message='more')
 
217
        
 
218
        out2, err2 = self.run_bzr('missing --directory a b', retcode=1)
 
219
        os.chdir('a')
 
220
        out1, err1 = self.run_bzr('missing ../b', retcode=1)
 
221
        self.assertEqualDiff(out1, out2)
 
222
        self.assertEqualDiff(err1, err2)