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

Unified Diff: gclient_scm.py

Issue 1063973002: Fix hook disable logic in gclient_scm (non-atomic os.rename on Windows) (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 5 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index 24064f92b8814e39f418fbe4307ca7f51ed66700..f383234b323c71c0ffb85d8d2e5c61c0aa2522ec 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -318,8 +318,10 @@ class GitWrapper(SCMWrapper):
return
for f in os.listdir(hook_dir):
if not f.endswith('.sample') and not f.endswith('.disabled'):
- os.rename(os.path.join(hook_dir, f),
- os.path.join(hook_dir, f + '.disabled'))
+ disabled_hook_path = os.path.join(hook_dir, f + '.disabled')
+ if os.path.exists(disabled_hook_path):
+ os.remove(disabled_hook_path)
+ os.rename(os.path.join(hook_dir, f), disabled_hook_path)
def update(self, options, args, file_list):
"""Runs git to update or transparently checkout the working copy.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698