changeset 30:1a6125362640

make this slightly less stupid
author Jeff Hammel <jhammel@mozilla.com>
date Mon, 10 Dec 2012 12:53:32 -0800
parents ade4262c1c6d
children 864172062af7
files mozillatry.py
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mozillatry.py	Mon Dec 10 12:11:45 2012 -0800
+++ b/mozillatry.py	Mon Dec 10 12:53:32 2012 -0800
@@ -19,9 +19,6 @@
     assert os.path.exists(directory) and os.path.isdir(directory)
     hg_dir = os.path.join(directory, '.hg')
     assert os.path.exists(hg_dir) and os.path.isdir(hg_dir)
-    patches = os.path.join(hg_dir, 'patches')
-    if os.path.exists(patches):
-        shutil.rmtree(patches)
     call(['hg', 'revert', '--no-backup', '--all'], cwd=directory)
     try:
         # XXX stupid; see
@@ -30,10 +27,10 @@
     except subprocess.CalledProcessError:
         pass
     call(['hg', 'qpop', '--all'], cwd=directory)
-    try:
-        shutil.rmtree(os.path.join(hg_dir, 'patches')) # remove patches
-    except:
-        pass
+    patches = os.path.join(hg_dir, 'patches')
+    if os.path.exists(patches):
+        # remove patches
+        shutil.rmtree(patches)
 
 def update_repo(directory):
     """update an hg repository"""