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

Unified Diff: tests/scm_unittest.py

Issue 6681032: Improve SVN.Revert() again to work better in reverting svn added directories. (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 side-by-side diff with in-line comments
Download patch
« scm.py ('K') | « scm.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/scm_unittest.py
diff --git a/tests/scm_unittest.py b/tests/scm_unittest.py
index 5b21c6f17ebcc6fa819e501390fb3167e52e642b..783fecd3da0eafcacb9f51795ae4b5be9dfc2e0f 100755
--- a/tests/scm_unittest.py
+++ b/tests/scm_unittest.py
@@ -267,26 +267,43 @@ class RealSvnTest(fake_repos.FakeReposTestBase):
# - Delete a file
# - svn delete a file
# - svn move a directory and svn rename files in it
+ # - add a directory tree.
+ def join(*args):
+ return scm.os.path.join(self.svn_root, *args)
self._capture(['move', 'foo', 'foo2'])
self._capture(
['move',
scm.os.path.join('foo2', 'origin'),
scm.os.path.join('foo2', 'o')])
- scm.os.remove(scm.os.path.join(self.svn_root, 'origin'))
- self._capture(
- ['propset', 'foo', 'bar',
- scm.os.path.join(self.svn_root, 'prout', 'origin')])
- fake_repos.gclient_utils.rmtree(scm.os.path.join(self.svn_root, 'prout'))
- with open(scm.os.path.join(self.svn_root, 'faa'), 'w') as f:
+ scm.os.remove(join('origin'))
+ self._capture(['propset', 'foo', 'bar', join('prout', 'origin')])
+ fake_repos.gclient_utils.rmtree(join('prout'))
+ with open(join('faa'), 'w') as f:
f.write('eh')
- with open(scm.os.path.join(self.svn_root, 'faala'), 'w') as f:
+ with open(join('faala'), 'w') as f:
f.write('oh')
- self._capture(['add', scm.os.path.join(self.svn_root, 'faala')])
- added_and_removed = scm.os.path.join(self.svn_root, 'added_and_removed')
+ self._capture(['add', join('faala')])
+ added_and_removed = join('added_and_removed')
with open(added_and_removed, 'w') as f:
f.write('oh')
self._capture(['add', added_and_removed])
scm.os.remove(added_and_removed)
+ # Make sure a tree of directories can be removed.
+ scm.os.makedirs(join('new_dir', 'subdir'))
+ with open(join('new_dir', 'subdir', 'newfile'), 'w') as f:
+ f.write('ah!')
+ self._capture(['add', join('new_dir')])
+ self._capture(['add', join('new_dir', 'subdir')])
+ self._capture(['add', join('new_dir', 'subdir', 'newfile')])
+ # A random file in an added directory confuses svn.
+ scm.os.makedirs(join('new_dir2', 'subdir'))
+ with open(join('new_dir2', 'subdir', 'newfile'), 'w') as f:
+ f.write('ah!')
+ self._capture(['add', join('new_dir2')])
+ self._capture(['add', join('new_dir2', 'subdir')])
+ self._capture(['add', join('new_dir2', 'subdir', 'newfile')])
+ with open(join('new_dir2', 'subdir', 'unversionedfile'), 'w') as f:
+ f.write('unadded file!')
scm.SVN.Revert(self.svn_root)
self._capture(['update', '--revision', 'base'])
« scm.py ('K') | « scm.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698