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

Unified Diff: checkout.py

Issue 10310034: Implement proper svn copy when a file is copied, moved or renamed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: remove git unit test Created 8 years, 7 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
« no previous file with comments | « no previous file | tests/checkout_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: checkout.py
diff --git a/checkout.py b/checkout.py
index 6fb32d5107971c0d8970331ca2b9565d451b31fc..fa732e8c77fc19d4313e9c713dba3bf55f540cb8 100644
--- a/checkout.py
+++ b/checkout.py
@@ -313,8 +313,12 @@ class SvnCheckout(CheckoutBase, SvnMixIn):
if os.path.isfile(filepath):
raise PatchApplicationFailed(
p.filename, 'File exist but was about to be overwriten')
- shutil.copy2(
- os.path.join(self.project_path, p.source_filename), filepath)
+ self._check_output_svn(
+ [
+ 'copy',
+ os.path.join(self.project_path, p.source_filename),
+ filepath
+ ])
if p.diff_hunks:
cmd = ['patch', '-p%s' % p.patchlevel, '--forward', '--force']
stdout += subprocess2.check_output(
@@ -323,7 +327,9 @@ class SvnCheckout(CheckoutBase, SvnMixIn):
# There is only a header. Just create the file if it doesn't
# exist.
open(filepath, 'w').close()
- if p.is_new:
+ if p.is_new and not p.source_filename:
+ # Do not run it if p.source_filename is defined, since svn copy was
+ # using above.
stdout += self._check_output_svn(
['add', p.filename, '--force'], credentials=False)
for prop in p.svn_properties:
« no previous file with comments | « no previous file | tests/checkout_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698