Commit 1b525e3c authored by Mitchell Hentges's avatar Mitchell Hentges
Browse files

Bug 1640815: Raise helpful error if no non-public commits on bootstrap r=rstewart

parent 44627158
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -322,9 +322,17 @@ class HgRepository(Repository):
        return self._client.rawcommand(args).decode('utf-8')

    def get_commit_time(self):
        return int(self._run(
        newest_public_revision_time = self._run(
            'log', '--rev', 'heads(ancestors(.) and not draft())',
            '--template', '{word(0, date|hgdate)}', '--limit', '1').strip())
            '--template', '{word(0, date|hgdate)}', '--limit', '1').strip()

        if not newest_public_revision_time:
            raise RuntimeError('Unable to find a non-draft commit in this hg '
                               'repository. If you created this repository from a '
                               'bundle, have you done a "hg pull" from hg.mozilla.org '
                               'since?')

        return int(newest_public_revision_time)

    def sparse_checkout_present(self):
        # We assume a sparse checkout is enabled if the .hg/sparse file