Exemple #1
0
    def exportDocs(self, version):
        branchName = "import-v{}".format(version)

        if not goTo(DOCSDIR):
            User.pause()
            return

        if check_call(shlex.split("make websitedoc")) != 0:
            print("error while calling 'make websitedoc'")
            exit(3)

        Git.chdirToRepositoryTopLevel()
        if not goTo("website"):
            User.pause()
            return

        Git.checkout(branchName, create=True)
        Git.add('.')
        Git.commit("update for offlineimap v{}".format(version))

        User.pause(
            "website: branch '{}' is ready for a merge in master!".format(
                branchName))
        goTo('..')
        return branchName
Exemple #2
0
    def updateAPI(self):
        req = "update API of the website? (requires {})".format(SPHINXBUILD)
        if User.yesNo(req, defaultToYes=True) is False:
            return False

        try:
            if check_call(shlex.split("{} --version".format(SPHINXBUILD))) != 0:
                raise RuntimeError("{} not found".format(SPHINXBUILD))
        except:
            print("""
Oops! you don't have {} installed?"
Cannot update the webite documentation..."
You should install it and manually run:"
  $ cd {}"
  $ make websitedoc"
Then, commit and push changes of the website.""".format(SPHINXBUILD, DOCSDIR))
            User.pause()
            return False

        Git.chdirToRepositoryTopLevel()
        if not goTo('website'):
            User.pause()
            return False
        if not Git.isClean:
            print("There is WIP in the website repository: stashing")
            Git.stash('WIP during offlineimap API import')

        goTo('..')
        return True
Exemple #3
0
    def createImportBranch(self, version):
        branchName = "import-v{}".format(version)

        Git.chdirToRepositoryTopLevel()
        if not goTo("website"):
            User.pause()
            return

        Git.checkout(branchName, create=True)
        Git.add('.')
        Git.commit("update for offlineimap v{}".format(version))

        User.pause(
            "website: branch '{}' is ready for a merge in master!".format(
                branchName))
        goTo('..')
        return branchName
Exemple #4
0
    def restore(self):
        Git.chdirToRepositoryTopLevel()
        try:
            Git.checkout('-f')
        except:
            pass
        # Git.checkout('master')
        # Git.resetKeep(self.master)
        # Git.checkout('next')
        # Git.resetKeep(self.next)

        if self.tag is not None:
            Git.rmTag(self.tag)

        if self.website is not None:
            if goTo('website'):
                Git.checkout(self.website)
                goTo('..')
Exemple #5
0
 def buildLatest(self, version):
     Git.chdirToRepositoryTopLevel()
     with open(WEBSITE_LATEST, 'w') as fd:
         fd.write(WEBSITE_LATEST_SKEL.format(stable=version))
Exemple #6
0
 def saveWebsite(self):
     Git.chdirToRepositoryTopLevel()
     goTo('website')
     self.website = Git.getRef('master')
     goTo('..')
Exemple #7
0
        return self.websiteBranch

    def after(self):
        for protectedRun in [self.testers.reset, self.changelog.savePrevious]:
            try:
                protectedRun()
            except Exception as e:
                print(e)

    def restore(self):
        self.state.restore()


if __name__ == '__main__':
    release = Release()
    Git.chdirToRepositoryTopLevel()

    try:
        release.prepare()
        currentVersion = release.getVersion()

        release.requestVersion(currentVersion)
        release.updateVersion()
        newVersion = release.getVersion()

        release.checkVersions(currentVersion, newVersion)
        release.updateChangelog()

        release.writeAnnounce()
        User.pause()
Exemple #8
0
        self.listTesters()
        number = User.request(msg)
        while number.lower() not in ['s', 'save', 'q', 'quit']:
            if number == '':
                continue
            try:
                number = int(number)
                self.feedbacks[number].switchFeedback()
            except (ValueError, IndexError) as e:
                print(e)
                exit(1)
            finally:
                self.listTesters()
                number = User.request(msg)
        if number in ['s', 'save']:
            self.testers.write()
        self.listTesters()

    def reset(self):
        self.testers.reset()
        self.testers.write()

    #def updateMailaliases(self):

if __name__ == '__main__':
    Git.chdirToRepositoryTopLevel()

    app = App()
    app.parseArgs()
    app.run()