~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2011-10-09 13:52:06 UTC
  • mfrom: (6202.1.3 revno-revision)
  • Revision ID: pqm@pqm.ubuntu.com-20111009135206-t3utsln6mtzv9eut
(jelmer) Add a --revision argument to 'bzr revno'. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2011 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
22
21
 
23
22
from bzrlib import (
24
23
    branch,
25
24
    bzrdir,
26
25
    osutils,
27
26
    tests,
28
 
    urlutils,
29
27
    workingtree,
30
28
    )
31
29
from bzrlib.tests.script import ScriptRunner
456
454
>>>>>>> MERGE-SOURCE
457
455
''',
458
456
                             'lightweight/file')
 
457
 
 
458
 
 
459
    def test_no_upgrade_single_file(self):
 
460
        """There's one basis revision per tree.
 
461
 
 
462
        Since you can't actually change the basis for a single file at the
 
463
        moment, we don't let you think you can.
 
464
 
 
465
        See bug 557886.
 
466
        """
 
467
        self.make_branch_and_tree('.')
 
468
        self.build_tree_contents([('a/',),
 
469
            ('a/file', 'content')])
 
470
        sr = ScriptRunner()
 
471
        sr.run_script(self, '''
 
472
            $ bzr update ./a
 
473
            2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory
 
474
            $ bzr update ./a/file
 
475
            2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory
 
476
            $ bzr update .
 
477
            2>Tree is up to date at revision 0 of branch ...
 
478
            $ cd a
 
479
            $ bzr update .
 
480
            2>bzr: ERROR: bzr update can only update a whole tree, not a file or subdirectory
 
481
            # however, you can update the whole tree from a subdirectory
 
482
            $ bzr update
 
483
            2>Tree is up to date at revision 0 of branch ...
 
484
            ''')