~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shelf_tests.py

  • Committer: Aaron Bentley
  • Date: 2005-11-21 14:29:35 UTC
  • mfrom: (288 bzrtools)
  • mto: (147.4.24 trunk)
  • mto: This revision was merged to the branch mainline in revision 324.
  • Revision ID: abentley@panoramicfeedback.com-20051121142935-96c67761f8d04a12
Updated from mainline bzrtools

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
    ORIGINAL = '\n\nhello test world\n\n'
7
7
    MODIFIED = '\n\ngoodbye test world\n\n'
8
8
    DIFF_HEADER = "=== modified file 'test_file'\n"
9
 
    DIFF_1 = """--- test_file
10
 
+++ test_file
 
9
    DIFF_1 = """--- test_file\t
 
10
+++ test_file\t
11
11
@@ -1,4 +1,4 @@
12
12
 
13
13
 
15
15
+goodbye test world
16
16
 
17
17
"""
18
 
    DIFF_2 = """--- test_file
19
 
+++ test_file
 
18
    DIFF_2 = """--- test_file\t
 
19
+++ test_file\t
20
20
@@ -1,4 +1,4 @@
21
21
 
22
22
 
31
31
        # Create a test file and commit it
32
32
        file('test_file', 'w').write(self.ORIGINAL)
33
33
        b.add('test_file')
34
 
        b.commit(message='add test_file')
 
34
        b.working_tree().commit(message='add test_file')
35
35
 
36
36
        # Modify the test file
37
37
        file('test_file', 'w').write(self.MODIFIED)
71
71
        # Create a test file and commit it
72
72
        file('test_file', 'w').write(self.ORIGINAL)
73
73
        b.add('test_file')
74
 
        b.commit(message='add test_file')
 
74
        b.working_tree().commit(message='add test_file')
75
75
 
76
76
        # Shelve the changes
77
77
        self.run_bzr('shelve', '--all')
86
86
        # Create a test file and commit it
87
87
        file('test_file', 'w').write(self.ORIGINAL)
88
88
        b.add('test_file')
89
 
        b.commit(message='add test_file')
 
89
        b.working_tree().commit(message='add test_file')
90
90
 
91
91
        # Modify the test file and commit it
92
92
        file('test_file', 'w').write(self.MODIFIED)
93
 
        b.commit(message='update test_file')
 
93
        b.working_tree().commit(message='update test_file')
94
94
 
95
95
        # Shelve the changes
96
96
        self.run_bzr('shelve', '-r', '1', '--all', retcode=1)
116
116
        (stdout, stderr) = self.run_bzr_captured(cmd.split(), retcode=None)
117
117
 
118
118
        self.assertEqual(stderr.split('\n')[0],
119
 
            'bzr: ERROR: shelve only accepts a single revision parameter.')
 
119
            'bzr: ERROR: bzrlib.errors.BzrCommandError: shelve only accepts a single revision parameter.')
120
120
 
121
 
    def disabled_test_shelf_with_whitespace(self):
 
121
    def test_shelf_with_whitespace(self):
122
122
        """Shows that bzr doesn't handle whitespace well"""
123
123
        self.run_bzr('init')
124
 
        file('file\t name', 'wb').write('hello')
 
124
        file('file name', 'wb').write('hello')
125
125
        self.run_bzr('add')
126
126
        self.run_bzr('commit', '-m', 'added')
127
 
        file('file\t name', 'wb').write('goodbye')
128
 
        self.run_bzr('shelve', '--all', 'file name')
 
127
        file('file name', 'wb').write('goodbye')
 
128
        self.run_bzr('shelve', '--all', 'file name', retcode=1)
129
129
 
130
130
    def test_whitespace_branches(self):
131
131
        os.mkdir('name with space')