Example #1
0
def delete(paths, commit=False):
    silent = config.get("log", "ignore-string", "SILENT")
    for path in paths:
        message = "%s: delete file %s" % (silent, path)
        if binrepo.is_binary(path):
            topdir = getpkgtopdir()
            binrepo.update_sources(topdir, removed=[os.path.basename(path)])
            if commit:
                svn = SVN()
                svn.commit(binrepo.sources_path(topdir), log=message)
        else:
            svn = SVN()
            svn.remove(path, local=True)
            if commit:
                svn.commit(path, log=message)
Example #2
0
def upload(paths, commit=False):
    for path in paths:
        if os.path.isdir(path) or binrepo.is_binary(path):
            topdir = getpkgtopdir()
            binrepo.upload_binary(topdir, os.path.basename(path))
            binrepo.update_sources(topdir, added=[path])
            if commit:
                svn = SVN()
                silent = config.get("log", "ignore-string", "SILENT")
                message = "%s: new file %s" % (silent, path)
                svn.commit(binrepo.sources_path(topdir), log=message)
        else:
            svn = SVN()
            svn.add(path, local=True)
            if commit:
                silent = config.get("log", "ignore-string", "SILENT")
                message = "%s: new file %s" % (silent, path)
                svn.commit(path, log=message)