Mercurial > mozilla > hg > MozillaTry
comparison mozillatry.py @ 33:915e064f2910
comments
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Wed, 26 Dec 2012 14:45:50 -0800 |
parents | daf7c333e01c |
children | 9d8dce82166e |
comparison
equal
deleted
inserted
replaced
32:daf7c333e01c | 33:915e064f2910 |
---|---|
11 import shutil | 11 import shutil |
12 import subprocess | 12 import subprocess |
13 import sys | 13 import sys |
14 | 14 |
15 from subprocess import check_call as call | 15 from subprocess import check_call as call |
16 | |
17 ### methods for hg | |
16 | 18 |
17 def reset(directory): | 19 def reset(directory): |
18 """reset an hg directory to a good state""" | 20 """reset an hg directory to a good state""" |
19 assert os.path.exists(directory) and os.path.isdir(directory) | 21 assert os.path.exists(directory) and os.path.isdir(directory) |
20 hg_dir = os.path.join(directory, '.hg') | 22 hg_dir = os.path.join(directory, '.hg') |
42 assert os.path.exists(directory) and os.path.isdir(directory) | 44 assert os.path.exists(directory) and os.path.isdir(directory) |
43 reset(directory) | 45 reset(directory) |
44 call(['hg', 'pull'], cwd=directory) | 46 call(['hg', 'pull'], cwd=directory) |
45 call(['hg', 'update'], cwd=directory) | 47 call(['hg', 'update'], cwd=directory) |
46 call(['hg', 'qinit'], cwd=directory) | 48 call(['hg', 'qinit'], cwd=directory) |
49 | |
50 | |
51 ### methods for try | |
47 | 52 |
48 def push_to_try(patches, repo, commit, _try='ssh://hg.mozilla.org/try/', update=True): | 53 def push_to_try(patches, repo, commit, _try='ssh://hg.mozilla.org/try/', update=True): |
49 """push a series of patches to try repository""" | 54 """push a series of patches to try repository""" |
50 | 55 |
51 # ensure the repo is in a good state | 56 # ensure the repo is in a good state |