~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-29 06:10:25 UTC
  • Revision ID: mbp@sourcefrog.net-20050329061025-6646f5d3b6bae417
new --show-ids option for 'deleted' command

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
>>> import bzrlib, os
31
31
>>> from bzrlib import ScratchBranch
32
 
>>> from bzrlib.osutils import isdir, isfile
33
32
>>> bzrlib.commands.cmd_rocks()
34
33
it sure does!
35
34
 
163
162
    >>> [v[0] for v in b.inventory.directories()]
164
163
    ['', 'd1']
165
164
    >>> list(b.working_tree().unknowns())
166
 
    ['d2', 'd1/f1']
 
165
    ['d1/f1', 'd2']
167
166
    >>> # d2 comes first because it's in the top directory
168
167
 
169
168
    >>> b.add('d2')
185
184
    ['configure', 'configure.in', 'doc', 'foo', 'foo.c', 'src']
186
185
    >>> b.add(['doc', 'foo.c', 'src', 'configure.in'])
187
186
    >>> list(b.unknowns())
188
 
    ['configure', 'foo', 'doc/configure']
 
187
    ['configure', 'doc/configure', 'foo']
189
188
    >>> f = file(b.abspath('.bzrignore'), 'w')
190
189
    >>> f.write('./configure\n'
191
190
    ...         './foo\n')
192
191
    >>> f.close()
193
192
    >>> b.add('.bzrignore')
194
193
    >>> list(b.unknowns())
195
 
    ['doc/configure']
196
 
    >>> b.commit("commit 1")
197
 
    >>> list(b.unknowns())
198
 
    ['doc/configure']
199
 
    >>> b.add("doc/configure")
200
 
    >>> b.commit("commit more")
201
 
    >>> del b
202
 
 
203
 
Renames, etc:
204
 
 
205
 
    >>> b = ScratchBranch(files=['foo'], dirs=['subdir'])
206
 
    >>> b.add(['foo', 'subdir'])
207
 
    >>> b.commit('add foo')
208
 
    >>> list(b.unknowns())
209
 
    []
210
 
    >>> b.move(['foo'], 'subdir')
211
 
    foo => subdir/foo
212
 
    >>> b.show_status()
213
 
    R       foo => subdir/foo
214
 
    >>> bzrlib.commands.cmd_renames(b.base)
215
 
    foo => subdir/foo
216
 
    >>> b.commit("move foo to subdir")
217
 
    >>> isfile(b.abspath('foo'))
218
 
    False
219
 
    >>> isfile(b.abspath('subdir/foo'))
220
 
    True
221
 
 
 
194
    ['configure', 'doc/configure', 'foo']
222
195
"""