Bug 1399100 - fix client.py follow-up, r=kaie
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Wed, 20 Sep 2017 09:13:14 +0200
changeset 433824 76aceb596872aef0261a7771b7a9e07828db55a7
parent 433823 aff312af1dec2af03d190a0851147d39fb422a55
child 433825 d67b9fdabf9dd65f9b0a5a50ff24a94987b7a628
push id1567
push userjlorenzo@mozilla.com
push dateThu, 02 Nov 2017 12:36:05 +0000
treeherdermozilla-release@e512c14a0406 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskaie
bugs1399100
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1399100 - fix client.py follow-up, r=kaie MozReview-Commit-ID: V8nVlkRenv
client.py
--- a/client.py
+++ b/client.py
@@ -107,32 +107,34 @@ def update_nspr_or_nss(tag, depfile, des
   destination = destination.rstrip('/')
   permanent_patch_dir = destination + '/patches'
   temporary_patch_dir = destination + '.patches'
   if os.path.exists(temporary_patch_dir):
     print "please clean up leftover directory " + temporary_patch_dir
     sys.exit(2)
   warn_if_patch_exists(permanent_patch_dir)
   # protect patch directory from being removed by do_hg_replace
-  shutil.move(permanent_patch_dir, temporary_patch_dir)
+  if os.path.exists(permanent_patch_dir):
+    shutil.move(permanent_patch_dir, temporary_patch_dir)
   # now update the destination
   print "reverting to HG version of %s to get its blank line state" % depfile
   check_call_noisy([options.hg, 'revert', depfile])
   old_state = get_trailing_blank_line_state(depfile)
   print "old state of %s is: %s" % (depfile, old_state)
   do_hg_replace(destination, hgpath, tag, HG_EXCLUSIONS, options.hg)
   new_state = get_trailing_blank_line_state(depfile)
   print "new state of %s is: %s" % (depfile, new_state)
   if old_state == new_state:
     print "toggling blank line in: ", depfile
     toggle_trailing_blank_line(depfile)
   tag_file = destination + "/TAG-INFO"
   print >>file(tag_file, "w"), tag
   # move patch directory back to a subdirectory
-  shutil.move(temporary_patch_dir, permanent_patch_dir)
+  if os.path.exists(temporary_patch_dir):
+    shutil.move(temporary_patch_dir, permanent_patch_dir)
 
 def warn_if_patch_exists(path):
   # If the given patch directory exists and contains at least one file,
   # then print warning and wait for the user to acknowledge.
   if os.path.isdir(path) and os.listdir(path):
     print "========================================"
     print "WARNING: At least one patch file exists"
     print "in directory: " + path