Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
bug 749720 - mozharness multilocale will now die on missing tags. r=rail
Browse files Browse the repository at this point in the history
  • Loading branch information
escapewindow committed May 3, 2012
1 parent f10c5ac commit 5fd49fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions mozharness/base/errors.py
Expand Up @@ -56,6 +56,7 @@ class VCSException(Exception):
HgErrorList = BaseErrorList + [
{'regex': re.compile(r'''^abort:'''), 'level': ERROR},
{'substr': r'''unknown exception encountered''', 'level': ERROR},
{'substr': r'''failed to import extension''', 'level': WARNING},
]

PythonErrorList = BaseErrorList + [
Expand Down
11 changes: 7 additions & 4 deletions mozharness/base/vcs/mercurial.py
Expand Up @@ -17,7 +17,7 @@
sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.dirname(sys.path[0]))))

from mozharness.base.errors import HgErrorList, VCSException
from mozharness.base.log import LogMixin
from mozharness.base.log import LogMixin, FATAL
from mozharness.base.script import ShellMixin, OSMixin

HG_OPTIONS = ['--config', 'ui.merge=internal:merge']
Expand Down Expand Up @@ -123,7 +123,7 @@ def hg_ver(self):
self.debug("Running hg version %s" % str(ver))
return ver

def update(self, dest, branch=None, revision=None):
def update(self, dest, branch=None, revision=None, error_level=FATAL):
"""Updates working copy `dest` to `branch` or `revision`.
If revision is set, branch will be ignored.
If neither is set then the working copy will be updated to the
Expand All @@ -139,7 +139,9 @@ def update(self, dest, branch=None, revision=None):
self.info("%s." % msg)
if revision is not None:
cmd = self.hg + ['update', '-C', '-r', revision]
self.run_command(cmd, cwd=dest, error_list=HgErrorList)
if self.run_command(cmd, cwd=dest, error_list=HgErrorList):
self.log("Unable to update %s to %s!" % (dest, revision),
level=error_level)
else:
# Check & switch branch
local_branch = self.get_branch_from_path(dest)
Expand All @@ -150,7 +152,8 @@ def update(self, dest, branch=None, revision=None):
if branch and branch != local_branch:
cmd.append(branch)

self.run_command(cmd, cwd=dest, error_list=HgErrorList)
if self.run_command(cmd, cwd=dest, error_list=HgErrorList):
self.log("Unable to update %s!" % dest, level=error_level)
return self.get_revision_from_path(dest)

def clone(self, repo, dest, branch=None, revision=None, update_dest=True):
Expand Down

0 comments on commit 5fd49fc

Please sign in to comment.