'Upgrade the sqlite format from version \'from_ver\' to current'

def __upgrade_db(self, from_ver):

    if (self.connection is not None):
        self.connection.close()
    self.connection = sqlite.connect(self.filename, check_same_thread=False)
    if (from_ver <= 1):
        self.ui._msg(('Upgrading    LocalStatus    cache    from    version    1    to    version    2    for    %s:%s' % (self.repository, self)))
        self.connection.executescript("ALTER    TABLE    status    ADD    mtime    INTEGER    DEFAULT    0;\n                                                                                                                                                                                    ALTER    TABLE    status    ADD    labels    VARCHAR(256)    DEFAULT    '';\n                                                                                                                                                                                    UPDATE    metadata    SET    value='2'    WHERE    key='db_version';\n                                                                                                                                                                        ")
        self.connection.commit()
