~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to tests/shelf_tests.py

  • Committer: Aaron Bentley
  • Date: 2013-08-20 03:02:43 UTC
  • Revision ID: aaron@aaronbentley.com-20130820030243-r8v1xfbcnd8f10p4
Fix zap command for 2.6/7

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