def clone(conf, source, *args, **opts): dest = args[0] if len(args) > 0 else None hook(conf, dest, "pre-clone", source=source) clone_app.clone(source, dest, rev=opts.get('rev')) hook(conf, dest, "post-clone", source=source) return 0
def test_invalid_source(): ''' Test case for clone(invalid_source) If a source uri do not contain ``_design/``, it's invalid. ''' clone('http://foo.bar')
def fetch(self, url, path, *args, **opts): if url.startswith("couchdb://"): url = url.replace("couchdb://", "http://") else: url = url.replace("couchdbs://", "https://") try: dburl, docid = url.split('_design/') except ValueError: raise VendorError("%s isn't a valid source" % url) dest = os.path.join(path, docid) clone(url, dest=dest) rcfile = os.path.join(dest, ".couchapprc") try: os.unlink(rcfile) except: pass
def fetch(self, url, path, *args, **opts): if url.startswith("couchdb://"): url = url.replace("couchdb://", "http://") else: url = url.replace("couchdbs://", "https://") try: dburl, docid = url.split("_design/") except ValueError: raise VendorError("%s isn't a valid source" % url) dest = os.path.join(path, docid) clone(url, dest=dest) rcfile = os.path.join(dest, ".couchapprc") try: os.unlink(rcfile) except: pass