~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Aaron Bentley
  • Date: 2007-01-11 03:10:41 UTC
  • mfrom: (2229 +trunk)
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20070111031041-cu4tmhma4sqjph48
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    def ls_equals(self, value, *args):
40
40
        out, err = self.run_bzr('ls', *args)
41
41
        self.assertEqual('', err)
42
 
        self.assertEqual(value, out)
 
42
        self.assertEqualDiff(value, out)
43
43
 
44
44
    def test_ls_null_verbose(self):
45
45
        # Can't supply both
83
83
                       'V        subdir/b\n'
84
84
                       , '--verbose')
85
85
 
 
86
    def test_show_ids(self):
 
87
        self.build_tree(['subdir/'])
 
88
        self.wt.add(['a', 'subdir'], ['a-id', 'subdir-id'])
 
89
        self.ls_equals(
 
90
            '.bzrignore                                         \n'
 
91
            'a                                                  a-id\n'
 
92
            'subdir                                             subdir-id\n', 
 
93
            '--show-ids')
 
94
        self.ls_equals(
 
95
            '?        .bzrignore\n'
 
96
            'V        a                                         a-id\n'
 
97
            'V        subdir/                                   subdir-id\n', 
 
98
            '--show-ids', '--verbose')
 
99
        self.ls_equals('.bzrignore\0\0'
 
100
                       'a\0a-id\0'
 
101
                       'subdir\0subdir-id\0', '--show-ids', '--null')
 
102
 
86
103
    def test_ls_recursive(self):
87
104
        self.build_tree(['subdir/', 'subdir/b'])
88
105
        self.wt.add(['a', 'subdir/', 'subdir/b', '.bzrignore'])
117
134
                       'subdir\n'
118
135
                       , '--from-root', '--non-recursive')
119
136
 
 
137
    def test_ls_path(self):
 
138
        """If a path is specified, files are listed with that prefix"""
 
139
        self.build_tree(['subdir/', 'subdir/b'])
 
140
        self.wt.add(['subdir', 'subdir/b'])
 
141
        self.ls_equals('subdir/b\n' ,
 
142
                       'subdir')
 
143
        os.chdir('subdir')
 
144
        self.ls_equals('../.bzrignore\n'
 
145
                       '../a\n'
 
146
                       '../subdir\n'
 
147
                       '../subdir/b\n' ,
 
148
                       '..')
 
149
        self.ls_equals('../.bzrignore\0'
 
150
                       '../a\0'
 
151
                       '../subdir\0'
 
152
                       '../subdir/b\0' ,
 
153
                       '..', '--null')
 
154
        self.ls_equals('?        ../.bzrignore\n'
 
155
                       '?        ../a\n'
 
156
                       'V        ../subdir/\n'
 
157
                       'V        ../subdir/b\n' ,
 
158
                       '..', '--verbose')
 
159
        self.run_bzr_error('cannot specify both --from-root and PATH', 'ls',
 
160
                           '--from-root', '..')
 
161
 
120
162
    def test_ls_revision(self):
121
163
        self.wt.add(['a'])
122
164
        self.wt.commit('add')