Fix hook disable logic in gclient_scm (non-atomic os.rename on Windows)
crrev.com/348703002 has introduced some code into gclient_scm.py which disables the .git/hooks when gclient is running in managed mode. The disabling logic renames the individual hook files to hook.disabled using os.rename. Conversely to what happen on Posix OSs, on Windows os.rename does not have atomic rename semantics [1] and it fails if the destination file already exists. This change improves the hook disable logic. [1] See https://bugs.python.org/issue8828 and os.replace in Python 3 BUG=474218 Review URL: https://codereview.chromium.org/1063973002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294715 0039d316-1c4b-4281-b951-d872f2087c98changes/01/332501/1
							parent
							
								
									e8bc1aa828
								
							
						
					
					
						commit
						4126556b4a
					
				
					Loading…
					
					
				
		Reference in New Issue