diff --git a/master/buildbot/clients/tryclient.py b/master/buildbot/clients/tryclient.py index 56661df7cde..ebc39e85a16 100644 --- a/master/buildbot/clients/tryclient.py +++ b/master/buildbot/clients/tryclient.py @@ -194,15 +194,21 @@ def _didvc(self, res, cmd): return stdout + @defer.inlineCallbacks def getBaseRevision(self): upstream = "" if self.repository: upstream = "r'%s'" % self.repository - d = self.dovc(["log", "--template", "{node}\\n", "-r", "max(::. - outgoing(%s))" % upstream]) - d.addCallback(self.parseStatus) - return d - - def parseStatus(self, output): + output = '' + try: + output = yield self.dovc(["log", "--template", "{node}\\n", "-r", + "max(::. - outgoing(%s))" % upstream]) + except RuntimeError: + # outgoing() will abort if no default-push/default path is configured + if upstream: + raise + # fall back to current working directory parent + output = yield self.dovc(["log", "--template", "{node}\\n", "-r", "p1()"]) m = re.search(r'^(\w+)', output) if not m: raise RuntimeError("Revision %r is not in the right format" % (output,))