/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/test_diff.py

  • Committer: Vincent Ladeuil
  • Date: 2008-06-10 15:25:47 UTC
  • mto: This revision was merged to the branch mainline in revision 504.
  • Revision ID: v.ladeuil+lp@free.fr-20080610152547-dwmil1p8pd0mfpnl
Fix third failing test (thanks to jam).

* tests/test_commit.py:
(TestPendingRevisions.test_pending_revisions_multi_merge): Fix
provided by jam: bzr we now filter the pending merges so that only
the 'heads()' are included. We just ensure that the pending merges
contain the unique tips for the ancestries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
from cStringIO import StringIO
19
19
import os
20
20
 
21
 
from bzrlib import (
22
 
    conflicts,
23
 
    errors,
24
 
    tests,
25
 
    )
 
21
from bzrlib import errors, tests
26
22
from bzrlib.merge_directive import MergeDirective2
27
23
 
28
24
from bzrlib.plugins.gtk.diff import (
307
303
            [('a-id', 'a', 'removed', 'a'),
308
304
             ('b-id', 'b', 'removed', 'b/'),
309
305
            ], tree)
310
 
 
311
 
    def test_status_missing_file(self):
312
 
        this = self.make_branch_and_tree('this')
313
 
        self.build_tree(['this/foo'])
314
 
        this.add(['foo'], ['foo-id'])
315
 
        this.commit('add')
316
 
 
317
 
        other = this.bzrdir.sprout('other').open_workingtree()
318
 
 
319
 
        os.remove('this/foo')
320
 
        this.remove('foo', force=True)
321
 
        this.commit('remove')
322
 
 
323
 
        f = open('other/foo', 'wt')
324
 
        try:
325
 
            f.write('Modified\n')
326
 
        finally:
327
 
            f.close()
328
 
        other.commit('modified')
329
 
 
330
 
        this.merge_from_branch(other.branch)
331
 
        conflicts.resolve(this)
332
 
 
333
 
        self.assertStatusEqual(
334
 
            [('foo-id', 'foo.OTHER', 'missing', 'foo.OTHER'),],
335
 
            this)
336
 
 
337
 
    def test_status_missing_directory(self):
338
 
        this = self.make_branch_and_tree('this')
339
 
        self.build_tree(['this/foo/', 'this/foo/bar'])
340
 
        this.add(['foo', 'foo/bar'], ['foo-id', 'bar-id'])
341
 
        this.commit('add')
342
 
 
343
 
        other = this.bzrdir.sprout('other').open_workingtree()
344
 
 
345
 
        os.remove('this/foo/bar')
346
 
        os.rmdir('this/foo')
347
 
        this.remove('foo', force=True)
348
 
        this.commit('remove')
349
 
 
350
 
        f = open('other/foo/bar', 'wt')
351
 
        try:
352
 
            f.write('Modified\n')
353
 
        finally:
354
 
            f.close()
355
 
        other.commit('modified')
356
 
 
357
 
        this.merge_from_branch(other.branch)
358
 
        conflicts.resolve(this)
359
 
 
360
 
        self.assertStatusEqual(
361
 
            [('foo-id', u'foo', 'added', u'foo/'),
362
 
             ('bar-id', u'foo/bar.OTHER', 'missing', u'foo/bar.OTHER'),],
363
 
            this)