Logo Search packages:      
Sourcecode: rapidsvn version File versions  Download package

void svn::Client::get ( Path dstPath,
const Path path,
const Revision revision,
const Revision peg_revision = Revision::UNSPECIFIED 
) throw (ClientException)

Retrieves the contents for a specific revision of a path and saves it to the destination file dstPath.

If dstPath is empty (""), then this path will be constructed from the temporary directory on this system and the filename in path. dstPath will still have the file extension from path and uniqueness of the temporary filename will be ensured.

Parameters:
dstPath Filename in which the contents of the file file will be safed.
path path or url
revision 
peg_revision peg revision to retrieve, by default is the latest one

Definition at line 138 of file client_cat.cpp.

References svn::openTempFile().

Referenced by Action::GetPathAsTempFile().

  {
    Pool pool;

    // create a new file and suppose we only want
    // this users to be able to read and write the file

    apr_file_t * file = openTempFile(dstPath, path, revision, pool);

    // now create a stream and let svn_client_cat write to the
    // stream
    svn_stream_t * stream = svn_stream_from_aprfile(file, pool);
    if (stream != 0)
    {
      svn_error_t * error = svn_client_cat2(
                              stream,
                              path.c_str(),
                              peg_revision.revision() ,
                              revision.revision(),
                              *m_context,
                              pool);

      if (error != 0)
        throw ClientException(error);

      svn_stream_close(stream);
    }

    // finalize stuff
    apr_file_close(file);
  }


Generated by  Doxygen 1.6.0   Back to index