Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Side by Side Diff: tests/scm_unittest.py

Issue 6650011: Add code to correctly revert a svn add'ed file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « scm.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Unit tests for scm.py.""" 6 """Unit tests for scm.py."""
7 7
8 # pylint: disable=E1101,W0403 8 # pylint: disable=E1101,W0403
9 9
10 # Fixes include path. 10 # Fixes include path.
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 scm.os.remove(scm.os.path.join(self.svn_root, 'origin')) 275 scm.os.remove(scm.os.path.join(self.svn_root, 'origin'))
276 self._capture( 276 self._capture(
277 ['propset', 'foo', 'bar', 277 ['propset', 'foo', 'bar',
278 scm.os.path.join(self.svn_root, 'prout', 'origin')]) 278 scm.os.path.join(self.svn_root, 'prout', 'origin')])
279 fake_repos.rmtree(scm.os.path.join(self.svn_root, 'prout')) 279 fake_repos.rmtree(scm.os.path.join(self.svn_root, 'prout'))
280 with open(scm.os.path.join(self.svn_root, 'faa'), 'w') as f: 280 with open(scm.os.path.join(self.svn_root, 'faa'), 'w') as f:
281 f.write('eh') 281 f.write('eh')
282 with open(scm.os.path.join(self.svn_root, 'faala'), 'w') as f: 282 with open(scm.os.path.join(self.svn_root, 'faala'), 'w') as f:
283 f.write('oh') 283 f.write('oh')
284 self._capture(['add', scm.os.path.join(self.svn_root, 'faala')]) 284 self._capture(['add', scm.os.path.join(self.svn_root, 'faala')])
285 added_and_removed = scm.os.path.join(self.svn_root, 'added_and_removed')
286 with open(added_and_removed, 'w') as f:
287 f.write('oh')
288 self._capture(['add', added_and_removed])
289 scm.os.remove(added_and_removed)
285 290
286 scm.SVN.Revert(self.svn_root) 291 scm.SVN.Revert(self.svn_root)
287 self._capture(['update', '--revision', 'base']) 292 self._capture(['update', '--revision', 'base'])
288 293
289 self.assertTree(self.tree, self.svn_root) 294 self.assertTree(self.tree, self.svn_root)
295 # Asserting the tree is not sufficient, svn status must come out clear too.
296 self.assertEquals('', self._capture(['status']))
290 297
291 298
292 if __name__ == '__main__': 299 if __name__ == '__main__':
293 import unittest 300 import unittest
294 unittest.main() 301 unittest.main()
295 302
296 # vim: ts=2:sw=2:tw=80:et: 303 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « scm.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698