Copy a main repository to a new location.
514812
def clone(cls, srcpath, destpath):
        """"""
        try:
            os.makedirs(destpath)
        except OSError as e:
            if not e.errno == errno.EEXIST:
                raise
        cmd = [SVNADMIN, 'dump', '--quiet', '.']
        dump = subprocess.Popen(
               cmd, cwd=srcpath, stdout=subprocess.PIPE,
               stderr=subprocess.PIPE,
        )
        repo = cls.create(destpath)
        repo.load(dump.stdout)
        stderr = dump.stderr.read()
        dump.stdout.close()
        dump.stderr.close()
        dump.wait()
        if dump.returncode != 0:
            raise subprocess.CalledProcessError(dump.returncode, cmd, stderr)
        return repo
7975
function copy(source, destination, callback) {
  cp(source, destination, {overwrite: true}, function done(err) {
    if (err) callback(err)
    else callback()
  })
}
959878
def copyresource( resource, filename, destdir ):
    
    data = pkgutil.get_data(resource, os.path.join('resources',filename) )
    #log.info( "Installing %s", os.path.join(destdir,filename) )
    with open( os.path.join(destdir,filename), 'wb' ) as fp:
        fp.write(data)
776533
def move_file(originals, destination):
    
    for original in originals:
        if os.path.exists(original):
            shutil.move(original, destination)
111946
function copyFromDir(starter, root) {
  if (!fs.existsSync(starter)) {
    throw new Error(`starter ${starter} doesn't exist`);
  }

  // Chmod with 755.
  // 493 = parseInt('755', 8)
  return fs.mkdirp(root, {mode: 493}).then(() => {
    console.log(
      `Creating new theme from local starter: ${chalk.green(starter)}`,
    );
    return fs.copy(starter, root, {
      filter: (file) =>
        !/^\.(git|hg)$/.test(path.basename(file)) && !/node_modules/.test(file),
    });
  });
}
1153342
def move(self, new_location):
        """"""
        self._perform_change(change.MoveResource(self, new_location),
                             'Moving <%s> to <%s>' % (self.path, new_location))
285049
def init(directory=None):
    """"""
    repo = repo_path(directory)
    if os.path.isdir(repo):
        raise RepositoryAlreadyExistsError(directory, repo)

    # Initialize repository with default template
    shutil.copytree(default_template_path, repo)

    message = '"Default presentation content."'
    subprocess.call(['git', 'init', '-q', repo])
    subprocess.call(['git', 'add', '.'], cwd=repo)
    subprocess.call(['git', 'commit', '-q', '-m', message], cwd=repo)

    return repo
620465
function copyRepo(dest) {
  return new Promise((resolve, reject) => {
    ncp('.tmp/repo', dest, (err) => {
      if (err) {
        reject(err)
        return
      }
      resolve()
    })
  })
}
638683
function clone() {
		Release.chdir( Release.dir.base );
		Release.dir.dist = Release.dir.base + "/dist";

		console.log( "Using distribution repo: ", distRemote );
		Release.exec( "git clone " + distRemote + " " + Release.dir.dist,
			"Error cloning repo." );

		// Distribution always works on master
		Release.chdir( Release.dir.dist );
		Release.exec( "git checkout master", "Error checking out branch." );
		console.log();
	}
897742
def clone(cls, srcpath, destpath):
        """"""
        # Mercurial will not create intermediate directories for clones.
        try:
            os.makedirs(destpath)
        except OSError as e:
            if not e.errno == errno.EEXIST:
                raise
        cmd = [HG, 'clone', '--quiet', '--noupdate', srcpath, destpath]
        subprocess.check_call(cmd)
        return cls(destpath)
230282
def clone_repo(self):
        """"""
        tempdir_path = tempfile.mkdtemp()

        if self.args.git:
            self.log.debug('Cloning git source repository from %s to %s',
                           self.source, tempdir_path)
            self.sh('git clone', self.source, tempdir_path)

        else:
            raise NotImplementedError('Unknown repo type')

        self.source = tempdir_path
218568
def move(self, src_url, dst_url):
        """"""
        self.copy(src_url, dst_url)
        self.destroy(src_url)
257247
def git_clone(git_url, path):
    """"""
    if os.path.exists(os.path.join(path, '.git')):
        # get rid of local repo if it already exists
        shutil.rmtree(path)

    os.makedirs(path, exist_ok=True)
    print('Start cloning from {}…'.format(git_url))
    git_proc = subprocess.Popen(['git', 'clone', git_url, path],
                                stderr=subprocess.PIPE,
                                stdout=subprocess.PIPE,
                                env={'GIT_TERMINAL_PROMPT': '0'})

    try:
        stdoutmsg, stderrmsg = git_proc.communicate(timeout=120)
    except subprocess.TimeoutExpired:
        git_proc.kill()
        stderrmsg = b'Timed out.'

    if git_proc.returncode == 0:
        print('Cloned {}.'.format(git_url))
    else:
        print('Error cloning from {}:\n{}'.format(git_url,
                                                  stderrmsg.decode('utf-8')))
186759
def copy_file(old, new):
    
    oldp = old.get_fullpath()
    newp = new.get_fullpath()
    log.info("Copying %s to %s", oldp, newp)
    new.create_directory()
    shutil.copy(oldp, newp)
389121
def move(self, source, destination):
        
        if source.isfile():
            source.copy(destination)
            source.remove()
        else:
            source.copy(destination, recursive=True)
            source.remove('r')
1051934
def _copy_update(sourcepath, destname):
    """"""
    if sys.platform.startswith('linux'):
        return os.system("/bin/cp -ua '%s' '%s'" % (sourcepath, destname))
    else:
        return os.system("rsync -ua '%s' '%s'" % (sourcepath, destname))
500020
def copy(self):
        """"""
        other = ContextModel(self._context, self.parent())
        other._stale = self._stale
        other._modified = self._modified
        other.request = self.request[:]
        other.packages_path = self.packages_path
        other.implicit_packages = self.implicit_packages
        other.package_filter = self.package_filter
        other.caching = self.caching
        other.default_patch_lock = self.default_patch_lock
        other.patch_locks = copy.deepcopy(self.patch_locks)
        return other