# HG changeset patch # User Jeff Hammel # Date 1355172812 28800 # Node ID 1a6125362640c3e5f0966ea064ec2759b3e547ae # Parent ade4262c1c6d2999e80a60e83d8407a712244271 make this slightly less stupid diff -r ade4262c1c6d -r 1a6125362640 mozillatry.py --- 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"""