~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/shelf_tests.py

  • Committer: Aaron Bentley
  • Date: 2009-07-13 19:14:10 UTC
  • Revision ID: aaron@aaronbentley.com-20090713191410-dhqsqf3kuz5x2oyd
Tags: release-1.17.0
Update NEWS for release 1.17.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
    UnshelveHunkSelector,
8
8
    )
9
9
from bzrlib.plugins.bzrtools.errors import NoColor
10
 
from bzrlib.plugins.bzrtools import command
11
10
from bzrlib.plugins.bzrtools.command_classes import cmd_shelf1
12
11
 
13
12
 
33
32
+hello test world
34
33
 
35
34
"""
36
 
    def setUp(self):
37
 
        bzrlib.tests.TestCaseWithTransport.setUp(self)
38
 
        command._testing = True
39
 
        self.addCleanup(command._stop_testing)
40
 
 
41
35
    def _check_diff(self, diff=DIFF_1, filename='test_file'):
42
36
        old_tree = self.tree.basis_tree()
43
37
        old_tree.lock_read()
44
38
        self.tree.lock_read()
45
39
        try:
46
40
            old_date = _patch_header_date(old_tree,
47
 
                                          old_tree.path2id(filename),
 
41
                                          old_tree.inventory.path2id(filename),
48
42
                                          filename)
49
43
            new_date = _patch_header_date(self.tree,
50
 
                self.tree.path2id(filename), filename)
 
44
                self.tree.inventory.path2id(filename), filename)
51
45
        finally:
52
46
            self.tree.unlock()
53
47
            old_tree.unlock()
63
57
        old_tree.lock_read()
64
58
        try:
65
59
            old_date = _patch_header_date(old_tree,
66
 
                                          old_tree.path2id(filename),
 
60
                                          old_tree.inventory.path2id(filename),
67
61
                                          filename)
68
62
        finally:
69
63
            old_tree.unlock()
96
90
            self.tree.lock_write()
97
91
            try:
98
92
                new_date = _patch_header_date(self.tree,
99
 
                    self.tree.path2id('test_file'), 'test_file')
 
93
                    self.tree.inventory.path2id('test_file'), 'test_file')
100
94
            finally:
101
95
                self.tree.unlock()
102
96
 
337
331
            f.write(self.MODIFIED)
338
332
            f.close()
339
333
            new_date = _patch_header_date(self.tree,
340
 
                self.tree.path2id('test_file'), 'test_file')
 
334
                self.tree.inventory.path2id('test_file'), 'test_file')
341
335
        finally:
342
336
            self.tree.unlock()
343
337
 
438
432
        self.tree.lock_read()
439
433
        try:
440
434
            old_date = _patch_header_date(old_tree,
441
 
                old_tree.path2id('test_file'),
 
435
                old_tree.inventory.path2id('test_file'),
442
436
                                          'test_file')
443
437
            new_date = _patch_header_date(self.tree,
444
 
                self.tree.path2id('test_file'), 'test_file')
 
438
                self.tree.inventory.path2id('test_file'), 'test_file')
445
439
        finally:
446
440
            old_tree.unlock()
447
441
            self.tree.unlock()