~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Samuel Bronson
  • Date: 2012-08-30 20:36:18 UTC
  • mto: (6015.57.3 2.4)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: naesten@gmail.com-20120830203618-y2dzw91nqpvpgxvx
Update INSTALL for switch to Python 2.6 and up.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
18
18
"""Tests for the update command of bzr."""
19
19
 
20
20
import os
 
21
import re
21
22
 
22
23
from bzrlib import (
23
24
    branch,
24
25
    bzrdir,
25
26
    osutils,
26
27
    tests,
 
28
    urlutils,
27
29
    workingtree,
28
30
    )
29
31
from bzrlib.tests.script import ScriptRunner
194
196
 
195
197
        self.build_tree(['checkout1/'])
196
198
        checkout_dir = bzrdir.BzrDirMetaFormat1().initialize('checkout1')
197
 
        checkout_dir.set_branch_reference(master.branch)
 
199
        branch.BranchReferenceFormat().initialize(checkout_dir,
 
200
            target_branch=master.branch)
198
201
        checkout1 = checkout_dir.create_workingtree('m1')
199
202
 
200
203
        # Create a second branch, with an extra commit
250
253
 
251
254
        self.build_tree(['checkout1/'])
252
255
        checkout_dir = bzrdir.BzrDirMetaFormat1().initialize('checkout1')
253
 
        checkout_dir.set_branch_reference(master.branch)
 
256
        branch.BranchReferenceFormat().initialize(checkout_dir,
 
257
            target_branch=master.branch)
254
258
        checkout1 = checkout_dir.create_workingtree('m1')
255
259
 
256
260
        # Create a second branch, with an extra commit
452
456
>>>>>>> MERGE-SOURCE
453
457
''',
454
458
                             'lightweight/file')
455
 
 
456
 
 
457
 
    def test_no_upgrade_single_file(self):
458
 
        """There's one basis revision per tree.
459
 
 
460
 
        Since you can't actually change the basis for a single file at the
461
 
        moment, we don't let you think you can.
462
 
 
463
 
        See bug 557886.
464
 
        """
465
 
        self.make_branch_and_tree('.')
466
 
        self.build_tree_contents([('a/',),
467
 
            ('a/file', 'content')])
468
 
        sr = ScriptRunner()
469
 
        sr.run_script(self, '''
470
 
            $ bzr update ./a
471
 
            2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory
472
 
            $ bzr update ./a/file
473
 
            2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory
474
 
            $ bzr update .
475
 
            2>Tree is up to date at revision 0 of branch ...
476
 
            $ cd a
477
 
            $ bzr update .
478
 
            2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory
479
 
            # however, you can update the whole tree from a subdirectory
480
 
            $ bzr update
481
 
            2>Tree is up to date at revision 0 of branch ...
482
 
            ''')