"""Subversion plugin for backup.py. Hotcopy's are performed via the svnadmin command: svnadmin hotcopy /repos/path /path/to/dest """ import plugins config = False location = '' nlocations = [] def init(cfg, *args, **kwargs): global location, nlocations, config config = cfg if len(args) != 1: if kwargs.has_key('location'): location = kwargs['location'] else: raise plugins.PluginError else: location = args[0] nlocations = plugins.normalize_path(args[0], cwd=False) def pre(): pass def run(): rsync = config.rsync() dest = config.destination() # we want rsync + source + dest def source(loc): return '%s ' % loc if nlocations: for loc in nlocations: c = rsync + source(loc) + dest print '>r>', c plugins.print_exec(c) else: c = rsync + source(location) + dest print '>r>', c plugins.print_exec(c) def post(): global config, location, nlocations config = False location = '' nlocations = []