51
51
self.run_bzr('init')
52
52
self.run_bzr('add')
53
self.run_bzr('commit', '-m', '1')
53
self.run_bzr('commit -m 1')
54
54
wt = WorkingTree.open('.')
55
55
wt.rename_one('a/b', 'f/b')
56
56
wt.rename_one('a/d/e', 'f/e')
92
92
def test_revert_dirname(self):
93
93
"""Test that revert DIRECTORY does what's expected"""
94
94
self._prepare_rename_mod_tree()
95
self.run_bzr('revert', 'a')
95
self.run_bzr('revert a')
96
96
self.failUnlessExists('a/b')
97
97
self.failUnlessExists('a/d')
98
98
self.failIfExists('a/g')
99
99
self.failUnlessExists('j')
100
100
self.failUnlessExists('h')
101
self.run_bzr('revert', 'f')
101
self.run_bzr('revert f')
102
102
self.failIfExists('j')
103
103
self.failIfExists('h')
104
104
self.failUnlessExists('a/d/e')
119
119
self.run_bzr('init')
121
121
file('hello', 'wt').write('foo')
122
self.run_bzr('add', 'hello')
123
self.run_bzr('commit', '-m', 'setup', 'hello')
122
self.run_bzr('add hello')
123
self.run_bzr('commit -m setup hello')
125
125
file('goodbye', 'wt').write('baz')
126
self.run_bzr('add', 'goodbye')
127
self.run_bzr('commit', '-m', 'setup', 'goodbye')
126
self.run_bzr('add goodbye')
127
self.run_bzr('commit -m setup goodbye')
129
129
file('hello', 'wt').write('bar')
130
130
file('goodbye', 'wt').write('qux')
131
self.run_bzr('revert', 'hello')
131
self.run_bzr('revert hello')
132
132
self.check_file_contents('hello', 'foo')
133
133
self.check_file_contents('goodbye', 'qux')
134
134
self.run_bzr('revert')
135
135
self.check_file_contents('goodbye', 'baz')
137
137
os.mkdir('revertdir')
138
self.run_bzr('add', 'revertdir')
139
self.run_bzr('commit', '-m', 'f')
138
self.run_bzr('add revertdir')
139
self.run_bzr('commit -m f')
140
140
os.rmdir('revertdir')
141
141
self.run_bzr('revert')
143
143
if bzrlib.osutils.has_symlinks():
144
144
os.symlink('/unlikely/to/exist', 'symlink')
145
self.run_bzr('add', 'symlink')
146
self.run_bzr('commit', '-m', 'f')
145
self.run_bzr('add symlink')
146
self.run_bzr('commit -m f')
147
147
os.unlink('symlink')
148
148
self.run_bzr('revert')
149
149
self.failUnlessExists('symlink')
156
156
self.log("skipping revert symlink tests")
158
158
file('hello', 'wt').write('xyz')
159
self.run_bzr('commit', '-m', 'xyz', 'hello')
160
self.run_bzr('revert', '-r', '1', 'hello')
159
self.run_bzr('commit -m xyz hello')
160
self.run_bzr('revert -r 1 hello')
161
161
self.check_file_contents('hello', 'foo')
162
self.run_bzr('revert', 'hello')
162
self.run_bzr('revert hello')
163
163
self.check_file_contents('hello', 'xyz')
164
164
os.chdir('revertdir')
165
165
self.run_bzr('revert')
183
183
self.build_tree(['file'])
184
184
tree.add(['file'])
185
185
tree.commit('add file')
186
out, err = self.run_bzr('revert', '-r', '-2')
186
out, err = self.run_bzr('revert -r -2')
187
187
self.assertEqual('', out)
188
188
self.assertEqual('-D file\n', err)