~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-10-06 20:45:48 UTC
  • mfrom: (4728.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20091006204548-bjnc3z4k256ppimz
MutableTree.has_changes() does not require a tree parameter anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2009 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
19
19
 
20
20
import os
21
21
 
 
22
from bzrlib import osutils
22
23
from bzrlib.tests import (
23
24
    condition_isinstance,
24
25
    split_suite_by_condition,
25
26
    multiply_tests,
 
27
    SymlinkFeature
26
28
    )
27
29
from bzrlib.tests.blackbox import ExternalBase
28
30
from bzrlib.tests.test_win32utils import NeedsGlobExpansionFeature
34
36
        standard_tests, condition_isinstance(TestAdd))
35
37
    scenarios = [
36
38
        ('pre-views', {'branch_tree_format': 'pack-0.92'}),
37
 
        ('view-aware', {'branch_tree_format': 'development-wt5'}),
 
39
        ('view-aware', {'branch_tree_format': 'development6-rich-root'}),
38
40
        ]
39
41
    return multiply_tests(to_adapt, scenarios, result)
40
42
 
53
55
        out = self.run_bzr('add')[0]
54
56
        # the ordering is not defined at the moment
55
57
        results = sorted(out.rstrip('\n').split('\n'))
56
 
        self.assertEquals(['If you wish to add some of these files, please'\
57
 
                           ' add them by name.',
58
 
                           'adding .bzrignore',
 
58
        self.assertEquals(['adding .bzrignore',
59
59
                           'adding dir',
60
60
                           'adding dir/sub.txt',
61
 
                           'adding top.txt',
62
 
                           'ignored 1 file(s).'],
 
61
                           'adding top.txt'],
63
62
                          results)
64
63
        out = self.run_bzr('add -v')[0]
65
64
        results = sorted(out.rstrip('\n').split('\n'))
66
 
        self.assertEquals(['If you wish to add some of these files, please'\
67
 
                           ' add them by name.',
68
 
                           'ignored CVS matching "CVS"'],
 
65
        self.assertEquals(['ignored CVS matching "CVS"'],
69
66
                          results)
70
67
 
71
68
    def test_add_quiet_is(self):
227
224
        self.build_tree([u'\u1234A', u'\u1235A', u'\u1235AA', 'cc'])
228
225
        self.run_bzr(['add', u'\u1234?', u'\u1235*'])
229
226
        self.assertEquals(self.run_bzr('unknowns')[0], 'cc\n')
 
227
 
 
228
    def test_add_via_symlink(self):
 
229
        self.requireFeature(SymlinkFeature)
 
230
        self.make_branch_and_tree('source')
 
231
        self.build_tree(['source/top.txt'])
 
232
        os.symlink('source', 'link')
 
233
        out = self.run_bzr(['add', 'link/top.txt'])[0]
 
234
        self.assertEquals(out, 'adding top.txt\n')
 
235
 
 
236
    def test_add_symlink_to_abspath(self):
 
237
        self.requireFeature(SymlinkFeature)
 
238
        self.make_branch_and_tree('tree')
 
239
        os.symlink(osutils.abspath('target'), 'tree/link')
 
240
        out = self.run_bzr(['add', 'tree/link'])[0]
 
241
        self.assertEquals(out, 'adding link\n')