33
33
//#include "svn_utf.h"
36
#include "svncpp/client.hpp"
37
#include "svncpp/dirent.hpp"
38
#include "svncpp/exception.hpp"
39
#include "svncpp/pool.hpp"
40
#include "svncpp/status.hpp"
41
#include "svncpp/targets.hpp"
42
#include "svncpp/info_entry.hpp"
43
#include "svncpp/url.hpp"
38
#include "exception.hpp"
41
#include "targets.hpp"
42
#include "info_entry.hpp"
44
#include "svncpp_defines.hpp"
45
#include "context_listener.hpp"
174
176
dirEntryToStatus (const QString& path, const DirEntry & dirEntry)
178
static_cast<svn_wc_entry_t *> (
179
apr_pcalloc (pool, sizeof (svn_wc_entry_t)));
181
178
QString url = path;
183
180
url += dirEntry.name();
185
e->name = apr_pstrdup(pool,dirEntry.name().utf8());
186
e->revision = dirEntry.createdRev ();
187
e->url = apr_pstrdup(pool,url.utf8());
188
e->kind = dirEntry.kind ();
189
e->schedule = svn_wc_schedule_normal;
190
e->text_time = dirEntry.time ();
191
e->prop_time = dirEntry.time ();
192
e->cmt_rev = dirEntry.createdRev ();
193
e->cmt_date = dirEntry.time ();
194
e->cmt_author = dirEntry.lastAuthor ();
196
svn_wc_status2_t * s =
197
static_cast<svn_wc_status2_t *> (
198
apr_pcalloc (pool, sizeof (svn_wc_status2_t)));
200
s->text_status = svn_wc_status_normal;
201
s->prop_status = svn_wc_status_normal;
204
s->repos_text_status = svn_wc_status_normal;
205
s->repos_prop_status = svn_wc_status_normal;
207
return Status (url, s);
181
return Status (url, dirEntry);
211
185
infoEntryToStatus(const QString&path,const InfoEntry&infoEntry)
215
static_cast<svn_wc_entry_t *> (
216
apr_pcalloc (pool, sizeof (svn_wc_entry_t)));
220
url += infoEntry.Name();
222
e->name = apr_pstrdup(pool,infoEntry.Name().utf8());
223
e->revision = infoEntry.revision();
224
e->url = apr_pstrdup(pool,url.utf8());
225
e->kind = infoEntry.kind ();
226
e->schedule = svn_wc_schedule_normal;
227
e->text_time = infoEntry.textTime ();
228
e->prop_time = infoEntry.propTime ();
229
e->cmt_rev = infoEntry.cmtRev ();
230
e->cmt_date = infoEntry.cmtDate();
231
e->cmt_author = infoEntry.cmtAuthor();
232
svn_wc_status2_t * s =
233
static_cast<svn_wc_status2_t *> (
234
apr_pcalloc (pool, sizeof (svn_wc_status2_t)));
236
s->text_status = svn_wc_status_normal;
237
s->prop_status = svn_wc_status_normal;
238
s->locked = infoEntry.lockEntry().Locked();
241
static_cast<svn_lock_t *> (
242
apr_pcalloc (pool, sizeof (svn_lock_t)));
243
l->token = apr_pstrdup(pool,infoEntry.lockEntry().Token().utf8());
244
l->path = apr_pstrdup(pool,path.utf8());
245
l->owner = apr_pstrdup(pool,infoEntry.lockEntry().Owner().utf8());
246
l->comment = apr_pstrdup(pool,infoEntry.lockEntry().Comment().utf8());
247
l->creation_date = infoEntry.lockEntry().Date();
248
l->expiration_date = infoEntry.lockEntry().Expiration();
253
s->repos_text_status = svn_wc_status_normal;
254
s->repos_prop_status = svn_wc_status_normal;
256
return Status (url, s);
187
return Status(infoEntry.url(),infoEntry);
259
190
static StatusEntries
264
195
const bool update,
265
196
const bool no_ignore,
266
197
Revision revision,
199
bool detailed_remote)
269
201
DirEntries dirEntries = client->list(path, revision, descend);
270
202
DirEntries::const_iterator it;
272
204
StatusEntries entries;
207
bool _det = detailed_remote;
274
210
for (it = dirEntries.begin (); it != dirEntries.end (); it++)
276
212
const DirEntry & dirEntry = *it;
278
entries.push_back (dirEntryToStatus (path, dirEntry));
214
if (_det && dirEntry.kind()==svn_node_file) {
216
InfoEntries infoEntries = client->info(url+dirEntry.name(),false,revision,Revision(Revision::UNDEFINED));
217
entries.push_back(infoEntryToStatus (path, infoEntries[0]));
218
} catch (ClientException) {
220
entries.push_back(dirEntryToStatus (path, dirEntry));
223
entries.push_back(dirEntryToStatus (path, dirEntry));
225
if (_det && context->getListener()->contextCancel()) {
226
throw ClientException("Canceld");
287
236
const bool get_all,
288
237
const bool update,
289
238
const bool no_ignore,
290
Revision revision) throw (ClientException)
240
bool detailed_remote) throw (ClientException)
292
242
if (Url::isValid (path))
293
243
return remoteStatus (this, path, descend, get_all, update,
294
no_ignore,revision,m_context);
244
no_ignore,revision,m_context,detailed_remote);
296
246
return localStatus (path, descend, get_all, update,
297
247
no_ignore, m_context);
411
361
baton.pool = pool;
412
362
svn_opt_revision_t pegr;
413
363
const char *truepath;
414
error = svn_opt_parse_path (&pegr, &truepath,path.utf8(), pool);
364
error = svn_opt_parse_path (&pegr, &truepath,
415
367
if (error != NULL)
416
368
throw ClientException (error);
418
if ((svn_path_is_url (path.utf8())) && (pegr.kind == svn_opt_revision_unspecified))
370
if ((svn_path_is_url (path.TOUTF8())) && (pegr.kind == svn_opt_revision_unspecified))
419
371
pegr.kind = svn_opt_revision_head;